From 362448cafa222e0979b84610c6172c1e326915e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jun 2026 01:04:22 +0000 Subject: [PATCH] build(deps): bump the ibm-github-dependencies group across 1 directory with 5 updates Bumps the ibm-github-dependencies group with 5 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) | `5.21.0` | `5.21.4` | | [github.com/IBM/ibm-cos-sdk-go](https://github.com/IBM/ibm-cos-sdk-go) | `1.12.3` | `1.14.1` | | [github.com/IBM/networking-go-sdk](https://github.com/IBM/networking-go-sdk) | `0.51.11` | `0.53.4` | | [github.com/IBM/platform-services-go-sdk](https://github.com/IBM/platform-services-go-sdk) | `0.86.1` | `0.99.1` | | [github.com/IBM/vpc-go-sdk](https://github.com/IBM/vpc-go-sdk) | `0.71.1` | `0.85.0` | Updates `github.com/IBM/go-sdk-core/v5` from 5.21.0 to 5.21.4 - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.21.0...v5.21.4) Updates `github.com/IBM/ibm-cos-sdk-go` from 1.12.3 to 1.14.1 - [Release notes](https://github.com/IBM/ibm-cos-sdk-go/releases) - [Changelog](https://github.com/IBM/ibm-cos-sdk-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/IBM/ibm-cos-sdk-go/compare/v1.12.3...v1.14.1) Updates `github.com/IBM/networking-go-sdk` from 0.51.11 to 0.53.4 - [Release notes](https://github.com/IBM/networking-go-sdk/releases) - [Changelog](https://github.com/IBM/networking-go-sdk/blob/master/CHANGELOG.md) - [Commits](https://github.com/IBM/networking-go-sdk/compare/v0.51.11...v0.53.4) Updates `github.com/IBM/platform-services-go-sdk` from 0.86.1 to 0.99.1 - [Release notes](https://github.com/IBM/platform-services-go-sdk/releases) - [Changelog](https://github.com/IBM/platform-services-go-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/platform-services-go-sdk/compare/v0.86.1...v0.99.1) Updates `github.com/IBM/vpc-go-sdk` from 0.71.1 to 0.85.0 - [Release notes](https://github.com/IBM/vpc-go-sdk/releases) - [Changelog](https://github.com/IBM/vpc-go-sdk/blob/master/CHANGELOG.md) - [Commits](https://github.com/IBM/vpc-go-sdk/compare/v0.71.1...v0.85.0) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-version: 5.21.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ibm-github-dependencies - dependency-name: github.com/IBM/ibm-cos-sdk-go dependency-version: 1.14.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ibm-github-dependencies - dependency-name: github.com/IBM/networking-go-sdk dependency-version: 0.53.4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ibm-github-dependencies - dependency-name: github.com/IBM/platform-services-go-sdk dependency-version: 0.99.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ibm-github-dependencies - dependency-name: github.com/IBM/vpc-go-sdk dependency-version: 0.85.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ibm-github-dependencies ... Signed-off-by: dependabot[bot] --- go.mod | 27 +- go.sum | 54 +- .../IBM/go-sdk-core/v5/core/unmarshal_v2.go | 4 +- .../IBM/go-sdk-core/v5/core/utils.go | 2 +- .../IBM/go-sdk-core/v5/core/version.go | 2 +- .../ibmiam/env_provider_trusted_profile.go | 20 +- .../credentials/ibmiam/iamcreds_file_utils.go | 23 +- .../aws/credentials/ibmiam/trusted_profile.go | 182 +- .../ibmiam/trusted_profile_provider.go | 54 +- .../ibm-cos-sdk-go/aws/endpoints/defaults.go | 8 +- .../IBM/ibm-cos-sdk-go/aws/version.go | 2 +- .../IBM/ibm-cos-sdk-go/service/s3/api.go | 534 +- .../service/s3/s3iface/interface.go | 8 + .../IBM/networking-go-sdk/common/version.go | 2 +- .../dnsrecordsv1/dns_records_v1.go | 1087 +- .../transit_gateway_apis_v1.go | 992 +- .../common/version.go | 2 +- .../globaltaggingv1/global_tagging_v1.go | 48 +- .../iamidentityv1/iam_identity_v1.go | 3180 ++- .../iam_policy_management_v1.go | 5757 +++- .../IBM/vpc-go-sdk/common/version.go | 2 +- .../github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go | 23503 ++++++++++++++-- .../asaskevich/govalidator/.gitignore | 15 - .../asaskevich/govalidator/.travis.yml | 12 - .../asaskevich/govalidator/CODE_OF_CONDUCT.md | 43 - .../asaskevich/govalidator/CONTRIBUTING.md | 63 - .../github.com/asaskevich/govalidator/LICENSE | 21 - .../asaskevich/govalidator/README.md | 622 - .../asaskevich/govalidator/arrays.go | 87 - .../asaskevich/govalidator/converter.go | 81 - .../github.com/asaskevich/govalidator/doc.go | 3 - .../asaskevich/govalidator/error.go | 47 - .../asaskevich/govalidator/numerics.go | 100 - .../asaskevich/govalidator/patterns.go | 113 - .../asaskevich/govalidator/types.go | 656 - .../asaskevich/govalidator/utils.go | 270 - .../asaskevich/govalidator/validator.go | 1768 -- .../asaskevich/govalidator/wercker.yml | 15 - .../mimetype/.git-blame-ignore-revs | 9 + .../mimetype/CODE_OF_CONDUCT.md | 76 - .../gabriel-vasile/mimetype/CONTRIBUTING.md | 12 - .../gabriel-vasile/mimetype/README.md | 37 +- .../mimetype/internal/charset/charset.go | 230 +- .../mimetype/internal/csv/parser.go | 125 + .../mimetype/internal/json/parser.go | 33 +- .../mimetype/internal/magic/archive.go | 108 +- .../mimetype/internal/magic/audio.go | 64 +- .../mimetype/internal/magic/binary.go | 72 +- .../mimetype/internal/magic/database.go | 24 +- .../mimetype/internal/magic/document.go | 78 +- .../mimetype/internal/magic/font.go | 22 +- .../mimetype/internal/magic/ftyp.go | 103 +- .../mimetype/internal/magic/image.go | 194 +- .../mimetype/internal/magic/magic.go | 199 +- .../mimetype/internal/magic/ms_office.go | 53 +- .../mimetype/internal/magic/netpbm.go | 111 + .../mimetype/internal/magic/text.go | 387 +- .../mimetype/internal/magic/text_csv.go | 80 +- .../mimetype/internal/magic/video.go | 22 +- .../mimetype/internal/magic/zip.go | 271 +- .../mimetype/internal/markup/markup.go | 105 + .../mimetype/internal/scan/bytes.go | 262 + .../gabriel-vasile/mimetype/mime.go | 53 +- .../gabriel-vasile/mimetype/mimetype.go | 13 +- .../mimetype/supported_mimes.md | 377 +- .../gabriel-vasile/mimetype/tree.go | 65 +- .../go-openapi/errors/.golangci.yml | 114 +- vendor/github.com/go-openapi/errors/README.md | 4 + vendor/github.com/go-openapi/errors/api.go | 29 +- vendor/github.com/go-openapi/errors/auth.go | 15 +- vendor/github.com/go-openapi/errors/doc.go | 15 +- .../github.com/go-openapi/errors/headers.go | 25 +- .../go-openapi/errors/middleware.go | 19 +- .../github.com/go-openapi/errors/parsing.go | 53 +- vendor/github.com/go-openapi/errors/schema.go | 51 +- .../go-openapi/strfmt/.golangci.yml | 120 +- vendor/github.com/go-openapi/strfmt/README.md | 13 +- vendor/github.com/go-openapi/strfmt/bson.go | 62 +- vendor/github.com/go-openapi/strfmt/date.go | 44 +- .../github.com/go-openapi/strfmt/default.go | 1041 +- vendor/github.com/go-openapi/strfmt/doc.go | 15 +- .../github.com/go-openapi/strfmt/duration.go | 87 +- vendor/github.com/go-openapi/strfmt/errors.go | 13 + vendor/github.com/go-openapi/strfmt/format.go | 80 +- vendor/github.com/go-openapi/strfmt/ifaces.go | 32 + vendor/github.com/go-openapi/strfmt/mongo.go | 646 + vendor/github.com/go-openapi/strfmt/time.go | 135 +- vendor/github.com/go-openapi/strfmt/ulid.go | 38 +- .../validator/v10/.golangci.yaml | 52 +- .../go-playground/validator/v10/README.md | 11 +- .../go-playground/validator/v10/baked_in.go | 301 +- .../go-playground/validator/v10/cache.go | 11 - .../go-playground/validator/v10/doc.go | 29 +- .../go-playground/validator/v10/errors.go | 15 +- .../go-playground/validator/v10/regexes.go | 2 + .../validator/v10/struct_level.go | 6 +- .../go-playground/validator/v10/util.go | 11 +- .../go-playground/validator/v10/validator.go | 32 +- .../validator/v10/validator_instance.go | 106 +- .../go-viper/mapstructure/v2/.editorconfig | 21 + .../go-viper/mapstructure/v2/.gitignore | 6 + .../go-viper/mapstructure/v2/.golangci.yaml | 48 + .../mapstructure/v2}/CHANGELOG.md | 8 + .../mapstructure/v2}/LICENSE | 0 .../go-viper/mapstructure/v2/README.md | 81 + .../go-viper/mapstructure/v2/decode_hooks.go | 714 + .../go-viper/mapstructure/v2/errors.go | 244 + .../go-viper/mapstructure/v2/flake.lock | 294 + .../go-viper/mapstructure/v2/flake.nix | 46 + .../mapstructure/v2/internal/errors/errors.go | 11 + .../mapstructure/v2/internal/errors/join.go | 9 + .../v2/internal/errors/join_go1_19.go | 61 + .../mapstructure/v2}/mapstructure.go | 594 +- .../mapstructure/v2/reflect_go1_19.go | 44 + .../mapstructure/v2/reflect_go1_20.go | 10 + .../mitchellh/mapstructure/README.md | 46 - .../mitchellh/mapstructure/decode_hooks.go | 279 - .../mitchellh/mapstructure/error.go | 50 - .../bson/bsonrw/extjson_writer.go | 7 +- vendor/golang.org/x/net/html/parse.go | 38 +- vendor/golang.org/x/net/html/render.go | 35 +- vendor/golang.org/x/net/html/token.go | 13 +- vendor/golang.org/x/net/http2/server.go | 21 - .../golang.org/x/net/http2/server_common.go | 22 + vendor/golang.org/x/net/http2/server_wrap.go | 40 + vendor/golang.org/x/net/http2/transport.go | 34 - .../x/net/http2/transport_common.go | 34 + .../x/net/http2/writesched_common.go | 41 + .../net/http2/writesched_priority_rfc7540.go | 41 - vendor/golang.org/x/sys/cpu/cpu.go | 19 +- .../golang.org/x/sys/cpu/cpu_linux_riscv64.go | 2 + vendor/golang.org/x/sys/cpu/cpu_loong64.go | 16 +- vendor/golang.org/x/sys/cpu/cpu_riscv64.go | 1 + vendor/golang.org/x/sys/unix/mkerrors.sh | 3 + vendor/golang.org/x/sys/unix/readv_unix.go | 103 + .../golang.org/x/sys/unix/syscall_darwin.go | 89 - vendor/golang.org/x/sys/unix/syscall_linux.go | 106 +- .../golang.org/x/sys/unix/syscall_openbsd.go | 4 + vendor/golang.org/x/sys/unix/zerrors_linux.go | 61 +- .../x/sys/unix/zerrors_linux_386.go | 7 +- .../x/sys/unix/zerrors_linux_amd64.go | 7 +- .../x/sys/unix/zerrors_linux_arm.go | 7 +- .../x/sys/unix/zerrors_linux_arm64.go | 7 +- .../x/sys/unix/zerrors_linux_loong64.go | 7 +- .../x/sys/unix/zerrors_linux_mips.go | 7 +- .../x/sys/unix/zerrors_linux_mips64.go | 7 +- .../x/sys/unix/zerrors_linux_mips64le.go | 7 +- .../x/sys/unix/zerrors_linux_mipsle.go | 7 +- .../x/sys/unix/zerrors_linux_ppc.go | 7 +- .../x/sys/unix/zerrors_linux_ppc64.go | 7 +- .../x/sys/unix/zerrors_linux_ppc64le.go | 7 +- .../x/sys/unix/zerrors_linux_riscv64.go | 1114 +- .../x/sys/unix/zerrors_linux_s390x.go | 7 +- .../x/sys/unix/zerrors_linux_sparc64.go | 7 +- .../golang.org/x/sys/unix/zsyscall_linux.go | 8 +- .../x/sys/unix/zsyscall_openbsd_386.go | 84 + .../x/sys/unix/zsyscall_openbsd_386.s | 20 + .../x/sys/unix/zsyscall_openbsd_amd64.go | 84 + .../x/sys/unix/zsyscall_openbsd_amd64.s | 20 + .../x/sys/unix/zsyscall_openbsd_arm.go | 84 + .../x/sys/unix/zsyscall_openbsd_arm.s | 20 + .../x/sys/unix/zsyscall_openbsd_arm64.go | 84 + .../x/sys/unix/zsyscall_openbsd_arm64.s | 20 + .../x/sys/unix/zsyscall_openbsd_mips64.go | 84 + .../x/sys/unix/zsyscall_openbsd_mips64.s | 20 + .../x/sys/unix/zsyscall_openbsd_ppc64.go | 84 + .../x/sys/unix/zsyscall_openbsd_ppc64.s | 24 + .../x/sys/unix/zsyscall_openbsd_riscv64.go | 84 + .../x/sys/unix/zsyscall_openbsd_riscv64.s | 20 + .../x/sys/unix/zsysnum_linux_386.go | 4 + .../x/sys/unix/zsysnum_linux_amd64.go | 5 + .../x/sys/unix/zsysnum_linux_arm.go | 4 + .../x/sys/unix/zsysnum_linux_arm64.go | 4 + .../x/sys/unix/zsysnum_linux_loong64.go | 5 + .../x/sys/unix/zsysnum_linux_mips.go | 4 + .../x/sys/unix/zsysnum_linux_mips64.go | 4 + .../x/sys/unix/zsysnum_linux_mips64le.go | 4 + .../x/sys/unix/zsysnum_linux_mipsle.go | 4 + .../x/sys/unix/zsysnum_linux_ppc.go | 4 + .../x/sys/unix/zsysnum_linux_ppc64.go | 4 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 4 + .../x/sys/unix/zsysnum_linux_riscv64.go | 4 + .../x/sys/unix/zsysnum_linux_s390x.go | 4 + .../x/sys/unix/zsysnum_linux_sparc64.go | 5 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 47 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 8 + .../x/sys/unix/ztypes_linux_amd64.go | 8 + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 8 + .../x/sys/unix/ztypes_linux_arm64.go | 8 + .../x/sys/unix/ztypes_linux_loong64.go | 8 + .../x/sys/unix/ztypes_linux_mips.go | 8 + .../x/sys/unix/ztypes_linux_mips64.go | 8 + .../x/sys/unix/ztypes_linux_mips64le.go | 8 + .../x/sys/unix/ztypes_linux_mipsle.go | 8 + .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 8 + .../x/sys/unix/ztypes_linux_ppc64.go | 8 + .../x/sys/unix/ztypes_linux_ppc64le.go | 8 + .../x/sys/unix/ztypes_linux_riscv64.go | 8 + .../x/sys/unix/ztypes_linux_s390x.go | 8 + .../x/sys/unix/ztypes_linux_sparc64.go | 8 + .../x/sys/windows/syscall_windows.go | 3 + .../golang.org/x/sys/windows/types_windows.go | 4 +- .../x/sys/windows/zsyscall_windows.go | 35 + vendor/modules.txt | 53 +- 204 files changed, 38440 insertions(+), 12954 deletions(-) delete mode 100644 vendor/github.com/asaskevich/govalidator/.gitignore delete mode 100644 vendor/github.com/asaskevich/govalidator/.travis.yml delete mode 100644 vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md delete mode 100644 vendor/github.com/asaskevich/govalidator/LICENSE delete mode 100644 vendor/github.com/asaskevich/govalidator/README.md delete mode 100644 vendor/github.com/asaskevich/govalidator/arrays.go delete mode 100644 vendor/github.com/asaskevich/govalidator/converter.go delete mode 100644 vendor/github.com/asaskevich/govalidator/doc.go delete mode 100644 vendor/github.com/asaskevich/govalidator/error.go delete mode 100644 vendor/github.com/asaskevich/govalidator/numerics.go delete mode 100644 vendor/github.com/asaskevich/govalidator/patterns.go delete mode 100644 vendor/github.com/asaskevich/govalidator/types.go delete mode 100644 vendor/github.com/asaskevich/govalidator/utils.go delete mode 100644 vendor/github.com/asaskevich/govalidator/validator.go delete mode 100644 vendor/github.com/asaskevich/govalidator/wercker.yml create mode 100644 vendor/github.com/gabriel-vasile/mimetype/.git-blame-ignore-revs delete mode 100644 vendor/github.com/gabriel-vasile/mimetype/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/gabriel-vasile/mimetype/CONTRIBUTING.md create mode 100644 vendor/github.com/gabriel-vasile/mimetype/internal/csv/parser.go create mode 100644 vendor/github.com/gabriel-vasile/mimetype/internal/magic/netpbm.go create mode 100644 vendor/github.com/gabriel-vasile/mimetype/internal/markup/markup.go create mode 100644 vendor/github.com/gabriel-vasile/mimetype/internal/scan/bytes.go create mode 100644 vendor/github.com/go-openapi/strfmt/errors.go create mode 100644 vendor/github.com/go-openapi/strfmt/ifaces.go create mode 100644 vendor/github.com/go-openapi/strfmt/mongo.go create mode 100644 vendor/github.com/go-viper/mapstructure/v2/.editorconfig create mode 100644 vendor/github.com/go-viper/mapstructure/v2/.gitignore create mode 100644 vendor/github.com/go-viper/mapstructure/v2/.golangci.yaml rename vendor/github.com/{mitchellh/mapstructure => go-viper/mapstructure/v2}/CHANGELOG.md (92%) rename vendor/github.com/{mitchellh/mapstructure => go-viper/mapstructure/v2}/LICENSE (100%) create mode 100644 vendor/github.com/go-viper/mapstructure/v2/README.md create mode 100644 vendor/github.com/go-viper/mapstructure/v2/decode_hooks.go create mode 100644 vendor/github.com/go-viper/mapstructure/v2/errors.go create mode 100644 vendor/github.com/go-viper/mapstructure/v2/flake.lock create mode 100644 vendor/github.com/go-viper/mapstructure/v2/flake.nix create mode 100644 vendor/github.com/go-viper/mapstructure/v2/internal/errors/errors.go create mode 100644 vendor/github.com/go-viper/mapstructure/v2/internal/errors/join.go create mode 100644 vendor/github.com/go-viper/mapstructure/v2/internal/errors/join_go1_19.go rename vendor/github.com/{mitchellh/mapstructure => go-viper/mapstructure/v2}/mapstructure.go (74%) create mode 100644 vendor/github.com/go-viper/mapstructure/v2/reflect_go1_19.go create mode 100644 vendor/github.com/go-viper/mapstructure/v2/reflect_go1_20.go delete mode 100644 vendor/github.com/mitchellh/mapstructure/README.md delete mode 100644 vendor/github.com/mitchellh/mapstructure/decode_hooks.go delete mode 100644 vendor/github.com/mitchellh/mapstructure/error.go create mode 100644 vendor/golang.org/x/sys/unix/readv_unix.go diff --git a/go.mod b/go.mod index de62b7419e95..337d6b1eb2ee 100644 --- a/go.mod +++ b/go.mod @@ -15,11 +15,11 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.7.0 github.com/Azure/msi-dataplane v0.4.3 github.com/IBM-Cloud/power-go-client v1.12.0 - github.com/IBM/go-sdk-core/v5 v5.21.0 - github.com/IBM/ibm-cos-sdk-go v1.12.3 - github.com/IBM/networking-go-sdk v0.51.11 - github.com/IBM/platform-services-go-sdk v0.86.1 - github.com/IBM/vpc-go-sdk v0.71.1 + github.com/IBM/go-sdk-core/v5 v5.21.4 + github.com/IBM/ibm-cos-sdk-go v1.14.1 + github.com/IBM/networking-go-sdk v0.53.4 + github.com/IBM/platform-services-go-sdk v0.99.1 + github.com/IBM/vpc-go-sdk v0.85.0 github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 github.com/aws/aws-sdk-go-v2 v1.41.5 github.com/aws/aws-sdk-go-v2/config v1.32.13 @@ -91,7 +91,7 @@ require ( go.uber.org/mock v0.6.0 go.uber.org/zap v1.28.0 golang.org/x/crypto v0.51.0 - golang.org/x/net v0.54.0 + golang.org/x/net v0.55.0 golang.org/x/oauth2 v0.36.0 golang.org/x/sync v0.20.0 golang.org/x/time v0.15.0 @@ -149,7 +149,6 @@ require ( github.com/PaesslerAG/gval v1.2.3 // indirect github.com/PaesslerAG/jsonpath v0.1.1 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 // indirect @@ -184,17 +183,17 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.9 // indirect + github.com/gabriel-vasile/mimetype v1.4.11 // indirect github.com/go-errors/errors v1.5.1 // indirect github.com/go-jose/go-jose/v4 v4.1.4 // indirect github.com/go-openapi/analysis v0.23.0 // indirect - github.com/go-openapi/errors v0.22.1 // indirect + github.com/go-openapi/errors v0.22.4 // indirect github.com/go-openapi/jsonpointer v0.22.4 // indirect github.com/go-openapi/jsonreference v0.21.4 // indirect github.com/go-openapi/loads v0.22.0 // indirect github.com/go-openapi/runtime v0.28.0 // indirect github.com/go-openapi/spec v0.21.0 // indirect - github.com/go-openapi/strfmt v0.23.0 // indirect + github.com/go-openapi/strfmt v0.25.0 // indirect github.com/go-openapi/swag v0.25.4 // indirect github.com/go-openapi/swag/cmdutils v0.25.4 // indirect github.com/go-openapi/swag/conv v0.25.4 // indirect @@ -210,8 +209,9 @@ require ( github.com/go-openapi/validate v0.24.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.26.0 // indirect + github.com/go-playground/validator/v10 v10.28.0 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect + github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/gobuffalo/flect v1.0.3 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -240,7 +240,6 @@ require ( github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/spdystream v0.5.1 // indirect github.com/moby/sys/user v0.4.0 // indirect github.com/moby/term v0.5.2 // indirect @@ -270,7 +269,7 @@ require ( github.com/xlab/treeprint v1.2.0 // indirect go.etcd.io/etcd/pkg/v3 v3.6.11 // indirect go.etcd.io/raft/v3 v3.6.0 // indirect - go.mongodb.org/mongo-driver v1.17.3 // indirect + go.mongodb.org/mongo-driver v1.17.6 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 // indirect @@ -286,7 +285,7 @@ require ( go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect golang.org/x/mod v0.35.0 // indirect - golang.org/x/sys v0.44.0 // indirect + golang.org/x/sys v0.45.0 // indirect golang.org/x/term v0.43.0 // indirect golang.org/x/text v0.37.0 // indirect golang.org/x/tools v0.44.0 // indirect diff --git a/go.sum b/go.sum index 98cc20c1167e..439d09d4fa59 100644 --- a/go.sum +++ b/go.sum @@ -62,16 +62,16 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2/go.mod h1:HKpQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/IBM-Cloud/power-go-client v1.12.0 h1:tF9Mq5GLYHebpzQT6IYB89lIxEST1E9teuchjxSAaw0= github.com/IBM-Cloud/power-go-client v1.12.0/go.mod h1:SpTK1ttW8bfMNUVQS8qOEuWn2KOkzaCLyzfze8MG1JE= -github.com/IBM/go-sdk-core/v5 v5.21.0 h1:DUnYhvC4SoC8T84rx5omnhY3+xcQg/Whyoa3mDPIMkk= -github.com/IBM/go-sdk-core/v5 v5.21.0/go.mod h1:Q3BYO6iDA2zweQPDGbNTtqft5tDcEpm6RTuqMlPcvbw= -github.com/IBM/ibm-cos-sdk-go v1.12.3 h1:kMIs1nfPY0UXAMcW6bq8O9WOd6KgqiDBnIMd0e/fMqA= -github.com/IBM/ibm-cos-sdk-go v1.12.3/go.mod h1:dt13UIqJRgfGIlSNlnf17JmAXlBXhfTgXLKV3as8ABk= -github.com/IBM/networking-go-sdk v0.51.11 h1:l+yMXcO9GDcb7JU9jl8riUOXjnHTvIKSLnXYFlYlKXo= -github.com/IBM/networking-go-sdk v0.51.11/go.mod h1:TAXWyBUk3C3R7aS1m84EfKdnDcBMZMAClwLfDj/SYZc= -github.com/IBM/platform-services-go-sdk v0.86.1 h1:ngBpaXvUF3gmLvbU1Z4lX1wowOSYgGoKBEBaR/urt30= -github.com/IBM/platform-services-go-sdk v0.86.1/go.mod h1:aGD045m6I8pfcB77wft8w2cHqWOJjcM3YSSV55BX0Js= -github.com/IBM/vpc-go-sdk v0.71.1 h1:SP5/uQs5JDb1QRvSJ1QC2BzE+BHEMq4jd2+JEcRuieE= -github.com/IBM/vpc-go-sdk v0.71.1/go.mod h1:K3vVlje72PYE3ZRt1iouE+jSIq+vCyYzT1HiFC06hUA= +github.com/IBM/go-sdk-core/v5 v5.21.4 h1:f1x/AkOj1BZuOHUM7qyeIt6Cw2pprlDRIKR+RUpxobs= +github.com/IBM/go-sdk-core/v5 v5.21.4/go.mod h1:cZJMMEImJkIXCd61kHeDFtjbdDpXq4ua4ITrwpBYdWs= +github.com/IBM/ibm-cos-sdk-go v1.14.1 h1:Qz122nd7m9F0GixhSNdL4OPSwhJKHR4NN/dmBPemflI= +github.com/IBM/ibm-cos-sdk-go v1.14.1/go.mod h1:h2G89PVcjfG5Bae1Q6Sr60MrPSGjD7x9ivF6crkJivM= +github.com/IBM/networking-go-sdk v0.53.4 h1:XDGOhavZocjVfItgcaT7/SFqB8zT2kznYuJ9LXkz/ug= +github.com/IBM/networking-go-sdk v0.53.4/go.mod h1:TAXWyBUk3C3R7aS1m84EfKdnDcBMZMAClwLfDj/SYZc= +github.com/IBM/platform-services-go-sdk v0.99.1 h1:Mr3tPhswn8rq01aaNWqU1bOYf55aM8mgBW182RvRlgE= +github.com/IBM/platform-services-go-sdk v0.99.1/go.mod h1:t93mozFmKrxexnKNdx2gNOtEI9Wd62dKAVffQYm0vRM= +github.com/IBM/vpc-go-sdk v0.85.0 h1:hNMz/8YvyShaXuXKnFHyEkNRsh2Ghj1iOrmB1i8LfZc= +github.com/IBM/vpc-go-sdk v0.85.0/go.mod h1:PkBoJoyDAdkcM2wrBSTJr0L6BVoX00wmX5LK5bR1/PY= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= @@ -102,8 +102,6 @@ github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/Y github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23 h1:I+Cy77zrFmVWIHOZaxiNV4L7w9xuVux9LMqAblGzvdE= github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23/go.mod h1:S7DsXubvw3xBC8rSI+qmzcTNw7xEND0ojHPqglh/whY= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= @@ -280,8 +278,8 @@ github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= -github.com/gabriel-vasile/mimetype v1.4.9 h1:5k+WDwEsD9eTLL8Tz3L0VnmVh9QxGjRmjBvAG7U/oYY= -github.com/gabriel-vasile/mimetype v1.4.9/go.mod h1:WnSQhFKJuBlRyLiKohA/2DtIlPFAbguNaG7QCHcyGok= +github.com/gabriel-vasile/mimetype v1.4.11 h1:AQvxbp830wPhHTqc1u7nzoLT+ZFxGY7emj5DR5DYFik= +github.com/gabriel-vasile/mimetype v1.4.11/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s= github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs= @@ -311,8 +309,8 @@ github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU= github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo= -github.com/go-openapi/errors v0.22.1 h1:kslMRRnK7NCb/CvR1q1VWuEQCEIsBGn5GgKD9e+HYhU= -github.com/go-openapi/errors v0.22.1/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0= +github.com/go-openapi/errors v0.22.4 h1:oi2K9mHTOb5DPW2Zjdzs/NIvwi2N3fARKaTJLdNabaM= +github.com/go-openapi/errors v0.22.4/go.mod h1:z9S8ASTUqx7+CP1Q8dD8ewGH/1JWFFLX/2PmAYNQLgk= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= @@ -328,8 +326,8 @@ github.com/go-openapi/runtime v0.28.0 h1:gpPPmWSNGo214l6n8hzdXYhPuJcGtziTOgUpvsF github.com/go-openapi/runtime v0.28.0/go.mod h1:QN7OzcS+XuYmkQLw05akXk0jRH/eZ3kb18+1KwW9gyc= github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= -github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c= -github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4= +github.com/go-openapi/strfmt v0.25.0 h1:7R0RX7mbKLa9EYCTHRcCuIPcaqlyQiWNPTXwClK0saQ= +github.com/go-openapi/strfmt v0.25.0/go.mod h1:nNXct7OzbwrMY9+5tLX4I21pzcmE6ccMGXl3jFdPfn8= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= @@ -371,12 +369,14 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc/iMaVtFbr3Sw2k= -github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo= +github.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688= +github.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= +github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4= github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= @@ -545,8 +545,6 @@ github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTS github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= @@ -763,8 +761,8 @@ go.etcd.io/etcd/server/v3 v3.6.11 h1:ltQkUbTRM/YVwZGRGFXi+qcjyECMVoKcoCxISSpvtxg go.etcd.io/etcd/server/v3 v3.6.11/go.mod h1:WGWPgjHk4fWKoC1ftSMuPvUbdOBqeqvc/pDBPQgN1aw= go.etcd.io/raft/v3 v3.6.0 h1:5NtvbDVYpnfZWcIHgGRk9DyzkBIXOi8j+DDp1IcnUWQ= go.etcd.io/raft/v3 v3.6.0/go.mod h1:nLvLevg6+xrVtHUmVaTcTz603gQPHfh7kUAwV6YpfGo= -go.mongodb.org/mongo-driver v1.17.3 h1:TQyXhnsWfWtgAhMtOgtYHMTkZIfBTpMTsMnd9ZBeHxQ= -go.mongodb.org/mongo-driver v1.17.3/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= +go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss= +go.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 h1:yI1/OhfEPy7J9eoa6Sj051C7n5dvpj0QX8g4sRchg04= @@ -845,8 +843,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= -golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= +golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= @@ -897,8 +895,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= -golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= +golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/vendor/github.com/IBM/go-sdk-core/v5/core/unmarshal_v2.go b/vendor/github.com/IBM/go-sdk-core/v5/core/unmarshal_v2.go index c9c8e75c080b..eaf22791ba7f 100644 --- a/vendor/github.com/IBM/go-sdk-core/v5/core/unmarshal_v2.go +++ b/vendor/github.com/IBM/go-sdk-core/v5/core/unmarshal_v2.go @@ -199,7 +199,7 @@ func UnmarshalModel(rawInput interface{}, propertyName string, result interface{ // Now delegate the work to the appropriate internal unmarshal function. switch rResultType.Kind() { - case reflect.Ptr, reflect.Interface: + case reflect.Pointer, reflect.Interface: // Unmarshal a single instance of a model. err = unmarshalModelInstance(rawInput, propertyName, result, unmarshaller) @@ -788,7 +788,7 @@ func getUnmarshalResultType(result interface{}) (ptrType reflect.Type, err error // This will be something like "mypackagev1.Foo" or "mypackagev1.FooIntf" func getModelResultType(result interface{}) string { rResultType := reflect.TypeOf(result).Elem() - if rResultType.Kind() == reflect.Ptr { + if rResultType.Kind() == reflect.Pointer { rResultType = rResultType.Elem() } diff --git a/vendor/github.com/IBM/go-sdk-core/v5/core/utils.go b/vendor/github.com/IBM/go-sdk-core/v5/core/utils.go index 1075799e03f5..e3d1fa850370 100644 --- a/vendor/github.com/IBM/go-sdk-core/v5/core/utils.go +++ b/vendor/github.com/IBM/go-sdk-core/v5/core/utils.go @@ -50,7 +50,7 @@ func IsNil(object interface{}) bool { } switch reflect.TypeOf(object).Kind() { - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: + case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Pointer, reflect.Slice: return reflect.ValueOf(object).IsNil() } diff --git a/vendor/github.com/IBM/go-sdk-core/v5/core/version.go b/vendor/github.com/IBM/go-sdk-core/v5/core/version.go index 5b70ae7ff9c5..11ef13fb7133 100644 --- a/vendor/github.com/IBM/go-sdk-core/v5/core/version.go +++ b/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.21.0" +const __VERSION__ = "5.21.4" diff --git a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/env_provider_trusted_profile.go b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/env_provider_trusted_profile.go index ca497763b45b..9cd87cf19ab8 100644 --- a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/env_provider_trusted_profile.go +++ b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/env_provider_trusted_profile.go @@ -19,15 +19,31 @@ const EnvProviderTrustedProfileName = "EnvProviderTrustedProfileIBM" // // Returns: // -// A new provider with AWS config, Trusted Profile ID, CR token file path, IBM IAM Authentication Server Endpoint and +// A new provider with AWS config, Trusted Profile ID, CR token file path or ApiKey, IBM IAM Authentication Server Endpoint and // Service Instance ID func NewEnvProviderTrustedProfile(config *aws.Config) *TrustedProfileProvider { trustedProfileID := os.Getenv("TRUSTED_PROFILE_ID") + trustedProfileName := os.Getenv("TRUSTED_PROFILE_NAME") + iamAccountID := os.Getenv("IAM_ACCOUNT_ID") serviceInstanceID := os.Getenv("IBM_SERVICE_INSTANCE_ID") crTokenFilePath := os.Getenv("CR_TOKEN_FILE_PATH") authEndPoint := os.Getenv("IBM_AUTH_ENDPOINT") + serviceIdApiKey := os.Getenv("IBM_SERVICE_ID_API_KEY") + + tpConfig := &TrustedProfileConfig{ + TrustedProfileID: trustedProfileID, + ServiceIDApiKey: serviceIdApiKey, + TrustedProfileName: trustedProfileName, + IAMAccountID: iamAccountID, + CrTokenFilePath: crTokenFilePath, + } + if crTokenFilePath != "" { + return NewTrustedProfileProviderWithConfig(TrustedProfileProviderName, config, authEndPoint, tpConfig, serviceInstanceID, ResourceComputeResource) + } else { + return NewTrustedProfileProviderWithConfig(TrustedProfileProviderName, config, authEndPoint, tpConfig, serviceInstanceID, ResourceServiceID) + + } - return NewTrustedProfileProvider(EnvProviderTrustedProfileName, config, authEndPoint, trustedProfileID, crTokenFilePath, serviceInstanceID, "CR") } // NewEnvCredentials Constructor diff --git a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/iamcreds_file_utils.go b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/iamcreds_file_utils.go index 7c36801fa0cd..312957aecbfa 100644 --- a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/iamcreds_file_utils.go +++ b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/iamcreds_file_utils.go @@ -6,20 +6,35 @@ import ( "github.com/IBM/ibm-cos-sdk-go/aws/awserr" ) -// Helper function to check whether both api-key and trusted-profile-id are set +// Helper function to check whether both api-key and trusted profile credentials are set // in environment variables. // // Returns: // -// Error if both apiKey and trustedProfileID are set, nil if only either of them is set. +// Error if both api-key and trusted profile credentials are set as environmental variables. + func CheckForConflictingIamCredentials() error { apiKey := os.Getenv("IBM_API_KEY_ID") trustedProfileID := os.Getenv("TRUSTED_PROFILE_ID") + trustedProfileName := os.Getenv("TRUSTED_PROFILE_NAME") + crTokenFilePath := os.Getenv("CR_TOKEN_FILE_PATH") + serviceIdApiKey := os.Getenv("IBM_SERVICE_ID_API_KEY") - if apiKey != "" && trustedProfileID != "" { + if apiKey != "" && (trustedProfileID != "" || trustedProfileName != "") { + return awserr.New("InvalidCredentials", + `only one of ApiKey or TrustedProfile credentials should be set, not both.`, + nil) + } + if trustedProfileName != "" && trustedProfileID != "" { return awserr.New("InvalidCredentials", - `only one of ApiKey or TrustedProfileID should be set, not both`, + `only one of TrustedProfileName or TrustedProfileID should be set, not both.`, nil) } + if crTokenFilePath != "" && serviceIdApiKey != "" { + return awserr.New("InvalidCredentials", + `only one of ServiceIdApiKey or CrTokenFilePath should be set, not both.`, + nil) + } + return nil } diff --git a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/trusted_profile.go b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/trusted_profile.go index 96d2efaafe45..b39ad0f573fc 100644 --- a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/trusted_profile.go +++ b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/trusted_profile.go @@ -1,6 +1,9 @@ package ibmiam import ( + "os" + "strings" + "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/ibm-cos-sdk-go/aws" "github.com/IBM/ibm-cos-sdk-go/aws/awserr" @@ -22,6 +25,9 @@ type TrustedProfileProvider struct { // Service Instance ID passes in a provider serviceInstanceID string + // Resource type - CR, SID, etc + resourceType ResourceType + // Error ErrorStatus error @@ -30,6 +36,16 @@ type TrustedProfileProvider struct { logLevel *aws.LogLevelType } +// TrustedProfileConfig has all the authentication parameters for trusted profile. +type TrustedProfileConfig struct { + TrustedProfileName string + CrTokenFilePath string + TrustedProfileID string + IAMAccountID string + ServiceIDApiKey string + DisableSSLVerification bool +} + // NewTrustedProfileProvider allows the creation of a custom IBM IAM Trusted Profile Provider // Parameters: // @@ -44,6 +60,8 @@ type TrustedProfileProvider struct { // Returns: // // TrustedProfileProvider +// +// Deprecated: Use NewTrustedProfileProviderWithConfig instead. func NewTrustedProfileProvider(providerName string, config *aws.Config, authEndPoint string, trustedProfileID string, crTokenFilePath string, serviceInstanceID string, resourceType string) (provider *TrustedProfileProvider) { provider = new(TrustedProfileProvider) @@ -61,7 +79,7 @@ func NewTrustedProfileProvider(providerName string, config *aws.Config, authEndP if crTokenFilePath == "" { provider.ErrorStatus = awserr.New("crTokenFilePathNotFound", "CR Token file path not found", nil) if provider.logLevel.Matches(aws.LogDebug) { - provider.logger.Log(debugLog, "", provider.ErrorStatus) + provider.logger.Log(debugLog, "", provider.ErrorStatus) } return } @@ -69,7 +87,7 @@ func NewTrustedProfileProvider(providerName string, config *aws.Config, authEndP if trustedProfileID == "" { provider.ErrorStatus = awserr.New("trustedProfileIDNotFound", "Trusted profile id not found", nil) if provider.logLevel.Matches(aws.LogDebug) { - provider.logger.Log(debugLog, "", provider.ErrorStatus) + provider.logger.Log(debugLog, "", provider.ErrorStatus) } return } @@ -79,23 +97,23 @@ func NewTrustedProfileProvider(providerName string, config *aws.Config, authEndP if authEndPoint == "" { authEndPoint = defaultAuthEndPoint if provider.logLevel.Matches(aws.LogDebug) { - provider.logger.Log(debugLog, "", "using default auth endpoint", authEndPoint) + provider.logger.Log(debugLog, "", "using default auth endpoint", authEndPoint) } } // This authenticator is dynamically initialized based on the resourceType parameter. // Since only cr-token based resources is supported now, it is initialized directly. // when other resources are supported, the authenticator should be initialized accordingly. + // Note: SSL verification is enabled by default for security. Only disable for testing. authenticator, err := core.NewContainerAuthenticatorBuilder(). SetCRTokenFilename(crTokenFilePath). SetIAMProfileID(trustedProfileID). SetURL(authEndPoint). - SetDisableSSLVerification(true). Build() if err != nil { provider.ErrorStatus = awserr.New("errCreatingAuthenticatorClient", "cannot setup new Authenticator client", err) if provider.logLevel.Matches(aws.LogDebug) { - provider.logger.Log(debugLog, "", provider.ErrorStatus) + provider.logger.Log(debugLog, "", provider.ErrorStatus) } return } @@ -104,6 +122,146 @@ func NewTrustedProfileProvider(providerName string, config *aws.Config, authEndP return provider } +// NewTrustedProfileProviderWithConfig allows the creation of a custom IBM IAM Trusted Profile Provider with trusted profile config +// Parameters: +// +// Provider Name +// AWS Config +// IBM IAM Authentication Server Endpoint +// Trusted Profile Config +// Service Instance ID +// Resource type +// +// Returns: +// +// TrustedProfileProvider + +func NewTrustedProfileProviderWithConfig(providerName string, config *aws.Config, authEndPoint string, trustedProfileConfig *TrustedProfileConfig, + serviceInstanceID string, resourceType ResourceType) (provider *TrustedProfileProvider) { + provider = new(TrustedProfileProvider) + + provider.providerName = providerName + provider.providerType = "oauth" + provider.resourceType = resourceType + + logLevel := aws.LogLevel(aws.LogOff) + if config != nil && config.LogLevel != nil && config.Logger != nil { + logLevel = config.LogLevel + provider.logger = config.Logger + } + provider.logLevel = logLevel + if trustedProfileConfig == nil { + provider.ErrorStatus = awserr.New("trustedProfileConfigNil", "TrustedProfileConfig cannot be nil", nil) + return + } + + if trustedProfileConfig.CrTokenFilePath == "" && trustedProfileConfig.ServiceIDApiKey == "" { + provider.ErrorStatus = awserr.New("CredentialsNotFound", "CR Token file path not found or Service Id's api key not found", nil) + if provider.logLevel.Matches(aws.LogDebug) { + provider.logger.Log(debugLog, "", provider.ErrorStatus) + } + return + } + + provider.serviceInstanceID = serviceInstanceID + + if authEndPoint == "" { + authEndPoint = defaultAuthEndPoint + if provider.logLevel.Matches(aws.LogDebug) { + provider.logger.Log(debugLog, "", "using default auth endpoint", authEndPoint) + } + } + var authenticatorErr error + // This authenticator is dynamically initialized based on the resourceType parameter. + if resourceType == ResourceComputeResource { + // For computed resource we need to make sure that the trusted profile ID is not null + if trustedProfileConfig.TrustedProfileID == "" { + provider.ErrorStatus = awserr.New("trustedProfileIDNotFound", "Trusted profile id not found", nil) + if provider.logLevel.Matches(aws.LogDebug) { + provider.logger.Log(debugLog, "", provider.ErrorStatus) + } + return + } + // Here cr-token based resources is specified, hence initialized accordingly. + // Note: SSL verification is enabled by default for security. Only disable for testing. + builder := core.NewContainerAuthenticatorBuilder(). + SetCRTokenFilename(trustedProfileConfig.CrTokenFilePath). + SetIAMProfileID(trustedProfileConfig.TrustedProfileID). + SetURL(authEndPoint) + // Check if SSL verification should be disabled + // Priority: 1. Config field, 2. Environment variable + disableSSL := trustedProfileConfig.DisableSSLVerification + if !disableSSL { + // Check environment variable if not explicitly set in config + envValue := os.Getenv("TRUSTED_PROFILE_CR_DISABLE_SSL_VERIFICATION") + if strings.ToLower(envValue) == "true" { + disableSSL = true + } + } + // Only disable SSL verification if explicitly requested (not recommended for production) + if disableSSL { + builder.SetDisableSSLVerification(true) + } + authenticator, err := builder.Build() + authenticatorErr = err + provider.authenticator = authenticator + } else if resourceType == ResourceServiceID { + if trustedProfileConfig.TrustedProfileID == "" && trustedProfileConfig.TrustedProfileName == "" { + provider.ErrorStatus = awserr.New("trustedProfileDetailsNotFound", "Trusted profile id or TrustedProfileName not found", nil) + if provider.logLevel.Matches(aws.LogDebug) { + provider.logger.Log(debugLog, "", provider.ErrorStatus) + } + return + } + //For service ID either trusted profile name of trusted profile id is required + if trustedProfileConfig.TrustedProfileID != "" && trustedProfileConfig.TrustedProfileName != "" { + provider.ErrorStatus = awserr.New("trustedProfileInputConflict", "Either provide TrustedProfileId or TrustedProfileName not both", nil) + if provider.logLevel.Matches(aws.LogDebug) { + provider.logger.Log(debugLog, "", provider.ErrorStatus) + } + return + } + // If TrustedProfileName is provided. + if trustedProfileConfig.TrustedProfileName != "" { + // If using trustedProfile name IamAccountID is also required to identify the right account , because trusted profile name is only unique within an account. + if trustedProfileConfig.IAMAccountID == "" { + provider.ErrorStatus = awserr.New("trustedProfileMissingRequiredField", "IamAccountId is required when using TrustedProfileName", nil) + if provider.logLevel.Matches(aws.LogDebug) { + provider.logger.Log(debugLog, "", provider.ErrorStatus) + } + return + } else { + // Here service-Id based resources with trustedProfileName is specified, hence initialized accordingly. + authenticator, err := core.NewIamAssumeAuthenticatorBuilder(). + SetApiKey(trustedProfileConfig.ServiceIDApiKey). + SetIAMProfileName(trustedProfileConfig.TrustedProfileName). + SetIAMAccountID(trustedProfileConfig.IAMAccountID). + Build() + authenticatorErr = err + provider.authenticator = authenticator + } + } + if trustedProfileConfig.TrustedProfileID != "" { + // Here service-Id based resources with trustedProfileId is specified, hence initialized accordingly. + authenticator, err := core.NewIamAssumeAuthenticatorBuilder(). + SetApiKey(trustedProfileConfig.ServiceIDApiKey). + SetIAMProfileID(trustedProfileConfig.TrustedProfileID). + Build() + authenticatorErr = err + provider.authenticator = authenticator + } + if authenticatorErr != nil { + provider.ErrorStatus = awserr.New("errCreatingAuthenticatorClient", "cannot setup new Authenticator client", authenticatorErr) + if provider.logLevel.Matches(aws.LogDebug) { + provider.logger.Log(debugLog, "", provider.ErrorStatus) + } + return + } + } + // When other resources are supported, the authenticator should be initialized accordingly. + return provider +} + // IsValid ... // Returns: // @@ -126,10 +284,13 @@ func (p *TrustedProfileProvider) Retrieve() (credentials.Value, error) { } // The respective resourceTypes's class should be called based on the resourceType parameter. - // Since only cr-token based resources is supported now, it is assigned to ContainerAuthenticator - // directly. when other resource types are supported, the respective class should be used accordingly. - tokenValue, err := p.authenticator.(*core.ContainerAuthenticator).GetToken() - + var tokenValue string + var err error + if p.resourceType == ResourceComputeResource { + tokenValue, err = p.authenticator.(*core.ContainerAuthenticator).GetToken() // Cr-token based resources, hence it is assigned to ContainerAuthenticator. + } else if p.resourceType == ResourceServiceID { + tokenValue, err = p.authenticator.(*core.IamAssumeAuthenticator).GetToken() // Service-Id based resources, hence it is assigned to IamAssumeAuthenticator + } if err != nil { var returnErr error if p.logLevel.Matches(aws.LogDebug) { @@ -138,7 +299,7 @@ func (p *TrustedProfileProvider) Retrieve() (credentials.Value, error) { returnErr = awserr.New("TokenManagerRetrieveError", "error retrieving the token", err) return credentials.Value{}, returnErr } - + // When other resource types are supported, the respective class should be used accordingly. return credentials.Value{ Token: token.Token{ AccessToken: tokenValue, @@ -148,6 +309,7 @@ func (p *TrustedProfileProvider) Retrieve() (credentials.Value, error) { ProviderType: p.providerType, ServiceInstanceID: p.serviceInstanceID, }, nil + } // IsExpired ... diff --git a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/trusted_profile_provider.go b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/trusted_profile_provider.go index 08ce0b2b036d..fa0d555e832e 100644 --- a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/trusted_profile_provider.go +++ b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam/trusted_profile_provider.go @@ -12,20 +12,70 @@ type ResourceType string const ( TrustedProfileProviderName = "TrustedProfileProviderIBM" ResourceComputeResource ResourceType = "CR" + ResourceServiceID ResourceType = "SID" ) // NewTrustedProfileProviderWithCR constructor of the IBM IAM provider that uses IAM trusted-profile // details passed // Returns: New TrustedProfileProvider (AWS type) func NewTrustedProfileProviderCR(config *aws.Config, authEndPoint string, trustedProfileID string, crTokenFilePath string, serviceInstanceID string) *TrustedProfileProvider { + + tpConfig := &TrustedProfileConfig{ + TrustedProfileID: trustedProfileID, + CrTokenFilePath: crTokenFilePath, + } // Resource type ResourceComputeResource is passed to identify that this is a CR-token based // resource. - return NewTrustedProfileProvider(TrustedProfileProviderName, config, authEndPoint, trustedProfileID, crTokenFilePath, serviceInstanceID, string(ResourceComputeResource)) + return NewTrustedProfileProviderWithConfig(TrustedProfileProviderName, config, authEndPoint, tpConfig, serviceInstanceID, ResourceComputeResource) } -// NewTrustedProfileCredentials constructor for IBM IAM that uses IAM trusted-profile +// NewTrustedProfileCredentials constructor for IBM IAM that uses IAM trusted-profile-id, crTokenFilePath // credentials passed // Returns: credentials.NewCredentials(newTrustedProfileProvider()) (AWS type) func NewTrustedProfileCredentialsCR(config *aws.Config, authEndPoint string, trustedProfileID string, crTokenFilePath string, serviceInstanceID string) *credentials.Credentials { return credentials.NewCredentials(NewTrustedProfileProviderCR(config, authEndPoint, trustedProfileID, crTokenFilePath, serviceInstanceID)) } + +// NewTrustedProfileCredentials constructor for IBM IAM that uses IAM trusted-profile-id , serviceId-api-key +// credentials passed +// Returns: credentials.NewCredentials(newTrustedProfileProvider()) (AWS type) +func NewTrustedProfileProviderServiceIdWithTrustedProfileId(config *aws.Config, authEndPoint string, trustedProfileID string, serviceIdApiKey string, serviceInstanceID string) *TrustedProfileProvider { + + tpConfig := &TrustedProfileConfig{ + TrustedProfileID: trustedProfileID, + ServiceIDApiKey: serviceIdApiKey, + } + // Resource type ResourceServiceID is passed to identify that this is a Service Id based + // resource. + return NewTrustedProfileProviderWithConfig(TrustedProfileProviderName, config, authEndPoint, tpConfig, serviceInstanceID, ResourceServiceID) +} + +// NewTrustedProfileCredentials constructor for IBM IAM that uses IAM trusted-profile-id, serviceId-api-key +// credentials passed +// Returns: credentials.NewCredentials(newTrustedProfileProvider()) (AWS type) +func NewTrustedProfileCredentialsServiceIDWithTrustedProfileId(config *aws.Config, authEndPoint string, trustedProfileID string, serviceIdApiKey string, serviceInstanceID string) *credentials.Credentials { + return credentials.NewCredentials(NewTrustedProfileProviderServiceIdWithTrustedProfileId(config, authEndPoint, trustedProfileID, serviceIdApiKey, serviceInstanceID)) +} + +// NewTrustedProfileCredentials constructor for IBM IAM that uses IAM trusted-profile-name, iam-account-id, serviceId-api-key +// credentials passed +// Returns: credentials.NewCredentials(newTrustedProfileProvider()) (AWS type) +func NewTrustedProfileProviderServiceIdWithTrustedProfileName(config *aws.Config, authEndPoint string, trustedProfileName string, iamAccountId string, serviceIdApiKey string, serviceInstanceID string) *TrustedProfileProvider { + + tpConfig := &TrustedProfileConfig{ + TrustedProfileName: trustedProfileName, + IAMAccountID: iamAccountId, + ServiceIDApiKey: serviceIdApiKey, + } + // Resource type ResourceServiceID is passed to identify that this is a Service Id based + // resource. + return NewTrustedProfileProviderWithConfig(TrustedProfileProviderName, config, authEndPoint, tpConfig, serviceInstanceID, ResourceServiceID) +} + +// NewTrustedProfileCredentials constructor for IBM IAM that uses IAM trusted-profile-id, serviceId-api-key +// +// credentials passed +// Returns: credentials.NewCredentials(newTrustedProfileProvider()) (AWS type) +func NewTrustedProfileCredentialsServiceIDWithTrustedProfileName(config *aws.Config, authEndPoint string, trustedProfileName string, iamAccountId string, serviceIdApiKey string, serviceInstanceID string) *credentials.Credentials { + return credentials.NewCredentials(NewTrustedProfileProviderServiceIdWithTrustedProfileName(config, authEndPoint, trustedProfileName, iamAccountId, serviceIdApiKey, serviceInstanceID)) +} diff --git a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/endpoints/defaults.go index 3bb705161a02..bf1d4fd0cd67 100644 --- a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/endpoints/defaults.go +++ b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/endpoints/defaults.go @@ -73,10 +73,10 @@ func DefaultResolver() Resolver { // 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 -// } +// partitions := endpoints.DefaultPartitions +// for _, p := range partitions { +// // ... inspect partitions +// } func DefaultPartitions() []Partition { return defaultPartitions.Partitions() } diff --git a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/version.go b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/version.go index 770f83fd6024..8cdcb4dd42c8 100644 --- a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/version.go +++ b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/version.go @@ -7,6 +7,6 @@ package aws const SDKName = "ibm-cos-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.12.3" +const SDKVersion = "1.14.1" // IBM COS SDK Code -- END diff --git a/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/api.go b/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/api.go index b1968d8c3004..b3d2c6dc7c58 100644 --- a/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/api.go +++ b/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/api.go @@ -3700,6 +3700,81 @@ func (c *S3) HeadObjectWithContext(ctx aws.Context, input *HeadObjectInput, opts return out, req.Send() } +const opListBucketReplicationFailures = "ListBucketReplicationFailures" + +// ListBucketReplicationFailuresRequest generates a "aws/request.Request" representing the +// client's request for the ListBucketReplicationFailures operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListBucketReplicationFailures for more information on using the ListBucketReplicationFailures +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// // Example sending a request using the ListBucketReplicationFailuresRequest method. +// req, resp := client.ListBucketReplicationFailuresRequest(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/ListBucketReplicationFailures +func (c *S3) ListBucketReplicationFailuresRequest(input *ListBucketReplicationFailuresInput) (req *request.Request, output *ListBucketReplicationFailuresOutput) { + op := &request.Operation{ + Name: opListBucketReplicationFailures, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?ibm-replication-failures", + } + + if input == nil { + input = &ListBucketReplicationFailuresInput{} + } + + output = &ListBucketReplicationFailuresOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Build.PushBackNamed(request.NamedHandler{ + Name: "contentMd5Handler", + Fn: checksum.AddBodyContentMD5Handler, + }) + return +} + +// ListBucketReplicationFailures API operation for Amazon Simple Storage Service. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation ListBucketReplicationFailures for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketReplicationFailures +func (c *S3) ListBucketReplicationFailures(input *ListBucketReplicationFailuresInput) (*ListBucketReplicationFailuresOutput, error) { + req, out := c.ListBucketReplicationFailuresRequest(input) + return out, req.Send() +} + +// ListBucketReplicationFailuresWithContext is the same as ListBucketReplicationFailures with the addition of +// the ability to pass a context and additional request options. +// +// See ListBucketReplicationFailures for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) ListBucketReplicationFailuresWithContext(ctx aws.Context, input *ListBucketReplicationFailuresInput, opts ...request.Option) (*ListBucketReplicationFailuresOutput, error) { + req, out := c.ListBucketReplicationFailuresRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListBuckets = "ListBuckets" // ListBucketsRequest generates a "aws/request.Request" representing the @@ -5446,6 +5521,82 @@ func (c *S3) PutBucketReplicationWithContext(ctx aws.Context, input *PutBucketRe return out, req.Send() } +const opPutBucketReplicationReattempt = "PutBucketReplicationReattempt" + +// PutBucketReplicationReattemptRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketReplicationReattempt operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketReplicationReattempt for more information on using the PutBucketReplicationReattempt +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// // Example sending a request using the PutBucketReplicationReattemptRequest method. +// req, resp := client.PutBucketReplicationReattemptRequest(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/PutBucketReplicationReattempt +func (c *S3) PutBucketReplicationReattemptRequest(input *PutBucketReplicationReattemptInput) (req *request.Request, output *PutBucketReplicationReattemptOutput) { + op := &request.Operation{ + Name: opPutBucketReplicationReattempt, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?ibm-replication-reattempt", + } + + if input == nil { + input = &PutBucketReplicationReattemptInput{} + } + + output = &PutBucketReplicationReattemptOutput{} + 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 +} + +// PutBucketReplicationReattempt API operation for Amazon Simple Storage Service. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketReplicationReattempt for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplicationReattempt +func (c *S3) PutBucketReplicationReattempt(input *PutBucketReplicationReattemptInput) (*PutBucketReplicationReattemptOutput, error) { + req, out := c.PutBucketReplicationReattemptRequest(input) + return out, req.Send() +} + +// PutBucketReplicationReattemptWithContext is the same as PutBucketReplicationReattempt with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketReplicationReattempt for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the 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) PutBucketReplicationReattemptWithContext(ctx aws.Context, input *PutBucketReplicationReattemptInput, opts ...request.Option) (*PutBucketReplicationReattemptOutput, error) { + req, out := c.PutBucketReplicationReattemptRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opPutBucketVersioning = "PutBucketVersioning" // PutBucketVersioningRequest generates a "aws/request.Request" representing the @@ -15906,6 +16057,128 @@ func (s *LifecycleRuleFilter) SetTag(v *Tag) *LifecycleRuleFilter { return s } +type ListBucketReplicationFailuresInput struct { + _ struct{} `locationName:"ListBucketReplicationFailuresRequest" type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` + + // Requests Amazon S3 to encode the object keys in the response and specifies + // the encoding method to use. An object key can contain any Unicode character; + // however, the 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"` + + FirstSyncAttemptedBefore *string `location:"querystring" locationName:"first-sync-attempted-before" type:"string"` + + MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListBucketReplicationFailuresInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListBucketReplicationFailuresInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListBucketReplicationFailuresInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListBucketReplicationFailuresInput"} + 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 *ListBucketReplicationFailuresInput) SetBucket(v string) *ListBucketReplicationFailuresInput { + s.Bucket = &v + return s +} + +func (s *ListBucketReplicationFailuresInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListBucketReplicationFailuresInput) SetContinuationToken(v string) *ListBucketReplicationFailuresInput { + s.ContinuationToken = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListBucketReplicationFailuresInput) SetEncodingType(v string) *ListBucketReplicationFailuresInput { + s.EncodingType = &v + return s +} + +// SetFirstSyncAttemptedBefore sets the FirstSyncAttemptedBefore field's value. +func (s *ListBucketReplicationFailuresInput) SetFirstSyncAttemptedBefore(v string) *ListBucketReplicationFailuresInput { + s.FirstSyncAttemptedBefore = &v + return s +} + +// SetMaxKeys sets the MaxKeys field's value. +func (s *ListBucketReplicationFailuresInput) SetMaxKeys(v int64) *ListBucketReplicationFailuresInput { + s.MaxKeys = &v + return s +} + +type ListBucketReplicationFailuresOutput struct { + _ struct{} `type:"structure" payload:"ListReplicationFailureResult"` + + ListReplicationFailureResult *ListReplicationFailureResult `locationName:"ListReplicationFailureResult" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListBucketReplicationFailuresOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListBucketReplicationFailuresOutput) GoString() string { + return s.String() +} + +// SetListReplicationFailureResult sets the ListReplicationFailureResult field's value. +func (s *ListBucketReplicationFailuresOutput) SetListReplicationFailureResult(v *ListReplicationFailureResult) *ListBucketReplicationFailuresOutput { + s.ListReplicationFailureResult = v + return s +} + type ListBucketsExtendedInput struct { _ struct{} `locationName:"ListBucketsExtendedRequest" type:"structure"` @@ -17856,6 +18129,110 @@ func (s *ListPartsOutput) SetUploadId(v string) *ListPartsOutput { return s } +type ListReplicationFailureResult struct { + _ struct{} `type:"structure"` + + // Contents is a required field + Contents []*ObjectSyncAttempted `locationNameList:"Contents" type:"list" flattened:"true" required:"true"` + + ContinuationToken *string `type:"string"` + + // Requests Amazon S3 to encode the object keys in the response and specifies + // the encoding method to use. An object key can contain any Unicode character; + // however, the 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 `type:"string" enum:"EncodingType"` + + FirstSyncAttemptedBefore *string `type:"string"` + + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // KeyCount is a required field + KeyCount *int64 `type:"integer" required:"true"` + + MaxKeys *int64 `type:"integer"` + + // Name is a required field + Name *string `type:"string" required:"true"` + + NextContinuationToken *string `type:"string"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListReplicationFailureResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListReplicationFailureResult) GoString() string { + return s.String() +} + +// SetContents sets the Contents field's value. +func (s *ListReplicationFailureResult) SetContents(v []*ObjectSyncAttempted) *ListReplicationFailureResult { + s.Contents = v + return s +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListReplicationFailureResult) SetContinuationToken(v string) *ListReplicationFailureResult { + s.ContinuationToken = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListReplicationFailureResult) SetEncodingType(v string) *ListReplicationFailureResult { + s.EncodingType = &v + return s +} + +// SetFirstSyncAttemptedBefore sets the FirstSyncAttemptedBefore field's value. +func (s *ListReplicationFailureResult) SetFirstSyncAttemptedBefore(v string) *ListReplicationFailureResult { + s.FirstSyncAttemptedBefore = &v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListReplicationFailureResult) SetIsTruncated(v bool) *ListReplicationFailureResult { + s.IsTruncated = &v + return s +} + +// SetKeyCount sets the KeyCount field's value. +func (s *ListReplicationFailureResult) SetKeyCount(v int64) *ListReplicationFailureResult { + s.KeyCount = &v + return s +} + +// SetMaxKeys sets the MaxKeys field's value. +func (s *ListReplicationFailureResult) SetMaxKeys(v int64) *ListReplicationFailureResult { + s.MaxKeys = &v + return s +} + +// SetName sets the Name field's value. +func (s *ListReplicationFailureResult) SetName(v string) *ListReplicationFailureResult { + s.Name = &v + return s +} + +// SetNextContinuationToken sets the NextContinuationToken field's value. +func (s *ListReplicationFailureResult) SetNextContinuationToken(v string) *ListReplicationFailureResult { + s.NextContinuationToken = &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) @@ -18439,6 +18816,81 @@ func (s *ObjectLockRule) SetDefaultRetention(v *DefaultRetention) *ObjectLockRul return s } +type ObjectSyncAttempted struct { + _ struct{} `type:"structure"` + + // FirstSyncAttempted is a required field + FirstSyncAttempted *time.Time `type:"timestamp" required:"true"` + + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // LastSyncAttempted is a required field + LastSyncAttempted *time.Time `type:"timestamp" required:"true"` + + SyncFailureCause *string `type:"string"` + + // SyncType is a required field + SyncType *string `type:"string" required:"true"` + + // VersionId is a required field + VersionId *string `type:"string" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ObjectSyncAttempted) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ObjectSyncAttempted) GoString() string { + return s.String() +} + +// SetFirstSyncAttempted sets the FirstSyncAttempted field's value. +func (s *ObjectSyncAttempted) SetFirstSyncAttempted(v time.Time) *ObjectSyncAttempted { + s.FirstSyncAttempted = &v + return s +} + +// SetKey sets the Key field's value. +func (s *ObjectSyncAttempted) SetKey(v string) *ObjectSyncAttempted { + s.Key = &v + return s +} + +// SetLastSyncAttempted sets the LastSyncAttempted field's value. +func (s *ObjectSyncAttempted) SetLastSyncAttempted(v time.Time) *ObjectSyncAttempted { + s.LastSyncAttempted = &v + return s +} + +// SetSyncFailureCause sets the SyncFailureCause field's value. +func (s *ObjectSyncAttempted) SetSyncFailureCause(v string) *ObjectSyncAttempted { + s.SyncFailureCause = &v + return s +} + +// SetSyncType sets the SyncType field's value. +func (s *ObjectSyncAttempted) SetSyncType(v string) *ObjectSyncAttempted { + s.SyncType = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *ObjectSyncAttempted) SetVersionId(v string) *ObjectSyncAttempted { + s.VersionId = &v + return s +} + // The version of an object. type ObjectVersion struct { _ struct{} `type:"structure"` @@ -19487,6 +19939,82 @@ func (s PutBucketReplicationOutput) GoString() string { return s.String() } +type PutBucketReplicationReattemptInput struct { + _ struct{} `locationName:"PutBucketReplicationReattemptRequest" type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PutBucketReplicationReattemptInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PutBucketReplicationReattemptInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketReplicationReattemptInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketReplicationReattemptInput"} + 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 *PutBucketReplicationReattemptInput) SetBucket(v string) *PutBucketReplicationReattemptInput { + s.Bucket = &v + return s +} + +func (s *PutBucketReplicationReattemptInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type PutBucketReplicationReattemptOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PutBucketReplicationReattemptOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PutBucketReplicationReattemptOutput) GoString() string { + return s.String() +} + type PutBucketVersioningInput struct { _ struct{} `locationName:"PutBucketVersioningRequest" type:"structure" payload:"VersioningConfiguration"` @@ -20797,7 +21325,11 @@ type PutObjectRetentionInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // Ignored by COS. + // Indicates whether S3 Object Lock should bypass Governance-mode restrictions + // to process this operation. To use this header, you must have the s3:BypassGovernanceRetention + // permission. + // + // This functionality is not supported for directory buckets. BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` // Ignored by COS. diff --git a/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/s3iface/interface.go b/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/s3iface/interface.go index cb1ff0ae8265..714bb1a7a87a 100644 --- a/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/s3iface/interface.go +++ b/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/s3iface/interface.go @@ -204,6 +204,10 @@ type S3API interface { HeadObjectWithContext(aws.Context, *s3.HeadObjectInput, ...request.Option) (*s3.HeadObjectOutput, error) HeadObjectRequest(*s3.HeadObjectInput) (*request.Request, *s3.HeadObjectOutput) + ListBucketReplicationFailures(*s3.ListBucketReplicationFailuresInput) (*s3.ListBucketReplicationFailuresOutput, error) + ListBucketReplicationFailuresWithContext(aws.Context, *s3.ListBucketReplicationFailuresInput, ...request.Option) (*s3.ListBucketReplicationFailuresOutput, error) + ListBucketReplicationFailuresRequest(*s3.ListBucketReplicationFailuresInput) (*request.Request, *s3.ListBucketReplicationFailuresOutput) + ListBuckets(*s3.ListBucketsInput) (*s3.ListBucketsOutput, error) ListBucketsWithContext(aws.Context, *s3.ListBucketsInput, ...request.Option) (*s3.ListBucketsOutput, error) ListBucketsRequest(*s3.ListBucketsInput) (*request.Request, *s3.ListBucketsOutput) @@ -278,6 +282,10 @@ type S3API interface { PutBucketReplicationWithContext(aws.Context, *s3.PutBucketReplicationInput, ...request.Option) (*s3.PutBucketReplicationOutput, error) PutBucketReplicationRequest(*s3.PutBucketReplicationInput) (*request.Request, *s3.PutBucketReplicationOutput) + PutBucketReplicationReattempt(*s3.PutBucketReplicationReattemptInput) (*s3.PutBucketReplicationReattemptOutput, error) + PutBucketReplicationReattemptWithContext(aws.Context, *s3.PutBucketReplicationReattemptInput, ...request.Option) (*s3.PutBucketReplicationReattemptOutput, error) + PutBucketReplicationReattemptRequest(*s3.PutBucketReplicationReattemptInput) (*request.Request, *s3.PutBucketReplicationReattemptOutput) + PutBucketVersioning(*s3.PutBucketVersioningInput) (*s3.PutBucketVersioningOutput, error) PutBucketVersioningWithContext(aws.Context, *s3.PutBucketVersioningInput, ...request.Option) (*s3.PutBucketVersioningOutput, error) PutBucketVersioningRequest(*s3.PutBucketVersioningInput) (*request.Request, *s3.PutBucketVersioningOutput) diff --git a/vendor/github.com/IBM/networking-go-sdk/common/version.go b/vendor/github.com/IBM/networking-go-sdk/common/version.go index e8e8941a73ab..253a7e1f5163 100644 --- a/vendor/github.com/IBM/networking-go-sdk/common/version.go +++ b/vendor/github.com/IBM/networking-go-sdk/common/version.go @@ -17,4 +17,4 @@ package common // Version of the SDK -const Version = "0.51.5" +const Version = "0.53.4" diff --git a/vendor/github.com/IBM/networking-go-sdk/dnsrecordsv1/dns_records_v1.go b/vendor/github.com/IBM/networking-go-sdk/dnsrecordsv1/dns_records_v1.go index f990bc47eba8..4fab2b277ad6 100644 --- a/vendor/github.com/IBM/networking-go-sdk/dnsrecordsv1/dns_records_v1.go +++ b/vendor/github.com/IBM/networking-go-sdk/dnsrecordsv1/dns_records_v1.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2026. * * 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.20.0-debb9f29-20201203-202043 + * IBM OpenAPI SDK Code Generator Version: 3.106.0-09823488-20250707-071701 */ // Package dnsrecordsv1 : Operations and models for the DnsRecordsV1 service @@ -35,7 +35,7 @@ import ( // DnsRecordsV1 : DNS records // -// Version: 1.0.1 +// API Version: 1.0.1 type DnsRecordsV1 struct { Service *core.BaseService @@ -74,22 +74,26 @@ func NewDnsRecordsV1UsingExternalConfig(options *DnsRecordsV1Options) (dnsRecord if options.Authenticator == nil { options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "env-auth-error", common.GetComponentInfo()) return } } dnsRecords, err = NewDnsRecordsV1(options) + err = core.RepurposeSDKProblem(err, "new-client-error") if err != nil { return } err = dnsRecords.Service.ConfigureService(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "client-config-error", common.GetComponentInfo()) return } if options.URL != "" { err = dnsRecords.Service.SetServiceURL(options.URL) + err = core.RepurposeSDKProblem(err, "url-set-error") } return } @@ -103,17 +107,20 @@ func NewDnsRecordsV1(options *DnsRecordsV1Options) (service *DnsRecordsV1, err e err = core.ValidateStruct(options, "options") if err != nil { + err = core.SDKErrorf(err, "", "invalid-global-options", common.GetComponentInfo()) return } baseService, err := core.NewBaseService(serviceOptions) if err != nil { + err = core.SDKErrorf(err, "", "new-base-error", common.GetComponentInfo()) return } if options.URL != "" { err = baseService.SetServiceURL(options.URL) if err != nil { + err = core.SDKErrorf(err, "", "set-url-error", common.GetComponentInfo()) return } } @@ -129,7 +136,7 @@ func NewDnsRecordsV1(options *DnsRecordsV1Options) (service *DnsRecordsV1, err e // 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") + return "", core.SDKErrorf(nil, "service does not support regional URLs", "no-regional-support", common.GetComponentInfo()) } // Clone makes a copy of "dnsRecords" suitable for processing requests. @@ -144,7 +151,11 @@ func (dnsRecords *DnsRecordsV1) Clone() *DnsRecordsV1 { // SetServiceURL sets the service URL func (dnsRecords *DnsRecordsV1) SetServiceURL(url string) error { - return dnsRecords.Service.SetServiceURL(url) + err := dnsRecords.Service.SetServiceURL(url) + if err != nil { + err = core.SDKErrorf(err, "", "url-set-error", common.GetComponentInfo()) + } + return err } // GetServiceURL returns the service URL @@ -181,13 +192,16 @@ func (dnsRecords *DnsRecordsV1) DisableRetries() { // ListAllDnsRecords : List all DNS records // List all DNS records for a given zone of a service instance. func (dnsRecords *DnsRecordsV1) ListAllDnsRecords(listAllDnsRecordsOptions *ListAllDnsRecordsOptions) (result *ListDnsrecordsResp, response *core.DetailedResponse, err error) { - return dnsRecords.ListAllDnsRecordsWithContext(context.Background(), listAllDnsRecordsOptions) + result, response, err = dnsRecords.ListAllDnsRecordsWithContext(context.Background(), listAllDnsRecordsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListAllDnsRecordsWithContext is an alternate form of the ListAllDnsRecords method which supports a Context parameter func (dnsRecords *DnsRecordsV1) ListAllDnsRecordsWithContext(ctx context.Context, listAllDnsRecordsOptions *ListAllDnsRecordsOptions) (result *ListDnsrecordsResp, response *core.DetailedResponse, err error) { err = core.ValidateStruct(listAllDnsRecordsOptions, "listAllDnsRecordsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -201,15 +215,16 @@ func (dnsRecords *DnsRecordsV1) ListAllDnsRecordsWithContext(ctx context.Context builder.EnableGzipCompression = dnsRecords.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(dnsRecords.Service.Options.URL, `/v1/{crn}/zones/{zone_identifier}/dns_records`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listAllDnsRecordsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("dns_records", "V1", "ListAllDnsRecords") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("dns_records", "V1", "ListAllDnsRecords") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listAllDnsRecordsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -241,19 +256,25 @@ func (dnsRecords *DnsRecordsV1) ListAllDnsRecordsWithContext(ctx context.Context request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = dnsRecords.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_all_dns_records", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalListDnsrecordsResp) - if err != nil { - return + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalListDnsrecordsResp) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result } - response.Result = result return } @@ -261,13 +282,16 @@ func (dnsRecords *DnsRecordsV1) ListAllDnsRecordsWithContext(ctx context.Context // CreateDnsRecord : Create DNS record // Add a new DNS record for a given zone for a given service instance. func (dnsRecords *DnsRecordsV1) CreateDnsRecord(createDnsRecordOptions *CreateDnsRecordOptions) (result *DnsrecordResp, response *core.DetailedResponse, err error) { - return dnsRecords.CreateDnsRecordWithContext(context.Background(), createDnsRecordOptions) + result, response, err = dnsRecords.CreateDnsRecordWithContext(context.Background(), createDnsRecordOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateDnsRecordWithContext is an alternate form of the CreateDnsRecord method which supports a Context parameter func (dnsRecords *DnsRecordsV1) CreateDnsRecordWithContext(ctx context.Context, createDnsRecordOptions *CreateDnsRecordOptions) (result *DnsrecordResp, response *core.DetailedResponse, err error) { err = core.ValidateStruct(createDnsRecordOptions, "createDnsRecordOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -281,15 +305,16 @@ func (dnsRecords *DnsRecordsV1) CreateDnsRecordWithContext(ctx context.Context, builder.EnableGzipCompression = dnsRecords.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(dnsRecords.Service.Options.URL, `/v1/{crn}/zones/{zone_identifier}/dns_records`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createDnsRecordOptions.Headers { + sdkHeaders := common.GetSdkHeaders("dns_records", "V1", "CreateDnsRecord") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("dns_records", "V1", "CreateDnsRecord") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createDnsRecordOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -311,29 +336,39 @@ func (dnsRecords *DnsRecordsV1) CreateDnsRecordWithContext(ctx context.Context, if createDnsRecordOptions.Priority != nil { body["priority"] = createDnsRecordOptions.Priority } + if createDnsRecordOptions.Proxied != nil { + body["proxied"] = createDnsRecordOptions.Proxied + } if createDnsRecordOptions.Data != nil { body["data"] = createDnsRecordOptions.Data } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = dnsRecords.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_dns_record", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDnsrecordResp) - if err != nil { - return + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDnsrecordResp) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result } - response.Result = result return } @@ -341,17 +376,21 @@ func (dnsRecords *DnsRecordsV1) CreateDnsRecordWithContext(ctx context.Context, // DeleteDnsRecord : Delete DNS record // Delete a DNS record given its id. func (dnsRecords *DnsRecordsV1) DeleteDnsRecord(deleteDnsRecordOptions *DeleteDnsRecordOptions) (result *DeleteDnsrecordResp, response *core.DetailedResponse, err error) { - return dnsRecords.DeleteDnsRecordWithContext(context.Background(), deleteDnsRecordOptions) + result, response, err = dnsRecords.DeleteDnsRecordWithContext(context.Background(), deleteDnsRecordOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteDnsRecordWithContext is an alternate form of the DeleteDnsRecord method which supports a Context parameter func (dnsRecords *DnsRecordsV1) DeleteDnsRecordWithContext(ctx context.Context, deleteDnsRecordOptions *DeleteDnsRecordOptions) (result *DeleteDnsrecordResp, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteDnsRecordOptions, "deleteDnsRecordOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteDnsRecordOptions, "deleteDnsRecordOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -366,34 +405,41 @@ func (dnsRecords *DnsRecordsV1) DeleteDnsRecordWithContext(ctx context.Context, builder.EnableGzipCompression = dnsRecords.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(dnsRecords.Service.Options.URL, `/v1/{crn}/zones/{zone_identifier}/dns_records/{dnsrecord_identifier}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deleteDnsRecordOptions.Headers { + sdkHeaders := common.GetSdkHeaders("dns_records", "V1", "DeleteDnsRecord") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("dns_records", "V1", "DeleteDnsRecord") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteDnsRecordOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = dnsRecords.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "delete_dns_record", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDeleteDnsrecordResp) - if err != nil { - return + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDeleteDnsrecordResp) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result } - response.Result = result return } @@ -401,17 +447,21 @@ func (dnsRecords *DnsRecordsV1) DeleteDnsRecordWithContext(ctx context.Context, // GetDnsRecord : Get DNS record // Get the details of a DNS record for a given zone under a given service instance. func (dnsRecords *DnsRecordsV1) GetDnsRecord(getDnsRecordOptions *GetDnsRecordOptions) (result *DnsrecordResp, response *core.DetailedResponse, err error) { - return dnsRecords.GetDnsRecordWithContext(context.Background(), getDnsRecordOptions) + result, response, err = dnsRecords.GetDnsRecordWithContext(context.Background(), getDnsRecordOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetDnsRecordWithContext is an alternate form of the GetDnsRecord method which supports a Context parameter func (dnsRecords *DnsRecordsV1) GetDnsRecordWithContext(ctx context.Context, getDnsRecordOptions *GetDnsRecordOptions) (result *DnsrecordResp, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getDnsRecordOptions, "getDnsRecordOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getDnsRecordOptions, "getDnsRecordOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -426,34 +476,41 @@ func (dnsRecords *DnsRecordsV1) GetDnsRecordWithContext(ctx context.Context, get builder.EnableGzipCompression = dnsRecords.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(dnsRecords.Service.Options.URL, `/v1/{crn}/zones/{zone_identifier}/dns_records/{dnsrecord_identifier}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getDnsRecordOptions.Headers { + sdkHeaders := common.GetSdkHeaders("dns_records", "V1", "GetDnsRecord") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("dns_records", "V1", "GetDnsRecord") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getDnsRecordOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = dnsRecords.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_dns_record", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDnsrecordResp) - if err != nil { - return + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDnsrecordResp) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result } - response.Result = result return } @@ -461,17 +518,21 @@ func (dnsRecords *DnsRecordsV1) GetDnsRecordWithContext(ctx context.Context, get // UpdateDnsRecord : Update DNS record // Update an existing DNS record for a given zone under a given service instance. func (dnsRecords *DnsRecordsV1) UpdateDnsRecord(updateDnsRecordOptions *UpdateDnsRecordOptions) (result *DnsrecordResp, response *core.DetailedResponse, err error) { - return dnsRecords.UpdateDnsRecordWithContext(context.Background(), updateDnsRecordOptions) + result, response, err = dnsRecords.UpdateDnsRecordWithContext(context.Background(), updateDnsRecordOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdateDnsRecordWithContext is an alternate form of the UpdateDnsRecord method which supports a Context parameter func (dnsRecords *DnsRecordsV1) UpdateDnsRecordWithContext(ctx context.Context, updateDnsRecordOptions *UpdateDnsRecordOptions) (result *DnsrecordResp, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updateDnsRecordOptions, "updateDnsRecordOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updateDnsRecordOptions, "updateDnsRecordOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -486,15 +547,16 @@ func (dnsRecords *DnsRecordsV1) UpdateDnsRecordWithContext(ctx context.Context, builder.EnableGzipCompression = dnsRecords.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(dnsRecords.Service.Options.URL, `/v1/{crn}/zones/{zone_identifier}/dns_records/{dnsrecord_identifier}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range updateDnsRecordOptions.Headers { + sdkHeaders := common.GetSdkHeaders("dns_records", "V1", "UpdateDnsRecord") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("dns_records", "V1", "UpdateDnsRecord") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range updateDnsRecordOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -513,36 +575,457 @@ func (dnsRecords *DnsRecordsV1) UpdateDnsRecordWithContext(ctx context.Context, if updateDnsRecordOptions.Content != nil { body["content"] = updateDnsRecordOptions.Content } - if updateDnsRecordOptions.Priority != nil { - body["priority"] = updateDnsRecordOptions.Priority + if updateDnsRecordOptions.Priority != nil { + body["priority"] = updateDnsRecordOptions.Priority + } + if updateDnsRecordOptions.Proxied != nil { + body["proxied"] = updateDnsRecordOptions.Proxied + } + if updateDnsRecordOptions.Data != nil { + body["data"] = updateDnsRecordOptions.Data + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = dnsRecords.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "update_dns_record", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDnsrecordResp) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// BatchDnsRecords : Batch DNS records +// Send a Batch of DNS Record API calls to be executed together. The operations you specify within the /batch request +// body are always executed in the following order: deletes, patches, puts, posts. +func (dnsRecords *DnsRecordsV1) BatchDnsRecords(batchDnsRecordsOptions *BatchDnsRecordsOptions) (result *BatchDnsRecordsResponse, response *core.DetailedResponse, err error) { + result, response, err = dnsRecords.BatchDnsRecordsWithContext(context.Background(), batchDnsRecordsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// BatchDnsRecordsWithContext is an alternate form of the BatchDnsRecords method which supports a Context parameter +func (dnsRecords *DnsRecordsV1) BatchDnsRecordsWithContext(ctx context.Context, batchDnsRecordsOptions *BatchDnsRecordsOptions) (result *BatchDnsRecordsResponse, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(batchDnsRecordsOptions, "batchDnsRecordsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "crn": *dnsRecords.Crn, + "zone_identifier": *dnsRecords.ZoneIdentifier, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = dnsRecords.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(dnsRecords.Service.Options.URL, `/v1/{crn}/zones/{zone_identifier}/dns_records/batch`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("dns_records", "V1", "BatchDnsRecords") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range batchDnsRecordsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + body := make(map[string]interface{}) + if batchDnsRecordsOptions.Deletes != nil { + body["deletes"] = batchDnsRecordsOptions.Deletes + } + if batchDnsRecordsOptions.Patches != nil { + body["patches"] = batchDnsRecordsOptions.Patches + } + if batchDnsRecordsOptions.Posts != nil { + body["posts"] = batchDnsRecordsOptions.Posts + } + if batchDnsRecordsOptions.Puts != nil { + body["puts"] = batchDnsRecordsOptions.Puts + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = dnsRecords.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "batch_dns_records", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalBatchDnsRecordsResponse) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} +func getServiceComponentInfo() *core.ProblemComponent { + return core.NewProblemComponent(DefaultServiceName, "1.0.1") +} + +// BatchDnsRecordsOptions : The BatchDnsRecords options. +type BatchDnsRecordsOptions struct { + Deletes []BatchDnsRecordsRequestDeletesItem `json:"deletes,omitempty"` + + Patches []BatchDnsRecordsRequestPatchesItem `json:"patches,omitempty"` + + Posts []DnsrecordInput `json:"posts,omitempty"` + + Puts []BatchDnsRecordsRequestPutsItem `json:"puts,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewBatchDnsRecordsOptions : Instantiate BatchDnsRecordsOptions +func (*DnsRecordsV1) NewBatchDnsRecordsOptions() *BatchDnsRecordsOptions { + return &BatchDnsRecordsOptions{} +} + +// SetDeletes : Allow user to set Deletes +func (_options *BatchDnsRecordsOptions) SetDeletes(deletes []BatchDnsRecordsRequestDeletesItem) *BatchDnsRecordsOptions { + _options.Deletes = deletes + return _options +} + +// SetPatches : Allow user to set Patches +func (_options *BatchDnsRecordsOptions) SetPatches(patches []BatchDnsRecordsRequestPatchesItem) *BatchDnsRecordsOptions { + _options.Patches = patches + return _options +} + +// SetPosts : Allow user to set Posts +func (_options *BatchDnsRecordsOptions) SetPosts(posts []DnsrecordInput) *BatchDnsRecordsOptions { + _options.Posts = posts + return _options +} + +// SetPuts : Allow user to set Puts +func (_options *BatchDnsRecordsOptions) SetPuts(puts []BatchDnsRecordsRequestPutsItem) *BatchDnsRecordsOptions { + _options.Puts = puts + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *BatchDnsRecordsOptions) SetHeaders(param map[string]string) *BatchDnsRecordsOptions { + options.Headers = param + return options +} + +// BatchDnsRecordsRequestDeletesItem : BatchDnsRecordsRequestDeletesItem struct +type BatchDnsRecordsRequestDeletesItem struct { + // DNS record ID to delete. + ID *string `json:"id" validate:"required"` +} + +// NewBatchDnsRecordsRequestDeletesItem : Instantiate BatchDnsRecordsRequestDeletesItem (Generic Model Constructor) +func (*DnsRecordsV1) NewBatchDnsRecordsRequestDeletesItem(id string) (_model *BatchDnsRecordsRequestDeletesItem, err error) { + _model = &BatchDnsRecordsRequestDeletesItem{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalBatchDnsRecordsRequestDeletesItem unmarshals an instance of BatchDnsRecordsRequestDeletesItem from the specified map of raw messages. +func UnmarshalBatchDnsRecordsRequestDeletesItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BatchDnsRecordsRequestDeletesItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BatchDnsRecordsRequestPatchesItem : BatchDnsRecordsRequestPatchesItem struct +type BatchDnsRecordsRequestPatchesItem struct { + // DNS record ID to patch. + ID *string `json:"id" validate:"required"` + + // Required for all record types except SRV. + Name *string `json:"name,omitempty"` + + // dns record type. + Type *string `json:"type,omitempty"` + + // dns record ttl value. + TTL *int64 `json:"ttl,omitempty"` + + // content of dns record. + Content *string `json:"content,omitempty"` + + // For MX records only. + Priority *int64 `json:"priority,omitempty"` + + // proxied. + Proxied *bool `json:"proxied,omitempty"` + + // For LOC, SRV, CAA, DS records only. + Data map[string]interface{} `json:"data,omitempty"` +} + +// Constants associated with the BatchDnsRecordsRequestPatchesItem.Type property. +// dns record type. +const ( + BatchDnsRecordsRequestPatchesItem_Type_A = "A" + BatchDnsRecordsRequestPatchesItem_Type_Aaaa = "AAAA" + BatchDnsRecordsRequestPatchesItem_Type_Caa = "CAA" + BatchDnsRecordsRequestPatchesItem_Type_Cname = "CNAME" + BatchDnsRecordsRequestPatchesItem_Type_Ds = "DS" + BatchDnsRecordsRequestPatchesItem_Type_Loc = "LOC" + BatchDnsRecordsRequestPatchesItem_Type_Mx = "MX" + BatchDnsRecordsRequestPatchesItem_Type_Ns = "NS" + BatchDnsRecordsRequestPatchesItem_Type_Ptr = "PTR" + BatchDnsRecordsRequestPatchesItem_Type_Srv = "SRV" + BatchDnsRecordsRequestPatchesItem_Type_Txt = "TXT" +) + +// NewBatchDnsRecordsRequestPatchesItem : Instantiate BatchDnsRecordsRequestPatchesItem (Generic Model Constructor) +func (*DnsRecordsV1) NewBatchDnsRecordsRequestPatchesItem(id string) (_model *BatchDnsRecordsRequestPatchesItem, err error) { + _model = &BatchDnsRecordsRequestPatchesItem{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalBatchDnsRecordsRequestPatchesItem unmarshals an instance of BatchDnsRecordsRequestPatchesItem from the specified map of raw messages. +func UnmarshalBatchDnsRecordsRequestPatchesItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BatchDnsRecordsRequestPatchesItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ttl", &obj.TTL) + if err != nil { + err = core.SDKErrorf(err, "", "ttl-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "content", &obj.Content) + if err != nil { + err = core.SDKErrorf(err, "", "content-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + err = core.SDKErrorf(err, "", "priority-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "proxied", &obj.Proxied) + if err != nil { + err = core.SDKErrorf(err, "", "proxied-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "data", &obj.Data) + if err != nil { + err = core.SDKErrorf(err, "", "data-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BatchDnsRecordsRequestPutsItem : BatchDnsRecordsRequestPutsItem struct +type BatchDnsRecordsRequestPutsItem struct { + // DNS record ID to update. + ID *string `json:"id" validate:"required"` + + // Required for all record types except SRV. + Name *string `json:"name" validate:"required"` + + // dns record type. + Type *string `json:"type" validate:"required"` + + // dns record ttl value. + TTL *int64 `json:"ttl" validate:"required"` + + // dns record content. + Content *string `json:"content" validate:"required"` + + // For MX records only. + Priority *int64 `json:"priority,omitempty"` + + // proxied. + Proxied *bool `json:"proxied,omitempty"` + + // For LOC, SRV, CAA, DS records only. + Data map[string]interface{} `json:"data,omitempty"` +} + +// Constants associated with the BatchDnsRecordsRequestPutsItem.Type property. +// dns record type. +const ( + BatchDnsRecordsRequestPutsItem_Type_A = "A" + BatchDnsRecordsRequestPutsItem_Type_Aaaa = "AAAA" + BatchDnsRecordsRequestPutsItem_Type_Caa = "CAA" + BatchDnsRecordsRequestPutsItem_Type_Cname = "CNAME" + BatchDnsRecordsRequestPutsItem_Type_Ds = "DS" + BatchDnsRecordsRequestPutsItem_Type_Loc = "LOC" + BatchDnsRecordsRequestPutsItem_Type_Mx = "MX" + BatchDnsRecordsRequestPutsItem_Type_Ns = "NS" + BatchDnsRecordsRequestPutsItem_Type_Ptr = "PTR" + BatchDnsRecordsRequestPutsItem_Type_Srv = "SRV" + BatchDnsRecordsRequestPutsItem_Type_Txt = "TXT" +) + +// NewBatchDnsRecordsRequestPutsItem : Instantiate BatchDnsRecordsRequestPutsItem (Generic Model Constructor) +func (*DnsRecordsV1) NewBatchDnsRecordsRequestPutsItem(id string, name string, typeVar string, ttl int64, content string) (_model *BatchDnsRecordsRequestPutsItem, err error) { + _model = &BatchDnsRecordsRequestPutsItem{ + ID: core.StringPtr(id), + Name: core.StringPtr(name), + Type: core.StringPtr(typeVar), + TTL: core.Int64Ptr(ttl), + Content: core.StringPtr(content), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalBatchDnsRecordsRequestPutsItem unmarshals an instance of BatchDnsRecordsRequestPutsItem from the specified map of raw messages. +func UnmarshalBatchDnsRecordsRequestPutsItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BatchDnsRecordsRequestPutsItem) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ttl", &obj.TTL) + if err != nil { + err = core.SDKErrorf(err, "", "ttl-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "content", &obj.Content) + if err != nil { + err = core.SDKErrorf(err, "", "content-error", common.GetComponentInfo()) + return } - if updateDnsRecordOptions.Proxied != nil { - body["proxied"] = updateDnsRecordOptions.Proxied + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + err = core.SDKErrorf(err, "", "priority-error", common.GetComponentInfo()) + return } - if updateDnsRecordOptions.Data != nil { - body["data"] = updateDnsRecordOptions.Data + err = core.UnmarshalPrimitive(m, "proxied", &obj.Proxied) + if err != nil { + err = core.SDKErrorf(err, "", "proxied-error", common.GetComponentInfo()) + return } - _, err = builder.SetBodyContentJSON(body) + err = core.UnmarshalPrimitive(m, "data", &obj.Data) if err != nil { + err = core.SDKErrorf(err, "", "data-error", common.GetComponentInfo()) return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - request, err := builder.Build() +// BatchDnsRecordsResponseResult : BatchDnsRecordsResponseResult struct +type BatchDnsRecordsResponseResult struct { + Deletes []BatchDnsRecordDetails `json:"deletes,omitempty"` + + Patches []BatchDnsRecordDetails `json:"patches,omitempty"` + + Posts []BatchDnsRecordDetails `json:"posts,omitempty"` + + Puts []BatchDnsRecordDetails `json:"puts,omitempty"` +} + +// UnmarshalBatchDnsRecordsResponseResult unmarshals an instance of BatchDnsRecordsResponseResult from the specified map of raw messages. +func UnmarshalBatchDnsRecordsResponseResult(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BatchDnsRecordsResponseResult) + err = core.UnmarshalModel(m, "deletes", &obj.Deletes, UnmarshalBatchDnsRecordDetails) if err != nil { + err = core.SDKErrorf(err, "", "deletes-error", common.GetComponentInfo()) return } - - var rawResponse map[string]json.RawMessage - response, err = dnsRecords.Service.Request(request, &rawResponse) + err = core.UnmarshalModel(m, "patches", &obj.Patches, UnmarshalBatchDnsRecordDetails) if err != nil { + err = core.SDKErrorf(err, "", "patches-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDnsrecordResp) + err = core.UnmarshalModel(m, "posts", &obj.Posts, UnmarshalBatchDnsRecordDetails) if err != nil { + err = core.SDKErrorf(err, "", "posts-error", common.GetComponentInfo()) return } - response.Result = result - + err = core.UnmarshalModel(m, "puts", &obj.Puts, UnmarshalBatchDnsRecordDetails) + if err != nil { + err = core.SDKErrorf(err, "", "puts-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -563,10 +1046,13 @@ type CreateDnsRecordOptions struct { // For MX records only. Priority *int64 `json:"priority,omitempty"` - // For LOC, SRV and CAA records only. - Data interface{} `json:"data,omitempty"` + // proxied. + Proxied *bool `json:"proxied,omitempty"` + + // For LOC, SRV, CAA, DS records only. + Data map[string]interface{} `json:"data,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -577,10 +1063,11 @@ const ( CreateDnsRecordOptions_Type_Aaaa = "AAAA" CreateDnsRecordOptions_Type_Caa = "CAA" CreateDnsRecordOptions_Type_Cname = "CNAME" + CreateDnsRecordOptions_Type_Ds = "DS" CreateDnsRecordOptions_Type_Loc = "LOC" CreateDnsRecordOptions_Type_Mx = "MX" CreateDnsRecordOptions_Type_Ns = "NS" - CreateDnsRecordOptions_Type_Spf = "SPF" + CreateDnsRecordOptions_Type_Ptr = "PTR" CreateDnsRecordOptions_Type_Srv = "SRV" CreateDnsRecordOptions_Type_Txt = "TXT" ) @@ -591,39 +1078,45 @@ func (*DnsRecordsV1) NewCreateDnsRecordOptions() *CreateDnsRecordOptions { } // SetName : Allow user to set Name -func (options *CreateDnsRecordOptions) SetName(name string) *CreateDnsRecordOptions { - options.Name = core.StringPtr(name) - return options +func (_options *CreateDnsRecordOptions) SetName(name string) *CreateDnsRecordOptions { + _options.Name = core.StringPtr(name) + return _options } // SetType : Allow user to set Type -func (options *CreateDnsRecordOptions) SetType(typeVar string) *CreateDnsRecordOptions { - options.Type = core.StringPtr(typeVar) - return options +func (_options *CreateDnsRecordOptions) SetType(typeVar string) *CreateDnsRecordOptions { + _options.Type = core.StringPtr(typeVar) + return _options } // SetTTL : Allow user to set TTL -func (options *CreateDnsRecordOptions) SetTTL(ttl int64) *CreateDnsRecordOptions { - options.TTL = core.Int64Ptr(ttl) - return options +func (_options *CreateDnsRecordOptions) SetTTL(ttl int64) *CreateDnsRecordOptions { + _options.TTL = core.Int64Ptr(ttl) + return _options } // SetContent : Allow user to set Content -func (options *CreateDnsRecordOptions) SetContent(content string) *CreateDnsRecordOptions { - options.Content = core.StringPtr(content) - return options +func (_options *CreateDnsRecordOptions) SetContent(content string) *CreateDnsRecordOptions { + _options.Content = core.StringPtr(content) + return _options } // SetPriority : Allow user to set Priority -func (options *CreateDnsRecordOptions) SetPriority(priority int64) *CreateDnsRecordOptions { - options.Priority = core.Int64Ptr(priority) - return options +func (_options *CreateDnsRecordOptions) SetPriority(priority int64) *CreateDnsRecordOptions { + _options.Priority = core.Int64Ptr(priority) + return _options +} + +// SetProxied : Allow user to set Proxied +func (_options *CreateDnsRecordOptions) SetProxied(proxied bool) *CreateDnsRecordOptions { + _options.Proxied = core.BoolPtr(proxied) + return _options } // SetData : Allow user to set Data -func (options *CreateDnsRecordOptions) SetData(data interface{}) *CreateDnsRecordOptions { - options.Data = data - return options +func (_options *CreateDnsRecordOptions) SetData(data map[string]interface{}) *CreateDnsRecordOptions { + _options.Data = data + return _options } // SetHeaders : Allow user to set Headers @@ -637,7 +1130,7 @@ type DeleteDnsRecordOptions struct { // Identifier of DNS record. DnsrecordIdentifier *string `json:"dnsrecord_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -649,9 +1142,9 @@ func (*DnsRecordsV1) NewDeleteDnsRecordOptions(dnsrecordIdentifier string) *Dele } // SetDnsrecordIdentifier : Allow user to set DnsrecordIdentifier -func (options *DeleteDnsRecordOptions) SetDnsrecordIdentifier(dnsrecordIdentifier string) *DeleteDnsRecordOptions { - options.DnsrecordIdentifier = core.StringPtr(dnsrecordIdentifier) - return options +func (_options *DeleteDnsRecordOptions) SetDnsrecordIdentifier(dnsrecordIdentifier string) *DeleteDnsRecordOptions { + _options.DnsrecordIdentifier = core.StringPtr(dnsrecordIdentifier) + return _options } // SetHeaders : Allow user to set Headers @@ -671,6 +1164,7 @@ func UnmarshalDeleteDnsrecordRespResult(m map[string]json.RawMessage, result int obj := new(DeleteDnsrecordRespResult) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -682,7 +1176,7 @@ type GetDnsRecordOptions struct { // Identifier of DNS record. DnsrecordIdentifier *string `json:"dnsrecord_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -694,9 +1188,9 @@ func (*DnsRecordsV1) NewGetDnsRecordOptions(dnsrecordIdentifier string) *GetDnsR } // SetDnsrecordIdentifier : Allow user to set DnsrecordIdentifier -func (options *GetDnsRecordOptions) SetDnsrecordIdentifier(dnsrecordIdentifier string) *GetDnsRecordOptions { - options.DnsrecordIdentifier = core.StringPtr(dnsrecordIdentifier) - return options +func (_options *GetDnsRecordOptions) SetDnsrecordIdentifier(dnsrecordIdentifier string) *GetDnsRecordOptions { + _options.DnsrecordIdentifier = core.StringPtr(dnsrecordIdentifier) + return _options } // SetHeaders : Allow user to set Headers @@ -731,7 +1225,7 @@ type ListAllDnsRecordsOptions struct { // Whether to match all (all) or atleast one search parameter (any). Match *string `json:"match,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -765,51 +1259,51 @@ func (*DnsRecordsV1) NewListAllDnsRecordsOptions() *ListAllDnsRecordsOptions { } // SetType : Allow user to set Type -func (options *ListAllDnsRecordsOptions) SetType(typeVar string) *ListAllDnsRecordsOptions { - options.Type = core.StringPtr(typeVar) - return options +func (_options *ListAllDnsRecordsOptions) SetType(typeVar string) *ListAllDnsRecordsOptions { + _options.Type = core.StringPtr(typeVar) + return _options } // SetName : Allow user to set Name -func (options *ListAllDnsRecordsOptions) SetName(name string) *ListAllDnsRecordsOptions { - options.Name = core.StringPtr(name) - return options +func (_options *ListAllDnsRecordsOptions) SetName(name string) *ListAllDnsRecordsOptions { + _options.Name = core.StringPtr(name) + return _options } // SetContent : Allow user to set Content -func (options *ListAllDnsRecordsOptions) SetContent(content string) *ListAllDnsRecordsOptions { - options.Content = core.StringPtr(content) - return options +func (_options *ListAllDnsRecordsOptions) SetContent(content string) *ListAllDnsRecordsOptions { + _options.Content = core.StringPtr(content) + return _options } // SetPage : Allow user to set Page -func (options *ListAllDnsRecordsOptions) SetPage(page int64) *ListAllDnsRecordsOptions { - options.Page = core.Int64Ptr(page) - return options +func (_options *ListAllDnsRecordsOptions) SetPage(page int64) *ListAllDnsRecordsOptions { + _options.Page = core.Int64Ptr(page) + return _options } // SetPerPage : Allow user to set PerPage -func (options *ListAllDnsRecordsOptions) SetPerPage(perPage int64) *ListAllDnsRecordsOptions { - options.PerPage = core.Int64Ptr(perPage) - return options +func (_options *ListAllDnsRecordsOptions) SetPerPage(perPage int64) *ListAllDnsRecordsOptions { + _options.PerPage = core.Int64Ptr(perPage) + return _options } // SetOrder : Allow user to set Order -func (options *ListAllDnsRecordsOptions) SetOrder(order string) *ListAllDnsRecordsOptions { - options.Order = core.StringPtr(order) - return options +func (_options *ListAllDnsRecordsOptions) SetOrder(order string) *ListAllDnsRecordsOptions { + _options.Order = core.StringPtr(order) + return _options } // SetDirection : Allow user to set Direction -func (options *ListAllDnsRecordsOptions) SetDirection(direction string) *ListAllDnsRecordsOptions { - options.Direction = core.StringPtr(direction) - return options +func (_options *ListAllDnsRecordsOptions) SetDirection(direction string) *ListAllDnsRecordsOptions { + _options.Direction = core.StringPtr(direction) + return _options } // SetMatch : Allow user to set Match -func (options *ListAllDnsRecordsOptions) SetMatch(match string) *ListAllDnsRecordsOptions { - options.Match = core.StringPtr(match) - return options +func (_options *ListAllDnsRecordsOptions) SetMatch(match string) *ListAllDnsRecordsOptions { + _options.Match = core.StringPtr(match) + return _options } // SetHeaders : Allow user to set Headers @@ -841,10 +1335,10 @@ type UpdateDnsRecordOptions struct { // proxied. Proxied *bool `json:"proxied,omitempty"` - // For LOC, SRV and CAA records only. - Data interface{} `json:"data,omitempty"` + // For LOC, SRV, CAA, DS records only. + Data map[string]interface{} `json:"data,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -855,10 +1349,11 @@ const ( UpdateDnsRecordOptions_Type_Aaaa = "AAAA" UpdateDnsRecordOptions_Type_Caa = "CAA" UpdateDnsRecordOptions_Type_Cname = "CNAME" + UpdateDnsRecordOptions_Type_Ds = "DS" UpdateDnsRecordOptions_Type_Loc = "LOC" UpdateDnsRecordOptions_Type_Mx = "MX" UpdateDnsRecordOptions_Type_Ns = "NS" - UpdateDnsRecordOptions_Type_Spf = "SPF" + UpdateDnsRecordOptions_Type_Ptr = "PTR" UpdateDnsRecordOptions_Type_Srv = "SRV" UpdateDnsRecordOptions_Type_Txt = "TXT" ) @@ -871,51 +1366,51 @@ func (*DnsRecordsV1) NewUpdateDnsRecordOptions(dnsrecordIdentifier string) *Upda } // SetDnsrecordIdentifier : Allow user to set DnsrecordIdentifier -func (options *UpdateDnsRecordOptions) SetDnsrecordIdentifier(dnsrecordIdentifier string) *UpdateDnsRecordOptions { - options.DnsrecordIdentifier = core.StringPtr(dnsrecordIdentifier) - return options +func (_options *UpdateDnsRecordOptions) SetDnsrecordIdentifier(dnsrecordIdentifier string) *UpdateDnsRecordOptions { + _options.DnsrecordIdentifier = core.StringPtr(dnsrecordIdentifier) + return _options } // SetName : Allow user to set Name -func (options *UpdateDnsRecordOptions) SetName(name string) *UpdateDnsRecordOptions { - options.Name = core.StringPtr(name) - return options +func (_options *UpdateDnsRecordOptions) SetName(name string) *UpdateDnsRecordOptions { + _options.Name = core.StringPtr(name) + return _options } // SetType : Allow user to set Type -func (options *UpdateDnsRecordOptions) SetType(typeVar string) *UpdateDnsRecordOptions { - options.Type = core.StringPtr(typeVar) - return options +func (_options *UpdateDnsRecordOptions) SetType(typeVar string) *UpdateDnsRecordOptions { + _options.Type = core.StringPtr(typeVar) + return _options } // SetTTL : Allow user to set TTL -func (options *UpdateDnsRecordOptions) SetTTL(ttl int64) *UpdateDnsRecordOptions { - options.TTL = core.Int64Ptr(ttl) - return options +func (_options *UpdateDnsRecordOptions) SetTTL(ttl int64) *UpdateDnsRecordOptions { + _options.TTL = core.Int64Ptr(ttl) + return _options } // SetContent : Allow user to set Content -func (options *UpdateDnsRecordOptions) SetContent(content string) *UpdateDnsRecordOptions { - options.Content = core.StringPtr(content) - return options +func (_options *UpdateDnsRecordOptions) SetContent(content string) *UpdateDnsRecordOptions { + _options.Content = core.StringPtr(content) + return _options } // SetPriority : Allow user to set Priority -func (options *UpdateDnsRecordOptions) SetPriority(priority int64) *UpdateDnsRecordOptions { - options.Priority = core.Int64Ptr(priority) - return options +func (_options *UpdateDnsRecordOptions) SetPriority(priority int64) *UpdateDnsRecordOptions { + _options.Priority = core.Int64Ptr(priority) + return _options } // SetProxied : Allow user to set Proxied -func (options *UpdateDnsRecordOptions) SetProxied(proxied bool) *UpdateDnsRecordOptions { - options.Proxied = core.BoolPtr(proxied) - return options +func (_options *UpdateDnsRecordOptions) SetProxied(proxied bool) *UpdateDnsRecordOptions { + _options.Proxied = core.BoolPtr(proxied) + return _options } // SetData : Allow user to set Data -func (options *UpdateDnsRecordOptions) SetData(data interface{}) *UpdateDnsRecordOptions { - options.Data = data - return options +func (_options *UpdateDnsRecordOptions) SetData(data map[string]interface{}) *UpdateDnsRecordOptions { + _options.Data = data + return _options } // SetHeaders : Allow user to set Headers @@ -924,6 +1419,193 @@ func (options *UpdateDnsRecordOptions) SetHeaders(param map[string]string) *Upda return options } +// BatchDnsRecordDetails : dns record details as returned by the batch API. +type BatchDnsRecordDetails struct { + // dns record identifier. + ID *string `json:"id,omitempty"` + + // created on. + CreatedOn *string `json:"created_on,omitempty"` + + // modified date. + ModifiedOn *string `json:"modified_on,omitempty"` + + // dns record name. + Name *string `json:"name,omitempty"` + + // dns record type. + Type *string `json:"type,omitempty"` + + // dns record content. + Content *string `json:"content,omitempty"` + + // proxiable. + Proxiable *bool `json:"proxiable,omitempty"` + + // proxied. + Proxied *bool `json:"proxied,omitempty"` + + // dns record ttl value. + TTL *int64 `json:"ttl,omitempty"` + + // Relevant only to MX type records. + Priority *int64 `json:"priority,omitempty"` + + // Data details for the DNS record. Only for LOC, SRV, CAA records. + Data map[string]interface{} `json:"data,omitempty"` + + // DNS record settings. + Settings map[string]interface{} `json:"settings,omitempty"` + + // DNS record metadata. + Meta map[string]interface{} `json:"meta,omitempty"` + + // Optional comment for the DNS record. + Comment *string `json:"comment,omitempty"` + + // Tags associated with the DNS record. + Tags []string `json:"tags,omitempty"` +} + +// Constants associated with the BatchDnsRecordDetails.Type property. +// dns record type. +const ( + BatchDnsRecordDetails_Type_A = "A" + BatchDnsRecordDetails_Type_Aaaa = "AAAA" + BatchDnsRecordDetails_Type_Caa = "CAA" + BatchDnsRecordDetails_Type_Cname = "CNAME" + BatchDnsRecordDetails_Type_Ds = "DS" + BatchDnsRecordDetails_Type_Loc = "LOC" + BatchDnsRecordDetails_Type_Mx = "MX" + BatchDnsRecordDetails_Type_Ns = "NS" + BatchDnsRecordDetails_Type_Ptr = "PTR" + BatchDnsRecordDetails_Type_Srv = "SRV" + BatchDnsRecordDetails_Type_Txt = "TXT" +) + +// UnmarshalBatchDnsRecordDetails unmarshals an instance of BatchDnsRecordDetails from the specified map of raw messages. +func UnmarshalBatchDnsRecordDetails(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BatchDnsRecordDetails) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_on", &obj.CreatedOn) + if err != nil { + err = core.SDKErrorf(err, "", "created_on-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "modified_on", &obj.ModifiedOn) + if err != nil { + err = core.SDKErrorf(err, "", "modified_on-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "content", &obj.Content) + if err != nil { + err = core.SDKErrorf(err, "", "content-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "proxiable", &obj.Proxiable) + if err != nil { + err = core.SDKErrorf(err, "", "proxiable-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "proxied", &obj.Proxied) + if err != nil { + err = core.SDKErrorf(err, "", "proxied-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ttl", &obj.TTL) + if err != nil { + err = core.SDKErrorf(err, "", "ttl-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + err = core.SDKErrorf(err, "", "priority-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "data", &obj.Data) + if err != nil { + err = core.SDKErrorf(err, "", "data-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "settings", &obj.Settings) + if err != nil { + err = core.SDKErrorf(err, "", "settings-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "meta", &obj.Meta) + if err != nil { + err = core.SDKErrorf(err, "", "meta-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "comment", &obj.Comment) + if err != nil { + err = core.SDKErrorf(err, "", "comment-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "tags", &obj.Tags) + if err != nil { + err = core.SDKErrorf(err, "", "tags-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BatchDnsRecordsResponse : Batch DNS records response. +type BatchDnsRecordsResponse struct { + // success response. + Success *bool `json:"success" validate:"required"` + + // errors. + Errors [][]string `json:"errors" validate:"required"` + + // messages. + Messages [][]string `json:"messages" validate:"required"` + + Result *BatchDnsRecordsResponseResult `json:"result" validate:"required"` +} + +// UnmarshalBatchDnsRecordsResponse unmarshals an instance of BatchDnsRecordsResponse from the specified map of raw messages. +func UnmarshalBatchDnsRecordsResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BatchDnsRecordsResponse) + err = core.UnmarshalPrimitive(m, "success", &obj.Success) + if err != nil { + err = core.SDKErrorf(err, "", "success-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "errors", &obj.Errors) + if err != nil { + err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "messages", &obj.Messages) + if err != nil { + err = core.SDKErrorf(err, "", "messages-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "result", &obj.Result, UnmarshalBatchDnsRecordsResponseResult) + if err != nil { + err = core.SDKErrorf(err, "", "result-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // DeleteDnsrecordResp : dns record delete response. type DeleteDnsrecordResp struct { // success response. @@ -944,18 +1626,22 @@ func UnmarshalDeleteDnsrecordResp(m map[string]json.RawMessage, result interface obj := new(DeleteDnsrecordResp) err = core.UnmarshalPrimitive(m, "success", &obj.Success) if err != nil { + err = core.SDKErrorf(err, "", "success-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "errors", &obj.Errors) if err != nil { + err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "messages", &obj.Messages) if err != nil { + err = core.SDKErrorf(err, "", "messages-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "result", &obj.Result, UnmarshalDeleteDnsrecordRespResult) if err != nil { + err = core.SDKErrorf(err, "", "result-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -1001,7 +1687,7 @@ type DnsrecordDetails struct { Priority *int64 `json:"priority,omitempty"` // Data details for the DNS record. Only for LOC, SRV, CAA records. - Data interface{} `json:"data,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` } // Constants associated with the DnsrecordDetails.Type property. @@ -1011,10 +1697,11 @@ const ( DnsrecordDetails_Type_Aaaa = "AAAA" DnsrecordDetails_Type_Caa = "CAA" DnsrecordDetails_Type_Cname = "CNAME" + DnsrecordDetails_Type_Ds = "DS" DnsrecordDetails_Type_Loc = "LOC" DnsrecordDetails_Type_Mx = "MX" DnsrecordDetails_Type_Ns = "NS" - DnsrecordDetails_Type_Spf = "SPF" + DnsrecordDetails_Type_Ptr = "PTR" DnsrecordDetails_Type_Srv = "SRV" DnsrecordDetails_Type_Txt = "TXT" ) @@ -1024,54 +1711,161 @@ func UnmarshalDnsrecordDetails(m map[string]json.RawMessage, result interface{}) obj := new(DnsrecordDetails) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_on", &obj.CreatedOn) if err != nil { + err = core.SDKErrorf(err, "", "created_on-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "modified_on", &obj.ModifiedOn) if err != nil { + err = core.SDKErrorf(err, "", "modified_on-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "content", &obj.Content) if err != nil { + err = core.SDKErrorf(err, "", "content-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "zone_id", &obj.ZoneID) if err != nil { + err = core.SDKErrorf(err, "", "zone_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "zone_name", &obj.ZoneName) if err != nil { + err = core.SDKErrorf(err, "", "zone_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "proxiable", &obj.Proxiable) if err != nil { + err = core.SDKErrorf(err, "", "proxiable-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "proxied", &obj.Proxied) if err != nil { + err = core.SDKErrorf(err, "", "proxied-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ttl", &obj.TTL) + if err != nil { + err = core.SDKErrorf(err, "", "ttl-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + err = core.SDKErrorf(err, "", "priority-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "data", &obj.Data) + if err != nil { + err = core.SDKErrorf(err, "", "data-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// DnsrecordInput : dns record input. +type DnsrecordInput struct { + // Required for all record types except SRV. + Name *string `json:"name,omitempty"` + + // dns record type. + Type *string `json:"type" validate:"required"` + + // dns record ttl value. + TTL *int64 `json:"ttl,omitempty"` + + // dns record content. + Content *string `json:"content,omitempty"` + + // For MX records only. + Priority *int64 `json:"priority,omitempty"` + + // proxied. + Proxied *bool `json:"proxied,omitempty"` + + // For LOC, SRV, CAA, DS records only. + Data map[string]interface{} `json:"data,omitempty"` +} + +// Constants associated with the DnsrecordInput.Type property. +// dns record type. +const ( + DnsrecordInput_Type_A = "A" + DnsrecordInput_Type_Aaaa = "AAAA" + DnsrecordInput_Type_Caa = "CAA" + DnsrecordInput_Type_Cname = "CNAME" + DnsrecordInput_Type_Ds = "DS" + DnsrecordInput_Type_Loc = "LOC" + DnsrecordInput_Type_Mx = "MX" + DnsrecordInput_Type_Ns = "NS" + DnsrecordInput_Type_Ptr = "PTR" + DnsrecordInput_Type_Srv = "SRV" + DnsrecordInput_Type_Txt = "TXT" +) + +// NewDnsrecordInput : Instantiate DnsrecordInput (Generic Model Constructor) +func (*DnsRecordsV1) NewDnsrecordInput(typeVar string) (_model *DnsrecordInput, err error) { + _model = &DnsrecordInput{ + Type: core.StringPtr(typeVar), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalDnsrecordInput unmarshals an instance of DnsrecordInput from the specified map of raw messages. +func UnmarshalDnsrecordInput(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(DnsrecordInput) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "ttl", &obj.TTL) if err != nil { + err = core.SDKErrorf(err, "", "ttl-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "content", &obj.Content) + if err != nil { + err = core.SDKErrorf(err, "", "content-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) if err != nil { + err = core.SDKErrorf(err, "", "priority-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "proxied", &obj.Proxied) + if err != nil { + err = core.SDKErrorf(err, "", "proxied-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "data", &obj.Data) if err != nil { + err = core.SDKErrorf(err, "", "data-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -1098,18 +1892,22 @@ func UnmarshalDnsrecordResp(m map[string]json.RawMessage, result interface{}) (e obj := new(DnsrecordResp) err = core.UnmarshalPrimitive(m, "success", &obj.Success) if err != nil { + err = core.SDKErrorf(err, "", "success-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "errors", &obj.Errors) if err != nil { + err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "messages", &obj.Messages) if err != nil { + err = core.SDKErrorf(err, "", "messages-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "result", &obj.Result, UnmarshalDnsrecordDetails) if err != nil { + err = core.SDKErrorf(err, "", "result-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -1139,22 +1937,27 @@ func UnmarshalListDnsrecordsResp(m map[string]json.RawMessage, result interface{ obj := new(ListDnsrecordsResp) err = core.UnmarshalPrimitive(m, "success", &obj.Success) if err != nil { + err = core.SDKErrorf(err, "", "success-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "errors", &obj.Errors) if err != nil { + err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "messages", &obj.Messages) if err != nil { + err = core.SDKErrorf(err, "", "messages-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "result", &obj.Result, UnmarshalDnsrecordDetails) if err != nil { + err = core.SDKErrorf(err, "", "result-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "result_info", &obj.ResultInfo, UnmarshalResultInfo) if err != nil { + err = core.SDKErrorf(err, "", "result_info-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -1181,18 +1984,22 @@ func UnmarshalResultInfo(m map[string]json.RawMessage, result interface{}) (err obj := new(ResultInfo) err = core.UnmarshalPrimitive(m, "page", &obj.Page) if err != nil { + err = core.SDKErrorf(err, "", "page-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "per_page", &obj.PerPage) if err != nil { + err = core.SDKErrorf(err, "", "per_page-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "count", &obj.Count) if err != nil { + err = core.SDKErrorf(err, "", "count-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) diff --git a/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go b/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go index df0c02ccff83..dffe47a9fcfc 100644 --- a/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go +++ b/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.73.0-eeee85a9-20230607-165104 + * IBM OpenAPI SDK Code Generator Version: 3.107.1-41b0fbd0-20250825-080732 */ // Package transitgatewayapisv1 : Operations and models for the TransitGatewayApisV1 service @@ -72,22 +72,26 @@ func NewTransitGatewayApisV1UsingExternalConfig(options *TransitGatewayApisV1Opt if options.Authenticator == nil { options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "env-auth-error", common.GetComponentInfo()) return } } transitGatewayApis, err = NewTransitGatewayApisV1(options) + err = core.RepurposeSDKProblem(err, "new-client-error") if err != nil { return } err = transitGatewayApis.Service.ConfigureService(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "client-config-error", common.GetComponentInfo()) return } if options.URL != "" { err = transitGatewayApis.Service.SetServiceURL(options.URL) + err = core.RepurposeSDKProblem(err, "url-set-error") } return } @@ -101,17 +105,20 @@ func NewTransitGatewayApisV1(options *TransitGatewayApisV1Options) (service *Tra err = core.ValidateStruct(options, "options") if err != nil { + err = core.SDKErrorf(err, "", "invalid-global-options", common.GetComponentInfo()) return } baseService, err := core.NewBaseService(serviceOptions) if err != nil { + err = core.SDKErrorf(err, "", "new-base-error", common.GetComponentInfo()) return } if options.URL != "" { err = baseService.SetServiceURL(options.URL) if err != nil { + err = core.SDKErrorf(err, "", "set-url-error", common.GetComponentInfo()) return } } @@ -126,7 +133,7 @@ func NewTransitGatewayApisV1(options *TransitGatewayApisV1Options) (service *Tra // 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") + return "", core.SDKErrorf(nil, "service does not support regional URLs", "no-regional-support", common.GetComponentInfo()) } // Clone makes a copy of "transitGatewayApis" suitable for processing requests. @@ -141,7 +148,11 @@ func (transitGatewayApis *TransitGatewayApisV1) Clone() *TransitGatewayApisV1 { // SetServiceURL sets the service URL func (transitGatewayApis *TransitGatewayApisV1) SetServiceURL(url string) error { - return transitGatewayApis.Service.SetServiceURL(url) + err := transitGatewayApis.Service.SetServiceURL(url) + if err != nil { + err = core.SDKErrorf(err, "", "url-set-error", common.GetComponentInfo()) + } + return err } // GetServiceURL returns the service URL @@ -178,13 +189,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DisableRetries() { // 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) { - return transitGatewayApis.ListTransitGatewaysWithContext(context.Background(), listTransitGatewaysOptions) + result, response, err = transitGatewayApis.ListTransitGatewaysWithContext(context.Background(), listTransitGatewaysOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListTransitGatewaysWithContext is an alternate form of the ListTransitGateways method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewaysWithContext(ctx context.Context, listTransitGatewaysOptions *ListTransitGatewaysOptions) (result *TransitGatewayCollection, response *core.DetailedResponse, err error) { err = core.ValidateStruct(listTransitGatewaysOptions, "listTransitGatewaysOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -193,15 +207,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewaysWithContext(c builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listTransitGatewaysOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGateways") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGateways") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listTransitGatewaysOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -216,17 +231,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewaysWithContext(c request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_transit_gateways", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -238,17 +257,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewaysWithContext(c // CreateTransitGateway : Creates a Transit Gateway // Create a Transit Gateway based on the supplied input template. func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGateway(createTransitGatewayOptions *CreateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { - return transitGatewayApis.CreateTransitGatewayWithContext(context.Background(), createTransitGatewayOptions) + result, response, err = transitGatewayApis.CreateTransitGatewayWithContext(context.Background(), createTransitGatewayOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTransitGatewayWithContext is an alternate form of the CreateTransitGateway method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayWithContext(ctx context.Context, createTransitGatewayOptions *CreateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTransitGatewayOptions, "createTransitGatewayOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayOptions, "createTransitGatewayOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -257,15 +280,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayWithContext( builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGateway") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGateway") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -291,22 +315,27 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayWithContext( } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGateway) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -319,17 +348,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayWithContext( // This request deletes a Transit Gateway. This operation cannot be reversed. For this request to succeed, the Transit // Gateway must not contain connections. func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGateway(deleteTransitGatewayOptions *DeleteTransitGatewayOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.DeleteTransitGatewayWithContext(context.Background(), deleteTransitGatewayOptions) + response, err = transitGatewayApis.DeleteTransitGatewayWithContext(context.Background(), deleteTransitGatewayOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteTransitGatewayWithContext is an alternate form of the DeleteTransitGateway method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayWithContext(ctx context.Context, deleteTransitGatewayOptions *DeleteTransitGatewayOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteTransitGatewayOptions, "deleteTransitGatewayOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteTransitGatewayOptions, "deleteTransitGatewayOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -342,15 +375,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayWithContext( builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deleteTransitGatewayOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGateway") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGateway") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTransitGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -358,10 +392,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayWithContext( request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_transit_gateway", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -369,17 +409,21 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayWithContext( // GetTransitGateway : Retrieves specified Transit Gateway // This request retrieves a single Transit Gateway specified by the identifier in the URL. func (transitGatewayApis *TransitGatewayApisV1) GetTransitGateway(getTransitGatewayOptions *GetTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { - return transitGatewayApis.GetTransitGatewayWithContext(context.Background(), getTransitGatewayOptions) + result, response, err = transitGatewayApis.GetTransitGatewayWithContext(context.Background(), getTransitGatewayOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetTransitGatewayWithContext is an alternate form of the GetTransitGateway method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayWithContext(ctx context.Context, getTransitGatewayOptions *GetTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getTransitGatewayOptions, "getTransitGatewayOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getTransitGatewayOptions, "getTransitGatewayOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -392,15 +436,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayWithContext(ctx builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getTransitGatewayOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGateway") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGateway") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getTransitGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -409,17 +454,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayWithContext(ctx request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_transit_gateway", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGateway) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -431,17 +480,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayWithContext(ctx // UpdateTransitGateway : Updates specified Transit Gateway // This request updates a Transit Gateway's name and/or global flag. func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGateway(updateTransitGatewayOptions *UpdateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { - return transitGatewayApis.UpdateTransitGatewayWithContext(context.Background(), updateTransitGatewayOptions) + result, response, err = transitGatewayApis.UpdateTransitGatewayWithContext(context.Background(), updateTransitGatewayOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdateTransitGatewayWithContext is an alternate form of the UpdateTransitGateway method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayWithContext(ctx context.Context, updateTransitGatewayOptions *UpdateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updateTransitGatewayOptions, "updateTransitGatewayOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updateTransitGatewayOptions, "updateTransitGatewayOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -454,15 +507,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayWithContext( builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range updateTransitGatewayOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGateway") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGateway") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range updateTransitGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -482,22 +536,27 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayWithContext( } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "update_transit_gateway", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGateway) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -509,13 +568,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayWithContext( // ListConnections : Retrieves all connections // List all transit gateway connections associated with this account. func (transitGatewayApis *TransitGatewayApisV1) ListConnections(listConnectionsOptions *ListConnectionsOptions) (result *TransitConnectionCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListConnectionsWithContext(context.Background(), listConnectionsOptions) + result, response, err = transitGatewayApis.ListConnectionsWithContext(context.Background(), listConnectionsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListConnectionsWithContext is an alternate form of the ListConnections method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListConnectionsWithContext(ctx context.Context, listConnectionsOptions *ListConnectionsOptions) (result *TransitConnectionCollection, response *core.DetailedResponse, err error) { err = core.ValidateStruct(listConnectionsOptions, "listConnectionsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -524,15 +586,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListConnectionsWithContext(ctx c builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/connections`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listConnectionsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListConnections") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListConnections") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listConnectionsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -553,17 +616,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListConnectionsWithContext(ctx c request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_connections", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitConnectionCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -575,17 +642,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListConnectionsWithContext(ctx c // ListTransitGatewayConnections : Retrieves all connections in a Transit Gateway // This request retrieves all connections in a Transit Gateway. func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnections(listTransitGatewayConnectionsOptions *ListTransitGatewayConnectionsOptions) (result *TransitGatewayConnectionCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListTransitGatewayConnectionsWithContext(context.Background(), listTransitGatewayConnectionsOptions) + result, response, err = transitGatewayApis.ListTransitGatewayConnectionsWithContext(context.Background(), listTransitGatewayConnectionsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListTransitGatewayConnectionsWithContext is an alternate form of the ListTransitGatewayConnections method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionsWithContext(ctx context.Context, listTransitGatewayConnectionsOptions *ListTransitGatewayConnectionsOptions) (result *TransitGatewayConnectionCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listTransitGatewayConnectionsOptions, "listTransitGatewayConnectionsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listTransitGatewayConnectionsOptions, "listTransitGatewayConnectionsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -598,15 +669,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionsWit builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listTransitGatewayConnectionsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayConnections") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayConnections") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listTransitGatewayConnectionsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -624,17 +696,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionsWit request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_transit_gateway_connections", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayConnectionCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -646,17 +722,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionsWit // CreateTransitGatewayConnection : Adds a connection to a Transit Gateway // Add a connection to Transit Gateway. func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnection(createTransitGatewayConnectionOptions *CreateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.CreateTransitGatewayConnectionWithContext(context.Background(), createTransitGatewayConnectionOptions) + result, response, err = transitGatewayApis.CreateTransitGatewayConnectionWithContext(context.Background(), createTransitGatewayConnectionOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTransitGatewayConnectionWithContext is an alternate form of the CreateTransitGatewayConnection method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionWithContext(ctx context.Context, createTransitGatewayConnectionOptions *CreateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTransitGatewayConnectionOptions, "createTransitGatewayConnectionOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayConnectionOptions, "createTransitGatewayConnectionOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -669,15 +749,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionWi builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayConnectionOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnection") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnection") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -736,22 +817,27 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionWi } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway_connection", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayConnectionCust) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -764,17 +850,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionWi // After the specified connection is detached, entities still within the Transit Gateway will no longer be able to // communicate directly to it through the IBM Cloud private backbone. func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnection(deleteTransitGatewayConnectionOptions *DeleteTransitGatewayConnectionOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.DeleteTransitGatewayConnectionWithContext(context.Background(), deleteTransitGatewayConnectionOptions) + response, err = transitGatewayApis.DeleteTransitGatewayConnectionWithContext(context.Background(), deleteTransitGatewayConnectionOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteTransitGatewayConnectionWithContext is an alternate form of the DeleteTransitGatewayConnection method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionWithContext(ctx context.Context, deleteTransitGatewayConnectionOptions *DeleteTransitGatewayConnectionOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteTransitGatewayConnectionOptions, "deleteTransitGatewayConnectionOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteTransitGatewayConnectionOptions, "deleteTransitGatewayConnectionOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -788,15 +878,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionWi builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deleteTransitGatewayConnectionOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnection") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnection") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTransitGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -804,10 +895,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionWi request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_transit_gateway_connection", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -815,17 +912,21 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionWi // GetTransitGatewayConnection : Retrieves specified Transit Gateway connection // This request retrieves a connection from the Transit Gateway. func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnection(getTransitGatewayConnectionOptions *GetTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.GetTransitGatewayConnectionWithContext(context.Background(), getTransitGatewayConnectionOptions) + result, response, err = transitGatewayApis.GetTransitGatewayConnectionWithContext(context.Background(), getTransitGatewayConnectionOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetTransitGatewayConnectionWithContext is an alternate form of the GetTransitGatewayConnection method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionWithContext(ctx context.Context, getTransitGatewayConnectionOptions *GetTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getTransitGatewayConnectionOptions, "getTransitGatewayConnectionOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getTransitGatewayConnectionOptions, "getTransitGatewayConnectionOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -839,15 +940,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionWithC builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getTransitGatewayConnectionOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnection") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnection") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getTransitGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -856,17 +958,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionWithC request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_transit_gateway_connection", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayConnectionCust) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -878,17 +984,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionWithC // UpdateTransitGatewayConnection : Updates specified Transit Gateway connection // Update the name of a connection to a Transit Gateway. func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnection(updateTransitGatewayConnectionOptions *UpdateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.UpdateTransitGatewayConnectionWithContext(context.Background(), updateTransitGatewayConnectionOptions) + result, response, err = transitGatewayApis.UpdateTransitGatewayConnectionWithContext(context.Background(), updateTransitGatewayConnectionOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdateTransitGatewayConnectionWithContext is an alternate form of the UpdateTransitGatewayConnection method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionWithContext(ctx context.Context, updateTransitGatewayConnectionOptions *UpdateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updateTransitGatewayConnectionOptions, "updateTransitGatewayConnectionOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updateTransitGatewayConnectionOptions, "updateTransitGatewayConnectionOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -902,15 +1012,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionWi builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range updateTransitGatewayConnectionOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnection") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnection") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range updateTransitGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -927,22 +1038,27 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionWi } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "update_transit_gateway_connection", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayConnectionCust) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -954,17 +1070,21 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionWi // CreateTransitGatewayConnectionActions : Performs actions on a connection for a Transit Gateway // Allow a network owner to approve or reject a cross-account connection request. func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionActions(createTransitGatewayConnectionActionsOptions *CreateTransitGatewayConnectionActionsOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.CreateTransitGatewayConnectionActionsWithContext(context.Background(), createTransitGatewayConnectionActionsOptions) + response, err = transitGatewayApis.CreateTransitGatewayConnectionActionsWithContext(context.Background(), createTransitGatewayConnectionActionsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTransitGatewayConnectionActionsWithContext is an alternate form of the CreateTransitGatewayConnectionActions method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionActionsWithContext(ctx context.Context, createTransitGatewayConnectionActionsOptions *CreateTransitGatewayConnectionActionsOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTransitGatewayConnectionActionsOptions, "createTransitGatewayConnectionActionsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayConnectionActionsOptions, "createTransitGatewayConnectionActionsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -978,15 +1098,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionAc builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/actions`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayConnectionActionsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnectionActions") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnectionActions") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayConnectionActionsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Content-Type", "application/json") @@ -999,15 +1120,22 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionAc } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway_connection_actions", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -1015,17 +1143,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionAc // ListTransitGatewayGreTunnel : Retrieves specified Transit Gateway redundant gre connection tunnels // This request retrieves a list of all the tunnels for connection. func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayGreTunnel(listTransitGatewayGreTunnelOptions *ListTransitGatewayGreTunnelOptions) (result *TransitGatewayTunnelCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListTransitGatewayGreTunnelWithContext(context.Background(), listTransitGatewayGreTunnelOptions) + result, response, err = transitGatewayApis.ListTransitGatewayGreTunnelWithContext(context.Background(), listTransitGatewayGreTunnelOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListTransitGatewayGreTunnelWithContext is an alternate form of the ListTransitGatewayGreTunnel method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayGreTunnelWithContext(ctx context.Context, listTransitGatewayGreTunnelOptions *ListTransitGatewayGreTunnelOptions) (result *TransitGatewayTunnelCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listTransitGatewayGreTunnelOptions, "listTransitGatewayGreTunnelOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listTransitGatewayGreTunnelOptions, "listTransitGatewayGreTunnelOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1039,15 +1171,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayGreTunnelWithC builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listTransitGatewayGreTunnelOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayGreTunnel") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayGreTunnel") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listTransitGatewayGreTunnelOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1056,17 +1189,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayGreTunnelWithC request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_transit_gateway_gre_tunnel", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayTunnelCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1078,17 +1215,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayGreTunnelWithC // CreateTransitGatewayGreTunnel : Creates a Transit Gateway redundant GRE tunnel // Add a tunnel to an existing Redundant GRE connection. func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayGreTunnel(createTransitGatewayGreTunnelOptions *CreateTransitGatewayGreTunnelOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { - return transitGatewayApis.CreateTransitGatewayGreTunnelWithContext(context.Background(), createTransitGatewayGreTunnelOptions) + result, response, err = transitGatewayApis.CreateTransitGatewayGreTunnelWithContext(context.Background(), createTransitGatewayGreTunnelOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTransitGatewayGreTunnelWithContext is an alternate form of the CreateTransitGatewayGreTunnel method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayGreTunnelWithContext(ctx context.Context, createTransitGatewayGreTunnelOptions *CreateTransitGatewayGreTunnelOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTransitGatewayGreTunnelOptions, "createTransitGatewayGreTunnelOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayGreTunnelOptions, "createTransitGatewayGreTunnelOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1102,15 +1243,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayGreTunnelWit builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayGreTunnelOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayGreTunnel") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayGreTunnel") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayGreTunnelOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1142,22 +1284,27 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayGreTunnelWit } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway_gre_tunnel", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1169,17 +1316,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayGreTunnelWit // DeleteTransitGatewayConnectionTunnels : Deletes a specified Transit Gateway redundant GRE tunnel // Remove a tunnel from a redundant GRE connection. func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionTunnels(deleteTransitGatewayConnectionTunnelsOptions *DeleteTransitGatewayConnectionTunnelsOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.DeleteTransitGatewayConnectionTunnelsWithContext(context.Background(), deleteTransitGatewayConnectionTunnelsOptions) + response, err = transitGatewayApis.DeleteTransitGatewayConnectionTunnelsWithContext(context.Background(), deleteTransitGatewayConnectionTunnelsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteTransitGatewayConnectionTunnelsWithContext is an alternate form of the DeleteTransitGatewayConnectionTunnels method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionTunnelsWithContext(ctx context.Context, deleteTransitGatewayConnectionTunnelsOptions *DeleteTransitGatewayConnectionTunnelsOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteTransitGatewayConnectionTunnelsOptions, "deleteTransitGatewayConnectionTunnelsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteTransitGatewayConnectionTunnelsOptions, "deleteTransitGatewayConnectionTunnelsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1194,15 +1345,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionTu builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deleteTransitGatewayConnectionTunnelsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnectionTunnels") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnectionTunnels") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTransitGatewayConnectionTunnelsOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -1210,10 +1362,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionTu request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_transit_gateway_connection_tunnels", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -1221,17 +1379,21 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionTu // GetTransitGatewayConnectionTunnels : Retrieves specified Transit Gateway connection tunnel // This request retrieves a connection tunnel from the Transit Gateway connection. func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionTunnels(getTransitGatewayConnectionTunnelsOptions *GetTransitGatewayConnectionTunnelsOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { - return transitGatewayApis.GetTransitGatewayConnectionTunnelsWithContext(context.Background(), getTransitGatewayConnectionTunnelsOptions) + result, response, err = transitGatewayApis.GetTransitGatewayConnectionTunnelsWithContext(context.Background(), getTransitGatewayConnectionTunnelsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetTransitGatewayConnectionTunnelsWithContext is an alternate form of the GetTransitGatewayConnectionTunnels method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionTunnelsWithContext(ctx context.Context, getTransitGatewayConnectionTunnelsOptions *GetTransitGatewayConnectionTunnelsOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getTransitGatewayConnectionTunnelsOptions, "getTransitGatewayConnectionTunnelsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getTransitGatewayConnectionTunnelsOptions, "getTransitGatewayConnectionTunnelsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1246,15 +1408,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionTunne builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getTransitGatewayConnectionTunnelsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnectionTunnels") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnectionTunnels") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getTransitGatewayConnectionTunnelsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1263,17 +1426,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionTunne request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_transit_gateway_connection_tunnels", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1285,17 +1452,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionTunne // UpdateTransitGatewayConnectionTunnels : Updates specified Transit Gateway redundant GRE tunnel // Update the name of a connection tunnel. func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionTunnels(updateTransitGatewayConnectionTunnelsOptions *UpdateTransitGatewayConnectionTunnelsOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { - return transitGatewayApis.UpdateTransitGatewayConnectionTunnelsWithContext(context.Background(), updateTransitGatewayConnectionTunnelsOptions) + result, response, err = transitGatewayApis.UpdateTransitGatewayConnectionTunnelsWithContext(context.Background(), updateTransitGatewayConnectionTunnelsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdateTransitGatewayConnectionTunnelsWithContext is an alternate form of the UpdateTransitGatewayConnectionTunnels method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionTunnelsWithContext(ctx context.Context, updateTransitGatewayConnectionTunnelsOptions *UpdateTransitGatewayConnectionTunnelsOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updateTransitGatewayConnectionTunnelsOptions, "updateTransitGatewayConnectionTunnelsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updateTransitGatewayConnectionTunnelsOptions, "updateTransitGatewayConnectionTunnelsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1310,15 +1481,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionTu builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range updateTransitGatewayConnectionTunnelsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnectionTunnels") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnectionTunnels") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range updateTransitGatewayConnectionTunnelsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1328,22 +1500,27 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionTu _, err = builder.SetBodyContentJSON(updateTransitGatewayConnectionTunnelsOptions.TransitGatewayTunnelPatch) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "update_transit_gateway_connection_tunnels", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1355,13 +1532,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionTu // ListGatewayLocations : Lists all locations that support Transit Gateways // List all locations that support Transit Gateways. func (transitGatewayApis *TransitGatewayApisV1) ListGatewayLocations(listGatewayLocationsOptions *ListGatewayLocationsOptions) (result *TSCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListGatewayLocationsWithContext(context.Background(), listGatewayLocationsOptions) + result, response, err = transitGatewayApis.ListGatewayLocationsWithContext(context.Background(), listGatewayLocationsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListGatewayLocationsWithContext is an alternate form of the ListGatewayLocations method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListGatewayLocationsWithContext(ctx context.Context, listGatewayLocationsOptions *ListGatewayLocationsOptions) (result *TSCollection, response *core.DetailedResponse, err error) { err = core.ValidateStruct(listGatewayLocationsOptions, "listGatewayLocationsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1370,15 +1550,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListGatewayLocationsWithContext( builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/locations`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listGatewayLocationsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListGatewayLocations") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListGatewayLocations") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listGatewayLocationsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1387,17 +1568,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListGatewayLocationsWithContext( request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_gateway_locations", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTSCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1409,17 +1594,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListGatewayLocationsWithContext( // GetGatewayLocation : Shows the details of a given Transit Gateway location // Get the details of a Transit Gateway Location. func (transitGatewayApis *TransitGatewayApisV1) GetGatewayLocation(getGatewayLocationOptions *GetGatewayLocationOptions) (result *TSLocation, response *core.DetailedResponse, err error) { - return transitGatewayApis.GetGatewayLocationWithContext(context.Background(), getGatewayLocationOptions) + result, response, err = transitGatewayApis.GetGatewayLocationWithContext(context.Background(), getGatewayLocationOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetGatewayLocationWithContext is an alternate form of the GetGatewayLocation method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) GetGatewayLocationWithContext(ctx context.Context, getGatewayLocationOptions *GetGatewayLocationOptions) (result *TSLocation, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getGatewayLocationOptions, "getGatewayLocationOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getGatewayLocationOptions, "getGatewayLocationOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1432,15 +1621,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetGatewayLocationWithContext(ct builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/locations/{name}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getGatewayLocationOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetGatewayLocation") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetGatewayLocation") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getGatewayLocationOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1449,17 +1639,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetGatewayLocationWithContext(ct request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_gateway_location", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTSLocation) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1471,17 +1665,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetGatewayLocationWithContext(ct // ListTransitGatewayConnectionPrefixFilters : Retrieves all prefix filters in a Transit Gateway connection // This request retrieves all prefix filters in a Transit Gateway connection. func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionPrefixFilters(listTransitGatewayConnectionPrefixFiltersOptions *ListTransitGatewayConnectionPrefixFiltersOptions) (result *PrefixFilterCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListTransitGatewayConnectionPrefixFiltersWithContext(context.Background(), listTransitGatewayConnectionPrefixFiltersOptions) + result, response, err = transitGatewayApis.ListTransitGatewayConnectionPrefixFiltersWithContext(context.Background(), listTransitGatewayConnectionPrefixFiltersOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListTransitGatewayConnectionPrefixFiltersWithContext is an alternate form of the ListTransitGatewayConnectionPrefixFilters method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionPrefixFiltersWithContext(ctx context.Context, listTransitGatewayConnectionPrefixFiltersOptions *ListTransitGatewayConnectionPrefixFiltersOptions) (result *PrefixFilterCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listTransitGatewayConnectionPrefixFiltersOptions, "listTransitGatewayConnectionPrefixFiltersOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listTransitGatewayConnectionPrefixFiltersOptions, "listTransitGatewayConnectionPrefixFiltersOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1495,15 +1693,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionPref builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listTransitGatewayConnectionPrefixFiltersOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayConnectionPrefixFilters") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayConnectionPrefixFilters") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listTransitGatewayConnectionPrefixFiltersOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1512,17 +1711,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionPref request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_transit_gateway_connection_prefix_filters", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPrefixFilterCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1532,19 +1735,25 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionPref } // CreateTransitGatewayConnectionPrefixFilter : Add a prefix filter to a Transit Gateway connection -// Add a prefix filter to a Transit Gateway connection. +// Add a Prefix Filter to a Transit Gateway Connection. Prefix Filters can be added to `vpc`, `classic`, `directlink`, +// and `power_virtual_server` Connection types. Prefix Filters cannot be added to `gre_tunnel`, `unbound_gre_tunnel`, +// `redundant_gre` or `vpn_gateway` Connection types. func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionPrefixFilter(createTransitGatewayConnectionPrefixFilterOptions *CreateTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.CreateTransitGatewayConnectionPrefixFilterWithContext(context.Background(), createTransitGatewayConnectionPrefixFilterOptions) + result, response, err = transitGatewayApis.CreateTransitGatewayConnectionPrefixFilterWithContext(context.Background(), createTransitGatewayConnectionPrefixFilterOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTransitGatewayConnectionPrefixFilterWithContext is an alternate form of the CreateTransitGatewayConnectionPrefixFilter method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionPrefixFilterWithContext(ctx context.Context, createTransitGatewayConnectionPrefixFilterOptions *CreateTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTransitGatewayConnectionPrefixFilterOptions, "createTransitGatewayConnectionPrefixFilterOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayConnectionPrefixFilterOptions, "createTransitGatewayConnectionPrefixFilterOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1558,15 +1767,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionPr builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayConnectionPrefixFilterOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnectionPrefixFilter") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnectionPrefixFilter") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayConnectionPrefixFilterOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1592,95 +1802,27 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionPr } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway_connection_prefix_filter", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPrefixFilterCust) if err != nil { - return - } - response.Result = result - } - - return -} - -// ReplaceTransitGatewayConnectionPrefixFilter : Replaces the prefix filters of the Transit Gateway connection -// Replaces the prefix filters of the Transit Gateway connection. -func (transitGatewayApis *TransitGatewayApisV1) ReplaceTransitGatewayConnectionPrefixFilter(replaceTransitGatewayConnectionPrefixFilterOptions *ReplaceTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ReplaceTransitGatewayConnectionPrefixFilterWithContext(context.Background(), replaceTransitGatewayConnectionPrefixFilterOptions) -} - -// ReplaceTransitGatewayConnectionPrefixFilterWithContext is an alternate form of the ReplaceTransitGatewayConnectionPrefixFilter method which supports a Context parameter -func (transitGatewayApis *TransitGatewayApisV1) ReplaceTransitGatewayConnectionPrefixFilterWithContext(ctx context.Context, replaceTransitGatewayConnectionPrefixFilterOptions *ReplaceTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(replaceTransitGatewayConnectionPrefixFilterOptions, "replaceTransitGatewayConnectionPrefixFilterOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(replaceTransitGatewayConnectionPrefixFilterOptions, "replaceTransitGatewayConnectionPrefixFilterOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "transit_gateway_id": *replaceTransitGatewayConnectionPrefixFilterOptions.TransitGatewayID, - "id": *replaceTransitGatewayConnectionPrefixFilterOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range replaceTransitGatewayConnectionPrefixFilterOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ReplaceTransitGatewayConnectionPrefixFilter") - 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(*transitGatewayApis.Version)) - - body := make(map[string]interface{}) - if replaceTransitGatewayConnectionPrefixFilterOptions.PrefixFilters != nil { - body["prefix_filters"] = replaceTransitGatewayConnectionPrefixFilterOptions.PrefixFilters - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - 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, UnmarshalPrefixFilterCollection) - if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1692,17 +1834,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ReplaceTransitGatewayConnectionP // DeleteTransitGatewayConnectionPrefixFilter : Remove prefix filter from Transit Gateway connection // Delete a prefix filter. func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionPrefixFilter(deleteTransitGatewayConnectionPrefixFilterOptions *DeleteTransitGatewayConnectionPrefixFilterOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.DeleteTransitGatewayConnectionPrefixFilterWithContext(context.Background(), deleteTransitGatewayConnectionPrefixFilterOptions) + response, err = transitGatewayApis.DeleteTransitGatewayConnectionPrefixFilterWithContext(context.Background(), deleteTransitGatewayConnectionPrefixFilterOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteTransitGatewayConnectionPrefixFilterWithContext is an alternate form of the DeleteTransitGatewayConnectionPrefixFilter method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionPrefixFilterWithContext(ctx context.Context, deleteTransitGatewayConnectionPrefixFilterOptions *DeleteTransitGatewayConnectionPrefixFilterOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteTransitGatewayConnectionPrefixFilterOptions, "deleteTransitGatewayConnectionPrefixFilterOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteTransitGatewayConnectionPrefixFilterOptions, "deleteTransitGatewayConnectionPrefixFilterOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1717,15 +1863,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionPr builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deleteTransitGatewayConnectionPrefixFilterOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnectionPrefixFilter") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnectionPrefixFilter") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTransitGatewayConnectionPrefixFilterOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -1733,10 +1880,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionPr request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_transit_gateway_connection_prefix_filter", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -1744,17 +1897,21 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionPr // GetTransitGatewayConnectionPrefixFilter : Retrieves specified Transit Gateway connection prefix filter // This request retrieves a prefix filter from the Transit Gateway connection. func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionPrefixFilter(getTransitGatewayConnectionPrefixFilterOptions *GetTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.GetTransitGatewayConnectionPrefixFilterWithContext(context.Background(), getTransitGatewayConnectionPrefixFilterOptions) + result, response, err = transitGatewayApis.GetTransitGatewayConnectionPrefixFilterWithContext(context.Background(), getTransitGatewayConnectionPrefixFilterOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetTransitGatewayConnectionPrefixFilterWithContext is an alternate form of the GetTransitGatewayConnectionPrefixFilter method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionPrefixFilterWithContext(ctx context.Context, getTransitGatewayConnectionPrefixFilterOptions *GetTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getTransitGatewayConnectionPrefixFilterOptions, "getTransitGatewayConnectionPrefixFilterOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getTransitGatewayConnectionPrefixFilterOptions, "getTransitGatewayConnectionPrefixFilterOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1769,15 +1926,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionPrefi builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getTransitGatewayConnectionPrefixFilterOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnectionPrefixFilter") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnectionPrefixFilter") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getTransitGatewayConnectionPrefixFilterOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1786,17 +1944,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionPrefi request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_transit_gateway_connection_prefix_filter", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPrefixFilterCust) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1808,17 +1970,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionPrefi // UpdateTransitGatewayConnectionPrefixFilter : Updates specified Transit Gateway connection prefix filter // Update prefix filter for a Transit Gateway Connection. func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionPrefixFilter(updateTransitGatewayConnectionPrefixFilterOptions *UpdateTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.UpdateTransitGatewayConnectionPrefixFilterWithContext(context.Background(), updateTransitGatewayConnectionPrefixFilterOptions) + result, response, err = transitGatewayApis.UpdateTransitGatewayConnectionPrefixFilterWithContext(context.Background(), updateTransitGatewayConnectionPrefixFilterOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdateTransitGatewayConnectionPrefixFilterWithContext is an alternate form of the UpdateTransitGatewayConnectionPrefixFilter method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionPrefixFilterWithContext(ctx context.Context, updateTransitGatewayConnectionPrefixFilterOptions *UpdateTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updateTransitGatewayConnectionPrefixFilterOptions, "updateTransitGatewayConnectionPrefixFilterOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updateTransitGatewayConnectionPrefixFilterOptions, "updateTransitGatewayConnectionPrefixFilterOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1833,15 +1999,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionPr builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range updateTransitGatewayConnectionPrefixFilterOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnectionPrefixFilter") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnectionPrefixFilter") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range updateTransitGatewayConnectionPrefixFilterOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1867,22 +2034,27 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionPr } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "update_transit_gateway_connection_prefix_filter", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPrefixFilterCust) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1895,17 +2067,21 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionPr // 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) + result, response, err = transitGatewayApis.ListTransitGatewayRouteReportsWithContext(context.Background(), listTransitGatewayRouteReportsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // 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 { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listTransitGatewayRouteReportsOptions, "listTransitGatewayRouteReportsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1918,15 +2094,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayRouteReportsWi builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listTransitGatewayRouteReportsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayRouteReports") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayRouteReports") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listTransitGatewayRouteReportsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1935,17 +2112,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayRouteReportsWi request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_transit_gateway_route_reports", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteReportCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1958,17 +2139,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayRouteReportsWi // 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) + result, response, err = transitGatewayApis.CreateTransitGatewayRouteReportWithContext(context.Background(), createTransitGatewayRouteReportOptions) + err = core.RepurposeSDKProblem(err, "") + return } // 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 { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayRouteReportOptions, "createTransitGatewayRouteReportOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1981,15 +2166,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayRouteReportW builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayRouteReportOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayRouteReport") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayRouteReport") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayRouteReportOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1998,17 +2184,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayRouteReportW request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway_route_report", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteReport) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2020,17 +2210,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayRouteReportW // DeleteTransitGatewayRouteReport : Deletes a route report // Delete a route report. func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayRouteReport(deleteTransitGatewayRouteReportOptions *DeleteTransitGatewayRouteReportOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.DeleteTransitGatewayRouteReportWithContext(context.Background(), deleteTransitGatewayRouteReportOptions) + response, err = transitGatewayApis.DeleteTransitGatewayRouteReportWithContext(context.Background(), deleteTransitGatewayRouteReportOptions) + err = core.RepurposeSDKProblem(err, "") + return } // 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 { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteTransitGatewayRouteReportOptions, "deleteTransitGatewayRouteReportOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2044,15 +2238,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayRouteReportW builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deleteTransitGatewayRouteReportOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayRouteReport") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayRouteReport") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTransitGatewayRouteReportOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -2060,10 +2255,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayRouteReportW request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_transit_gateway_route_report", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -2071,17 +2272,21 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayRouteReportW // GetTransitGatewayRouteReport : Retrieves a 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) + result, response, err = transitGatewayApis.GetTransitGatewayRouteReportWithContext(context.Background(), getTransitGatewayRouteReportOptions) + err = core.RepurposeSDKProblem(err, "") + return } // 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 { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getTransitGatewayRouteReportOptions, "getTransitGatewayRouteReportOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2095,15 +2300,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayRouteReportWith builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getTransitGatewayRouteReportOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayRouteReport") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayRouteReport") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getTransitGatewayRouteReportOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -2112,17 +2318,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayRouteReportWith request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_transit_gateway_route_report", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteReport) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2130,6 +2340,9 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayRouteReportWith return } +func getServiceComponentInfo() *core.ProblemComponent { + return core.NewProblemComponent(DefaultServiceName, "__VERSION__") +} // CreateTransitGatewayConnectionActionsOptions : The CreateTransitGatewayConnectionActions options. type CreateTransitGatewayConnectionActionsOptions struct { @@ -2142,7 +2355,7 @@ type CreateTransitGatewayConnectionActionsOptions struct { // The action that is to be performed against the connection request. Action *string `json:"action" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2305,7 +2518,7 @@ type CreateTransitGatewayConnectionOptions struct { // `redundant_gre` connections. Zone ZoneIdentityIntf `json:"zone,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2501,7 +2714,7 @@ type CreateTransitGatewayConnectionPrefixFilterOptions struct { // If the `ge` value is non-zero the the `le` value must between the `ge` value and 32, inclusive. Le *int64 `json:"le,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2604,7 +2817,7 @@ type CreateTransitGatewayGreTunnelOptions struct { // will assign an ASN. RemoteBgpAsn *int64 `json:"remote_bgp_asn,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2700,7 +2913,7 @@ type CreateTransitGatewayOptions struct { // group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. ResourceGroup *ResourceGroupIdentity `json:"resource_group,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2753,7 +2966,7 @@ type CreateTransitGatewayRouteReportOptions struct { // The Transit Gateway identifier. TransitGatewayID *string `json:"transit_gateway_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2784,7 +2997,7 @@ type DeleteTransitGatewayConnectionOptions struct { // The connection identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2825,7 +3038,7 @@ type DeleteTransitGatewayConnectionPrefixFilterOptions struct { // Prefix filter identifier. FilterID *string `json:"filter_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2873,7 +3086,7 @@ type DeleteTransitGatewayConnectionTunnelsOptions struct { // The tunnel identifier. GreTunnelID *string `json:"gre_tunnel_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2915,7 +3128,7 @@ type DeleteTransitGatewayOptions struct { // The Transit Gateway identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2946,7 +3159,7 @@ type DeleteTransitGatewayRouteReportOptions struct { // Route report identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2981,7 +3194,7 @@ type GetGatewayLocationOptions struct { // The Transit Gateway location Name. Name *string `json:"name" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3012,7 +3225,7 @@ type GetTransitGatewayConnectionOptions struct { // The connection identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3053,7 +3266,7 @@ type GetTransitGatewayConnectionPrefixFilterOptions struct { // Prefix filter identifier. FilterID *string `json:"filter_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3101,7 +3314,7 @@ type GetTransitGatewayConnectionTunnelsOptions struct { // The tunnel identifier. GreTunnelID *string `json:"gre_tunnel_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3143,7 +3356,7 @@ type GetTransitGatewayOptions struct { // The Transit Gateway identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3174,7 +3387,7 @@ type GetTransitGatewayRouteReportOptions struct { // Route report identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3218,7 +3431,7 @@ type ListConnectionsOptions struct { // Search for connections with the given network_type value. NetworkType *string `json:"network_type,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3260,7 +3473,7 @@ func (options *ListConnectionsOptions) SetHeaders(param map[string]string) *List // ListGatewayLocationsOptions : The ListGatewayLocations options. type ListGatewayLocationsOptions struct { - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3283,7 +3496,7 @@ type ListTransitGatewayConnectionPrefixFiltersOptions struct { // The connection identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3327,7 +3540,7 @@ type ListTransitGatewayConnectionsOptions struct { // Search for connections with the given name. Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3376,7 +3589,7 @@ type ListTransitGatewayGreTunnelOptions struct { // The connection identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3411,7 +3624,7 @@ type ListTransitGatewayRouteReportsOptions struct { // The Transit Gateway identifier. TransitGatewayID *string `json:"transit_gateway_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3442,7 +3655,7 @@ type ListTransitGatewaysOptions struct { // A server supplied token determining which resource to start the page on. Start *string `json:"start,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3480,6 +3693,7 @@ func UnmarshalPaginationFirstConnection(m map[string]json.RawMessage, result int obj := new(PaginationFirstConnection) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3497,6 +3711,7 @@ func UnmarshalPaginationFirstTG(m map[string]json.RawMessage, result interface{} obj := new(PaginationFirstTG) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3515,6 +3730,7 @@ func UnmarshalPaginationFirstTGWConnection(m map[string]json.RawMessage, result obj := new(PaginationFirstTGWConnection) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3535,10 +3751,12 @@ func UnmarshalPaginationNextConnection(m map[string]json.RawMessage, result inte obj := new(PaginationNextConnection) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "start", &obj.Start) if err != nil { + err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3559,10 +3777,12 @@ func UnmarshalPaginationNextTG(m map[string]json.RawMessage, result interface{}) obj := new(PaginationNextTG) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "start", &obj.Start) if err != nil { + err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3583,10 +3803,12 @@ func UnmarshalPaginationNextTGWConnection(m map[string]json.RawMessage, result i obj := new(PaginationNextTGWConnection) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "start", &obj.Start) if err != nil { + err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3604,6 +3826,7 @@ func UnmarshalPrefixFilterCollection(m map[string]json.RawMessage, result interf obj := new(PrefixFilterCollection) err = core.UnmarshalModel(m, "prefix_filters", &obj.PrefixFilters, UnmarshalPrefixFilterCust) if err != nil { + err = core.SDKErrorf(err, "", "prefix_filters-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3668,157 +3891,48 @@ func UnmarshalPrefixFilterCust(m map[string]json.RawMessage, result interface{}) obj := new(PrefixFilterCust) err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "before", &obj.Before) if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "ge", &obj.Ge) if err != nil { + err = core.SDKErrorf(err, "", "ge-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "le", &obj.Le) if err != nil { + err = core.SDKErrorf(err, "", "le-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// PrefixFilterPut : A prefix filter update template. -type PrefixFilterPut struct { - // Whether or not this prefix filter should allow or deny prefixes matching this filter's prefix definition. - Action *string `json:"action" validate:"required"` - - // Defines the minimum matched prefix precision. If this field is non-zero then the filter will match all routes within - // the `prefix` that have a prefix length greater or equal to this value. - // - // This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix - // or less then or equal to 32. If this value is set to zero, the filter will not use the `ge` route matching behavior. - // If the `le` value is non-zero the the `ge` value must between the prefix length and the - // `le` value, inclusive. - Ge *int64 `json:"ge,omitempty"` - - // Defines the maximum matched prefix precision. If this field is non-zero then the filter will match all routes within - // the `prefix` that have a prefix length less than or equal to this value. - // - // This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix - // or less then or equal to 32. If this value is set to zero, the filter will not use the `le` route matching behavior. - // If the `ge` value is non-zero the the `le` value must between the `ge` value and 32, inclusive. - Le *int64 `json:"le,omitempty"` - - // The IPv4 Prefix to be matched by this filter. If both the `le` and `ge` are zero, then this filter will only apply - // to routes that exactly match this prefix, while a non-zero value for either `le` or `ge`, this filter can apply to - // multiple routes with different prefix lengths, but will still only apply to prefixes contained in the address space - // defined by `prefix`. - Prefix *string `json:"prefix" validate:"required"` -} - -// Constants associated with the PrefixFilterPut.Action property. -// Whether or not this prefix filter should allow or deny prefixes matching this filter's prefix definition. -const ( - PrefixFilterPut_Action_Deny = "deny" - PrefixFilterPut_Action_Permit = "permit" -) - -// NewPrefixFilterPut : Instantiate PrefixFilterPut (Generic Model Constructor) -func (*TransitGatewayApisV1) NewPrefixFilterPut(action string, prefix string) (_model *PrefixFilterPut, err error) { - _model = &PrefixFilterPut{ - Action: core.StringPtr(action), - Prefix: core.StringPtr(prefix), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalPrefixFilterPut unmarshals an instance of PrefixFilterPut from the specified map of raw messages. -func UnmarshalPrefixFilterPut(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PrefixFilterPut) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ge", &obj.Ge) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "le", &obj.Le) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReplaceTransitGatewayConnectionPrefixFilterOptions : The ReplaceTransitGatewayConnectionPrefixFilter options. -type ReplaceTransitGatewayConnectionPrefixFilterOptions struct { - // The Transit Gateway identifier. - TransitGatewayID *string `json:"transit_gateway_id" validate:"required,ne="` - - // The connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // Array of prefix filters. - PrefixFilters []PrefixFilterPut `json:"prefix_filters" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewReplaceTransitGatewayConnectionPrefixFilterOptions : Instantiate ReplaceTransitGatewayConnectionPrefixFilterOptions -func (*TransitGatewayApisV1) NewReplaceTransitGatewayConnectionPrefixFilterOptions(transitGatewayID string, id string, prefixFilters []PrefixFilterPut) *ReplaceTransitGatewayConnectionPrefixFilterOptions { - return &ReplaceTransitGatewayConnectionPrefixFilterOptions{ - TransitGatewayID: core.StringPtr(transitGatewayID), - ID: core.StringPtr(id), - PrefixFilters: prefixFilters, - } -} - -// SetTransitGatewayID : Allow user to set TransitGatewayID -func (_options *ReplaceTransitGatewayConnectionPrefixFilterOptions) SetTransitGatewayID(transitGatewayID string) *ReplaceTransitGatewayConnectionPrefixFilterOptions { - _options.TransitGatewayID = core.StringPtr(transitGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *ReplaceTransitGatewayConnectionPrefixFilterOptions) SetID(id string) *ReplaceTransitGatewayConnectionPrefixFilterOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetPrefixFilters : Allow user to set PrefixFilters -func (_options *ReplaceTransitGatewayConnectionPrefixFilterOptions) SetPrefixFilters(prefixFilters []PrefixFilterPut) *ReplaceTransitGatewayConnectionPrefixFilterOptions { - _options.PrefixFilters = prefixFilters - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ReplaceTransitGatewayConnectionPrefixFilterOptions) SetHeaders(param map[string]string) *ReplaceTransitGatewayConnectionPrefixFilterOptions { - options.Headers = param - return options -} - // ResourceGroupIdentity : The resource group to use. If unspecified, the account's [default resource // group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. type ResourceGroupIdentity struct { @@ -3832,6 +3946,9 @@ func (*TransitGatewayApisV1) NewResourceGroupIdentity(id string) (_model *Resour ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -3840,6 +3957,7 @@ func UnmarshalResourceGroupIdentity(m map[string]json.RawMessage, result interfa obj := new(ResourceGroupIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3861,10 +3979,12 @@ func UnmarshalResourceGroupReference(m map[string]json.RawMessage, result interf obj := new(ResourceGroupReference) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3907,26 +4027,32 @@ func UnmarshalRouteReport(m map[string]json.RawMessage, result interface{}) (err obj := new(RouteReport) err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalRouteReportConnection) if err != nil { + err = core.SDKErrorf(err, "", "connections-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "overlapping_routes", &obj.OverlappingRoutes, UnmarshalRouteReportOverlappingRouteGroup) if err != nil { + err = core.SDKErrorf(err, "", "overlapping_routes-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3944,6 +4070,7 @@ func UnmarshalRouteReportCollection(m map[string]json.RawMessage, result interfa obj := new(RouteReportCollection) err = core.UnmarshalModel(m, "route_reports", &obj.RouteReports, UnmarshalRouteReport) if err != nil { + err = core.SDKErrorf(err, "", "route_reports-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3973,22 +4100,27 @@ func UnmarshalRouteReportConnection(m map[string]json.RawMessage, result interfa obj := new(RouteReportConnection) err = core.UnmarshalModel(m, "bgps", &obj.Bgps, UnmarshalRouteReportConnectionBgp) if err != nil { + err = core.SDKErrorf(err, "", "bgps-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReportConnectionRoute) if err != nil { + err = core.SDKErrorf(err, "", "routes-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4015,18 +4147,22 @@ func UnmarshalRouteReportConnectionBgp(m map[string]json.RawMessage, result inte obj := new(RouteReportConnectionBgp) err = core.UnmarshalPrimitive(m, "as_path", &obj.AsPath) if err != nil { + err = core.SDKErrorf(err, "", "as_path-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "is_used", &obj.IsUsed) if err != nil { + err = core.SDKErrorf(err, "", "is_used-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_preference", &obj.LocalPreference) if err != nil { + err = core.SDKErrorf(err, "", "local_preference-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4044,6 +4180,7 @@ func UnmarshalRouteReportConnectionRoute(m map[string]json.RawMessage, result in obj := new(RouteReportConnectionRoute) err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4064,10 +4201,12 @@ func UnmarshalRouteReportOverlappingRoute(m map[string]json.RawMessage, result i obj := new(RouteReportOverlappingRoute) err = core.UnmarshalPrimitive(m, "connection_id", &obj.ConnectionID) if err != nil { + err = core.SDKErrorf(err, "", "connection_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4085,6 +4224,7 @@ func UnmarshalRouteReportOverlappingRouteGroup(m map[string]json.RawMessage, res obj := new(RouteReportOverlappingRouteGroup) err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReportOverlappingRoute) if err != nil { + err = core.SDKErrorf(err, "", "routes-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4102,6 +4242,7 @@ func UnmarshalTSCollection(m map[string]json.RawMessage, result interface{}) (er obj := new(TSCollection) err = core.UnmarshalModel(m, "locations", &obj.Locations, UnmarshalTSLocationBasic) if err != nil { + err = core.SDKErrorf(err, "", "locations-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4139,18 +4280,22 @@ func UnmarshalTSLocalLocation(m map[string]json.RawMessage, result interface{}) obj := new(TSLocalLocation) err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "supported_connection_types", &obj.SupportedConnectionTypes) if err != nil { + err = core.SDKErrorf(err, "", "supported_connection_types-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4180,22 +4325,27 @@ func UnmarshalTSLocation(m map[string]json.RawMessage, result interface{}) (err obj := new(TSLocation) err = core.UnmarshalPrimitive(m, "billing_location", &obj.BillingLocation) if err != nil { + err = core.SDKErrorf(err, "", "billing_location-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "local_connection_locations", &obj.LocalConnectionLocations, UnmarshalTSLocalLocation) if err != nil { + err = core.SDKErrorf(err, "", "local_connection_locations-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneReference) if err != nil { + err = core.SDKErrorf(err, "", "zones-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4219,14 +4369,17 @@ func UnmarshalTSLocationBasic(m map[string]json.RawMessage, result interface{}) obj := new(TSLocationBasic) err = core.UnmarshalPrimitive(m, "billing_location", &obj.BillingLocation) if err != nil { + err = core.SDKErrorf(err, "", "billing_location-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4387,94 +4540,117 @@ func UnmarshalTransitConnection(m map[string]json.RawMessage, result interface{} obj := new(TransitConnection) err = core.UnmarshalPrimitive(m, "base_network_type", &obj.BaseNetworkType) if err != nil { + err = core.SDKErrorf(err, "", "base_network_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_id", &obj.NetworkID) if err != nil { + err = core.SDKErrorf(err, "", "network_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_type", &obj.NetworkType) if err != nil { + err = core.SDKErrorf(err, "", "network_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "base_connection_id", &obj.BaseConnectionID) if err != nil { + err = core.SDKErrorf(err, "", "base_connection_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_bgp_asn", &obj.LocalBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "local_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_gateway_ip", &obj.LocalGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "local_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_tunnel_ip", &obj.LocalTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "local_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "mtu", &obj.Mtu) if err != nil { + err = core.SDKErrorf(err, "", "mtu-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_account_id", &obj.NetworkAccountID) if err != nil { + err = core.SDKErrorf(err, "", "network_account_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "prefix_filters", &obj.PrefixFilters, UnmarshalTransitGatewayConnectionPrefixFilterReference) if err != nil { + err = core.SDKErrorf(err, "", "prefix_filters-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix_filters_default", &obj.PrefixFiltersDefault) if err != nil { + err = core.SDKErrorf(err, "", "prefix_filters_default-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_bgp_asn", &obj.RemoteBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "remote_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_gateway_ip", &obj.RemoteGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_tunnel_ip", &obj.RemoteTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "request_status", &obj.RequestStatus) if err != nil { + err = core.SDKErrorf(err, "", "request_status-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "transit_gateway", &obj.TransitGateway, UnmarshalTransitGatewayReference) if err != nil { + err = core.SDKErrorf(err, "", "transit_gateway-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { + err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4501,18 +4677,22 @@ func UnmarshalTransitConnectionCollection(m map[string]json.RawMessage, result i obj := new(TransitConnectionCollection) err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalTransitConnection) if err != nil { + err = core.SDKErrorf(err, "", "connections-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPaginationFirstConnection) if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPaginationNextConnection) if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4585,50 +4765,62 @@ func UnmarshalTransitGateway(m map[string]json.RawMessage, result interface{}) ( obj := new(TransitGateway) err = core.UnmarshalPrimitive(m, "connection_count", &obj.ConnectionCount) if err != nil { + err = core.SDKErrorf(err, "", "connection_count-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "connection_needs_attention", &obj.ConnectionNeedsAttention) if err != nil { + err = core.SDKErrorf(err, "", "connection_needs_attention-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "crn", &obj.Crn) if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "global", &obj.Global) if err != nil { + err = core.SDKErrorf(err, "", "global-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "gre_enhanced_route_propagation", &obj.GreEnhancedRoutePropagation) if err != nil { + err = core.SDKErrorf(err, "", "gre_enhanced_route_propagation-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "location", &obj.Location) if err != nil { + err = core.SDKErrorf(err, "", "location-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { + err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4655,18 +4847,22 @@ func UnmarshalTransitGatewayCollection(m map[string]json.RawMessage, result inte obj := new(TransitGatewayCollection) err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPaginationFirstTG) if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPaginationNextTG) if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "transit_gateways", &obj.TransitGateways, UnmarshalTransitGateway) if err != nil { + err = core.SDKErrorf(err, "", "transit_gateways-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4706,22 +4902,27 @@ func UnmarshalTransitGatewayConnectionCollection(m map[string]json.RawMessage, r obj := new(TransitGatewayConnectionCollection) err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalTransitGatewayConnectionCust) if err != nil { + err = core.SDKErrorf(err, "", "connections-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPaginationFirstTGWConnection) if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPaginationNextTGWConnection) if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4898,94 +5099,117 @@ func UnmarshalTransitGatewayConnectionCust(m map[string]json.RawMessage, result obj := new(TransitGatewayConnectionCust) err = core.UnmarshalPrimitive(m, "base_connection_id", &obj.BaseConnectionID) if err != nil { + err = core.SDKErrorf(err, "", "base_connection_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "base_network_type", &obj.BaseNetworkType) if err != nil { + err = core.SDKErrorf(err, "", "base_network_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "cidr", &obj.Cidr) if err != nil { + err = core.SDKErrorf(err, "", "cidr-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_bgp_asn", &obj.LocalBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "local_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_gateway_ip", &obj.LocalGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "local_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_tunnel_ip", &obj.LocalTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "local_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "mtu", &obj.Mtu) if err != nil { + err = core.SDKErrorf(err, "", "mtu-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_account_id", &obj.NetworkAccountID) if err != nil { + err = core.SDKErrorf(err, "", "network_account_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_id", &obj.NetworkID) if err != nil { + err = core.SDKErrorf(err, "", "network_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_type", &obj.NetworkType) if err != nil { + err = core.SDKErrorf(err, "", "network_type-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "prefix_filters", &obj.PrefixFilters, UnmarshalTransitGatewayConnectionPrefixFilterReference) if err != nil { + err = core.SDKErrorf(err, "", "prefix_filters-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix_filters_default", &obj.PrefixFiltersDefault) if err != nil { + err = core.SDKErrorf(err, "", "prefix_filters_default-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_bgp_asn", &obj.RemoteBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "remote_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_gateway_ip", &obj.RemoteGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_tunnel_ip", &obj.RemoteTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "request_status", &obj.RequestStatus) if err != nil { + err = core.SDKErrorf(err, "", "request_status-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { + err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5021,6 +5245,9 @@ func (*TransitGatewayApisV1) NewTransitGatewayConnectionPrefixFilter(action stri Prefix: core.StringPtr(prefix), } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -5029,18 +5256,22 @@ func UnmarshalTransitGatewayConnectionPrefixFilter(m map[string]json.RawMessage, obj := new(TransitGatewayConnectionPrefixFilter) err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "ge", &obj.Ge) if err != nil { + err = core.SDKErrorf(err, "", "ge-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "le", &obj.Le) if err != nil { + err = core.SDKErrorf(err, "", "le-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5101,34 +5332,42 @@ func UnmarshalTransitGatewayConnectionPrefixFilterReference(m map[string]json.Ra obj := new(TransitGatewayConnectionPrefixFilterReference) err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "before", &obj.Before) if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "ge", &obj.Ge) if err != nil { + err = core.SDKErrorf(err, "", "ge-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "le", &obj.Le) if err != nil { + err = core.SDKErrorf(err, "", "le-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5152,14 +5391,17 @@ func UnmarshalTransitGatewayReference(m map[string]json.RawMessage, result inter obj := new(TransitGatewayReference) err = core.UnmarshalPrimitive(m, "crn", &obj.Crn) if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5200,9 +5442,9 @@ type TransitGatewayTunnel struct { // The ID of the network VPC being connected via this connection. NetworkID *string `json:"network_id,omitempty"` - // Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, - // 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If `remote_bgp_asn` is omitted on create requests, IBM - // will assign an ASN. + // Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512, 64513, 65100, + // 65200-65234, 65402-65433, 65500, 65516, 65519, 65521, 65531 and 4201065000-4201065999 If `remote_bgp_asn` is omitted + // on create requests, IBM will assign an ASN. RemoteBgpAsn *int64 `json:"remote_bgp_asn" validate:"required"` // Remote gateway IP address. @@ -5228,6 +5470,7 @@ type TransitGatewayTunnel struct { const ( TransitGatewayTunnel_BaseNetworkType_Classic = "classic" TransitGatewayTunnel_BaseNetworkType_Vpc = "vpc" + TransitGatewayTunnel_BaseNetworkType_Vpn = "vpn" ) // Constants associated with the TransitGatewayTunnel.Status property. @@ -5249,66 +5492,82 @@ func UnmarshalTransitGatewayTunnel(m map[string]json.RawMessage, result interfac obj := new(TransitGatewayTunnel) err = core.UnmarshalPrimitive(m, "base_network_type", &obj.BaseNetworkType) if err != nil { + err = core.SDKErrorf(err, "", "base_network_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_bgp_asn", &obj.LocalBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "local_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_gateway_ip", &obj.LocalGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "local_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_tunnel_ip", &obj.LocalTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "local_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "mtu", &obj.Mtu) if err != nil { + err = core.SDKErrorf(err, "", "mtu-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_account_id", &obj.NetworkAccountID) if err != nil { + err = core.SDKErrorf(err, "", "network_account_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_id", &obj.NetworkID) if err != nil { + err = core.SDKErrorf(err, "", "network_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_bgp_asn", &obj.RemoteBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "remote_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_gateway_ip", &obj.RemoteGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_tunnel_ip", &obj.RemoteTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { + err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5326,6 +5585,7 @@ func UnmarshalTransitGatewayTunnelCollection(m map[string]json.RawMessage, resul obj := new(TransitGatewayTunnelCollection) err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5343,6 +5603,7 @@ func UnmarshalTransitGatewayTunnelPatch(m map[string]json.RawMessage, result int obj := new(TransitGatewayTunnelPatch) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5351,11 +5612,11 @@ func UnmarshalTransitGatewayTunnelPatch(m map[string]json.RawMessage, result int // AsPatch returns a generic map representation of the TransitGatewayTunnelPatch func (transitGatewayTunnelPatch *TransitGatewayTunnelPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(transitGatewayTunnelPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) + _patch = map[string]interface{}{} + if !core.IsNil(transitGatewayTunnelPatch.Name) { + _patch["name"] = transitGatewayTunnelPatch.Name } + return } @@ -5399,6 +5660,9 @@ func (*TransitGatewayApisV1) NewTransitGatewayTunnelTemplate(localGatewayIp stri Zone: zone, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -5407,30 +5671,37 @@ func UnmarshalTransitGatewayTunnelTemplate(m map[string]json.RawMessage, result obj := new(TransitGatewayTunnelTemplate) err = core.UnmarshalPrimitive(m, "local_gateway_ip", &obj.LocalGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "local_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_tunnel_ip", &obj.LocalTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "local_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_bgp_asn", &obj.RemoteBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "remote_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_gateway_ip", &obj.RemoteGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_tunnel_ip", &obj.RemoteTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { + err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5453,7 +5724,7 @@ type UpdateTransitGatewayConnectionOptions struct { // Default setting of permit or deny which applies to any routes that don't match a specified filter. PrefixFiltersDefault *string `json:"prefix_filters_default,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -5544,7 +5815,7 @@ type UpdateTransitGatewayConnectionPrefixFilterOptions struct { // The IPv4 Prefix to be matched by this filter. Prefix *string `json:"prefix,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -5632,7 +5903,7 @@ type UpdateTransitGatewayConnectionTunnelsOptions struct { // The update connection tunnel template. TransitGatewayTunnelPatch map[string]interface{} `json:"TransitGatewayTunnel_patch" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -5690,7 +5961,7 @@ type UpdateTransitGatewayOptions struct { // A human readable name for a resource. Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -5752,6 +6023,7 @@ func UnmarshalZoneIdentity(m map[string]json.RawMessage, result interface{}) (er obj := new(ZoneIdentity) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5769,6 +6041,7 @@ func UnmarshalZoneReference(m map[string]json.RawMessage, result interface{}) (e obj := new(ZoneReference) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5791,6 +6064,7 @@ func UnmarshalZoneIdentityByName(m map[string]json.RawMessage, result interface{ obj := new(ZoneIdentityByName) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5810,7 +6084,7 @@ type TransitGatewaysPager struct { // NewTransitGatewaysPager returns a new TransitGatewaysPager instance. func (transitGatewayApis *TransitGatewayApisV1) NewTransitGatewaysPager(options *ListTransitGatewaysOptions) (pager *TransitGatewaysPager, err error) { if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) return } @@ -5838,6 +6112,7 @@ func (pager *TransitGatewaysPager) GetNextWithContext(ctx context.Context) (page result, _, err := pager.client.ListTransitGatewaysWithContext(ctx, pager.options) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } @@ -5859,6 +6134,7 @@ func (pager *TransitGatewaysPager) GetAllWithContext(ctx context.Context) (allIt var nextPage []TransitGateway nextPage, err = pager.GetNextWithContext(ctx) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } allItems = append(allItems, nextPage...) @@ -5868,12 +6144,16 @@ func (pager *TransitGatewaysPager) GetAllWithContext(ctx context.Context) (allIt // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. func (pager *TransitGatewaysPager) GetNext() (page []TransitGateway, err error) { - return pager.GetNextWithContext(context.Background()) + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. func (pager *TransitGatewaysPager) GetAll() (allItems []TransitGateway, err error) { - return pager.GetAllWithContext(context.Background()) + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } // ConnectionsPager can be used to simplify the use of the "ListConnections" method. @@ -5889,7 +6169,7 @@ type ConnectionsPager struct { // NewConnectionsPager returns a new ConnectionsPager instance. func (transitGatewayApis *TransitGatewayApisV1) NewConnectionsPager(options *ListConnectionsOptions) (pager *ConnectionsPager, err error) { if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) return } @@ -5917,6 +6197,7 @@ func (pager *ConnectionsPager) GetNextWithContext(ctx context.Context) (page []T result, _, err := pager.client.ListConnectionsWithContext(ctx, pager.options) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } @@ -5938,6 +6219,7 @@ func (pager *ConnectionsPager) GetAllWithContext(ctx context.Context) (allItems var nextPage []TransitConnection nextPage, err = pager.GetNextWithContext(ctx) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } allItems = append(allItems, nextPage...) @@ -5947,12 +6229,16 @@ func (pager *ConnectionsPager) GetAllWithContext(ctx context.Context) (allItems // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. func (pager *ConnectionsPager) GetNext() (page []TransitConnection, err error) { - return pager.GetNextWithContext(context.Background()) + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. func (pager *ConnectionsPager) GetAll() (allItems []TransitConnection, err error) { - return pager.GetAllWithContext(context.Background()) + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } // TransitGatewayConnectionsPager can be used to simplify the use of the "ListTransitGatewayConnections" method. @@ -5968,7 +6254,7 @@ type TransitGatewayConnectionsPager struct { // NewTransitGatewayConnectionsPager returns a new TransitGatewayConnectionsPager instance. func (transitGatewayApis *TransitGatewayApisV1) NewTransitGatewayConnectionsPager(options *ListTransitGatewayConnectionsOptions) (pager *TransitGatewayConnectionsPager, err error) { if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) return } @@ -5996,6 +6282,7 @@ func (pager *TransitGatewayConnectionsPager) GetNextWithContext(ctx context.Cont result, _, err := pager.client.ListTransitGatewayConnectionsWithContext(ctx, pager.options) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } @@ -6017,6 +6304,7 @@ func (pager *TransitGatewayConnectionsPager) GetAllWithContext(ctx context.Conte var nextPage []TransitGatewayConnectionCust nextPage, err = pager.GetNextWithContext(ctx) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } allItems = append(allItems, nextPage...) @@ -6026,10 +6314,14 @@ func (pager *TransitGatewayConnectionsPager) GetAllWithContext(ctx context.Conte // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. func (pager *TransitGatewayConnectionsPager) GetNext() (page []TransitGatewayConnectionCust, err error) { - return pager.GetNextWithContext(context.Background()) + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. func (pager *TransitGatewayConnectionsPager) GetAll() (allItems []TransitGatewayConnectionCust, err error) { - return pager.GetAllWithContext(context.Background()) + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } diff --git a/vendor/github.com/IBM/platform-services-go-sdk/common/version.go b/vendor/github.com/IBM/platform-services-go-sdk/common/version.go index 960e31915135..e981d17fff3e 100644 --- a/vendor/github.com/IBM/platform-services-go-sdk/common/version.go +++ b/vendor/github.com/IBM/platform-services-go-sdk/common/version.go @@ -17,4 +17,4 @@ package common // Version of the SDK -const Version = "0.86.1" +const Version = "0.99.1" diff --git a/vendor/github.com/IBM/platform-services-go-sdk/globaltaggingv1/global_tagging_v1.go b/vendor/github.com/IBM/platform-services-go-sdk/globaltaggingv1/global_tagging_v1.go index 01bd969b0212..77b78499af4c 100644 --- a/vendor/github.com/IBM/platform-services-go-sdk/globaltaggingv1/global_tagging_v1.go +++ b/vendor/github.com/IBM/platform-services-go-sdk/globaltaggingv1/global_tagging_v1.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2025. + * (C) Copyright IBM Corp. 2026. * * 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.105.0-3c13b041-20250605-193116 + * IBM OpenAPI SDK Code Generator Version: 3.111.0-1bfb72c2-20260206-185521 */ // Package globaltaggingv1 : Operations and models for the GlobalTaggingV1 service @@ -203,12 +203,12 @@ func (globalTagging *GlobalTaggingV1) ListTagsWithContext(ctx context.Context, l return } - for headerName, headerValue := range listTagsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "ListTags") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "ListTags") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listTagsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -307,12 +307,12 @@ func (globalTagging *GlobalTaggingV1) CreateTagWithContext(ctx context.Context, return } - for headerName, headerValue := range createTagOptions.Headers { + sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "CreateTag") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "CreateTag") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTagOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -391,12 +391,12 @@ func (globalTagging *GlobalTaggingV1) DeleteTagAllWithContext(ctx context.Contex return } - for headerName, headerValue := range deleteTagAllOptions.Headers { + sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "DeleteTagAll") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "DeleteTagAll") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTagAllOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -476,12 +476,12 @@ func (globalTagging *GlobalTaggingV1) DeleteTagWithContext(ctx context.Context, return } - for headerName, headerValue := range deleteTagOptions.Headers { + sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "DeleteTag") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "DeleteTag") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTagOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -558,12 +558,12 @@ func (globalTagging *GlobalTaggingV1) AttachTagWithContext(ctx context.Context, return } - for headerName, headerValue := range attachTagOptions.Headers { + sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "AttachTag") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "AttachTag") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range attachTagOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -662,12 +662,12 @@ func (globalTagging *GlobalTaggingV1) DetachTagWithContext(ctx context.Context, return } - for headerName, headerValue := range detachTagOptions.Headers { + sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "DetachTag") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("global_tagging", "V1", "DetachTag") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range detachTagOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1779,6 +1779,9 @@ type TagResultsItem struct { // It is `true` if the operation exits with an error. IsError *bool `json:"is_error,omitempty"` + + // Error message returned when the operation fails. + Message *string `json:"message,omitempty"` } // UnmarshalTagResultsItem unmarshals an instance of TagResultsItem from the specified map of raw messages. @@ -1794,6 +1797,11 @@ func UnmarshalTagResultsItem(m map[string]json.RawMessage, result interface{}) ( err = core.SDKErrorf(err, "", "is_error-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } diff --git a/vendor/github.com/IBM/platform-services-go-sdk/iamidentityv1/iam_identity_v1.go b/vendor/github.com/IBM/platform-services-go-sdk/iamidentityv1/iam_identity_v1.go index 7a0cfc7f283b..f872a9e13e25 100644 --- a/vendor/github.com/IBM/platform-services-go-sdk/iamidentityv1/iam_identity_v1.go +++ b/vendor/github.com/IBM/platform-services-go-sdk/iamidentityv1/iam_identity_v1.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2025. + * (C) Copyright IBM Corp. 2026. * * 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.106.0-09823488-20250707-071701 + * IBM OpenAPI SDK Code Generator Version: 3.113.1-d76630af-20260320-135953 */ // Package iamidentityv1 : Operations and models for the IamIdentityV1 service @@ -1251,6 +1251,9 @@ func (iamIdentity *IamIdentityV1) CreateAPIKeyWithContext(ctx context.Context, c if createAPIKeyOptions.ActionWhenLeaked != nil { body["action_when_leaked"] = createAPIKeyOptions.ActionWhenLeaked } + if createAPIKeyOptions.ExpiresAt != nil { + body["expires_at"] = createAPIKeyOptions.ExpiresAt + } _, err = builder.SetBodyContentJSON(body) if err != nil { err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) @@ -1491,6 +1494,9 @@ func (iamIdentity *IamIdentityV1) UpdateAPIKeyWithContext(ctx context.Context, u if updateAPIKeyOptions.ActionWhenLeaked != nil { body["action_when_leaked"] = updateAPIKeyOptions.ActionWhenLeaked } + if updateAPIKeyOptions.ExpiresAt != nil { + body["expires_at"] = updateAPIKeyOptions.ExpiresAt + } _, err = builder.SetBodyContentJSON(body) if err != nil { err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) @@ -2410,7 +2416,7 @@ func (iamIdentity *IamIdentityV1) GetClaimRuleWithContext(ctx context.Context, g pathParamsMap := map[string]string{ "profile-id": *getClaimRuleOptions.ProfileID, - "rule-id": *getClaimRuleOptions.RuleID, + "rule-id": *getClaimRuleOptions.RuleID, } builder := core.NewRequestBuilder(core.GET) @@ -2480,7 +2486,7 @@ func (iamIdentity *IamIdentityV1) UpdateClaimRuleWithContext(ctx context.Context pathParamsMap := map[string]string{ "profile-id": *updateClaimRuleOptions.ProfileID, - "rule-id": *updateClaimRuleOptions.RuleID, + "rule-id": *updateClaimRuleOptions.RuleID, } builder := core.NewRequestBuilder(core.PUT) @@ -2583,7 +2589,7 @@ func (iamIdentity *IamIdentityV1) DeleteClaimRuleWithContext(ctx context.Context pathParamsMap := map[string]string{ "profile-id": *deleteClaimRuleOptions.ProfileID, - "rule-id": *deleteClaimRuleOptions.RuleID, + "rule-id": *deleteClaimRuleOptions.RuleID, } builder := core.NewRequestBuilder(core.DELETE) @@ -2676,6 +2682,9 @@ func (iamIdentity *IamIdentityV1) CreateLinkWithContext(ctx context.Context, cre if createLinkOptions.Name != nil { body["name"] = createLinkOptions.Name } + if createLinkOptions.IsCrossAccount != nil { + body["is_cross_account"] = createLinkOptions.IsCrossAccount + } _, err = builder.SetBodyContentJSON(body) if err != nil { err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) @@ -2875,7 +2884,7 @@ func (iamIdentity *IamIdentityV1) GetLinkWithContext(ctx context.Context, getLin pathParamsMap := map[string]string{ "profile-id": *getLinkOptions.ProfileID, - "link-id": *getLinkOptions.LinkID, + "link-id": *getLinkOptions.LinkID, } builder := core.NewRequestBuilder(core.GET) @@ -2945,7 +2954,7 @@ func (iamIdentity *IamIdentityV1) DeleteLinkWithContext(ctx context.Context, del pathParamsMap := map[string]string{ "profile-id": *deleteLinkOptions.ProfileID, - "link-id": *deleteLinkOptions.LinkID, + "link-id": *deleteLinkOptions.LinkID, } builder := core.NewRequestBuilder(core.DELETE) @@ -3160,7 +3169,7 @@ func (iamIdentity *IamIdentityV1) SetProfileIdentityWithContext(ctx context.Cont } pathParamsMap := map[string]string{ - "profile-id": *setProfileIdentityOptions.ProfileID, + "profile-id": *setProfileIdentityOptions.ProfileID, "identity-type": *setProfileIdentityOptions.IdentityType, } @@ -3250,7 +3259,7 @@ func (iamIdentity *IamIdentityV1) GetProfileIdentityWithContext(ctx context.Cont } pathParamsMap := map[string]string{ - "profile-id": *getProfileIdentityOptions.ProfileID, + "profile-id": *getProfileIdentityOptions.ProfileID, "identity-type": *getProfileIdentityOptions.IdentityType, "identifier-id": *getProfileIdentityOptions.IdentifierID, } @@ -3325,7 +3334,7 @@ func (iamIdentity *IamIdentityV1) DeleteProfileIdentityWithContext(ctx context.C } pathParamsMap := map[string]string{ - "profile-id": *deleteProfileIdentityOptions.ProfileID, + "profile-id": *deleteProfileIdentityOptions.ProfileID, "identity-type": *deleteProfileIdentityOptions.IdentityType, "identifier-id": *deleteProfileIdentityOptions.IdentifierID, } @@ -3465,7 +3474,7 @@ func (iamIdentity *IamIdentityV1) GetReportWithContext(ctx context.Context, getR pathParamsMap := map[string]string{ "account_id": *getReportOptions.AccountID, - "reference": *getReportOptions.Reference, + "reference": *getReportOptions.Reference, } builder := core.NewRequestBuilder(core.GET) @@ -3559,6 +3568,9 @@ func (iamIdentity *IamIdentityV1) GetAccountSettingsWithContext(ctx context.Cont if getAccountSettingsOptions.IncludeHistory != nil { builder.AddQuery("include_history", fmt.Sprint(*getAccountSettingsOptions.IncludeHistory)) } + if getAccountSettingsOptions.ResolveUserMfa != nil { + builder.AddQuery("resolve_user_mfa", fmt.Sprint(*getAccountSettingsOptions.ResolveUserMfa)) + } request, err := builder.Build() if err != nil { @@ -3665,6 +3677,12 @@ func (iamIdentity *IamIdentityV1) UpdateAccountSettingsWithContext(ctx context.C if updateAccountSettingsOptions.SystemRefreshTokenExpirationInSeconds != nil { body["system_refresh_token_expiration_in_seconds"] = updateAccountSettingsOptions.SystemRefreshTokenExpirationInSeconds } + if updateAccountSettingsOptions.RestrictUserListVisibility != nil { + body["restrict_user_list_visibility"] = updateAccountSettingsOptions.RestrictUserListVisibility + } + if updateAccountSettingsOptions.RestrictUserDomains != nil { + body["restrict_user_domains"] = updateAccountSettingsOptions.RestrictUserDomains + } _, err = builder.SetBodyContentJSON(body) if err != nil { err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) @@ -3941,7 +3959,7 @@ func (iamIdentity *IamIdentityV1) GetMfaReportWithContext(ctx context.Context, g pathParamsMap := map[string]string{ "account_id": *getMfaReportOptions.AccountID, - "reference": *getMfaReportOptions.Reference, + "reference": *getMfaReportOptions.Reference, } builder := core.NewRequestBuilder(core.GET) @@ -4000,28 +4018,29 @@ func (iamIdentity *IamIdentityV1) GetMfaReportWithContext(ctx context.Context, g // // - **console/landing_page** // -// service: `console` +// service: `console` // -// preference_id: `landing_page` +// preference_id: `landing_page` // -// supported identity types: `Trusted Profile` +// supported identity types: `Trusted Profile` // -// type: `string` +// type: `string` // -// validation: valid path for the IBM Cloud Console (without host part), e.g. `/billing` or `/iam` +// validation: valid path for the IBM Cloud Console (without host part), e.g. `/billing` or `/iam` // // - **console/global_left_navigation** // -// service: `console` +// service: `console` // -// preference_id: `global_left_navigation` +// preference_id: `global_left_navigation` // -// supported identity types: `Trusted Profile` +// supported identity types: `Trusted Profile` // -// type: `list of strings` +// type: `list of strings` +// +// validation: each entry in the list of strings must match the identifier of one navigation entry in the console; +// these identifiers are defined and interpreted by the IBM Cloud Console; currently the following entries are // -// validation: each entry in the list of strings must match the identifier of one navigation entry in the console; -// these identifiers are defined and interpreted by the IBM Cloud Console; currently the following entries are // supported: // // `slash,projects,rex,containers,databases,is,logmet,automation,complianceAndSecurity,apis,cp4d,partner-center,sap,satellite,vmWare,watsonx` @@ -4054,9 +4073,9 @@ func (iamIdentity *IamIdentityV1) UpdatePreferenceOnScopeAccountWithContext(ctx } pathParamsMap := map[string]string{ - "account_id": *updatePreferenceOnScopeAccountOptions.AccountID, - "iam_id": *updatePreferenceOnScopeAccountOptions.IamID, - "service": *updatePreferenceOnScopeAccountOptions.Service, + "account_id": *updatePreferenceOnScopeAccountOptions.AccountID, + "iam_id": *updatePreferenceOnScopeAccountOptions.IamID, + "service": *updatePreferenceOnScopeAccountOptions.Service, "preference_id": *updatePreferenceOnScopeAccountOptions.PreferenceID, } @@ -4142,9 +4161,9 @@ func (iamIdentity *IamIdentityV1) DeletePreferencesOnScopeAccountWithContext(ctx } pathParamsMap := map[string]string{ - "account_id": *deletePreferencesOnScopeAccountOptions.AccountID, - "iam_id": *deletePreferencesOnScopeAccountOptions.IamID, - "service": *deletePreferencesOnScopeAccountOptions.Service, + "account_id": *deletePreferencesOnScopeAccountOptions.AccountID, + "iam_id": *deletePreferencesOnScopeAccountOptions.IamID, + "service": *deletePreferencesOnScopeAccountOptions.Service, "preference_id": *deletePreferencesOnScopeAccountOptions.PreferenceID, } @@ -4197,7 +4216,7 @@ func (iamIdentity *IamIdentityV1) DeletePreferencesOnScopeAccountWithContext(ctx // // - iam-identity.preferences.update // -// By default, the `Administrator` role on service `iam-identity` contains this action. +// By default, the `Administrator` role on service `iam-identity` contains this action. // // - Services inside the IBM Cloud Console can call this method. func (iamIdentity *IamIdentityV1) GetPreferencesOnScopeAccount(getPreferencesOnScopeAccountOptions *GetPreferencesOnScopeAccountOptions) (result *IdentityPreferenceResponse, response *core.DetailedResponse, err error) { @@ -4220,9 +4239,9 @@ func (iamIdentity *IamIdentityV1) GetPreferencesOnScopeAccountWithContext(ctx co } pathParamsMap := map[string]string{ - "account_id": *getPreferencesOnScopeAccountOptions.AccountID, - "iam_id": *getPreferencesOnScopeAccountOptions.IamID, - "service": *getPreferencesOnScopeAccountOptions.Service, + "account_id": *getPreferencesOnScopeAccountOptions.AccountID, + "iam_id": *getPreferencesOnScopeAccountOptions.IamID, + "service": *getPreferencesOnScopeAccountOptions.Service, "preference_id": *getPreferencesOnScopeAccountOptions.PreferenceID, } @@ -4298,7 +4317,7 @@ func (iamIdentity *IamIdentityV1) GetAllPreferencesOnScopeAccountWithContext(ctx pathParamsMap := map[string]string{ "account_id": *getAllPreferencesOnScopeAccountOptions.AccountID, - "iam_id": *getAllPreferencesOnScopeAccountOptions.IamID, + "iam_id": *getAllPreferencesOnScopeAccountOptions.IamID, } builder := core.NewRequestBuilder(core.GET) @@ -4851,7 +4870,7 @@ func (iamIdentity *IamIdentityV1) GetProfileTemplateVersionWithContext(ctx conte pathParamsMap := map[string]string{ "template_id": *getProfileTemplateVersionOptions.TemplateID, - "version": *getProfileTemplateVersionOptions.Version, + "version": *getProfileTemplateVersionOptions.Version, } builder := core.NewRequestBuilder(core.GET) @@ -4925,7 +4944,7 @@ func (iamIdentity *IamIdentityV1) UpdateProfileTemplateVersionWithContext(ctx co pathParamsMap := map[string]string{ "template_id": *updateProfileTemplateVersionOptions.TemplateID, - "version": *updateProfileTemplateVersionOptions.Version, + "version": *updateProfileTemplateVersionOptions.Version, } builder := core.NewRequestBuilder(core.PUT) @@ -5025,7 +5044,7 @@ func (iamIdentity *IamIdentityV1) DeleteProfileTemplateVersionWithContext(ctx co pathParamsMap := map[string]string{ "template_id": *deleteProfileTemplateVersionOptions.TemplateID, - "version": *deleteProfileTemplateVersionOptions.Version, + "version": *deleteProfileTemplateVersionOptions.Version, } builder := core.NewRequestBuilder(core.DELETE) @@ -5086,7 +5105,7 @@ func (iamIdentity *IamIdentityV1) CommitProfileTemplateWithContext(ctx context.C pathParamsMap := map[string]string{ "template_id": *commitProfileTemplateOptions.TemplateID, - "version": *commitProfileTemplateOptions.Version, + "version": *commitProfileTemplateOptions.Version, } builder := core.NewRequestBuilder(core.POST) @@ -6019,7 +6038,7 @@ func (iamIdentity *IamIdentityV1) GetAccountSettingsTemplateVersionWithContext(c pathParamsMap := map[string]string{ "template_id": *getAccountSettingsTemplateVersionOptions.TemplateID, - "version": *getAccountSettingsTemplateVersionOptions.Version, + "version": *getAccountSettingsTemplateVersionOptions.Version, } builder := core.NewRequestBuilder(core.GET) @@ -6093,7 +6112,7 @@ func (iamIdentity *IamIdentityV1) UpdateAccountSettingsTemplateVersionWithContex pathParamsMap := map[string]string{ "template_id": *updateAccountSettingsTemplateVersionOptions.TemplateID, - "version": *updateAccountSettingsTemplateVersionOptions.Version, + "version": *updateAccountSettingsTemplateVersionOptions.Version, } builder := core.NewRequestBuilder(core.PUT) @@ -6186,7 +6205,7 @@ func (iamIdentity *IamIdentityV1) DeleteAccountSettingsTemplateVersionWithContex pathParamsMap := map[string]string{ "template_id": *deleteAccountSettingsTemplateVersionOptions.TemplateID, - "version": *deleteAccountSettingsTemplateVersionOptions.Version, + "version": *deleteAccountSettingsTemplateVersionOptions.Version, } builder := core.NewRequestBuilder(core.DELETE) @@ -6247,7 +6266,7 @@ func (iamIdentity *IamIdentityV1) CommitAccountSettingsTemplateWithContext(ctx c pathParamsMap := map[string]string{ "template_id": *commitAccountSettingsTemplateOptions.TemplateID, - "version": *commitAccountSettingsTemplateOptions.Version, + "version": *commitAccountSettingsTemplateOptions.Version, } builder := core.NewRequestBuilder(core.POST) @@ -6686,10 +6705,261 @@ func (iamIdentity *IamIdentityV1) UpdateAccountSettingsAssignmentWithContext(ctx return } + +// GetAccountLimits : Get account entity limits +// Returns the details of an account's entity limits with query parameters for consumption details. +func (iamIdentity *IamIdentityV1) GetAccountLimits(getAccountLimitsOptions *GetAccountLimitsOptions) (result *IdentityLimitsUsageResponse, response *core.DetailedResponse, err error) { + result, response, err = iamIdentity.GetAccountLimitsWithContext(context.Background(), getAccountLimitsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAccountLimitsWithContext is an alternate form of the GetAccountLimits method which supports a Context parameter +func (iamIdentity *IamIdentityV1) GetAccountLimitsWithContext(ctx context.Context, getAccountLimitsOptions *GetAccountLimitsOptions) (result *IdentityLimitsUsageResponse, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getAccountLimitsOptions, "getAccountLimitsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(getAccountLimitsOptions, "getAccountLimitsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "account_id": *getAccountLimitsOptions.AccountID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamIdentity.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamIdentity.Service.Options.URL, `/v1/accounts/{account_id}/limits/identity`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "GetAccountLimits") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getAccountLimitsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + if getAccountLimitsOptions.ServiceidGroups != nil { + builder.AddQuery("serviceid_groups", fmt.Sprint(*getAccountLimitsOptions.ServiceidGroups)) + } + if getAccountLimitsOptions.ServiceidsPerGroup != nil { + builder.AddQuery("serviceids_per_group", fmt.Sprint(*getAccountLimitsOptions.ServiceidsPerGroup)) + } + if getAccountLimitsOptions.Profiles != nil { + builder.AddQuery("profiles", fmt.Sprint(*getAccountLimitsOptions.Profiles)) + } + if getAccountLimitsOptions.ApikeysPerIdentity != nil { + builder.AddQuery("apikeys_per_identity", fmt.Sprint(*getAccountLimitsOptions.ApikeysPerIdentity)) + } + if getAccountLimitsOptions.Templates != nil { + builder.AddQuery("templates", fmt.Sprint(*getAccountLimitsOptions.Templates)) + } + if getAccountLimitsOptions.TemplateVersionsPerTemplate != nil { + builder.AddQuery("template_versions_per_template", fmt.Sprint(*getAccountLimitsOptions.TemplateVersionsPerTemplate)) + } + if getAccountLimitsOptions.Idps != nil { + builder.AddQuery("idps", fmt.Sprint(*getAccountLimitsOptions.Idps)) + } + if getAccountLimitsOptions.ClaimRulesPerGroup != nil { + builder.AddQuery("claim_rules_per_group", fmt.Sprint(*getAccountLimitsOptions.ClaimRulesPerGroup)) + } + if getAccountLimitsOptions.ClaimRulesPerProfile != nil { + builder.AddQuery("claim_rules_per_profile", fmt.Sprint(*getAccountLimitsOptions.ClaimRulesPerProfile)) + } + if getAccountLimitsOptions.CrLinks != nil { + builder.AddQuery("cr_links", fmt.Sprint(*getAccountLimitsOptions.CrLinks)) + } + if getAccountLimitsOptions.CrLinksPerProfile != nil { + builder.AddQuery("cr_links_per_profile", fmt.Sprint(*getAccountLimitsOptions.CrLinksPerProfile)) + } + if getAccountLimitsOptions.CrRules != nil { + builder.AddQuery("cr_rules", fmt.Sprint(*getAccountLimitsOptions.CrRules)) + } + if getAccountLimitsOptions.CrRulesPerProfile != nil { + builder.AddQuery("cr_rules_per_profile", fmt.Sprint(*getAccountLimitsOptions.CrRulesPerProfile)) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = iamIdentity.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "getAccountLimits", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIdentityLimitsUsageResponse) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// BulkListAccountEntityConsumption : Get account entity limits via POST request +// Returns the details of an account's entity limits using a body for larger list of parameters for consumption details. +func (iamIdentity *IamIdentityV1) BulkListAccountEntityConsumption(bulkListAccountEntityConsumptionOptions *BulkListAccountEntityConsumptionOptions) (result *IdentityLimitsUsageResponse, response *core.DetailedResponse, err error) { + result, response, err = iamIdentity.BulkListAccountEntityConsumptionWithContext(context.Background(), bulkListAccountEntityConsumptionOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// BulkListAccountEntityConsumptionWithContext is an alternate form of the BulkListAccountEntityConsumption method which supports a Context parameter +func (iamIdentity *IamIdentityV1) BulkListAccountEntityConsumptionWithContext(ctx context.Context, bulkListAccountEntityConsumptionOptions *BulkListAccountEntityConsumptionOptions) (result *IdentityLimitsUsageResponse, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(bulkListAccountEntityConsumptionOptions, "bulkListAccountEntityConsumptionOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(bulkListAccountEntityConsumptionOptions, "bulkListAccountEntityConsumptionOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "account_id": *bulkListAccountEntityConsumptionOptions.AccountID, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamIdentity.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamIdentity.Service.Options.URL, `/v1/accounts/{account_id}/limits/identity`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "BulkListAccountEntityConsumption") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range bulkListAccountEntityConsumptionOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + body := make(map[string]interface{}) + if bulkListAccountEntityConsumptionOptions.ServiceidGroups != nil { + body["serviceid_groups"] = bulkListAccountEntityConsumptionOptions.ServiceidGroups + } + if bulkListAccountEntityConsumptionOptions.ServiceidsPerGroup != nil { + body["serviceids_per_group"] = bulkListAccountEntityConsumptionOptions.ServiceidsPerGroup + } + if bulkListAccountEntityConsumptionOptions.Profiles != nil { + body["profiles"] = bulkListAccountEntityConsumptionOptions.Profiles + } + if bulkListAccountEntityConsumptionOptions.ApikeysPerIdentity != nil { + body["apikeys_per_identity"] = bulkListAccountEntityConsumptionOptions.ApikeysPerIdentity + } + if bulkListAccountEntityConsumptionOptions.Templates != nil { + body["templates"] = bulkListAccountEntityConsumptionOptions.Templates + } + if bulkListAccountEntityConsumptionOptions.TemplateVersionsPerTemplate != nil { + body["template_versions_per_template"] = bulkListAccountEntityConsumptionOptions.TemplateVersionsPerTemplate + } + if bulkListAccountEntityConsumptionOptions.Idps != nil { + body["idps"] = bulkListAccountEntityConsumptionOptions.Idps + } + if bulkListAccountEntityConsumptionOptions.ClaimRulesPerGroup != nil { + body["claim_rules_per_group"] = bulkListAccountEntityConsumptionOptions.ClaimRulesPerGroup + } + if bulkListAccountEntityConsumptionOptions.ClaimRulesPerProfile != nil { + body["claim_rules_per_profile"] = bulkListAccountEntityConsumptionOptions.ClaimRulesPerProfile + } + if bulkListAccountEntityConsumptionOptions.CrLinks != nil { + body["cr_links"] = bulkListAccountEntityConsumptionOptions.CrLinks + } + if bulkListAccountEntityConsumptionOptions.CrLinksPerProfile != nil { + body["cr_links_per_profile"] = bulkListAccountEntityConsumptionOptions.CrLinksPerProfile + } + if bulkListAccountEntityConsumptionOptions.CrRules != nil { + body["cr_rules"] = bulkListAccountEntityConsumptionOptions.CrRules + } + if bulkListAccountEntityConsumptionOptions.CrRulesPerProfile != nil { + body["cr_rules_per_profile"] = bulkListAccountEntityConsumptionOptions.CrRulesPerProfile + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = iamIdentity.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "bulkListAccountEntityConsumption", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalIdentityLimitsUsageResponse) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} func getServiceComponentInfo() *core.ProblemComponent { return core.NewProblemComponent(DefaultServiceName, "1.0.0") } +// AccessGroupCount : Claim rule count for a specific access group. +type AccessGroupCount struct { + // Access group identifier. + GroupID *string `json:"group_id,omitempty"` + + // Number of claim rules for the access group. + Count *int64 `json:"count,omitempty"` +} + +// UnmarshalAccessGroupCount unmarshals an instance of AccessGroupCount from the specified map of raw messages. +func UnmarshalAccessGroupCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccessGroupCount) + err = core.UnmarshalPrimitive(m, "group_id", &obj.GroupID) + if err != nil { + err = core.SDKErrorf(err, "", "group_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "count", &obj.Count) + if err != nil { + err = core.SDKErrorf(err, "", "count-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // AccountBasedMfaEnrollment : AccountBasedMfaEnrollment struct type AccountBasedMfaEnrollment struct { SecurityQuestions *MfaEnrollmentTypeStatus `json:"security_questions" validate:"required"` @@ -6729,43 +6999,44 @@ func UnmarshalAccountBasedMfaEnrollment(m map[string]json.RawMessage, result int return } -// AccountSettingsAccountSection : AccountSettingsAccountSection struct -type AccountSettingsAccountSection struct { - // Unique ID of the account. - AccountID *string `json:"account_id,omitempty"` +// AccountSettingsAssignedTemplatesSection : Input body parameters for the Account Settings REST request. +type AccountSettingsAssignedTemplatesSection struct { + // Template Id. + TemplateID *string `json:"template_id" validate:"required"` + + // Template version. + TemplateVersion *int64 `json:"template_version" validate:"required"` - // Defines whether or not creating a service ID is access controlled. Valid values: + // Template name. + TemplateName *string `json:"template_name" validate:"required"` + + // Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` - // Defines whether or not creating platform API keys is access controlled. Valid values: - // * RESTRICTED - to apply access control - // * NOT_RESTRICTED - to remove access control + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` // Defines the IP addresses and subnets from which IAM tokens can be created for the account. AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` - // Defines the MFA requirement for the user. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * 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. + // * LEVEL3 - Security Key MFA for all users. Mfa *string `json:"mfa,omitempty"` - // List of users that are exempted from the MFA requirement of the account. - UserMfa []EffectiveAccountSettingsUserMfa `json:"user_mfa,omitempty"` - - // History of the Account Settings. - History []EnityHistoryRecord `json:"history,omitempty"` - // 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. @@ -6790,56 +7061,94 @@ type AccountSettingsAccountSection struct { // * Any whole number between '900' and '259200' // * NOT_SET - To unset account setting and use service default. SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` + + // Defines whether or not user visibility is access controlled. Valid values: + // * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to + // the account, or descendants of those users based on the classic infrastructure hierarchy + // * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console + // * NOT_SET - to 'unset' a previous set value. + RestrictUserListVisibility *string `json:"restrict_user_list_visibility,omitempty"` + + // List of users that are exempted from the MFA requirement of the account. + UserMfa []AccountSettingsUserMfaResponse `json:"user_mfa,omitempty"` + + RestrictUserDomains *AssignedTemplatesAccountSettingsRestrictUserDomains `json:"restrict_user_domains,omitempty"` } -// Constants associated with the AccountSettingsAccountSection.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: -// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// Constants associated with the AccountSettingsAssignedTemplatesSection.RestrictCreateServiceID property. +// Defines whether or not creating the resource is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// +// IDs, including the account owner +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. +const ( + AccountSettingsAssignedTemplatesSectionRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsAssignedTemplatesSectionRestrictCreateServiceIDNotSetConst = "NOT_SET" + AccountSettingsAssignedTemplatesSectionRestrictCreateServiceIDRestrictedConst = "RESTRICTED" +) + +// Constants associated with the AccountSettingsAssignedTemplatesSection.RestrictCreatePlatformApikey property. +// Defines whether or not creating the resource is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// // IDs, including the account owner -// * NOT_RESTRICTED - all members of an account can create service IDs -// * NOT_SET - to 'unset' a previous set value. +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. const ( - AccountSettingsAccountSectionRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsAccountSectionRestrictCreateServiceIDNotSetConst = "NOT_SET" - AccountSettingsAccountSectionRestrictCreateServiceIDRestrictedConst = "RESTRICTED" + AccountSettingsAssignedTemplatesSectionRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsAssignedTemplatesSectionRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" + AccountSettingsAssignedTemplatesSectionRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" ) -// Constants associated with the AccountSettingsAccountSection.RestrictCreatePlatformApikey property. -// 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. +// Constants associated with the AccountSettingsAssignedTemplatesSection.Mfa property. +// MFA trait definitions as follows: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - 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 - Security Key MFA for all users. const ( - AccountSettingsAccountSectionRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsAccountSectionRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" - AccountSettingsAccountSectionRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" + AccountSettingsAssignedTemplatesSectionMfaLevel1Const = "LEVEL1" + AccountSettingsAssignedTemplatesSectionMfaLevel2Const = "LEVEL2" + AccountSettingsAssignedTemplatesSectionMfaLevel3Const = "LEVEL3" + AccountSettingsAssignedTemplatesSectionMfaNoneConst = "NONE" + AccountSettingsAssignedTemplatesSectionMfaNoneNoRopcConst = "NONE_NO_ROPC" + AccountSettingsAssignedTemplatesSectionMfaTotpConst = "TOTP" + AccountSettingsAssignedTemplatesSectionMfaTotp4allConst = "TOTP4ALL" ) -// Constants associated with the AccountSettingsAccountSection.Mfa property. -// Defines the MFA requirement for the user. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * 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. +// Constants associated with the AccountSettingsAssignedTemplatesSection.RestrictUserListVisibility property. +// Defines whether or not user visibility is access controlled. Valid values: +// - RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to +// +// the account, or descendants of those users based on the classic infrastructure hierarchy +// - NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console +// - NOT_SET - to 'unset' a previous set value. const ( - AccountSettingsAccountSectionMfaLevel1Const = "LEVEL1" - AccountSettingsAccountSectionMfaLevel2Const = "LEVEL2" - AccountSettingsAccountSectionMfaLevel3Const = "LEVEL3" - AccountSettingsAccountSectionMfaNoneConst = "NONE" - AccountSettingsAccountSectionMfaNoneNoRopcConst = "NONE_NO_ROPC" - AccountSettingsAccountSectionMfaTotpConst = "TOTP" - AccountSettingsAccountSectionMfaTotp4allConst = "TOTP4ALL" + AccountSettingsAssignedTemplatesSectionRestrictUserListVisibilityNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsAssignedTemplatesSectionRestrictUserListVisibilityNotSetConst = "NOT_SET" + AccountSettingsAssignedTemplatesSectionRestrictUserListVisibilityRestrictedConst = "RESTRICTED" ) -// UnmarshalAccountSettingsAccountSection unmarshals an instance of AccountSettingsAccountSection from the specified map of raw messages. -func UnmarshalAccountSettingsAccountSection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountSettingsAccountSection) - err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) +// UnmarshalAccountSettingsAssignedTemplatesSection unmarshals an instance of AccountSettingsAssignedTemplatesSection from the specified map of raw messages. +func UnmarshalAccountSettingsAssignedTemplatesSection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsAssignedTemplatesSection) + err = core.UnmarshalPrimitive(m, "template_id", &obj.TemplateID) if err != nil { - err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "template_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "template_version", &obj.TemplateVersion) + if err != nil { + err = core.SDKErrorf(err, "", "template_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "template_name", &obj.TemplateName) + if err != nil { + err = core.SDKErrorf(err, "", "template_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) @@ -6862,16 +7171,6 @@ func UnmarshalAccountSettingsAccountSection(m map[string]json.RawMessage, result err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalEffectiveAccountSettingsUserMfa) - if err != nil { - err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "history", &obj.History, UnmarshalEnityHistoryRecord) - if err != nil { - err = core.SDKErrorf(err, "", "history-error", common.GetComponentInfo()) - return - } err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) if err != nil { err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) @@ -6897,376 +7196,62 @@ func UnmarshalAccountSettingsAccountSection(m map[string]json.RawMessage, result err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "restrict_user_list_visibility", &obj.RestrictUserListVisibility) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_list_visibility-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfaResponse) + if err != nil { + err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "restrict_user_domains", &obj.RestrictUserDomains, UnmarshalAssignedTemplatesAccountSettingsRestrictUserDomains) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_domains-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// AccountSettingsAssignedTemplatesSection : AccountSettingsAssignedTemplatesSection struct -type AccountSettingsAssignedTemplatesSection struct { - // Template Id. - TemplateID *string `json:"template_id,omitempty"` - - // Template version. - TemplateVersion *int64 `json:"template_version,omitempty"` - - // Template name. - TemplateName *string `json:"template_name,omitempty"` - - // Defines whether or not creating a service ID is access controlled. Valid values: +// AccountSettingsEffectiveSection : AccountSettingsEffectiveSection struct +type AccountSettingsEffectiveSection struct { + // Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` - // Defines whether or not creating platform API keys is access controlled. Valid values: - // * RESTRICTED - to apply access control - // * NOT_RESTRICTED - to remove access control + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` + // Defines whether or not user visibility is access controlled. Valid values: + // * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to + // the account, or descendants of those users based on the classic infrastructure hierarchy + // * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. + RestrictUserListVisibility *string `json:"restrict_user_list_visibility,omitempty"` + // Defines the IP addresses and subnets from which IAM tokens can be created for the account. AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` - // Defines the MFA requirement for the user. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * 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. + // * LEVEL3 - Security Key MFA for all users. Mfa *string `json:"mfa,omitempty"` // List of users that are exempted from the MFA requirement of the account. - UserMfa []EffectiveAccountSettingsUserMfa `json:"user_mfa,omitempty"` - - // 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. - SessionExpirationInSeconds *string `json:"session_expiration_in_seconds,omitempty"` - - // 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. - SessionInvalidationInSeconds *string `json:"session_invalidation_in_seconds,omitempty"` - - // Defines the max allowed sessions per identity required by the account. Valid values: - // * Any whole number greater than 0 - // * NOT_SET - To unset account setting and use service default. - MaxSessionsPerIdentity *string `json:"max_sessions_per_identity,omitempty"` - - // Defines the access token expiration in seconds. Valid values: - // * Any whole number between '900' and '3600' - // * NOT_SET - To unset account setting and use service default. - SystemAccessTokenExpirationInSeconds *string `json:"system_access_token_expiration_in_seconds,omitempty"` - - // Defines the refresh token expiration in seconds. Valid values: - // * Any whole number between '900' and '259200' - // * NOT_SET - To unset account setting and use service default. - SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` -} - -// Constants associated with the AccountSettingsAssignedTemplatesSection.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: -// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service -// IDs, including the account owner -// * NOT_RESTRICTED - all members of an account can create service IDs -// * NOT_SET - to 'unset' a previous set value. -const ( - AccountSettingsAssignedTemplatesSectionRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsAssignedTemplatesSectionRestrictCreateServiceIDNotSetConst = "NOT_SET" - AccountSettingsAssignedTemplatesSectionRestrictCreateServiceIDRestrictedConst = "RESTRICTED" -) - -// Constants associated with the AccountSettingsAssignedTemplatesSection.RestrictCreatePlatformApikey property. -// 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. -const ( - AccountSettingsAssignedTemplatesSectionRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsAssignedTemplatesSectionRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" - AccountSettingsAssignedTemplatesSectionRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" -) - -// Constants associated with the AccountSettingsAssignedTemplatesSection.Mfa property. -// Defines the MFA requirement for the user. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * 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. -const ( - AccountSettingsAssignedTemplatesSectionMfaLevel1Const = "LEVEL1" - AccountSettingsAssignedTemplatesSectionMfaLevel2Const = "LEVEL2" - AccountSettingsAssignedTemplatesSectionMfaLevel3Const = "LEVEL3" - AccountSettingsAssignedTemplatesSectionMfaNoneConst = "NONE" - AccountSettingsAssignedTemplatesSectionMfaNoneNoRopcConst = "NONE_NO_ROPC" - AccountSettingsAssignedTemplatesSectionMfaTotpConst = "TOTP" - AccountSettingsAssignedTemplatesSectionMfaTotp4allConst = "TOTP4ALL" -) - -// UnmarshalAccountSettingsAssignedTemplatesSection unmarshals an instance of AccountSettingsAssignedTemplatesSection from the specified map of raw messages. -func UnmarshalAccountSettingsAssignedTemplatesSection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountSettingsAssignedTemplatesSection) - err = core.UnmarshalPrimitive(m, "template_id", &obj.TemplateID) - if err != nil { - err = core.SDKErrorf(err, "", "template_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "template_version", &obj.TemplateVersion) - if err != nil { - err = core.SDKErrorf(err, "", "template_version-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "template_name", &obj.TemplateName) - if err != nil { - err = core.SDKErrorf(err, "", "template_name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) - if err != nil { - err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "restrict_create_platform_apikey", &obj.RestrictCreatePlatformApikey) - if err != nil { - err = core.SDKErrorf(err, "", "restrict_create_platform_apikey-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "allowed_ip_addresses", &obj.AllowedIPAddresses) - if err != nil { - err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) - if err != nil { - err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalEffectiveAccountSettingsUserMfa) - if err != nil { - err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "session_invalidation_in_seconds", &obj.SessionInvalidationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "session_invalidation_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "max_sessions_per_identity", &obj.MaxSessionsPerIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "max_sessions_per_identity-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "system_access_token_expiration_in_seconds", &obj.SystemAccessTokenExpirationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "system_access_token_expiration_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "system_refresh_token_expiration_in_seconds", &obj.SystemRefreshTokenExpirationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AccountSettingsComponent : AccountSettingsComponent struct -type AccountSettingsComponent struct { - // Defines whether or not creating a service ID is access controlled. Valid values: - // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service - // IDs, including the account owner - // * NOT_RESTRICTED - all members of an account can create service IDs - // * NOT_SET - to 'unset' a previous set value. - RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` - - // 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. - RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` - - // Defines the IP addresses and subnets from which IAM tokens can be created for the account. - AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` - - // Defines the MFA trait for the account. Valid values: - // * NONE - No MFA trait set - // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - // * 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. - Mfa *string `json:"mfa,omitempty"` - - // List of users that are exempted from the MFA requirement of the account. - UserMfa []AccountSettingsUserMfa `json:"user_mfa,omitempty"` - - // 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. - SessionExpirationInSeconds *string `json:"session_expiration_in_seconds,omitempty"` - - // 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. - SessionInvalidationInSeconds *string `json:"session_invalidation_in_seconds,omitempty"` - - // Defines the max allowed sessions per identity required by the account. Valid values: - // * Any whole number greater than 0 - // * NOT_SET - To unset account setting and use service default. - MaxSessionsPerIdentity *string `json:"max_sessions_per_identity,omitempty"` - - // Defines the access token expiration in seconds. Valid values: - // * Any whole number between '900' and '3600' - // * NOT_SET - To unset account setting and use service default. - SystemAccessTokenExpirationInSeconds *string `json:"system_access_token_expiration_in_seconds,omitempty"` - - // Defines the refresh token expiration in seconds. Valid values: - // * Any whole number between '900' and '259200' - // * NOT_SET - To unset account setting and use service default. - SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` -} - -// Constants associated with the AccountSettingsComponent.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: -// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service -// IDs, including the account owner -// * NOT_RESTRICTED - all members of an account can create service IDs -// * NOT_SET - to 'unset' a previous set value. -const ( - AccountSettingsComponentRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsComponentRestrictCreateServiceIDNotSetConst = "NOT_SET" - AccountSettingsComponentRestrictCreateServiceIDRestrictedConst = "RESTRICTED" -) - -// Constants associated with the AccountSettingsComponent.RestrictCreatePlatformApikey property. -// 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. -const ( - AccountSettingsComponentRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsComponentRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" - AccountSettingsComponentRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" -) - -// Constants associated with the AccountSettingsComponent.Mfa property. -// Defines the MFA trait for the account. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * 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. -const ( - AccountSettingsComponentMfaLevel1Const = "LEVEL1" - AccountSettingsComponentMfaLevel2Const = "LEVEL2" - AccountSettingsComponentMfaLevel3Const = "LEVEL3" - AccountSettingsComponentMfaNoneConst = "NONE" - AccountSettingsComponentMfaNoneNoRopcConst = "NONE_NO_ROPC" - AccountSettingsComponentMfaTotpConst = "TOTP" - AccountSettingsComponentMfaTotp4allConst = "TOTP4ALL" -) - -// UnmarshalAccountSettingsComponent unmarshals an instance of AccountSettingsComponent from the specified map of raw messages. -func UnmarshalAccountSettingsComponent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountSettingsComponent) - err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) - if err != nil { - err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "restrict_create_platform_apikey", &obj.RestrictCreatePlatformApikey) - if err != nil { - err = core.SDKErrorf(err, "", "restrict_create_platform_apikey-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "allowed_ip_addresses", &obj.AllowedIPAddresses) - if err != nil { - err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) - if err != nil { - err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfa) - if err != nil { - err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "session_invalidation_in_seconds", &obj.SessionInvalidationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "session_invalidation_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "max_sessions_per_identity", &obj.MaxSessionsPerIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "max_sessions_per_identity-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "system_access_token_expiration_in_seconds", &obj.SystemAccessTokenExpirationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "system_access_token_expiration_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "system_refresh_token_expiration_in_seconds", &obj.SystemRefreshTokenExpirationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AccountSettingsEffectiveSection : AccountSettingsEffectiveSection struct -type AccountSettingsEffectiveSection struct { - // Defines whether or not creating a service ID is access controlled. Valid values: - // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service - // IDs, including the account owner - // * NOT_RESTRICTED - all members of an account can create service IDs - // * NOT_SET - to 'unset' a previous set value. - RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` - - // 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. - RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` - - // Defines the IP addresses and subnets from which IAM tokens can be created for the account. - AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` - - // Defines the MFA requirement for the user. Valid values: - // * NONE - No MFA trait set - // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - // * 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. - Mfa *string `json:"mfa,omitempty"` - - // List of users that are exempted from the MFA requirement of the account. - UserMfa []EffectiveAccountSettingsUserMfa `json:"user_mfa,omitempty"` + UserMfa []AccountSettingsUserMfaResponse `json:"user_mfa,omitempty"` // Defines the session expiration in seconds for the account. Valid values: // * Any whole number between between '900' and '86400' @@ -7295,45 +7280,59 @@ type AccountSettingsEffectiveSection struct { } // Constants associated with the AccountSettingsEffectiveSection.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: -// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// Defines whether or not creating the resource is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// // IDs, including the account owner -// * NOT_RESTRICTED - all members of an account can create service IDs -// * NOT_SET - to 'unset' a previous set value. +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. const ( AccountSettingsEffectiveSectionRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsEffectiveSectionRestrictCreateServiceIDNotSetConst = "NOT_SET" - AccountSettingsEffectiveSectionRestrictCreateServiceIDRestrictedConst = "RESTRICTED" + AccountSettingsEffectiveSectionRestrictCreateServiceIDNotSetConst = "NOT_SET" + AccountSettingsEffectiveSectionRestrictCreateServiceIDRestrictedConst = "RESTRICTED" ) // Constants associated with the AccountSettingsEffectiveSection.RestrictCreatePlatformApikey property. -// 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. +// Defines whether or not creating the resource is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// +// IDs, including the account owner +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. const ( AccountSettingsEffectiveSectionRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsEffectiveSectionRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" - AccountSettingsEffectiveSectionRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" + AccountSettingsEffectiveSectionRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" + AccountSettingsEffectiveSectionRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" +) + +// Constants associated with the AccountSettingsEffectiveSection.RestrictUserListVisibility property. +// Defines whether or not user visibility is access controlled. Valid values: +// - RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to +// +// the account, or descendants of those users based on the classic infrastructure hierarchy +// - NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. +const ( + AccountSettingsEffectiveSectionRestrictUserListVisibilityNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsEffectiveSectionRestrictUserListVisibilityRestrictedConst = "RESTRICTED" ) // Constants associated with the AccountSettingsEffectiveSection.Mfa property. -// Defines the MFA requirement for the user. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * 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. +// MFA trait definitions as follows: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - 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 - Security Key MFA for all users. const ( - AccountSettingsEffectiveSectionMfaLevel1Const = "LEVEL1" - AccountSettingsEffectiveSectionMfaLevel2Const = "LEVEL2" - AccountSettingsEffectiveSectionMfaLevel3Const = "LEVEL3" - AccountSettingsEffectiveSectionMfaNoneConst = "NONE" + AccountSettingsEffectiveSectionMfaLevel1Const = "LEVEL1" + AccountSettingsEffectiveSectionMfaLevel2Const = "LEVEL2" + AccountSettingsEffectiveSectionMfaLevel3Const = "LEVEL3" + AccountSettingsEffectiveSectionMfaNoneConst = "NONE" AccountSettingsEffectiveSectionMfaNoneNoRopcConst = "NONE_NO_ROPC" - AccountSettingsEffectiveSectionMfaTotpConst = "TOTP" - AccountSettingsEffectiveSectionMfaTotp4allConst = "TOTP4ALL" + AccountSettingsEffectiveSectionMfaTotpConst = "TOTP" + AccountSettingsEffectiveSectionMfaTotp4allConst = "TOTP4ALL" ) // UnmarshalAccountSettingsEffectiveSection unmarshals an instance of AccountSettingsEffectiveSection from the specified map of raw messages. @@ -7349,6 +7348,11 @@ func UnmarshalAccountSettingsEffectiveSection(m map[string]json.RawMessage, resu err = core.SDKErrorf(err, "", "restrict_create_platform_apikey-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "restrict_user_list_visibility", &obj.RestrictUserListVisibility) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_list_visibility-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "allowed_ip_addresses", &obj.AllowedIPAddresses) if err != nil { err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) @@ -7359,7 +7363,7 @@ func UnmarshalAccountSettingsEffectiveSection(m map[string]json.RawMessage, resu err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalEffectiveAccountSettingsUserMfa) + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfaResponse) if err != nil { err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) return @@ -7393,7 +7397,7 @@ func UnmarshalAccountSettingsEffectiveSection(m map[string]json.RawMessage, resu return } -// AccountSettingsResponse : Response body format for Account Settings REST requests. +// AccountSettingsResponse : Input body parameters for the Account Settings REST request. type AccountSettingsResponse struct { // Context with key properties for problem determination. Context *ResponseContext `json:"context,omitempty"` @@ -7401,41 +7405,39 @@ type AccountSettingsResponse struct { // Unique ID of the account. AccountID *string `json:"account_id" validate:"required"` - // Defines whether or not creating a service ID is access controlled. Valid values: + // Version of the account settings. + EntityTag *string `json:"entity_tag" validate:"required"` + + // History of the Account Settings. + History []EnityHistoryRecord `json:"history,omitempty"` + + // Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreateServiceID *string `json:"restrict_create_service_id" validate:"required"` - // Defines whether or not creating platform API keys is access controlled. Valid values: - // * RESTRICTED - to apply access control - // * NOT_RESTRICTED - to remove access control + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey" validate:"required"` // Defines the IP addresses and subnets from which IAM tokens can be created for the account. AllowedIPAddresses *string `json:"allowed_ip_addresses" validate:"required"` - // Version of the account settings. - EntityTag *string `json:"entity_tag" validate:"required"` - - // Defines the MFA trait for the account. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * 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. + // * LEVEL3 - Security Key MFA for all users. Mfa *string `json:"mfa" validate:"required"` - // List of users that are exempted from the MFA requirement of the account. - UserMfa []AccountSettingsUserMfa `json:"user_mfa" validate:"required"` - - // History of the Account Settings. - History []EnityHistoryRecord `json:"history,omitempty"` - // 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. @@ -7460,48 +7462,75 @@ type AccountSettingsResponse struct { // * Any whole number between '900' and '259200' // * NOT_SET - To unset account setting and use service default. SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds" validate:"required"` + + // Defines whether or not user visibility is access controlled. Valid values: + // * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to + // the account, or descendants of those users based on the classic infrastructure hierarchy + // * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. + RestrictUserListVisibility *string `json:"restrict_user_list_visibility" validate:"required"` + + // List of users that are exempted from the MFA requirement of the account. + UserMfa []AccountSettingsUserMfaResponse `json:"user_mfa" validate:"required"` + + // Defines if account invitations are restricted to specified domains. To remove an entry for a realm_id, perform an + // update (PUT) request with only the realm_id set. + RestrictUserDomains []AccountSettingsUserDomainRestriction `json:"restrict_user_domains" validate:"required"` } // Constants associated with the AccountSettingsResponse.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: -// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// Defines whether or not creating the resource is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// // IDs, including the account owner -// * NOT_RESTRICTED - all members of an account can create service IDs -// * NOT_SET - to 'unset' a previous set value. +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. const ( AccountSettingsResponseRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsResponseRestrictCreateServiceIDNotSetConst = "NOT_SET" - AccountSettingsResponseRestrictCreateServiceIDRestrictedConst = "RESTRICTED" + AccountSettingsResponseRestrictCreateServiceIDNotSetConst = "NOT_SET" + AccountSettingsResponseRestrictCreateServiceIDRestrictedConst = "RESTRICTED" ) // Constants associated with the AccountSettingsResponse.RestrictCreatePlatformApikey property. -// 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. +// Defines whether or not creating the resource is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// +// IDs, including the account owner +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. const ( AccountSettingsResponseRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsResponseRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" - AccountSettingsResponseRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" + AccountSettingsResponseRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" + AccountSettingsResponseRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" ) // Constants associated with the AccountSettingsResponse.Mfa property. -// Defines the MFA trait for the account. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * 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. +// MFA trait definitions as follows: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - 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 - Security Key MFA for all users. const ( - AccountSettingsResponseMfaLevel1Const = "LEVEL1" - AccountSettingsResponseMfaLevel2Const = "LEVEL2" - AccountSettingsResponseMfaLevel3Const = "LEVEL3" - AccountSettingsResponseMfaNoneConst = "NONE" + AccountSettingsResponseMfaLevel1Const = "LEVEL1" + AccountSettingsResponseMfaLevel2Const = "LEVEL2" + AccountSettingsResponseMfaLevel3Const = "LEVEL3" + AccountSettingsResponseMfaNoneConst = "NONE" AccountSettingsResponseMfaNoneNoRopcConst = "NONE_NO_ROPC" - AccountSettingsResponseMfaTotpConst = "TOTP" - AccountSettingsResponseMfaTotp4allConst = "TOTP4ALL" + AccountSettingsResponseMfaTotpConst = "TOTP" + AccountSettingsResponseMfaTotp4allConst = "TOTP4ALL" +) + +// Constants associated with the AccountSettingsResponse.RestrictUserListVisibility property. +// Defines whether or not user visibility is access controlled. Valid values: +// - RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to +// +// the account, or descendants of those users based on the classic infrastructure hierarchy +// - NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. +const ( + AccountSettingsResponseRestrictUserListVisibilityNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsResponseRestrictUserListVisibilityRestrictedConst = "RESTRICTED" ) // UnmarshalAccountSettingsResponse unmarshals an instance of AccountSettingsResponse from the specified map of raw messages. @@ -7517,6 +7546,16 @@ func UnmarshalAccountSettingsResponse(m map[string]json.RawMessage, result inter err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "entity_tag", &obj.EntityTag) + if err != nil { + err = core.SDKErrorf(err, "", "entity_tag-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "history", &obj.History, UnmarshalEnityHistoryRecord) + if err != nil { + err = core.SDKErrorf(err, "", "history-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) if err != nil { err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) @@ -7532,26 +7571,11 @@ func UnmarshalAccountSettingsResponse(m map[string]json.RawMessage, result inter err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "entity_tag", &obj.EntityTag) - if err != nil { - err = core.SDKErrorf(err, "", "entity_tag-error", common.GetComponentInfo()) - return - } err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) if err != nil { err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfa) - if err != nil { - err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "history", &obj.History, UnmarshalEnityHistoryRecord) - if err != nil { - err = core.SDKErrorf(err, "", "history-error", common.GetComponentInfo()) - return - } err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) if err != nil { err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) @@ -7577,6 +7601,21 @@ func UnmarshalAccountSettingsResponse(m map[string]json.RawMessage, result inter err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "restrict_user_list_visibility", &obj.RestrictUserListVisibility) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_list_visibility-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfaResponse) + if err != nil { + err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "restrict_user_domains", &obj.RestrictUserDomains, UnmarshalAccountSettingsUserDomainRestriction) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_domains-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -7669,7 +7708,8 @@ type AccountSettingsTemplateResponse struct { // Committed flag determines if the template is ready for assignment. Committed *bool `json:"committed" validate:"required"` - AccountSettings *AccountSettingsComponent `json:"account_settings" validate:"required"` + // Input body parameters for the Account Settings REST request. + AccountSettings *TemplateAccountSettings `json:"account_settings" validate:"required"` // History of the Template. History []EnityHistoryRecord `json:"history,omitempty"` @@ -7726,7 +7766,7 @@ func UnmarshalAccountSettingsTemplateResponse(m map[string]json.RawMessage, resu err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "account_settings", &obj.AccountSettings, UnmarshalAccountSettingsComponent) + err = core.UnmarshalModel(m, "account_settings", &obj.AccountSettings, UnmarshalTemplateAccountSettings) if err != nil { err = core.SDKErrorf(err, "", "account_settings-error", common.GetComponentInfo()) return @@ -7770,65 +7810,132 @@ func UnmarshalAccountSettingsTemplateResponse(m map[string]json.RawMessage, resu return } -// AccountSettingsUserMfa : AccountSettingsUserMfa struct -type AccountSettingsUserMfa struct { +// AccountSettingsUserDomainRestriction : Input body parameters for the Account Settings REST request. +type AccountSettingsUserDomainRestriction struct { + // The realm that the restrictions apply to. + RealmID *string `json:"realm_id" validate:"required"` + + // The list of allowed email patterns. Wildcard syntax is supported, '*' represents any sequence of zero or more + // characters in the string, except for '.' and '@'. The sequence ends if a '.' or '@' was found. '**' represents any + // sequence of zero or more characters in the string - without limit. + InvitationEmailAllowPatterns []string `json:"invitation_email_allow_patterns,omitempty"` + + // When true invites will only be possible to the domain patterns provided, otherwise invites are unrestricted. + RestrictInvitation *bool `json:"restrict_invitation,omitempty"` +} + +// NewAccountSettingsUserDomainRestriction : Instantiate AccountSettingsUserDomainRestriction (Generic Model Constructor) +func (*IamIdentityV1) NewAccountSettingsUserDomainRestriction(realmID string) (_model *AccountSettingsUserDomainRestriction, err error) { + _model = &AccountSettingsUserDomainRestriction{ + RealmID: core.StringPtr(realmID), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalAccountSettingsUserDomainRestriction unmarshals an instance of AccountSettingsUserDomainRestriction from the specified map of raw messages. +func UnmarshalAccountSettingsUserDomainRestriction(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsUserDomainRestriction) + err = core.UnmarshalPrimitive(m, "realm_id", &obj.RealmID) + if err != nil { + err = core.SDKErrorf(err, "", "realm_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "invitation_email_allow_patterns", &obj.InvitationEmailAllowPatterns) + if err != nil { + err = core.SDKErrorf(err, "", "invitation_email_allow_patterns-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "restrict_invitation", &obj.RestrictInvitation) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_invitation-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AccountSettingsUserMfaResponse : AccountSettingsUserMfaResponse struct +type AccountSettingsUserMfaResponse struct { // The iam_id of the user. IamID *string `json:"iam_id" validate:"required"` - // Defines the MFA requirement for the user. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * 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. + // * LEVEL3 - Security Key MFA for all users. Mfa *string `json:"mfa" validate:"required"` + + // name of the user account. + Name *string `json:"name,omitempty"` + + // userName of the user. + UserName *string `json:"userName,omitempty"` + + // email of the user. + Email *string `json:"email,omitempty"` + + // optional description. + Description *string `json:"description,omitempty"` } -// Constants associated with the AccountSettingsUserMfa.Mfa property. -// Defines the MFA requirement for the user. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * 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. +// Constants associated with the AccountSettingsUserMfaResponse.Mfa property. +// MFA trait definitions as follows: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - 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 - Security Key MFA for all users. const ( - AccountSettingsUserMfaMfaLevel1Const = "LEVEL1" - AccountSettingsUserMfaMfaLevel2Const = "LEVEL2" - AccountSettingsUserMfaMfaLevel3Const = "LEVEL3" - AccountSettingsUserMfaMfaNoneConst = "NONE" - AccountSettingsUserMfaMfaNoneNoRopcConst = "NONE_NO_ROPC" - AccountSettingsUserMfaMfaTotpConst = "TOTP" - AccountSettingsUserMfaMfaTotp4allConst = "TOTP4ALL" + AccountSettingsUserMfaResponseMfaLevel1Const = "LEVEL1" + AccountSettingsUserMfaResponseMfaLevel2Const = "LEVEL2" + AccountSettingsUserMfaResponseMfaLevel3Const = "LEVEL3" + AccountSettingsUserMfaResponseMfaNoneConst = "NONE" + AccountSettingsUserMfaResponseMfaNoneNoRopcConst = "NONE_NO_ROPC" + AccountSettingsUserMfaResponseMfaTotpConst = "TOTP" + AccountSettingsUserMfaResponseMfaTotp4allConst = "TOTP4ALL" ) -// NewAccountSettingsUserMfa : Instantiate AccountSettingsUserMfa (Generic Model Constructor) -func (*IamIdentityV1) NewAccountSettingsUserMfa(iamID string, mfa string) (_model *AccountSettingsUserMfa, err error) { - _model = &AccountSettingsUserMfa{ - IamID: core.StringPtr(iamID), - Mfa: core.StringPtr(mfa), +// UnmarshalAccountSettingsUserMfaResponse unmarshals an instance of AccountSettingsUserMfaResponse from the specified map of raw messages. +func UnmarshalAccountSettingsUserMfaResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsUserMfaResponse) + err = core.UnmarshalPrimitive(m, "iam_id", &obj.IamID) + if err != nil { + err = core.SDKErrorf(err, "", "iam_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) + if err != nil { + err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return } - err = core.ValidateStruct(_model, "required parameters") + err = core.UnmarshalPrimitive(m, "userName", &obj.UserName) if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "userName-error", common.GetComponentInfo()) + return } - return -} - -// UnmarshalAccountSettingsUserMfa unmarshals an instance of AccountSettingsUserMfa from the specified map of raw messages. -func UnmarshalAccountSettingsUserMfa(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountSettingsUserMfa) - err = core.UnmarshalPrimitive(m, "iam_id", &obj.IamID) + err = core.UnmarshalPrimitive(m, "email", &obj.Email) if err != nil { - err = core.SDKErrorf(err, "", "iam_id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "email-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) + err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7847,7 +7954,7 @@ type ActionControls struct { // NewActionControls : Instantiate ActionControls (Generic Model Constructor) func (*IamIdentityV1) NewActionControls(rules *ActionControlsRules, policies *ActionControlsPolicies) (_model *ActionControls, err error) { _model = &ActionControls{ - Rules: rules, + Rules: rules, Policies: policies, } err = core.ValidateStruct(_model, "required parameters") @@ -7889,7 +7996,7 @@ type ActionControlsIdentities struct { // NewActionControlsIdentities : Instantiate ActionControlsIdentities (Generic Model Constructor) func (*IamIdentityV1) NewActionControlsIdentities(add bool, remove bool) (_model *ActionControlsIdentities, err error) { _model = &ActionControlsIdentities{ - Add: core.BoolPtr(add), + Add: core.BoolPtr(add), Remove: core.BoolPtr(remove), } err = core.ValidateStruct(_model, "required parameters") @@ -7926,7 +8033,7 @@ type ActionControlsPolicies struct { // NewActionControlsPolicies : Instantiate ActionControlsPolicies (Generic Model Constructor) func (*IamIdentityV1) NewActionControlsPolicies(add bool, remove bool) (_model *ActionControlsPolicies, err error) { _model = &ActionControlsPolicies{ - Add: core.BoolPtr(add), + Add: core.BoolPtr(add), Remove: core.BoolPtr(remove), } err = core.ValidateStruct(_model, "required parameters") @@ -7963,7 +8070,7 @@ type ActionControlsRules struct { // NewActionControlsRules : Instantiate ActionControlsRules (Generic Model Constructor) func (*IamIdentityV1) NewActionControlsRules(add bool, remove bool) (_model *ActionControlsRules, err error) { _model = &ActionControlsRules{ - Add: core.BoolPtr(add), + Add: core.BoolPtr(add), Remove: core.BoolPtr(remove), } err = core.ValidateStruct(_model, "required parameters") @@ -8059,6 +8166,11 @@ type APIKey struct { // Defines the action to take when API key is leaked, valid values are 'none', 'disable' and 'delete'. ActionWhenLeaked *string `json:"action_when_leaked,omitempty"` + // Date and time when the API key becomes invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. **WARNING** + // An API key will be permanently and irrevocably deleted when both the expires_at and modified_at timestamps are more + // than ninety (90) days in the past, regardless of the key’s locked status or any other state. + ExpiresAt *string `json:"expires_at,omitempty"` + // 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. Description *string `json:"description,omitempty"` @@ -8144,6 +8256,11 @@ func UnmarshalAPIKey(m map[string]json.RawMessage, result interface{}) (err erro err = core.SDKErrorf(err, "", "action_when_leaked-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "expires_at", &obj.ExpiresAt) + if err != nil { + err = core.SDKErrorf(err, "", "expires_at-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) @@ -8199,6 +8316,14 @@ type APIKeyInsideCreateServiceIDRequest struct { // 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. StoreValue *bool `json:"store_value,omitempty"` + + // Defines the action to take when API key is leaked, valid values are 'none', 'disable' and 'delete'. + ActionWhenLeaked *string `json:"action_when_leaked,omitempty"` + + // Date and time when the API key becomes invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. **WARNING** + // An API key will be permanently and irrevocably deleted when both the expires_at and modified_at timestamps are more + // than ninety (90) days in the past, regardless of the key’s locked status or any other state. + ExpiresAt *string `json:"expires_at,omitempty"` } // NewAPIKeyInsideCreateServiceIDRequest : Instantiate APIKeyInsideCreateServiceIDRequest (Generic Model Constructor) @@ -8236,6 +8361,16 @@ func UnmarshalAPIKeyInsideCreateServiceIDRequest(m map[string]json.RawMessage, r err = core.SDKErrorf(err, "", "store_value-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "action_when_leaked", &obj.ActionWhenLeaked) + if err != nil { + err = core.SDKErrorf(err, "", "action_when_leaked-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "expires_at", &obj.ExpiresAt) + if err != nil { + err = core.SDKErrorf(err, "", "expires_at-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -8434,6 +8569,177 @@ func UnmarshalApikeyActivityUser(m map[string]json.RawMessage, result interface{ return } +// AssignedTemplatesAccountSettingsRestrictUserDomains : AssignedTemplatesAccountSettingsRestrictUserDomains struct +type AssignedTemplatesAccountSettingsRestrictUserDomains struct { + AccountSufficient *bool `json:"account_sufficient,omitempty"` + + // Defines if account invitations are restricted to specified domains. To remove an entry for a realm_id, perform an + // update (PUT) request with only the realm_id set. + Restrictions []AccountSettingsUserDomainRestriction `json:"restrictions,omitempty"` +} + +// UnmarshalAssignedTemplatesAccountSettingsRestrictUserDomains unmarshals an instance of AssignedTemplatesAccountSettingsRestrictUserDomains from the specified map of raw messages. +func UnmarshalAssignedTemplatesAccountSettingsRestrictUserDomains(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AssignedTemplatesAccountSettingsRestrictUserDomains) + err = core.UnmarshalPrimitive(m, "account_sufficient", &obj.AccountSufficient) + if err != nil { + err = core.SDKErrorf(err, "", "account_sufficient-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "restrictions", &obj.Restrictions, UnmarshalAccountSettingsUserDomainRestriction) + if err != nil { + err = core.SDKErrorf(err, "", "restrictions-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// BulkListAccountEntityConsumptionOptions : The BulkListAccountEntityConsumption options. +type BulkListAccountEntityConsumptionOptions struct { + // Unique ID of the account. + AccountID *string `json:"account_id" validate:"required,ne="` + + // Flag to include service ID groups usage. + ServiceidGroups *bool `json:"serviceid_groups,omitempty"` + + // List of service ID group IDs to get usage for. + ServiceidsPerGroup []string `json:"serviceids_per_group,omitempty"` + + // Flag to include trusted profiles usage. + Profiles *bool `json:"profiles,omitempty"` + + // List of identity IDs to get API key usage for. + ApikeysPerIdentity []string `json:"apikeys_per_identity,omitempty"` + + // Flag to include templates usage. + Templates *bool `json:"templates,omitempty"` + + // List of template IDs to get version usage for. + TemplateVersionsPerTemplate []string `json:"template_versions_per_template,omitempty"` + + // Flag to include identity providers usage. + Idps *bool `json:"idps,omitempty"` + + // List of access group IDs to get claim rules usage for. + ClaimRulesPerGroup []string `json:"claim_rules_per_group,omitempty"` + + // List of profile IDs to get claim rules usage for. + ClaimRulesPerProfile []string `json:"claim_rules_per_profile,omitempty"` + + // Flag to include compute resource links usage. + CrLinks *bool `json:"cr_links,omitempty"` + + // List of profile IDs to get compute resource links usage for. + CrLinksPerProfile []string `json:"cr_links_per_profile,omitempty"` + + // Flag to include compute resource rules usage. + CrRules *bool `json:"cr_rules,omitempty"` + + // List of profile IDs to get compute resource rules usage for. + CrRulesPerProfile []string `json:"cr_rules_per_profile,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewBulkListAccountEntityConsumptionOptions : Instantiate BulkListAccountEntityConsumptionOptions +func (*IamIdentityV1) NewBulkListAccountEntityConsumptionOptions(accountID string) *BulkListAccountEntityConsumptionOptions { + return &BulkListAccountEntityConsumptionOptions{ + AccountID: core.StringPtr(accountID), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *BulkListAccountEntityConsumptionOptions) SetAccountID(accountID string) *BulkListAccountEntityConsumptionOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetServiceidGroups : Allow user to set ServiceidGroups +func (_options *BulkListAccountEntityConsumptionOptions) SetServiceidGroups(serviceidGroups bool) *BulkListAccountEntityConsumptionOptions { + _options.ServiceidGroups = core.BoolPtr(serviceidGroups) + return _options +} + +// SetServiceidsPerGroup : Allow user to set ServiceidsPerGroup +func (_options *BulkListAccountEntityConsumptionOptions) SetServiceidsPerGroup(serviceidsPerGroup []string) *BulkListAccountEntityConsumptionOptions { + _options.ServiceidsPerGroup = serviceidsPerGroup + return _options +} + +// SetProfiles : Allow user to set Profiles +func (_options *BulkListAccountEntityConsumptionOptions) SetProfiles(profiles bool) *BulkListAccountEntityConsumptionOptions { + _options.Profiles = core.BoolPtr(profiles) + return _options +} + +// SetApikeysPerIdentity : Allow user to set ApikeysPerIdentity +func (_options *BulkListAccountEntityConsumptionOptions) SetApikeysPerIdentity(apikeysPerIdentity []string) *BulkListAccountEntityConsumptionOptions { + _options.ApikeysPerIdentity = apikeysPerIdentity + return _options +} + +// SetTemplates : Allow user to set Templates +func (_options *BulkListAccountEntityConsumptionOptions) SetTemplates(templates bool) *BulkListAccountEntityConsumptionOptions { + _options.Templates = core.BoolPtr(templates) + return _options +} + +// SetTemplateVersionsPerTemplate : Allow user to set TemplateVersionsPerTemplate +func (_options *BulkListAccountEntityConsumptionOptions) SetTemplateVersionsPerTemplate(templateVersionsPerTemplate []string) *BulkListAccountEntityConsumptionOptions { + _options.TemplateVersionsPerTemplate = templateVersionsPerTemplate + return _options +} + +// SetIdps : Allow user to set Idps +func (_options *BulkListAccountEntityConsumptionOptions) SetIdps(idps bool) *BulkListAccountEntityConsumptionOptions { + _options.Idps = core.BoolPtr(idps) + return _options +} + +// SetClaimRulesPerGroup : Allow user to set ClaimRulesPerGroup +func (_options *BulkListAccountEntityConsumptionOptions) SetClaimRulesPerGroup(claimRulesPerGroup []string) *BulkListAccountEntityConsumptionOptions { + _options.ClaimRulesPerGroup = claimRulesPerGroup + return _options +} + +// SetClaimRulesPerProfile : Allow user to set ClaimRulesPerProfile +func (_options *BulkListAccountEntityConsumptionOptions) SetClaimRulesPerProfile(claimRulesPerProfile []string) *BulkListAccountEntityConsumptionOptions { + _options.ClaimRulesPerProfile = claimRulesPerProfile + return _options +} + +// SetCrLinks : Allow user to set CrLinks +func (_options *BulkListAccountEntityConsumptionOptions) SetCrLinks(crLinks bool) *BulkListAccountEntityConsumptionOptions { + _options.CrLinks = core.BoolPtr(crLinks) + return _options +} + +// SetCrLinksPerProfile : Allow user to set CrLinksPerProfile +func (_options *BulkListAccountEntityConsumptionOptions) SetCrLinksPerProfile(crLinksPerProfile []string) *BulkListAccountEntityConsumptionOptions { + _options.CrLinksPerProfile = crLinksPerProfile + return _options +} + +// SetCrRules : Allow user to set CrRules +func (_options *BulkListAccountEntityConsumptionOptions) SetCrRules(crRules bool) *BulkListAccountEntityConsumptionOptions { + _options.CrRules = core.BoolPtr(crRules) + return _options +} + +// SetCrRulesPerProfile : Allow user to set CrRulesPerProfile +func (_options *BulkListAccountEntityConsumptionOptions) SetCrRulesPerProfile(crRulesPerProfile []string) *BulkListAccountEntityConsumptionOptions { + _options.CrRulesPerProfile = crRulesPerProfile + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *BulkListAccountEntityConsumptionOptions) SetHeaders(param map[string]string) *BulkListAccountEntityConsumptionOptions { + options.Headers = param + return options +} + // CommitAccountSettingsTemplateOptions : The CommitAccountSettingsTemplate options. type CommitAccountSettingsTemplateOptions struct { // ID of the account settings template. @@ -8450,7 +8756,7 @@ type CommitAccountSettingsTemplateOptions struct { func (*IamIdentityV1) NewCommitAccountSettingsTemplateOptions(templateID string, version string) *CommitAccountSettingsTemplateOptions { return &CommitAccountSettingsTemplateOptions{ TemplateID: core.StringPtr(templateID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -8488,7 +8794,7 @@ type CommitProfileTemplateOptions struct { func (*IamIdentityV1) NewCommitProfileTemplateOptions(templateID string, version string) *CommitProfileTemplateOptions { return &CommitProfileTemplateOptions{ TemplateID: core.StringPtr(templateID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -8531,17 +8837,17 @@ type CreateAccountSettingsAssignmentOptions struct { // Constants associated with the CreateAccountSettingsAssignmentOptions.TargetType property. // Type of target to deploy to. const ( - CreateAccountSettingsAssignmentOptionsTargetTypeAccountConst = "Account" + CreateAccountSettingsAssignmentOptionsTargetTypeAccountConst = "Account" CreateAccountSettingsAssignmentOptionsTargetTypeAccountgroupConst = "AccountGroup" ) // NewCreateAccountSettingsAssignmentOptions : Instantiate CreateAccountSettingsAssignmentOptions func (*IamIdentityV1) NewCreateAccountSettingsAssignmentOptions(templateID string, templateVersion int64, targetType string, target string) *CreateAccountSettingsAssignmentOptions { return &CreateAccountSettingsAssignmentOptions{ - TemplateID: core.StringPtr(templateID), + TemplateID: core.StringPtr(templateID), TemplateVersion: core.Int64Ptr(templateVersion), - TargetType: core.StringPtr(targetType), - Target: core.StringPtr(target), + TargetType: core.StringPtr(targetType), + Target: core.StringPtr(target), } } @@ -8586,7 +8892,8 @@ type CreateAccountSettingsTemplateOptions struct { // The description of the trusted profile template. Describe the template for enterprise account users. Description *string `json:"description,omitempty"` - AccountSettings *AccountSettingsComponent `json:"account_settings,omitempty"` + // Input body parameters for the Account Settings REST request. + AccountSettings *TemplateAccountSettings `json:"account_settings,omitempty"` // Allows users to set headers on API requests. Headers map[string]string @@ -8616,7 +8923,7 @@ func (_options *CreateAccountSettingsTemplateOptions) SetDescription(description } // SetAccountSettings : Allow user to set AccountSettings -func (_options *CreateAccountSettingsTemplateOptions) SetAccountSettings(accountSettings *AccountSettingsComponent) *CreateAccountSettingsTemplateOptions { +func (_options *CreateAccountSettingsTemplateOptions) SetAccountSettings(accountSettings *TemplateAccountSettings) *CreateAccountSettingsTemplateOptions { _options.AccountSettings = accountSettings return _options } @@ -8641,7 +8948,8 @@ type CreateAccountSettingsTemplateVersionOptions struct { // The description of the trusted profile template. Describe the template for enterprise account users. Description *string `json:"description,omitempty"` - AccountSettings *AccountSettingsComponent `json:"account_settings,omitempty"` + // Input body parameters for the Account Settings REST request. + AccountSettings *TemplateAccountSettings `json:"account_settings,omitempty"` // Allows users to set headers on API requests. Headers map[string]string @@ -8679,7 +8987,7 @@ func (_options *CreateAccountSettingsTemplateVersionOptions) SetDescription(desc } // SetAccountSettings : Allow user to set AccountSettings -func (_options *CreateAccountSettingsTemplateVersionOptions) SetAccountSettings(accountSettings *AccountSettingsComponent) *CreateAccountSettingsTemplateVersionOptions { +func (_options *CreateAccountSettingsTemplateVersionOptions) SetAccountSettings(accountSettings *TemplateAccountSettings) *CreateAccountSettingsTemplateVersionOptions { _options.AccountSettings = accountSettings return _options } @@ -8726,6 +9034,11 @@ type CreateAPIKeyOptions struct { // Defines the action to take when API key is leaked, valid values are 'none', 'disable' and 'delete'. ActionWhenLeaked *string `json:"action_when_leaked,omitempty"` + // Date and time when the API key becomes invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. **WARNING** + // An API key will be permanently and irrevocably deleted when both the expires_at and modified_at timestamps are more + // than ninety (90) days in the past, regardless of the key’s locked status or any other state. + ExpiresAt *string `json:"expires_at,omitempty"` + // Indicates if the API key is locked for further write operations. False by default. EntityLock *string `json:"Entity-Lock,omitempty"` @@ -8739,7 +9052,7 @@ type CreateAPIKeyOptions struct { // NewCreateAPIKeyOptions : Instantiate CreateAPIKeyOptions func (*IamIdentityV1) NewCreateAPIKeyOptions(name string, iamID string) *CreateAPIKeyOptions { return &CreateAPIKeyOptions{ - Name: core.StringPtr(name), + Name: core.StringPtr(name), IamID: core.StringPtr(iamID), } } @@ -8792,6 +9105,12 @@ func (_options *CreateAPIKeyOptions) SetActionWhenLeaked(actionWhenLeaked string return _options } +// SetExpiresAt : Allow user to set ExpiresAt +func (_options *CreateAPIKeyOptions) SetExpiresAt(expiresAt string) *CreateAPIKeyOptions { + _options.ExpiresAt = core.StringPtr(expiresAt) + return _options +} + // SetEntityLock : Allow user to set EntityLock func (_options *CreateAPIKeyOptions) SetEntityLock(entityLock string) *CreateAPIKeyOptions { _options.EntityLock = core.StringPtr(entityLock) @@ -8832,7 +9151,7 @@ type CreateClaimRuleOptions struct { RealmName *string `json:"realm_name,omitempty"` // 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. + // VSI, PVS, BMS, IKS_SA, ROKS_SA, CE. CrType *string `json:"cr_type,omitempty"` // Session expiration in seconds, only required if type is 'Profile-SAML'. @@ -8845,8 +9164,8 @@ type CreateClaimRuleOptions struct { // NewCreateClaimRuleOptions : Instantiate CreateClaimRuleOptions func (*IamIdentityV1) NewCreateClaimRuleOptions(profileID string, typeVar string, conditions []ProfileClaimRuleConditions) *CreateClaimRuleOptions { return &CreateClaimRuleOptions{ - ProfileID: core.StringPtr(profileID), - Type: core.StringPtr(typeVar), + ProfileID: core.StringPtr(profileID), + Type: core.StringPtr(typeVar), Conditions: conditions, } } @@ -8910,7 +9229,7 @@ type CreateLinkOptions struct { // ID of the trusted profile. ProfileID *string `json:"profile-id" validate:"required,ne="` - // The compute resource type. Valid values are VSI, IKS_SA, ROKS_SA. + // The compute resource type. Valid values are VSI, PVS, BMS, IKS_SA, ROKS_SA, CE. CrType *string `json:"cr_type" validate:"required"` // Link details. @@ -8919,6 +9238,10 @@ type CreateLinkOptions struct { // Optional name of the Link. Name *string `json:"name,omitempty"` + // Flag to indicate that the link provides cross account access. If not provided then the account scope of the CRN must + // match the Profile's account. + IsCrossAccount *bool `json:"is_cross_account,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -8927,8 +9250,8 @@ type CreateLinkOptions struct { func (*IamIdentityV1) NewCreateLinkOptions(profileID string, crType string, link *CreateProfileLinkRequestLink) *CreateLinkOptions { return &CreateLinkOptions{ ProfileID: core.StringPtr(profileID), - CrType: core.StringPtr(crType), - Link: link, + CrType: core.StringPtr(crType), + Link: link, } } @@ -8956,6 +9279,12 @@ func (_options *CreateLinkOptions) SetName(name string) *CreateLinkOptions { return _options } +// SetIsCrossAccount : Allow user to set IsCrossAccount +func (_options *CreateLinkOptions) SetIsCrossAccount(isCrossAccount bool) *CreateLinkOptions { + _options.IsCrossAccount = core.BoolPtr(isCrossAccount) + return _options +} + // SetHeaders : Allow user to set Headers func (options *CreateLinkOptions) SetHeaders(param map[string]string) *CreateLinkOptions { options.Headers = param @@ -9084,7 +9413,7 @@ type CreateProfileOptions struct { // NewCreateProfileOptions : Instantiate CreateProfileOptions func (*IamIdentityV1) NewCreateProfileOptions(name string, accountID string) *CreateProfileOptions { return &CreateProfileOptions{ - Name: core.StringPtr(name), + Name: core.StringPtr(name), AccountID: core.StringPtr(accountID), } } @@ -9340,7 +9669,7 @@ type CreateServiceIDGroupOptions struct { func (*IamIdentityV1) NewCreateServiceIDGroupOptions(accountID string, name string) *CreateServiceIDGroupOptions { return &CreateServiceIDGroupOptions{ AccountID: core.StringPtr(accountID), - Name: core.StringPtr(name), + Name: core.StringPtr(name), } } @@ -9405,7 +9734,7 @@ type CreateServiceIDOptions struct { func (*IamIdentityV1) NewCreateServiceIDOptions(accountID string, name string) *CreateServiceIDOptions { return &CreateServiceIDOptions{ AccountID: core.StringPtr(accountID), - Name: core.StringPtr(name), + Name: core.StringPtr(name), } } @@ -9484,17 +9813,17 @@ type CreateTrustedProfileAssignmentOptions struct { // Constants associated with the CreateTrustedProfileAssignmentOptions.TargetType property. // Type of target to deploy to. const ( - CreateTrustedProfileAssignmentOptionsTargetTypeAccountConst = "Account" + CreateTrustedProfileAssignmentOptionsTargetTypeAccountConst = "Account" CreateTrustedProfileAssignmentOptionsTargetTypeAccountgroupConst = "AccountGroup" ) // NewCreateTrustedProfileAssignmentOptions : Instantiate CreateTrustedProfileAssignmentOptions func (*IamIdentityV1) NewCreateTrustedProfileAssignmentOptions(templateID string, templateVersion int64, targetType string, target string) *CreateTrustedProfileAssignmentOptions { return &CreateTrustedProfileAssignmentOptions{ - TemplateID: core.StringPtr(templateID), + TemplateID: core.StringPtr(templateID), TemplateVersion: core.Int64Ptr(templateVersion), - TargetType: core.StringPtr(targetType), - Target: core.StringPtr(target), + TargetType: core.StringPtr(targetType), + Target: core.StringPtr(target), } } @@ -9572,7 +9901,7 @@ type DeleteAccountSettingsTemplateVersionOptions struct { func (*IamIdentityV1) NewDeleteAccountSettingsTemplateVersionOptions(templateID string, version string) *DeleteAccountSettingsTemplateVersionOptions { return &DeleteAccountSettingsTemplateVersionOptions{ TemplateID: core.StringPtr(templateID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -9694,7 +10023,7 @@ type DeleteClaimRuleOptions struct { func (*IamIdentityV1) NewDeleteClaimRuleOptions(profileID string, ruleID string) *DeleteClaimRuleOptions { return &DeleteClaimRuleOptions{ ProfileID: core.StringPtr(profileID), - RuleID: core.StringPtr(ruleID), + RuleID: core.StringPtr(ruleID), } } @@ -9721,10 +10050,10 @@ type DeleteLinkByParametersOptions struct { // The unique ID of the Trusted Profile. ProfileID *string `json:"profile-id" validate:"required,ne="` - // The compute resource type. Valid values are VSI, BMS, IKS_SA, ROKS_SA, CE. + // The compute resource type. Valid values are VSI, PVS, BMS, IKS_SA, ROKS_SA, CE. Type *string `json:"type" validate:"required"` - // CRN of the compute resource (IKS/ROKS/VSI/BMS). + // CRN of the compute resource (VSI/PVS/BMS/IKS/ROKS/CE). CRN *string `json:"crn,omitempty"` // Namespace of the compute resource (IKS/ROKS). @@ -9747,7 +10076,7 @@ type DeleteLinkByParametersOptions struct { func (*IamIdentityV1) NewDeleteLinkByParametersOptions(profileID string, typeVar string) *DeleteLinkByParametersOptions { return &DeleteLinkByParametersOptions{ ProfileID: core.StringPtr(profileID), - Type: core.StringPtr(typeVar), + Type: core.StringPtr(typeVar), } } @@ -9815,7 +10144,7 @@ type DeleteLinkOptions struct { func (*IamIdentityV1) NewDeleteLinkOptions(profileID string, linkID string) *DeleteLinkOptions { return &DeleteLinkOptions{ ProfileID: core.StringPtr(profileID), - LinkID: core.StringPtr(linkID), + LinkID: core.StringPtr(linkID), } } @@ -9858,9 +10187,9 @@ type DeletePreferencesOnScopeAccountOptions struct { // NewDeletePreferencesOnScopeAccountOptions : Instantiate DeletePreferencesOnScopeAccountOptions func (*IamIdentityV1) NewDeletePreferencesOnScopeAccountOptions(accountID string, iamID string, service string, preferenceID string) *DeletePreferencesOnScopeAccountOptions { return &DeletePreferencesOnScopeAccountOptions{ - AccountID: core.StringPtr(accountID), - IamID: core.StringPtr(iamID), - Service: core.StringPtr(service), + AccountID: core.StringPtr(accountID), + IamID: core.StringPtr(iamID), + Service: core.StringPtr(service), PreferenceID: core.StringPtr(preferenceID), } } @@ -9913,15 +10242,15 @@ type DeleteProfileIdentityOptions struct { // Constants associated with the DeleteProfileIdentityOptions.IdentityType property. // Type of the identity. const ( - DeleteProfileIdentityOptionsIdentityTypeCRNConst = "crn" + DeleteProfileIdentityOptionsIdentityTypeCRNConst = "crn" DeleteProfileIdentityOptionsIdentityTypeServiceidConst = "serviceid" - DeleteProfileIdentityOptionsIdentityTypeUserConst = "user" + DeleteProfileIdentityOptionsIdentityTypeUserConst = "user" ) // NewDeleteProfileIdentityOptions : Instantiate DeleteProfileIdentityOptions func (*IamIdentityV1) NewDeleteProfileIdentityOptions(profileID string, identityType string, identifierID string) *DeleteProfileIdentityOptions { return &DeleteProfileIdentityOptions{ - ProfileID: core.StringPtr(profileID), + ProfileID: core.StringPtr(profileID), IdentityType: core.StringPtr(identityType), IdentifierID: core.StringPtr(identifierID), } @@ -9995,7 +10324,7 @@ type DeleteProfileTemplateVersionOptions struct { func (*IamIdentityV1) NewDeleteProfileTemplateVersionOptions(templateID string, version string) *DeleteProfileTemplateVersionOptions { return &DeleteProfileTemplateVersionOptions{ TemplateID: core.StringPtr(templateID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -10139,7 +10468,8 @@ type EffectiveAccountSettingsResponse struct { Effective *AccountSettingsEffectiveSection `json:"effective" validate:"required"` - Account *AccountSettingsAccountSection `json:"account" validate:"required"` + // Input body parameters for the Account Settings REST request. + Account *AccountSettingsResponse `json:"account" validate:"required"` // assigned template section. AssignedTemplates []AccountSettingsAssignedTemplatesSection `json:"assigned_templates,omitempty"` @@ -10163,7 +10493,7 @@ func UnmarshalEffectiveAccountSettingsResponse(m map[string]json.RawMessage, res err = core.SDKErrorf(err, "", "effective-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountSettingsAccountSection) + err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountSettingsResponse) if err != nil { err = core.SDKErrorf(err, "", "account-error", common.GetComponentInfo()) return @@ -10177,90 +10507,6 @@ func UnmarshalEffectiveAccountSettingsResponse(m map[string]json.RawMessage, res return } -// EffectiveAccountSettingsUserMfa : EffectiveAccountSettingsUserMfa struct -type EffectiveAccountSettingsUserMfa struct { - // The iam_id of the user. - IamID *string `json:"iam_id" validate:"required"` - - // Defines the MFA requirement for the user. Valid values: - // * NONE - No MFA trait set - // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - // * 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. - Mfa *string `json:"mfa" validate:"required"` - - // name of the user account. - Name *string `json:"name,omitempty"` - - // userName of the user. - UserName *string `json:"userName,omitempty"` - - // email of the user. - Email *string `json:"email,omitempty"` - - // optional description. - Description *string `json:"description,omitempty"` -} - -// Constants associated with the EffectiveAccountSettingsUserMfa.Mfa property. -// Defines the MFA requirement for the user. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * 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. -const ( - EffectiveAccountSettingsUserMfaMfaLevel1Const = "LEVEL1" - EffectiveAccountSettingsUserMfaMfaLevel2Const = "LEVEL2" - EffectiveAccountSettingsUserMfaMfaLevel3Const = "LEVEL3" - EffectiveAccountSettingsUserMfaMfaNoneConst = "NONE" - EffectiveAccountSettingsUserMfaMfaNoneNoRopcConst = "NONE_NO_ROPC" - EffectiveAccountSettingsUserMfaMfaTotpConst = "TOTP" - EffectiveAccountSettingsUserMfaMfaTotp4allConst = "TOTP4ALL" -) - -// UnmarshalEffectiveAccountSettingsUserMfa unmarshals an instance of EffectiveAccountSettingsUserMfa from the specified map of raw messages. -func UnmarshalEffectiveAccountSettingsUserMfa(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EffectiveAccountSettingsUserMfa) - err = core.UnmarshalPrimitive(m, "iam_id", &obj.IamID) - if err != nil { - err = core.SDKErrorf(err, "", "iam_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) - if err != nil { - err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "userName", &obj.UserName) - if err != nil { - err = core.SDKErrorf(err, "", "userName-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "email", &obj.Email) - if err != nil { - err = core.SDKErrorf(err, "", "email-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) - if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // EnableAPIKeyOptions : The EnableAPIKey options. type EnableAPIKeyOptions struct { // Unique ID of the API key. @@ -10467,6 +10713,151 @@ func UnmarshalExceptionResponse(m map[string]json.RawMessage, result interface{} return } +// GetAccountLimitsOptions : The GetAccountLimits options. +type GetAccountLimitsOptions struct { + // Unique ID of the account. + AccountID *string `json:"account_id" validate:"required,ne="` + + // Boolean to include serviceid group consumption. + ServiceidGroups *bool `json:"serviceid_groups,omitempty"` + + // Comma seperated list of ServiceID groups to include for consumption. + ServiceidsPerGroup *string `json:"serviceids_per_group,omitempty"` + + // Boolean to include trusted profiles consumption. + Profiles *string `json:"profiles,omitempty"` + + // Comma seperated list of IAM IDs to include for API key consumption. + ApikeysPerIdentity *string `json:"apikeys_per_identity,omitempty"` + + // Boolean to include template consumption. + Templates *string `json:"templates,omitempty"` + + // Comma seperated list of template IDs to include for template version consumption. + TemplateVersionsPerTemplate *string `json:"template_versions_per_template,omitempty"` + + // Boolean to include identity provider consumption. + Idps *string `json:"idps,omitempty"` + + // Comma seperated list of access groups to include for claim rules consumption. + ClaimRulesPerGroup *string `json:"claim_rules_per_group,omitempty"` + + // Comma seperated list of profiles to include for claim rules consumption. + ClaimRulesPerProfile *string `json:"claim_rules_per_profile,omitempty"` + + // Boolean to include compute resource links consumption. + CrLinks *string `json:"cr_links,omitempty"` + + // Comma seperated list of profile IDs to include for cr links consumption. + CrLinksPerProfile *string `json:"cr_links_per_profile,omitempty"` + + // Boolean to include compute resource rules consumption. + CrRules *string `json:"cr_rules,omitempty"` + + // Comma seperated list of profile IDs to include for cr rules consumption. + CrRulesPerProfile *string `json:"cr_rules_per_profile,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetAccountLimitsOptions : Instantiate GetAccountLimitsOptions +func (*IamIdentityV1) NewGetAccountLimitsOptions(accountID string) *GetAccountLimitsOptions { + return &GetAccountLimitsOptions{ + AccountID: core.StringPtr(accountID), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *GetAccountLimitsOptions) SetAccountID(accountID string) *GetAccountLimitsOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetServiceidGroups : Allow user to set ServiceidGroups +func (_options *GetAccountLimitsOptions) SetServiceidGroups(serviceidGroups bool) *GetAccountLimitsOptions { + _options.ServiceidGroups = core.BoolPtr(serviceidGroups) + return _options +} + +// SetServiceidsPerGroup : Allow user to set ServiceidsPerGroup +func (_options *GetAccountLimitsOptions) SetServiceidsPerGroup(serviceidsPerGroup string) *GetAccountLimitsOptions { + _options.ServiceidsPerGroup = core.StringPtr(serviceidsPerGroup) + return _options +} + +// SetProfiles : Allow user to set Profiles +func (_options *GetAccountLimitsOptions) SetProfiles(profiles string) *GetAccountLimitsOptions { + _options.Profiles = core.StringPtr(profiles) + return _options +} + +// SetApikeysPerIdentity : Allow user to set ApikeysPerIdentity +func (_options *GetAccountLimitsOptions) SetApikeysPerIdentity(apikeysPerIdentity string) *GetAccountLimitsOptions { + _options.ApikeysPerIdentity = core.StringPtr(apikeysPerIdentity) + return _options +} + +// SetTemplates : Allow user to set Templates +func (_options *GetAccountLimitsOptions) SetTemplates(templates string) *GetAccountLimitsOptions { + _options.Templates = core.StringPtr(templates) + return _options +} + +// SetTemplateVersionsPerTemplate : Allow user to set TemplateVersionsPerTemplate +func (_options *GetAccountLimitsOptions) SetTemplateVersionsPerTemplate(templateVersionsPerTemplate string) *GetAccountLimitsOptions { + _options.TemplateVersionsPerTemplate = core.StringPtr(templateVersionsPerTemplate) + return _options +} + +// SetIdps : Allow user to set Idps +func (_options *GetAccountLimitsOptions) SetIdps(idps string) *GetAccountLimitsOptions { + _options.Idps = core.StringPtr(idps) + return _options +} + +// SetClaimRulesPerGroup : Allow user to set ClaimRulesPerGroup +func (_options *GetAccountLimitsOptions) SetClaimRulesPerGroup(claimRulesPerGroup string) *GetAccountLimitsOptions { + _options.ClaimRulesPerGroup = core.StringPtr(claimRulesPerGroup) + return _options +} + +// SetClaimRulesPerProfile : Allow user to set ClaimRulesPerProfile +func (_options *GetAccountLimitsOptions) SetClaimRulesPerProfile(claimRulesPerProfile string) *GetAccountLimitsOptions { + _options.ClaimRulesPerProfile = core.StringPtr(claimRulesPerProfile) + return _options +} + +// SetCrLinks : Allow user to set CrLinks +func (_options *GetAccountLimitsOptions) SetCrLinks(crLinks string) *GetAccountLimitsOptions { + _options.CrLinks = core.StringPtr(crLinks) + return _options +} + +// SetCrLinksPerProfile : Allow user to set CrLinksPerProfile +func (_options *GetAccountLimitsOptions) SetCrLinksPerProfile(crLinksPerProfile string) *GetAccountLimitsOptions { + _options.CrLinksPerProfile = core.StringPtr(crLinksPerProfile) + return _options +} + +// SetCrRules : Allow user to set CrRules +func (_options *GetAccountLimitsOptions) SetCrRules(crRules string) *GetAccountLimitsOptions { + _options.CrRules = core.StringPtr(crRules) + return _options +} + +// SetCrRulesPerProfile : Allow user to set CrRulesPerProfile +func (_options *GetAccountLimitsOptions) SetCrRulesPerProfile(crRulesPerProfile string) *GetAccountLimitsOptions { + _options.CrRulesPerProfile = core.StringPtr(crRulesPerProfile) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetAccountLimitsOptions) SetHeaders(param map[string]string) *GetAccountLimitsOptions { + options.Headers = param + return options +} + // GetAccountSettingsAssignmentOptions : The GetAccountSettingsAssignment options. type GetAccountSettingsAssignmentOptions struct { // ID of the Assignment Record. @@ -10512,6 +10903,9 @@ type GetAccountSettingsOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` + // Enrich MFA exemptions with user PI. + ResolveUserMfa *bool `json:"resolve_user_mfa,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -10535,6 +10929,12 @@ func (_options *GetAccountSettingsOptions) SetIncludeHistory(includeHistory bool return _options } +// SetResolveUserMfa : Allow user to set ResolveUserMfa +func (_options *GetAccountSettingsOptions) SetResolveUserMfa(resolveUserMfa bool) *GetAccountSettingsOptions { + _options.ResolveUserMfa = core.BoolPtr(resolveUserMfa) + return _options +} + // SetHeaders : Allow user to set Headers func (options *GetAccountSettingsOptions) SetHeaders(param map[string]string) *GetAccountSettingsOptions { options.Headers = param @@ -10560,7 +10960,7 @@ type GetAccountSettingsTemplateVersionOptions struct { func (*IamIdentityV1) NewGetAccountSettingsTemplateVersionOptions(templateID string, version string) *GetAccountSettingsTemplateVersionOptions { return &GetAccountSettingsTemplateVersionOptions{ TemplateID: core.StringPtr(templateID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -10604,7 +11004,7 @@ type GetAllPreferencesOnScopeAccountOptions struct { func (*IamIdentityV1) NewGetAllPreferencesOnScopeAccountOptions(accountID string, iamID string) *GetAllPreferencesOnScopeAccountOptions { return &GetAllPreferencesOnScopeAccountOptions{ AccountID: core.StringPtr(accountID), - IamID: core.StringPtr(iamID), + IamID: core.StringPtr(iamID), } } @@ -10724,7 +11124,7 @@ type GetClaimRuleOptions struct { func (*IamIdentityV1) NewGetClaimRuleOptions(profileID string, ruleID string) *GetClaimRuleOptions { return &GetClaimRuleOptions{ ProfileID: core.StringPtr(profileID), - RuleID: core.StringPtr(ruleID), + RuleID: core.StringPtr(ruleID), } } @@ -10882,7 +11282,7 @@ type GetLinkOptions struct { func (*IamIdentityV1) NewGetLinkOptions(profileID string, linkID string) *GetLinkOptions { return &GetLinkOptions{ ProfileID: core.StringPtr(profileID), - LinkID: core.StringPtr(linkID), + LinkID: core.StringPtr(linkID), } } @@ -10958,7 +11358,7 @@ type GetMfaStatusOptions struct { func (*IamIdentityV1) NewGetMfaStatusOptions(accountID string, iamID string) *GetMfaStatusOptions { return &GetMfaStatusOptions{ AccountID: core.StringPtr(accountID), - IamID: core.StringPtr(iamID), + IamID: core.StringPtr(iamID), } } @@ -11001,9 +11401,9 @@ type GetPreferencesOnScopeAccountOptions struct { // NewGetPreferencesOnScopeAccountOptions : Instantiate GetPreferencesOnScopeAccountOptions func (*IamIdentityV1) NewGetPreferencesOnScopeAccountOptions(accountID string, iamID string, service string, preferenceID string) *GetPreferencesOnScopeAccountOptions { return &GetPreferencesOnScopeAccountOptions{ - AccountID: core.StringPtr(accountID), - IamID: core.StringPtr(iamID), - Service: core.StringPtr(service), + AccountID: core.StringPtr(accountID), + IamID: core.StringPtr(iamID), + Service: core.StringPtr(service), PreferenceID: core.StringPtr(preferenceID), } } @@ -11084,15 +11484,15 @@ type GetProfileIdentityOptions struct { // Constants associated with the GetProfileIdentityOptions.IdentityType property. // Type of the identity. const ( - GetProfileIdentityOptionsIdentityTypeCRNConst = "crn" + GetProfileIdentityOptionsIdentityTypeCRNConst = "crn" GetProfileIdentityOptionsIdentityTypeServiceidConst = "serviceid" - GetProfileIdentityOptionsIdentityTypeUserConst = "user" + GetProfileIdentityOptionsIdentityTypeUserConst = "user" ) // NewGetProfileIdentityOptions : Instantiate GetProfileIdentityOptions func (*IamIdentityV1) NewGetProfileIdentityOptions(profileID string, identityType string, identifierID string) *GetProfileIdentityOptions { return &GetProfileIdentityOptions{ - ProfileID: core.StringPtr(profileID), + ProfileID: core.StringPtr(profileID), IdentityType: core.StringPtr(identityType), IdentifierID: core.StringPtr(identifierID), } @@ -11179,7 +11579,7 @@ type GetProfileTemplateVersionOptions struct { func (*IamIdentityV1) NewGetProfileTemplateVersionOptions(templateID string, version string) *GetProfileTemplateVersionOptions { return &GetProfileTemplateVersionOptions{ TemplateID: core.StringPtr(templateID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -11311,199 +11711,530 @@ func (_options *GetServiceIDOptions) SetIncludeHistory(includeHistory bool) *Get return _options } -// SetIncludeActivity : Allow user to set IncludeActivity -func (_options *GetServiceIDOptions) SetIncludeActivity(includeActivity bool) *GetServiceIDOptions { - _options.IncludeActivity = core.BoolPtr(includeActivity) - return _options -} +// SetIncludeActivity : Allow user to set IncludeActivity +func (_options *GetServiceIDOptions) SetIncludeActivity(includeActivity bool) *GetServiceIDOptions { + _options.IncludeActivity = core.BoolPtr(includeActivity) + return _options +} + +// SetShowGroupID : Allow user to set ShowGroupID +func (_options *GetServiceIDOptions) SetShowGroupID(showGroupID string) *GetServiceIDOptions { + _options.ShowGroupID = core.StringPtr(showGroupID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetServiceIDOptions) SetHeaders(param map[string]string) *GetServiceIDOptions { + options.Headers = param + return options +} + +// GetTrustedProfileAssignmentOptions : The GetTrustedProfileAssignment options. +type GetTrustedProfileAssignmentOptions struct { + // ID of the Assignment Record. + AssignmentID *string `json:"assignment_id" validate:"required,ne="` + + // Defines if the entity history is included in the response. + IncludeHistory *bool `json:"include_history,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetTrustedProfileAssignmentOptions : Instantiate GetTrustedProfileAssignmentOptions +func (*IamIdentityV1) NewGetTrustedProfileAssignmentOptions(assignmentID string) *GetTrustedProfileAssignmentOptions { + return &GetTrustedProfileAssignmentOptions{ + AssignmentID: core.StringPtr(assignmentID), + } +} + +// SetAssignmentID : Allow user to set AssignmentID +func (_options *GetTrustedProfileAssignmentOptions) SetAssignmentID(assignmentID string) *GetTrustedProfileAssignmentOptions { + _options.AssignmentID = core.StringPtr(assignmentID) + return _options +} + +// SetIncludeHistory : Allow user to set IncludeHistory +func (_options *GetTrustedProfileAssignmentOptions) SetIncludeHistory(includeHistory bool) *GetTrustedProfileAssignmentOptions { + _options.IncludeHistory = core.BoolPtr(includeHistory) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetTrustedProfileAssignmentOptions) SetHeaders(param map[string]string) *GetTrustedProfileAssignmentOptions { + options.Headers = param + return options +} + +// IDBasedMfaEnrollment : IDBasedMfaEnrollment struct +type IDBasedMfaEnrollment struct { + // MFA trait definitions as follows: + // * NONE - No MFA trait set + // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + // * 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 - Security Key MFA for all users. + TraitAccountDefault *string `json:"trait_account_default" validate:"required"` + + // MFA trait definitions as follows: + // * NONE - No MFA trait set + // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + // * 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 - Security Key MFA for all users. + TraitUserSpecific *string `json:"trait_user_specific,omitempty"` + + // MFA trait definitions as follows: + // * NONE - No MFA trait set + // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + // * 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 - Security Key MFA for all users. + TraitEffective *string `json:"trait_effective" validate:"required"` + + // The enrollment complies to the effective requirement. + Complies *bool `json:"complies" validate:"required"` + + // Defines comply state for the account. Valid values: + // * NO - User does not comply in the given account. + // * ACCOUNT- User complies in the given account, but does not comply in at least one of the other account + // memberships. + // * CROSS_ACCOUNT - User complies in the given account and across all other account memberships. + ComplyState *string `json:"comply_state,omitempty"` +} + +// Constants associated with the IDBasedMfaEnrollment.TraitAccountDefault property. +// MFA trait definitions as follows: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - 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 - Security Key MFA for all users. +const ( + IDBasedMfaEnrollmentTraitAccountDefaultLevel1Const = "LEVEL1" + IDBasedMfaEnrollmentTraitAccountDefaultLevel2Const = "LEVEL2" + IDBasedMfaEnrollmentTraitAccountDefaultLevel3Const = "LEVEL3" + IDBasedMfaEnrollmentTraitAccountDefaultNoneConst = "NONE" + IDBasedMfaEnrollmentTraitAccountDefaultNoneNoRopcConst = "NONE_NO_ROPC" + IDBasedMfaEnrollmentTraitAccountDefaultTotpConst = "TOTP" + IDBasedMfaEnrollmentTraitAccountDefaultTotp4allConst = "TOTP4ALL" +) + +// Constants associated with the IDBasedMfaEnrollment.TraitUserSpecific property. +// MFA trait definitions as follows: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - 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 - Security Key MFA for all users. +const ( + IDBasedMfaEnrollmentTraitUserSpecificLevel1Const = "LEVEL1" + IDBasedMfaEnrollmentTraitUserSpecificLevel2Const = "LEVEL2" + IDBasedMfaEnrollmentTraitUserSpecificLevel3Const = "LEVEL3" + IDBasedMfaEnrollmentTraitUserSpecificNoneConst = "NONE" + IDBasedMfaEnrollmentTraitUserSpecificNoneNoRopcConst = "NONE_NO_ROPC" + IDBasedMfaEnrollmentTraitUserSpecificTotpConst = "TOTP" + IDBasedMfaEnrollmentTraitUserSpecificTotp4allConst = "TOTP4ALL" +) + +// Constants associated with the IDBasedMfaEnrollment.TraitEffective property. +// MFA trait definitions as follows: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - 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 - Security Key MFA for all users. +const ( + IDBasedMfaEnrollmentTraitEffectiveLevel1Const = "LEVEL1" + IDBasedMfaEnrollmentTraitEffectiveLevel2Const = "LEVEL2" + IDBasedMfaEnrollmentTraitEffectiveLevel3Const = "LEVEL3" + IDBasedMfaEnrollmentTraitEffectiveNoneConst = "NONE" + IDBasedMfaEnrollmentTraitEffectiveNoneNoRopcConst = "NONE_NO_ROPC" + IDBasedMfaEnrollmentTraitEffectiveTotpConst = "TOTP" + IDBasedMfaEnrollmentTraitEffectiveTotp4allConst = "TOTP4ALL" +) + +// Constants associated with the IDBasedMfaEnrollment.ComplyState property. +// Defines comply state for the account. Valid values: +// - NO - User does not comply in the given account. +// - ACCOUNT- User complies in the given account, but does not comply in at least one of the other account +// +// memberships. +// - CROSS_ACCOUNT - User complies in the given account and across all other account memberships. +const ( + IDBasedMfaEnrollmentComplyStateAccountConst = "ACCOUNT" + IDBasedMfaEnrollmentComplyStateCrossAccountConst = "CROSS_ACCOUNT" + IDBasedMfaEnrollmentComplyStateNoConst = "NO" +) + +// UnmarshalIDBasedMfaEnrollment unmarshals an instance of IDBasedMfaEnrollment from the specified map of raw messages. +func UnmarshalIDBasedMfaEnrollment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IDBasedMfaEnrollment) + err = core.UnmarshalPrimitive(m, "trait_account_default", &obj.TraitAccountDefault) + if err != nil { + err = core.SDKErrorf(err, "", "trait_account_default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "trait_user_specific", &obj.TraitUserSpecific) + if err != nil { + err = core.SDKErrorf(err, "", "trait_user_specific-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "trait_effective", &obj.TraitEffective) + if err != nil { + err = core.SDKErrorf(err, "", "trait_effective-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "complies", &obj.Complies) + if err != nil { + err = core.SDKErrorf(err, "", "complies-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "comply_state", &obj.ComplyState) + if err != nil { + err = core.SDKErrorf(err, "", "comply_state-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IdentityCount : API key count for a specific identity. +type IdentityCount struct { + // IAM identifier of the identity. + IamID *string `json:"iam_id,omitempty"` + + // Number of API keys for the identity. + Count *int64 `json:"count,omitempty"` +} + +// UnmarshalIdentityCount unmarshals an instance of IdentityCount from the specified map of raw messages. +func UnmarshalIdentityCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityCount) + err = core.UnmarshalPrimitive(m, "iam_id", &obj.IamID) + if err != nil { + err = core.SDKErrorf(err, "", "iam_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "count", &obj.Count) + if err != nil { + err = core.SDKErrorf(err, "", "count-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IdentityLimitsUsageResponse : Response body format for identity limits usage. +type IdentityLimitsUsageResponse struct { + // Limit and current usage count for a resource. + ServiceidGroups *LimitCount `json:"serviceid_groups,omitempty"` + + // Usage count for service IDs per group. + ServiceidsPerGroup *IdentityLimitsUsageResponseServiceidsPerGroup `json:"serviceids_per_group,omitempty"` + + // Limit and current usage count for a resource. + Profiles *LimitCount `json:"profiles,omitempty"` + + // Usage count for API keys per identity. + ApikeysPerIdentity *IdentityLimitsUsageResponseApikeysPerIdentity `json:"apikeys_per_identity,omitempty"` + + // Limit and current usage count for a resource. + ProfileTemplates *LimitCount `json:"profile_templates,omitempty"` + + // Limit and current usage count for a resource. + AccountSettingsTemplates *LimitCount `json:"account_settings_templates,omitempty"` + + // Usage count for template versions per template. + TemplateVersionsPerTemplate *IdentityLimitsUsageResponseTemplateVersionsPerTemplate `json:"template_versions_per_template,omitempty"` + + // Limit and current usage count for a resource. + Idps *LimitCount `json:"idps,omitempty"` + + // Usage count for claim rules per access group. + ClaimRulesPerGroup *IdentityLimitsUsageResponseClaimRulesPerGroup `json:"claim_rules_per_group,omitempty"` + + // Usage count for claim rules per profile. + ClaimRulesPerProfile *IdentityLimitsUsageResponseClaimRulesPerProfile `json:"claim_rules_per_profile,omitempty"` + + // Limit and current usage count for a resource. + CrLinks *LimitCount `json:"cr_links,omitempty"` + + // Usage count for compute resource links per profile. + CrLinksPerProfile *IdentityLimitsUsageResponseCrLinksPerProfile `json:"cr_links_per_profile,omitempty"` + + // Limit and current usage count for a resource. + CrRules *LimitCount `json:"cr_rules,omitempty"` + + // Usage count for compute resource rules per profile. + CrRulesPerProfile *IdentityLimitsUsageResponseCrRulesPerProfile `json:"cr_rules_per_profile,omitempty"` +} + +// UnmarshalIdentityLimitsUsageResponse unmarshals an instance of IdentityLimitsUsageResponse from the specified map of raw messages. +func UnmarshalIdentityLimitsUsageResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityLimitsUsageResponse) + err = core.UnmarshalModel(m, "serviceid_groups", &obj.ServiceidGroups, UnmarshalLimitCount) + if err != nil { + err = core.SDKErrorf(err, "", "serviceid_groups-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "serviceids_per_group", &obj.ServiceidsPerGroup, UnmarshalIdentityLimitsUsageResponseServiceidsPerGroup) + if err != nil { + err = core.SDKErrorf(err, "", "serviceids_per_group-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalLimitCount) + if err != nil { + err = core.SDKErrorf(err, "", "profiles-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "apikeys_per_identity", &obj.ApikeysPerIdentity, UnmarshalIdentityLimitsUsageResponseApikeysPerIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "apikeys_per_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "profile_templates", &obj.ProfileTemplates, UnmarshalLimitCount) + if err != nil { + err = core.SDKErrorf(err, "", "profile_templates-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "account_settings_templates", &obj.AccountSettingsTemplates, UnmarshalLimitCount) + if err != nil { + err = core.SDKErrorf(err, "", "account_settings_templates-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "template_versions_per_template", &obj.TemplateVersionsPerTemplate, UnmarshalIdentityLimitsUsageResponseTemplateVersionsPerTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "template_versions_per_template-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "idps", &obj.Idps, UnmarshalLimitCount) + if err != nil { + err = core.SDKErrorf(err, "", "idps-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "claim_rules_per_group", &obj.ClaimRulesPerGroup, UnmarshalIdentityLimitsUsageResponseClaimRulesPerGroup) + if err != nil { + err = core.SDKErrorf(err, "", "claim_rules_per_group-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "claim_rules_per_profile", &obj.ClaimRulesPerProfile, UnmarshalIdentityLimitsUsageResponseClaimRulesPerProfile) + if err != nil { + err = core.SDKErrorf(err, "", "claim_rules_per_profile-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "cr_links", &obj.CrLinks, UnmarshalLimitCount) + if err != nil { + err = core.SDKErrorf(err, "", "cr_links-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "cr_links_per_profile", &obj.CrLinksPerProfile, UnmarshalIdentityLimitsUsageResponseCrLinksPerProfile) + if err != nil { + err = core.SDKErrorf(err, "", "cr_links_per_profile-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "cr_rules", &obj.CrRules, UnmarshalLimitCount) + if err != nil { + err = core.SDKErrorf(err, "", "cr_rules-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "cr_rules_per_profile", &obj.CrRulesPerProfile, UnmarshalIdentityLimitsUsageResponseCrRulesPerProfile) + if err != nil { + err = core.SDKErrorf(err, "", "cr_rules_per_profile-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IdentityLimitsUsageResponseApikeysPerIdentity : Usage count for API keys per identity. +type IdentityLimitsUsageResponseApikeysPerIdentity struct { + // Maximum allowed API keys per identity. + Limit *int64 `json:"limit" validate:"required"` -// SetShowGroupID : Allow user to set ShowGroupID -func (_options *GetServiceIDOptions) SetShowGroupID(showGroupID string) *GetServiceIDOptions { - _options.ShowGroupID = core.StringPtr(showGroupID) - return _options + // List of identities with their API key usage counts. + Identities []IdentityCount `json:"identities,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *GetServiceIDOptions) SetHeaders(param map[string]string) *GetServiceIDOptions { - options.Headers = param - return options +// UnmarshalIdentityLimitsUsageResponseApikeysPerIdentity unmarshals an instance of IdentityLimitsUsageResponseApikeysPerIdentity from the specified map of raw messages. +func UnmarshalIdentityLimitsUsageResponseApikeysPerIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityLimitsUsageResponseApikeysPerIdentity) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "identities", &obj.Identities, UnmarshalIdentityCount) + if err != nil { + err = core.SDKErrorf(err, "", "identities-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetTrustedProfileAssignmentOptions : The GetTrustedProfileAssignment options. -type GetTrustedProfileAssignmentOptions struct { - // ID of the Assignment Record. - AssignmentID *string `json:"assignment_id" validate:"required,ne="` - - // Defines if the entity history is included in the response. - IncludeHistory *bool `json:"include_history,omitempty"` +// IdentityLimitsUsageResponseClaimRulesPerGroup : Usage count for claim rules per access group. +type IdentityLimitsUsageResponseClaimRulesPerGroup struct { + // Maximum allowed claim rules per access group. + Limit *int64 `json:"limit" validate:"required"` - // Allows users to set headers on API requests. - Headers map[string]string + // List of access groups with their claim rules usage counts. + AccessGroups []AccessGroupCount `json:"access_groups,omitempty"` } -// NewGetTrustedProfileAssignmentOptions : Instantiate GetTrustedProfileAssignmentOptions -func (*IamIdentityV1) NewGetTrustedProfileAssignmentOptions(assignmentID string) *GetTrustedProfileAssignmentOptions { - return &GetTrustedProfileAssignmentOptions{ - AssignmentID: core.StringPtr(assignmentID), +// UnmarshalIdentityLimitsUsageResponseClaimRulesPerGroup unmarshals an instance of IdentityLimitsUsageResponseClaimRulesPerGroup from the specified map of raw messages. +func UnmarshalIdentityLimitsUsageResponseClaimRulesPerGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityLimitsUsageResponseClaimRulesPerGroup) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "access_groups", &obj.AccessGroups, UnmarshalAccessGroupCount) + if err != nil { + err = core.SDKErrorf(err, "", "access_groups-error", common.GetComponentInfo()) + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetAssignmentID : Allow user to set AssignmentID -func (_options *GetTrustedProfileAssignmentOptions) SetAssignmentID(assignmentID string) *GetTrustedProfileAssignmentOptions { - _options.AssignmentID = core.StringPtr(assignmentID) - return _options -} +// IdentityLimitsUsageResponseClaimRulesPerProfile : Usage count for claim rules per profile. +type IdentityLimitsUsageResponseClaimRulesPerProfile struct { + // Maximum allowed claim rules per profile. + Limit *int64 `json:"limit" validate:"required"` -// SetIncludeHistory : Allow user to set IncludeHistory -func (_options *GetTrustedProfileAssignmentOptions) SetIncludeHistory(includeHistory bool) *GetTrustedProfileAssignmentOptions { - _options.IncludeHistory = core.BoolPtr(includeHistory) - return _options + // List of profiles with their claim rules usage counts. + Profiles []ProfileCount `json:"profiles,omitempty"` } -// SetHeaders : Allow user to set Headers -func (options *GetTrustedProfileAssignmentOptions) SetHeaders(param map[string]string) *GetTrustedProfileAssignmentOptions { - options.Headers = param - return options +// UnmarshalIdentityLimitsUsageResponseClaimRulesPerProfile unmarshals an instance of IdentityLimitsUsageResponseClaimRulesPerProfile from the specified map of raw messages. +func UnmarshalIdentityLimitsUsageResponseClaimRulesPerProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityLimitsUsageResponseClaimRulesPerProfile) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalProfileCount) + if err != nil { + err = core.SDKErrorf(err, "", "profiles-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// IDBasedMfaEnrollment : IDBasedMfaEnrollment struct -type IDBasedMfaEnrollment struct { - // Defines the MFA trait for the account. Valid values: - // * NONE - No MFA trait set - // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - // * 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. - TraitAccountDefault *string `json:"trait_account_default" validate:"required"` - - // Defines the MFA trait for the account. Valid values: - // * NONE - No MFA trait set - // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - // * 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. - TraitUserSpecific *string `json:"trait_user_specific,omitempty"` - - // Defines the MFA trait for the account. Valid values: - // * NONE - No MFA trait set - // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - // * 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. - TraitEffective *string `json:"trait_effective" validate:"required"` - - // The enrollment complies to the effective requirement. - Complies *bool `json:"complies" validate:"required"` +// IdentityLimitsUsageResponseCrLinksPerProfile : Usage count for compute resource links per profile. +type IdentityLimitsUsageResponseCrLinksPerProfile struct { + // Maximum allowed compute resource links per profile. + Limit *int64 `json:"limit" validate:"required"` - // Defines comply state for the account. Valid values: - // * NO - User does not comply in the given account. - // * ACCOUNT- User complies in the given account, but does not comply in at least one of the other account - // memberships. - // * CROSS_ACCOUNT - User complies in the given account and across all other account memberships. - ComplyState *string `json:"comply_state,omitempty"` + // List of profiles with their compute resource links usage counts. + Profiles []ProfileCount `json:"profiles,omitempty"` } -// Constants associated with the IDBasedMfaEnrollment.TraitAccountDefault property. -// Defines the MFA trait for the account. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * 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. -const ( - IDBasedMfaEnrollmentTraitAccountDefaultLevel1Const = "LEVEL1" - IDBasedMfaEnrollmentTraitAccountDefaultLevel2Const = "LEVEL2" - IDBasedMfaEnrollmentTraitAccountDefaultLevel3Const = "LEVEL3" - IDBasedMfaEnrollmentTraitAccountDefaultNoneConst = "NONE" - IDBasedMfaEnrollmentTraitAccountDefaultNoneNoRopcConst = "NONE_NO_ROPC" - IDBasedMfaEnrollmentTraitAccountDefaultTotpConst = "TOTP" - IDBasedMfaEnrollmentTraitAccountDefaultTotp4allConst = "TOTP4ALL" -) - -// Constants associated with the IDBasedMfaEnrollment.TraitUserSpecific property. -// Defines the MFA trait for the account. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * 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. -const ( - IDBasedMfaEnrollmentTraitUserSpecificLevel1Const = "LEVEL1" - IDBasedMfaEnrollmentTraitUserSpecificLevel2Const = "LEVEL2" - IDBasedMfaEnrollmentTraitUserSpecificLevel3Const = "LEVEL3" - IDBasedMfaEnrollmentTraitUserSpecificNoneConst = "NONE" - IDBasedMfaEnrollmentTraitUserSpecificNoneNoRopcConst = "NONE_NO_ROPC" - IDBasedMfaEnrollmentTraitUserSpecificTotpConst = "TOTP" - IDBasedMfaEnrollmentTraitUserSpecificTotp4allConst = "TOTP4ALL" -) +// UnmarshalIdentityLimitsUsageResponseCrLinksPerProfile unmarshals an instance of IdentityLimitsUsageResponseCrLinksPerProfile from the specified map of raw messages. +func UnmarshalIdentityLimitsUsageResponseCrLinksPerProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityLimitsUsageResponseCrLinksPerProfile) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalProfileCount) + if err != nil { + err = core.SDKErrorf(err, "", "profiles-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} -// Constants associated with the IDBasedMfaEnrollment.TraitEffective property. -// Defines the MFA trait for the account. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * 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. -const ( - IDBasedMfaEnrollmentTraitEffectiveLevel1Const = "LEVEL1" - IDBasedMfaEnrollmentTraitEffectiveLevel2Const = "LEVEL2" - IDBasedMfaEnrollmentTraitEffectiveLevel3Const = "LEVEL3" - IDBasedMfaEnrollmentTraitEffectiveNoneConst = "NONE" - IDBasedMfaEnrollmentTraitEffectiveNoneNoRopcConst = "NONE_NO_ROPC" - IDBasedMfaEnrollmentTraitEffectiveTotpConst = "TOTP" - IDBasedMfaEnrollmentTraitEffectiveTotp4allConst = "TOTP4ALL" -) +// IdentityLimitsUsageResponseCrRulesPerProfile : Usage count for compute resource rules per profile. +type IdentityLimitsUsageResponseCrRulesPerProfile struct { + // Maximum allowed compute resource rules per profile. + Limit *int64 `json:"limit" validate:"required"` -// Constants associated with the IDBasedMfaEnrollment.ComplyState property. -// Defines comply state for the account. Valid values: -// * NO - User does not comply in the given account. -// * ACCOUNT- User complies in the given account, but does not comply in at least one of the other account -// memberships. -// * CROSS_ACCOUNT - User complies in the given account and across all other account memberships. -const ( - IDBasedMfaEnrollmentComplyStateAccountConst = "ACCOUNT" - IDBasedMfaEnrollmentComplyStateCrossAccountConst = "CROSS_ACCOUNT" - IDBasedMfaEnrollmentComplyStateNoConst = "NO" -) + // List of profiles with their compute resource rules usage counts. + Profiles []ProfileCount `json:"profiles,omitempty"` +} -// UnmarshalIDBasedMfaEnrollment unmarshals an instance of IDBasedMfaEnrollment from the specified map of raw messages. -func UnmarshalIDBasedMfaEnrollment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(IDBasedMfaEnrollment) - err = core.UnmarshalPrimitive(m, "trait_account_default", &obj.TraitAccountDefault) +// UnmarshalIdentityLimitsUsageResponseCrRulesPerProfile unmarshals an instance of IdentityLimitsUsageResponseCrRulesPerProfile from the specified map of raw messages. +func UnmarshalIdentityLimitsUsageResponseCrRulesPerProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityLimitsUsageResponseCrRulesPerProfile) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { - err = core.SDKErrorf(err, "", "trait_account_default-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "trait_user_specific", &obj.TraitUserSpecific) + err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalProfileCount) if err != nil { - err = core.SDKErrorf(err, "", "trait_user_specific-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "profiles-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "trait_effective", &obj.TraitEffective) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IdentityLimitsUsageResponseServiceidsPerGroup : Usage count for service IDs per group. +type IdentityLimitsUsageResponseServiceidsPerGroup struct { + // Maximum allowed service IDs per group. + Limit *int64 `json:"limit" validate:"required"` + + // List of service ID groups with their usage counts. + ServiceidGroups []ServiceIDGroupCount `json:"serviceid_groups,omitempty"` +} + +// UnmarshalIdentityLimitsUsageResponseServiceidsPerGroup unmarshals an instance of IdentityLimitsUsageResponseServiceidsPerGroup from the specified map of raw messages. +func UnmarshalIdentityLimitsUsageResponseServiceidsPerGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityLimitsUsageResponseServiceidsPerGroup) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { - err = core.SDKErrorf(err, "", "trait_effective-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "complies", &obj.Complies) + err = core.UnmarshalModel(m, "serviceid_groups", &obj.ServiceidGroups, UnmarshalServiceIDGroupCount) if err != nil { - err = core.SDKErrorf(err, "", "complies-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "serviceid_groups-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "comply_state", &obj.ComplyState) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IdentityLimitsUsageResponseTemplateVersionsPerTemplate : Usage count for template versions per template. +type IdentityLimitsUsageResponseTemplateVersionsPerTemplate struct { + // Maximum allowed versions per template. + Limit *int64 `json:"limit" validate:"required"` + + // List of templates with their version usage counts. + Templates []TemplateCount `json:"templates,omitempty"` +} + +// UnmarshalIdentityLimitsUsageResponseTemplateVersionsPerTemplate unmarshals an instance of IdentityLimitsUsageResponseTemplateVersionsPerTemplate from the specified map of raw messages. +func UnmarshalIdentityLimitsUsageResponseTemplateVersionsPerTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityLimitsUsageResponseTemplateVersionsPerTemplate) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { - err = core.SDKErrorf(err, "", "comply_state-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "templates", &obj.Templates, UnmarshalTemplateCount) + if err != nil { + err = core.SDKErrorf(err, "", "templates-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -11528,8 +12259,8 @@ type IdentityPreferenceResponse struct { // present. ValueString *string `json:"value_string,omitempty"` - // List of value of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' is - // present. + // List of values of the preference, only one value property is set, either 'value_string' or 'value_list_of_strings' + // is present. ValueListOfStrings []string `json:"value_list_of_strings,omitempty"` } @@ -11588,6 +12319,32 @@ func UnmarshalIdentityPreferencesResponse(m map[string]json.RawMessage, result i return } +// LimitCount : Limit and current usage count for a resource. +type LimitCount struct { + // Maximum allowed value for the resource. + Limit *int64 `json:"limit" validate:"required"` + + // Current usage count for the resource. + Count *int64 `json:"count,omitempty"` +} + +// UnmarshalLimitCount unmarshals an instance of LimitCount from the specified map of raw messages. +func UnmarshalLimitCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LimitCount) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "count", &obj.Count) + if err != nil { + err = core.SDKErrorf(err, "", "count-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // ListAccountSettingsAssignmentsOptions : The ListAccountSettingsAssignments options. type ListAccountSettingsAssignmentsOptions struct { // Account ID of the Assignments to query. This parameter is required unless using a pagetoken. @@ -11627,22 +12384,22 @@ type ListAccountSettingsAssignmentsOptions struct { // Constants associated with the ListAccountSettingsAssignmentsOptions.TargetType property. // Filter results by the assignment's target type. const ( - ListAccountSettingsAssignmentsOptionsTargetTypeAccountConst = "Account" + ListAccountSettingsAssignmentsOptionsTargetTypeAccountConst = "Account" ListAccountSettingsAssignmentsOptionsTargetTypeAccountgroupConst = "AccountGroup" ) // Constants associated with the ListAccountSettingsAssignmentsOptions.Sort property. // If specified, the items are sorted by the value of this property. const ( - ListAccountSettingsAssignmentsOptionsSortCreatedAtConst = "created_at" + ListAccountSettingsAssignmentsOptionsSortCreatedAtConst = "created_at" ListAccountSettingsAssignmentsOptionsSortLastModifiedAtConst = "last_modified_at" - ListAccountSettingsAssignmentsOptionsSortTemplateIDConst = "template_id" + ListAccountSettingsAssignmentsOptionsSortTemplateIDConst = "template_id" ) // Constants associated with the ListAccountSettingsAssignmentsOptions.Order property. // Sort order. const ( - ListAccountSettingsAssignmentsOptionsOrderAscConst = "asc" + ListAccountSettingsAssignmentsOptionsOrderAscConst = "asc" ListAccountSettingsAssignmentsOptionsOrderDescConst = "desc" ) @@ -11744,15 +12501,15 @@ type ListAccountSettingsTemplatesOptions struct { // Constants associated with the ListAccountSettingsTemplatesOptions.Sort property. // Optional sort property. If specified, the returned templated are sorted according to this property. const ( - ListAccountSettingsTemplatesOptionsSortCreatedAtConst = "created_at" + ListAccountSettingsTemplatesOptionsSortCreatedAtConst = "created_at" ListAccountSettingsTemplatesOptionsSortLastModifiedAtConst = "last_modified_at" - ListAccountSettingsTemplatesOptionsSortNameConst = "name" + ListAccountSettingsTemplatesOptionsSortNameConst = "name" ) // Constants associated with the ListAccountSettingsTemplatesOptions.Order property. // Optional sort order. const ( - ListAccountSettingsTemplatesOptionsOrderAscConst = "asc" + ListAccountSettingsTemplatesOptionsOrderAscConst = "asc" ListAccountSettingsTemplatesOptionsOrderDescConst = "desc" ) @@ -11853,20 +12610,20 @@ type ListAPIKeysOptions struct { // Optional parameter to define the scope of the queried API keys. Can be 'entity' (default) or 'account'. const ( ListAPIKeysOptionsScopeAccountConst = "account" - ListAPIKeysOptionsScopeEntityConst = "entity" + ListAPIKeysOptionsScopeEntityConst = "entity" ) // Constants associated with the ListAPIKeysOptions.Type property. // Optional parameter to filter the type of the queried API keys. Can be 'user' or 'serviceid'. const ( ListAPIKeysOptionsTypeServiceidConst = "serviceid" - ListAPIKeysOptionsTypeUserConst = "user" + ListAPIKeysOptionsTypeUserConst = "user" ) // Constants associated with the ListAPIKeysOptions.Order property. // Optional sort order, valid values are asc and desc. Default: asc. const ( - ListAPIKeysOptionsOrderAscConst = "asc" + ListAPIKeysOptionsOrderAscConst = "asc" ListAPIKeysOptionsOrderDescConst = "desc" ) @@ -12030,15 +12787,15 @@ type ListProfileTemplatesOptions struct { // Constants associated with the ListProfileTemplatesOptions.Sort property. // Optional sort property. If specified, the returned templates are sorted according to this property. const ( - ListProfileTemplatesOptionsSortCreatedAtConst = "created_at" + ListProfileTemplatesOptionsSortCreatedAtConst = "created_at" ListProfileTemplatesOptionsSortLastModifiedAtConst = "last_modified_at" - ListProfileTemplatesOptionsSortNameConst = "name" + ListProfileTemplatesOptionsSortNameConst = "name" ) // Constants associated with the ListProfileTemplatesOptions.Order property. // Optional sort order. const ( - ListProfileTemplatesOptionsOrderAscConst = "asc" + ListProfileTemplatesOptionsOrderAscConst = "asc" ListProfileTemplatesOptionsOrderDescConst = "desc" ) @@ -12124,7 +12881,7 @@ type ListProfilesOptions struct { // Constants associated with the ListProfilesOptions.Order property. // Optional sort order, valid values are asc and desc. Default: asc. const ( - ListProfilesOptionsOrderAscConst = "asc" + ListProfilesOptionsOrderAscConst = "asc" ListProfilesOptionsOrderDescConst = "desc" ) @@ -12256,7 +13013,7 @@ type ListServiceIdsOptions struct { // Constants associated with the ListServiceIdsOptions.Order property. // Optional sort order, valid values are asc and desc. Default: asc. const ( - ListServiceIdsOptionsOrderAscConst = "asc" + ListServiceIdsOptionsOrderAscConst = "asc" ListServiceIdsOptionsOrderDescConst = "desc" ) @@ -12370,22 +13127,22 @@ type ListTrustedProfileAssignmentsOptions struct { // Constants associated with the ListTrustedProfileAssignmentsOptions.TargetType property. // Filter results by the assignment's target type. const ( - ListTrustedProfileAssignmentsOptionsTargetTypeAccountConst = "Account" + ListTrustedProfileAssignmentsOptionsTargetTypeAccountConst = "Account" ListTrustedProfileAssignmentsOptionsTargetTypeAccountgroupConst = "AccountGroup" ) // Constants associated with the ListTrustedProfileAssignmentsOptions.Sort property. // If specified, the items are sorted by the value of this property. const ( - ListTrustedProfileAssignmentsOptionsSortCreatedAtConst = "created_at" + ListTrustedProfileAssignmentsOptionsSortCreatedAtConst = "created_at" ListTrustedProfileAssignmentsOptionsSortLastModifiedAtConst = "last_modified_at" - ListTrustedProfileAssignmentsOptionsSortTemplateIDConst = "template_id" + ListTrustedProfileAssignmentsOptionsSortTemplateIDConst = "template_id" ) // Constants associated with the ListTrustedProfileAssignmentsOptions.Order property. // Sort order. const ( - ListTrustedProfileAssignmentsOptionsOrderAscConst = "asc" + ListTrustedProfileAssignmentsOptionsOrderAscConst = "asc" ListTrustedProfileAssignmentsOptionsOrderDescConst = "desc" ) @@ -12487,15 +13244,15 @@ type ListVersionsOfAccountSettingsTemplateOptions struct { // Constants associated with the ListVersionsOfAccountSettingsTemplateOptions.Sort property. // Optional sort property. If specified, the returned templated are sorted according to this property. const ( - ListVersionsOfAccountSettingsTemplateOptionsSortCreatedAtConst = "created_at" + ListVersionsOfAccountSettingsTemplateOptionsSortCreatedAtConst = "created_at" ListVersionsOfAccountSettingsTemplateOptionsSortLastModifiedAtConst = "last_modified_at" - ListVersionsOfAccountSettingsTemplateOptionsSortNameConst = "name" + ListVersionsOfAccountSettingsTemplateOptionsSortNameConst = "name" ) // Constants associated with the ListVersionsOfAccountSettingsTemplateOptions.Order property. // Optional sort order. const ( - ListVersionsOfAccountSettingsTemplateOptionsOrderAscConst = "asc" + ListVersionsOfAccountSettingsTemplateOptionsOrderAscConst = "asc" ListVersionsOfAccountSettingsTemplateOptionsOrderDescConst = "desc" ) @@ -12575,15 +13332,15 @@ type ListVersionsOfProfileTemplateOptions struct { // Constants associated with the ListVersionsOfProfileTemplateOptions.Sort property. // Optional sort property. If specified, the returned templated are sorted according to this property. const ( - ListVersionsOfProfileTemplateOptionsSortCreatedAtConst = "created_at" + ListVersionsOfProfileTemplateOptionsSortCreatedAtConst = "created_at" ListVersionsOfProfileTemplateOptionsSortLastModifiedAtConst = "last_modified_at" - ListVersionsOfProfileTemplateOptionsSortNameConst = "name" + ListVersionsOfProfileTemplateOptionsSortNameConst = "name" ) // Constants associated with the ListVersionsOfProfileTemplateOptions.Order property. // Optional sort order. const ( - ListVersionsOfProfileTemplateOptionsOrderAscConst = "asc" + ListVersionsOfProfileTemplateOptionsOrderAscConst = "asc" ListVersionsOfProfileTemplateOptionsOrderDescConst = "desc" ) @@ -12718,38 +13475,6 @@ func UnmarshalMfaEnrollmentTypeStatus(m map[string]json.RawMessage, result inter return } -// MfaEnrollments : MfaEnrollments struct -type MfaEnrollments struct { - // currently effective mfa type i.e. id_based_mfa or account_based_mfa. - EffectiveMfaType *string `json:"effective_mfa_type" validate:"required"` - - IDBasedMfa *IDBasedMfaEnrollment `json:"id_based_mfa,omitempty"` - - AccountBasedMfa *AccountBasedMfaEnrollment `json:"account_based_mfa,omitempty"` -} - -// UnmarshalMfaEnrollments unmarshals an instance of MfaEnrollments from the specified map of raw messages. -func UnmarshalMfaEnrollments(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(MfaEnrollments) - err = core.UnmarshalPrimitive(m, "effective_mfa_type", &obj.EffectiveMfaType) - if err != nil { - err = core.SDKErrorf(err, "", "effective_mfa_type-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "id_based_mfa", &obj.IDBasedMfa, UnmarshalIDBasedMfaEnrollment) - if err != nil { - err = core.SDKErrorf(err, "", "id_based_mfa-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "account_based_mfa", &obj.AccountBasedMfa, UnmarshalAccountBasedMfaEnrollment) - if err != nil { - err = core.SDKErrorf(err, "", "account_based_mfa-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // PolicyTemplateReference : Metadata for external access policy. type PolicyTemplateReference struct { // ID of Access Policy Template. @@ -12762,7 +13487,7 @@ type PolicyTemplateReference struct { // NewPolicyTemplateReference : Instantiate PolicyTemplateReference (Generic Model Constructor) func (*IamIdentityV1) NewPolicyTemplateReference(id string, version string) (_model *PolicyTemplateReference, err error) { _model = &PolicyTemplateReference{ - ID: core.StringPtr(id), + ID: core.StringPtr(id), Version: core.StringPtr(version), } err = core.ValidateStruct(_model, "required parameters") @@ -12815,7 +13540,8 @@ type ProfileClaimRule struct { // Session expiration in seconds. Expiration *int64 `json:"expiration" validate:"required"` - // The compute resource type. Not required if type is Profile-SAML. Valid values are VSI, IKS_SA, ROKS_SA. + // The compute resource type. Not required if type is Profile-SAML. Valid values are VSI, PVS, BMS, IKS_SA, ROKS_SA, + // CE. CrType *string `json:"cr_type,omitempty"` // Conditions of this claim rule. @@ -12896,9 +13622,9 @@ type ProfileClaimRuleConditions struct { // NewProfileClaimRuleConditions : Instantiate ProfileClaimRuleConditions (Generic Model Constructor) func (*IamIdentityV1) NewProfileClaimRuleConditions(claim string, operator string, value string) (_model *ProfileClaimRuleConditions, err error) { _model = &ProfileClaimRuleConditions{ - Claim: core.StringPtr(claim), + Claim: core.StringPtr(claim), Operator: core.StringPtr(operator), - Value: core.StringPtr(value), + Value: core.StringPtr(value), } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -12955,6 +13681,32 @@ func UnmarshalProfileClaimRuleList(m map[string]json.RawMessage, result interfac return } +// ProfileCount : Resource count for a specific profile. +type ProfileCount struct { + // Profile identifier. + ProfileID *string `json:"profile_id,omitempty"` + + // Number of resources associated with the profile. + Count *int64 `json:"count,omitempty"` +} + +// UnmarshalProfileCount unmarshals an instance of ProfileCount from the specified map of raw messages. +func UnmarshalProfileCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProfileCount) + err = core.UnmarshalPrimitive(m, "profile_id", &obj.ProfileID) + if err != nil { + err = core.SDKErrorf(err, "", "profile_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "count", &obj.Count) + if err != nil { + err = core.SDKErrorf(err, "", "count-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // ProfileIdentitiesResponse : ProfileIdentitiesResponse struct type ProfileIdentitiesResponse struct { // Entity tag of the profile identities response. @@ -13003,16 +13755,16 @@ type ProfileIdentityRequest struct { // Constants associated with the ProfileIdentityRequest.Type property. // Type of the identity. const ( - ProfileIdentityRequestTypeCRNConst = "crn" + ProfileIdentityRequestTypeCRNConst = "crn" ProfileIdentityRequestTypeServiceidConst = "serviceid" - ProfileIdentityRequestTypeUserConst = "user" + ProfileIdentityRequestTypeUserConst = "user" ) // NewProfileIdentityRequest : Instantiate ProfileIdentityRequest (Generic Model Constructor) func (*IamIdentityV1) NewProfileIdentityRequest(identifier string, typeVar string) (_model *ProfileIdentityRequest, err error) { _model = &ProfileIdentityRequest{ Identifier: core.StringPtr(identifier), - Type: core.StringPtr(typeVar), + Type: core.StringPtr(typeVar), } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -13073,9 +13825,9 @@ type ProfileIdentityResponse struct { // Constants associated with the ProfileIdentityResponse.Type property. // Type of the identity. const ( - ProfileIdentityResponseTypeCRNConst = "crn" + ProfileIdentityResponseTypeCRNConst = "crn" ProfileIdentityResponseTypeServiceidConst = "serviceid" - ProfileIdentityResponseTypeUserConst = "user" + ProfileIdentityResponseTypeUserConst = "user" ) // UnmarshalProfileIdentityResponse unmarshals an instance of ProfileIdentityResponse from the specified map of raw messages. @@ -13127,9 +13879,13 @@ type ProfileLink struct { // Optional name of the Link. Name *string `json:"name,omitempty"` - // The compute resource type. Valid values are VSI, BMS, IKS_SA, ROKS_SA, CE. + // The compute resource type. Valid values are VSI, PVS, BMS, IKS_SA, ROKS_SA, CE. CrType *string `json:"cr_type" validate:"required"` + // Flag to indicate that the link provides cross account access. If not provided then the account scope of the CRN must + // match the Profile's account. + IsCrossAccount *bool `json:"is_cross_account,omitempty"` + Link *ProfileLinkLink `json:"link" validate:"required"` } @@ -13166,6 +13922,11 @@ func UnmarshalProfileLink(m map[string]json.RawMessage, result interface{}) (err err = core.SDKErrorf(err, "", "cr_type-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "is_cross_account", &obj.IsCrossAccount) + if err != nil { + err = core.SDKErrorf(err, "", "is_cross_account-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "link", &obj.Link, UnmarshalProfileLinkLink) if err != nil { err = core.SDKErrorf(err, "", "link-error", common.GetComponentInfo()) @@ -13711,12 +14472,38 @@ func UnmarshalServiceIDGroup(m map[string]json.RawMessage, result interface{}) ( } err = core.UnmarshalPrimitive(m, "created_by", &obj.CreatedBy) if err != nil { - err = core.SDKErrorf(err, "", "created_by-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "created_by-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "modified_at", &obj.ModifiedAt) + if err != nil { + err = core.SDKErrorf(err, "", "modified_at-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ServiceIDGroupCount : Service ID count for a specific group. +type ServiceIDGroupCount struct { + // Service ID group identifier. + GroupID *string `json:"group_id,omitempty"` + + // Number of service IDs in the group. + Count *int64 `json:"count,omitempty"` +} + +// UnmarshalServiceIDGroupCount unmarshals an instance of ServiceIDGroupCount from the specified map of raw messages. +func UnmarshalServiceIDGroupCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ServiceIDGroupCount) + err = core.UnmarshalPrimitive(m, "group_id", &obj.GroupID) + if err != nil { + err = core.SDKErrorf(err, "", "group_id-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "modified_at", &obj.ModifiedAt) + err = core.UnmarshalPrimitive(m, "count", &obj.Count) if err != nil { - err = core.SDKErrorf(err, "", "modified_at-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "count-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -13830,7 +14617,7 @@ type SetProfileIdentitiesOptions struct { func (*IamIdentityV1) NewSetProfileIdentitiesOptions(profileID string, ifMatch string) *SetProfileIdentitiesOptions { return &SetProfileIdentitiesOptions{ ProfileID: core.StringPtr(profileID), - IfMatch: core.StringPtr(ifMatch), + IfMatch: core.StringPtr(ifMatch), } } @@ -13889,26 +14676,26 @@ type SetProfileIdentityOptions struct { // Constants associated with the SetProfileIdentityOptions.IdentityType property. // Type of the identity. const ( - SetProfileIdentityOptionsIdentityTypeCRNConst = "crn" + SetProfileIdentityOptionsIdentityTypeCRNConst = "crn" SetProfileIdentityOptionsIdentityTypeServiceidConst = "serviceid" - SetProfileIdentityOptionsIdentityTypeUserConst = "user" + SetProfileIdentityOptionsIdentityTypeUserConst = "user" ) // Constants associated with the SetProfileIdentityOptions.Type property. // Type of the identity. const ( - SetProfileIdentityOptionsTypeCRNConst = "crn" + SetProfileIdentityOptionsTypeCRNConst = "crn" SetProfileIdentityOptionsTypeServiceidConst = "serviceid" - SetProfileIdentityOptionsTypeUserConst = "user" + SetProfileIdentityOptionsTypeUserConst = "user" ) // NewSetProfileIdentityOptions : Instantiate SetProfileIdentityOptions func (*IamIdentityV1) NewSetProfileIdentityOptions(profileID string, identityType string, identifier string, typeVar string) *SetProfileIdentityOptions { return &SetProfileIdentityOptions{ - ProfileID: core.StringPtr(profileID), + ProfileID: core.StringPtr(profileID), IdentityType: core.StringPtr(identityType), - Identifier: core.StringPtr(identifier), - Type: core.StringPtr(typeVar), + Identifier: core.StringPtr(identifier), + Type: core.StringPtr(typeVar), } } @@ -13954,6 +14741,224 @@ func (options *SetProfileIdentityOptions) SetHeaders(param map[string]string) *S return options } +// TemplateAccountSettings : Input body parameters for the Account Settings REST request. +type TemplateAccountSettings struct { + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs + // * NOT_SET - to 'unset' a previous set value. + RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` + + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs + // * NOT_SET - to 'unset' a previous set value. + RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` + + // Defines the IP addresses and subnets from which IAM tokens can be created for the account. + AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` + + // MFA trait definitions as follows: + // * NONE - No MFA trait set + // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + // * 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 - Security Key MFA for all users. + Mfa *string `json:"mfa,omitempty"` + + // List of users that are exempted from the MFA requirement of the account. + UserMfa []UserMfa `json:"user_mfa,omitempty"` + + // 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. + SessionExpirationInSeconds *string `json:"session_expiration_in_seconds,omitempty"` + + // 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. + SessionInvalidationInSeconds *string `json:"session_invalidation_in_seconds,omitempty"` + + // Defines the max allowed sessions per identity required by the account. Valid values: + // * Any whole number greater than 0 + // * NOT_SET - To unset account setting and use service default. + MaxSessionsPerIdentity *string `json:"max_sessions_per_identity,omitempty"` + + // Defines the access token expiration in seconds. Valid values: + // * Any whole number between '900' and '3600' + // * NOT_SET - To unset account setting and use service default. + SystemAccessTokenExpirationInSeconds *string `json:"system_access_token_expiration_in_seconds,omitempty"` + + // Defines the refresh token expiration in seconds. Valid values: + // * Any whole number between '900' and '259200' + // * NOT_SET - To unset account setting and use service default. + SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` + + // Defines whether or not user visibility is access controlled. Valid values: + // * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to + // the account, or descendants of those users based on the classic infrastructure hierarchy + // * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console + // * NOT_SET - to 'unset' a previous set value. + RestrictUserListVisibility *string `json:"restrict_user_list_visibility,omitempty"` + + RestrictUserDomains *TemplateAccountSettingsRestrictUserDomains `json:"restrict_user_domains,omitempty"` +} + +// Constants associated with the TemplateAccountSettings.RestrictCreateServiceID property. +// Defines whether or not creating the resource is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// +// IDs, including the account owner +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. +const ( + TemplateAccountSettingsRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" + TemplateAccountSettingsRestrictCreateServiceIDNotSetConst = "NOT_SET" + TemplateAccountSettingsRestrictCreateServiceIDRestrictedConst = "RESTRICTED" +) + +// Constants associated with the TemplateAccountSettings.RestrictCreatePlatformApikey property. +// Defines whether or not creating the resource is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// +// IDs, including the account owner +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. +const ( + TemplateAccountSettingsRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" + TemplateAccountSettingsRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" + TemplateAccountSettingsRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" +) + +// Constants associated with the TemplateAccountSettings.Mfa property. +// MFA trait definitions as follows: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - 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 - Security Key MFA for all users. +const ( + TemplateAccountSettingsMfaLevel1Const = "LEVEL1" + TemplateAccountSettingsMfaLevel2Const = "LEVEL2" + TemplateAccountSettingsMfaLevel3Const = "LEVEL3" + TemplateAccountSettingsMfaNoneConst = "NONE" + TemplateAccountSettingsMfaNoneNoRopcConst = "NONE_NO_ROPC" + TemplateAccountSettingsMfaTotpConst = "TOTP" + TemplateAccountSettingsMfaTotp4allConst = "TOTP4ALL" +) + +// Constants associated with the TemplateAccountSettings.RestrictUserListVisibility property. +// Defines whether or not user visibility is access controlled. Valid values: +// - RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to +// +// the account, or descendants of those users based on the classic infrastructure hierarchy +// - NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console +// - NOT_SET - to 'unset' a previous set value. +const ( + TemplateAccountSettingsRestrictUserListVisibilityNotRestrictedConst = "NOT_RESTRICTED" + TemplateAccountSettingsRestrictUserListVisibilityNotSetConst = "NOT_SET" + TemplateAccountSettingsRestrictUserListVisibilityRestrictedConst = "RESTRICTED" +) + +// UnmarshalTemplateAccountSettings unmarshals an instance of TemplateAccountSettings from the specified map of raw messages. +func UnmarshalTemplateAccountSettings(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateAccountSettings) + err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "restrict_create_platform_apikey", &obj.RestrictCreatePlatformApikey) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_create_platform_apikey-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "allowed_ip_addresses", &obj.AllowedIPAddresses) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) + if err != nil { + err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalUserMfa) + if err != nil { + err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "session_invalidation_in_seconds", &obj.SessionInvalidationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "session_invalidation_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "max_sessions_per_identity", &obj.MaxSessionsPerIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "max_sessions_per_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "system_access_token_expiration_in_seconds", &obj.SystemAccessTokenExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "system_access_token_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "system_refresh_token_expiration_in_seconds", &obj.SystemRefreshTokenExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "restrict_user_list_visibility", &obj.RestrictUserListVisibility) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_list_visibility-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "restrict_user_domains", &obj.RestrictUserDomains, UnmarshalTemplateAccountSettingsRestrictUserDomains) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_domains-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// TemplateAccountSettingsRestrictUserDomains : TemplateAccountSettingsRestrictUserDomains struct +type TemplateAccountSettingsRestrictUserDomains struct { + AccountSufficient *bool `json:"account_sufficient,omitempty"` + + // Defines if account invitations are restricted to specified domains. To remove an entry for a realm_id, perform an + // update (PUT) request with only the realm_id set. + Restrictions []AccountSettingsUserDomainRestriction `json:"restrictions,omitempty"` +} + +// UnmarshalTemplateAccountSettingsRestrictUserDomains unmarshals an instance of TemplateAccountSettingsRestrictUserDomains from the specified map of raw messages. +func UnmarshalTemplateAccountSettingsRestrictUserDomains(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateAccountSettingsRestrictUserDomains) + err = core.UnmarshalPrimitive(m, "account_sufficient", &obj.AccountSufficient) + if err != nil { + err = core.SDKErrorf(err, "", "account_sufficient-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "restrictions", &obj.Restrictions, UnmarshalAccountSettingsUserDomainRestriction) + if err != nil { + err = core.SDKErrorf(err, "", "restrictions-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // TemplateAssignmentListResponse : List Response body format for Template Assignments Records. type TemplateAssignmentListResponse struct { // Context with key properties for problem determination. @@ -14312,6 +15317,32 @@ func UnmarshalTemplateAssignmentResponseResourceDetail(m map[string]json.RawMess return } +// TemplateCount : Version count for a specific template. +type TemplateCount struct { + // Template identifier. + TemplateID *string `json:"template_id,omitempty"` + + // Number of versions for the template. + Count *int64 `json:"count,omitempty"` +} + +// UnmarshalTemplateCount unmarshals an instance of TemplateCount from the specified map of raw messages. +func UnmarshalTemplateCount(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateCount) + err = core.UnmarshalPrimitive(m, "template_id", &obj.TemplateID) + if err != nil { + err = core.SDKErrorf(err, "", "template_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "count", &obj.Count) + if err != nil { + err = core.SDKErrorf(err, "", "count-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // TemplateProfileComponentRequest : Input body parameters for the TemplateProfileComponent. type TemplateProfileComponentRequest struct { // Name of the Profile. @@ -14622,7 +15653,7 @@ const ( // NewTrustedProfileTemplateClaimRule : Instantiate TrustedProfileTemplateClaimRule (Generic Model Constructor) func (*IamIdentityV1) NewTrustedProfileTemplateClaimRule(typeVar string, conditions []ProfileClaimRuleConditions) (_model *TrustedProfileTemplateClaimRule, err error) { _model = &TrustedProfileTemplateClaimRule{ - Type: core.StringPtr(typeVar), + Type: core.StringPtr(typeVar), Conditions: conditions, } err = core.ValidateStruct(_model, "required parameters") @@ -15013,8 +16044,8 @@ type UpdateAccountSettingsAssignmentOptions struct { // NewUpdateAccountSettingsAssignmentOptions : Instantiate UpdateAccountSettingsAssignmentOptions func (*IamIdentityV1) NewUpdateAccountSettingsAssignmentOptions(assignmentID string, ifMatch string, templateVersion int64) *UpdateAccountSettingsAssignmentOptions { return &UpdateAccountSettingsAssignmentOptions{ - AssignmentID: core.StringPtr(assignmentID), - IfMatch: core.StringPtr(ifMatch), + AssignmentID: core.StringPtr(assignmentID), + IfMatch: core.StringPtr(ifMatch), TemplateVersion: core.Int64Ptr(templateVersion), } } @@ -15053,35 +16084,35 @@ type UpdateAccountSettingsOptions struct { // The id of the account to update the settings for. AccountID *string `json:"account_id" validate:"required,ne="` - // Defines whether or not creating a service ID is access controlled. Valid values: + // Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` - // Defines whether or not creating platform API keys is access controlled. Valid values: - // * RESTRICTED - only users assigned the 'User API key creator' role on the IAM Identity Service can create API - // keys, including the account owner - // * NOT_RESTRICTED - all members of an account can create platform API keys + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` // Defines the IP addresses and subnets from which IAM tokens can be created for the account. AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` - // Defines the MFA trait for the account. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * 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. + // * LEVEL3 - Security Key MFA for all users. Mfa *string `json:"mfa,omitempty"` // List of users that are exempted from the MFA requirement of the account. - UserMfa []AccountSettingsUserMfa `json:"user_mfa,omitempty"` + UserMfa []UserMfa `json:"user_mfa,omitempty"` // Defines the session expiration in seconds for the account. Valid values: // * Any whole number between between '900' and '86400' @@ -15093,7 +16124,7 @@ type UpdateAccountSettingsOptions struct { // * NOT_SET - To unset account setting and use service default. SessionInvalidationInSeconds *string `json:"session_invalidation_in_seconds,omitempty"` - // Defines the max allowed sessions per identity required by the account. Value values: + // Defines the max allowed sessions per identity required by the account. Valid values: // * Any whole number greater than 0 // * NOT_SET - To unset account setting and use service default. MaxSessionsPerIdentity *string `json:"max_sessions_per_identity,omitempty"` @@ -15108,57 +16139,80 @@ type UpdateAccountSettingsOptions struct { // * NOT_SET - To unset account setting and use service default. SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` + // Defines whether or not user visibility is access controlled. Valid values: + // * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to + // the account, or descendants of those users based on the classic infrastructure hierarchy + // * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. + RestrictUserListVisibility *string `json:"restrict_user_list_visibility,omitempty"` + + // Defines if account invitations are restricted to specified domains. To remove an entry for a realm_id, perform an + // update (PUT) request with only the realm_id set. + RestrictUserDomains []AccountSettingsUserDomainRestriction `json:"restrict_user_domains,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } // Constants associated with the UpdateAccountSettingsOptions.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: -// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// Defines whether or not creating the resource is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// // IDs, including the account owner -// * NOT_RESTRICTED - all members of an account can create service IDs -// * NOT_SET - to 'unset' a previous set value. +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. const ( UpdateAccountSettingsOptionsRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" - UpdateAccountSettingsOptionsRestrictCreateServiceIDNotSetConst = "NOT_SET" - UpdateAccountSettingsOptionsRestrictCreateServiceIDRestrictedConst = "RESTRICTED" + UpdateAccountSettingsOptionsRestrictCreateServiceIDNotSetConst = "NOT_SET" + UpdateAccountSettingsOptionsRestrictCreateServiceIDRestrictedConst = "RESTRICTED" ) // Constants associated with the UpdateAccountSettingsOptions.RestrictCreatePlatformApikey property. -// Defines whether or not creating platform API keys is access controlled. Valid values: -// * RESTRICTED - only users assigned the 'User API key creator' role on the IAM Identity Service can create API keys, -// including the account owner -// * NOT_RESTRICTED - all members of an account can create platform API keys -// * NOT_SET - to 'unset' a previous set value. +// Defines whether or not creating the resource is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// +// IDs, including the account owner +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. const ( UpdateAccountSettingsOptionsRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" - UpdateAccountSettingsOptionsRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" - UpdateAccountSettingsOptionsRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" + UpdateAccountSettingsOptionsRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" + UpdateAccountSettingsOptionsRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" ) // Constants associated with the UpdateAccountSettingsOptions.Mfa property. -// Defines the MFA trait for the account. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * 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. +// MFA trait definitions as follows: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - 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 - Security Key MFA for all users. const ( - UpdateAccountSettingsOptionsMfaLevel1Const = "LEVEL1" - UpdateAccountSettingsOptionsMfaLevel2Const = "LEVEL2" - UpdateAccountSettingsOptionsMfaLevel3Const = "LEVEL3" - UpdateAccountSettingsOptionsMfaNoneConst = "NONE" + UpdateAccountSettingsOptionsMfaLevel1Const = "LEVEL1" + UpdateAccountSettingsOptionsMfaLevel2Const = "LEVEL2" + UpdateAccountSettingsOptionsMfaLevel3Const = "LEVEL3" + UpdateAccountSettingsOptionsMfaNoneConst = "NONE" UpdateAccountSettingsOptionsMfaNoneNoRopcConst = "NONE_NO_ROPC" - UpdateAccountSettingsOptionsMfaTotpConst = "TOTP" - UpdateAccountSettingsOptionsMfaTotp4allConst = "TOTP4ALL" + UpdateAccountSettingsOptionsMfaTotpConst = "TOTP" + UpdateAccountSettingsOptionsMfaTotp4allConst = "TOTP4ALL" +) + +// Constants associated with the UpdateAccountSettingsOptions.RestrictUserListVisibility property. +// Defines whether or not user visibility is access controlled. Valid values: +// - RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to +// +// the account, or descendants of those users based on the classic infrastructure hierarchy +// - NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. +const ( + UpdateAccountSettingsOptionsRestrictUserListVisibilityNotRestrictedConst = "NOT_RESTRICTED" + UpdateAccountSettingsOptionsRestrictUserListVisibilityRestrictedConst = "RESTRICTED" ) // NewUpdateAccountSettingsOptions : Instantiate UpdateAccountSettingsOptions func (*IamIdentityV1) NewUpdateAccountSettingsOptions(ifMatch string, accountID string) *UpdateAccountSettingsOptions { return &UpdateAccountSettingsOptions{ - IfMatch: core.StringPtr(ifMatch), + IfMatch: core.StringPtr(ifMatch), AccountID: core.StringPtr(accountID), } } @@ -15200,7 +16254,7 @@ func (_options *UpdateAccountSettingsOptions) SetMfa(mfa string) *UpdateAccountS } // SetUserMfa : Allow user to set UserMfa -func (_options *UpdateAccountSettingsOptions) SetUserMfa(userMfa []AccountSettingsUserMfa) *UpdateAccountSettingsOptions { +func (_options *UpdateAccountSettingsOptions) SetUserMfa(userMfa []UserMfa) *UpdateAccountSettingsOptions { _options.UserMfa = userMfa return _options } @@ -15235,6 +16289,18 @@ func (_options *UpdateAccountSettingsOptions) SetSystemRefreshTokenExpirationInS return _options } +// SetRestrictUserListVisibility : Allow user to set RestrictUserListVisibility +func (_options *UpdateAccountSettingsOptions) SetRestrictUserListVisibility(restrictUserListVisibility string) *UpdateAccountSettingsOptions { + _options.RestrictUserListVisibility = core.StringPtr(restrictUserListVisibility) + return _options +} + +// SetRestrictUserDomains : Allow user to set RestrictUserDomains +func (_options *UpdateAccountSettingsOptions) SetRestrictUserDomains(restrictUserDomains []AccountSettingsUserDomainRestriction) *UpdateAccountSettingsOptions { + _options.RestrictUserDomains = restrictUserDomains + return _options +} + // SetHeaders : Allow user to set Headers func (options *UpdateAccountSettingsOptions) SetHeaders(param map[string]string) *UpdateAccountSettingsOptions { options.Headers = param @@ -15263,7 +16329,8 @@ type UpdateAccountSettingsTemplateVersionOptions struct { // The description of the trusted profile template. Describe the template for enterprise account users. Description *string `json:"description,omitempty"` - AccountSettings *AccountSettingsComponent `json:"account_settings,omitempty"` + // Input body parameters for the Account Settings REST request. + AccountSettings *TemplateAccountSettings `json:"account_settings,omitempty"` // Allows users to set headers on API requests. Headers map[string]string @@ -15272,9 +16339,9 @@ type UpdateAccountSettingsTemplateVersionOptions struct { // NewUpdateAccountSettingsTemplateVersionOptions : Instantiate UpdateAccountSettingsTemplateVersionOptions func (*IamIdentityV1) NewUpdateAccountSettingsTemplateVersionOptions(ifMatch string, templateID string, version string) *UpdateAccountSettingsTemplateVersionOptions { return &UpdateAccountSettingsTemplateVersionOptions{ - IfMatch: core.StringPtr(ifMatch), + IfMatch: core.StringPtr(ifMatch), TemplateID: core.StringPtr(templateID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -15315,7 +16382,7 @@ func (_options *UpdateAccountSettingsTemplateVersionOptions) SetDescription(desc } // SetAccountSettings : Allow user to set AccountSettings -func (_options *UpdateAccountSettingsTemplateVersionOptions) SetAccountSettings(accountSettings *AccountSettingsComponent) *UpdateAccountSettingsTemplateVersionOptions { +func (_options *UpdateAccountSettingsTemplateVersionOptions) SetAccountSettings(accountSettings *TemplateAccountSettings) *UpdateAccountSettingsTemplateVersionOptions { _options.AccountSettings = accountSettings return _options } @@ -15352,6 +16419,11 @@ type UpdateAPIKeyOptions struct { // Defines the action to take when API key is leaked, valid values are 'none', 'disable' and 'delete'. ActionWhenLeaked *string `json:"action_when_leaked,omitempty"` + // Date and time when the API key becomes invalid, ISO 8601 datetime in the format 'yyyy-MM-ddTHH:mm+0000'. **WARNING** + // An API key will be permanently and irrevocably deleted when both the expires_at and modified_at timestamps are more + // than ninety (90) days in the past, regardless of the key’s locked status or any other state. + ExpiresAt *string `json:"expires_at,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -15359,7 +16431,7 @@ type UpdateAPIKeyOptions struct { // NewUpdateAPIKeyOptions : Instantiate UpdateAPIKeyOptions func (*IamIdentityV1) NewUpdateAPIKeyOptions(id string, ifMatch string) *UpdateAPIKeyOptions { return &UpdateAPIKeyOptions{ - ID: core.StringPtr(id), + ID: core.StringPtr(id), IfMatch: core.StringPtr(ifMatch), } } @@ -15400,6 +16472,12 @@ func (_options *UpdateAPIKeyOptions) SetActionWhenLeaked(actionWhenLeaked string return _options } +// SetExpiresAt : Allow user to set ExpiresAt +func (_options *UpdateAPIKeyOptions) SetExpiresAt(expiresAt string) *UpdateAPIKeyOptions { + _options.ExpiresAt = core.StringPtr(expiresAt) + return _options +} + // SetHeaders : Allow user to set Headers func (options *UpdateAPIKeyOptions) SetHeaders(param map[string]string) *UpdateAPIKeyOptions { options.Headers = param @@ -15436,7 +16514,7 @@ type UpdateClaimRuleOptions struct { RealmName *string `json:"realm_name,omitempty"` // 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. + // VSI, PVS, BMS, IKS_SA, ROKS_SA, CE. CrType *string `json:"cr_type,omitempty"` // Session expiration in seconds, only required if type is 'Profile-SAML'. @@ -15449,10 +16527,10 @@ type UpdateClaimRuleOptions struct { // NewUpdateClaimRuleOptions : Instantiate UpdateClaimRuleOptions func (*IamIdentityV1) NewUpdateClaimRuleOptions(profileID string, ruleID string, ifMatch string, typeVar string, conditions []ProfileClaimRuleConditions) *UpdateClaimRuleOptions { return &UpdateClaimRuleOptions{ - ProfileID: core.StringPtr(profileID), - RuleID: core.StringPtr(ruleID), - IfMatch: core.StringPtr(ifMatch), - Type: core.StringPtr(typeVar), + ProfileID: core.StringPtr(profileID), + RuleID: core.StringPtr(ruleID), + IfMatch: core.StringPtr(ifMatch), + Type: core.StringPtr(typeVar), Conditions: conditions, } } @@ -15539,7 +16617,7 @@ type UpdatePreferenceOnScopeAccountOptions struct { // contains a string value of the preference. only one value property is set, either 'value_string' or // 'value_list_of_strings' is present. - ValueString *string `json:"value_string" validate:"required"` + ValueString *string `json:"value_string,omitempty"` // contains a list of string values of the preference. only one value property is set, either 'value_string' or // 'value_list_of_strings' is present. @@ -15550,13 +16628,12 @@ type UpdatePreferenceOnScopeAccountOptions struct { } // NewUpdatePreferenceOnScopeAccountOptions : Instantiate UpdatePreferenceOnScopeAccountOptions -func (*IamIdentityV1) NewUpdatePreferenceOnScopeAccountOptions(accountID string, iamID string, service string, preferenceID string, valueString string) *UpdatePreferenceOnScopeAccountOptions { +func (*IamIdentityV1) NewUpdatePreferenceOnScopeAccountOptions(accountID string, iamID string, service string, preferenceID string) *UpdatePreferenceOnScopeAccountOptions { return &UpdatePreferenceOnScopeAccountOptions{ - AccountID: core.StringPtr(accountID), - IamID: core.StringPtr(iamID), - Service: core.StringPtr(service), + AccountID: core.StringPtr(accountID), + IamID: core.StringPtr(iamID), + Service: core.StringPtr(service), PreferenceID: core.StringPtr(preferenceID), - ValueString: core.StringPtr(valueString), } } @@ -15632,7 +16709,7 @@ type UpdateProfileOptions struct { func (*IamIdentityV1) NewUpdateProfileOptions(profileID string, ifMatch string) *UpdateProfileOptions { return &UpdateProfileOptions{ ProfileID: core.StringPtr(profileID), - IfMatch: core.StringPtr(ifMatch), + IfMatch: core.StringPtr(ifMatch), } } @@ -15711,9 +16788,9 @@ type UpdateProfileTemplateVersionOptions struct { // NewUpdateProfileTemplateVersionOptions : Instantiate UpdateProfileTemplateVersionOptions func (*IamIdentityV1) NewUpdateProfileTemplateVersionOptions(ifMatch string, templateID string, version string) *UpdateProfileTemplateVersionOptions { return &UpdateProfileTemplateVersionOptions{ - IfMatch: core.StringPtr(ifMatch), + IfMatch: core.StringPtr(ifMatch), TemplateID: core.StringPtr(templateID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -15800,9 +16877,9 @@ type UpdateServiceIDGroupOptions struct { // NewUpdateServiceIDGroupOptions : Instantiate UpdateServiceIDGroupOptions func (*IamIdentityV1) NewUpdateServiceIDGroupOptions(id string, ifMatch string, name string) *UpdateServiceIDGroupOptions { return &UpdateServiceIDGroupOptions{ - ID: core.StringPtr(id), + ID: core.StringPtr(id), IfMatch: core.StringPtr(ifMatch), - Name: core.StringPtr(name), + Name: core.StringPtr(name), } } @@ -15868,7 +16945,7 @@ type UpdateServiceIDOptions struct { // NewUpdateServiceIDOptions : Instantiate UpdateServiceIDOptions func (*IamIdentityV1) NewUpdateServiceIDOptions(id string, ifMatch string) *UpdateServiceIDOptions { return &UpdateServiceIDOptions{ - ID: core.StringPtr(id), + ID: core.StringPtr(id), IfMatch: core.StringPtr(ifMatch), } } @@ -15936,8 +17013,8 @@ type UpdateTrustedProfileAssignmentOptions struct { // NewUpdateTrustedProfileAssignmentOptions : Instantiate UpdateTrustedProfileAssignmentOptions func (*IamIdentityV1) NewUpdateTrustedProfileAssignmentOptions(assignmentID string, ifMatch string, templateVersion int64) *UpdateTrustedProfileAssignmentOptions { return &UpdateTrustedProfileAssignmentOptions{ - AssignmentID: core.StringPtr(assignmentID), - IfMatch: core.StringPtr(ifMatch), + AssignmentID: core.StringPtr(assignmentID), + IfMatch: core.StringPtr(ifMatch), TemplateVersion: core.Int64Ptr(templateVersion), } } @@ -16016,6 +17093,58 @@ func UnmarshalUserActivity(m map[string]json.RawMessage, result interface{}) (er return } +// UserMfa : UserMfa struct +type UserMfa struct { + // The iam_id of the user. + IamID *string `json:"iam_id,omitempty"` + + // MFA trait definitions as follows: + // * NONE - No MFA trait set + // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + // * 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 - Security Key MFA for all users. + Mfa *string `json:"mfa,omitempty"` +} + +// Constants associated with the UserMfa.Mfa property. +// MFA trait definitions as follows: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - 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 - Security Key MFA for all users. +const ( + UserMfaMfaLevel1Const = "LEVEL1" + UserMfaMfaLevel2Const = "LEVEL2" + UserMfaMfaLevel3Const = "LEVEL3" + UserMfaMfaNoneConst = "NONE" + UserMfaMfaNoneNoRopcConst = "NONE_NO_ROPC" + UserMfaMfaTotpConst = "TOTP" + UserMfaMfaTotp4allConst = "TOTP4ALL" +) + +// UnmarshalUserMfa unmarshals an instance of UserMfa from the specified map of raw messages. +func UnmarshalUserMfa(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(UserMfa) + err = core.UnmarshalPrimitive(m, "iam_id", &obj.IamID) + if err != nil { + err = core.SDKErrorf(err, "", "iam_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) + if err != nil { + err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // UserMfaEnrollments : UserMfaEnrollments struct type UserMfaEnrollments struct { // IAMid of the user. @@ -16070,7 +17199,12 @@ type UserReportMfaEnrollmentStatus struct { // Email of the user. Email *string `json:"email,omitempty"` - Enrollments *MfaEnrollments `json:"enrollments" validate:"required"` + // currently effective mfa type i.e. id_based_mfa or account_based_mfa. + EffectiveMfaType *string `json:"effective_mfa_type" validate:"required"` + + IDBasedMfa *IDBasedMfaEnrollment `json:"id_based_mfa" validate:"required"` + + AccountBasedMfa *AccountBasedMfaEnrollment `json:"account_based_mfa" validate:"required"` } // UnmarshalUserReportMfaEnrollmentStatus unmarshals an instance of UserReportMfaEnrollmentStatus from the specified map of raw messages. @@ -16096,9 +17230,19 @@ func UnmarshalUserReportMfaEnrollmentStatus(m map[string]json.RawMessage, result err = core.SDKErrorf(err, "", "email-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "enrollments", &obj.Enrollments, UnmarshalMfaEnrollments) + err = core.UnmarshalPrimitive(m, "effective_mfa_type", &obj.EffectiveMfaType) + if err != nil { + err = core.SDKErrorf(err, "", "effective_mfa_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "id_based_mfa", &obj.IDBasedMfa, UnmarshalIDBasedMfaEnrollment) + if err != nil { + err = core.SDKErrorf(err, "", "id_based_mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "account_based_mfa", &obj.AccountBasedMfa, UnmarshalAccountBasedMfaEnrollment) if err != nil { - err = core.SDKErrorf(err, "", "enrollments-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "account_based_mfa-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) diff --git a/vendor/github.com/IBM/platform-services-go-sdk/iampolicymanagementv1/iam_policy_management_v1.go b/vendor/github.com/IBM/platform-services-go-sdk/iampolicymanagementv1/iam_policy_management_v1.go index 4386dca177e5..8d6d27483fa7 100644 --- a/vendor/github.com/IBM/platform-services-go-sdk/iampolicymanagementv1/iam_policy_management_v1.go +++ b/vendor/github.com/IBM/platform-services-go-sdk/iampolicymanagementv1/iam_policy_management_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.106.0-09823488-20250707-071701 + * IBM OpenAPI SDK Code Generator Version: 3.107.1-41b0fbd0-20250825-080732 */ // Package iampolicymanagementv1 : Operations and models for the IamPolicyManagementV1 service @@ -4316,989 +4316,2178 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteActionControlAssignmentW return } -func getServiceComponentInfo() *core.ProblemComponent { - return core.NewProblemComponent(DefaultServiceName, "1.0.1") -} -// AccountSettingsAccessManagement : The Access Management Account Settings that are currently set for the requested account. -type AccountSettingsAccessManagement struct { - // How external accounts can interact in relation to the requested account. - ExternalAccountIdentityInteraction *ExternalAccountIdentityInteraction `json:"external_account_identity_interaction" validate:"required"` +// ListRoleTemplates : List role templates by attributes +// List role templates and filter by attributes by using query parameters. The following attributes are supported: +// `account_id`, `name`, `role_name`, `role_service_name`, `state`, `limit`, `start`. +// `account_id` is a required query parameter. Only role templates that have the specified attributes and that the +// caller has read access to are returned. If the caller does not have read access to any role templates an empty array +// is returned. +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleTemplates(listRoleTemplatesOptions *ListRoleTemplatesOptions) (result *RoleTemplateCollection, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.ListRoleTemplatesWithContext(context.Background(), listRoleTemplatesOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalAccountSettingsAccessManagement unmarshals an instance of AccountSettingsAccessManagement from the specified map of raw messages. -func UnmarshalAccountSettingsAccessManagement(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountSettingsAccessManagement) - err = core.UnmarshalModel(m, "external_account_identity_interaction", &obj.ExternalAccountIdentityInteraction, UnmarshalExternalAccountIdentityInteraction) +// ListRoleTemplatesWithContext is an alternate form of the ListRoleTemplates method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleTemplatesWithContext(ctx context.Context, listRoleTemplatesOptions *ListRoleTemplatesOptions) (result *RoleTemplateCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listRoleTemplatesOptions, "listRoleTemplatesOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "external_account_identity_interaction-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(listRoleTemplatesOptions, "listRoleTemplatesOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ActionControlAssignment : The set of properties associated with the assigned action control template. -type ActionControlAssignment struct { - // Action control assignment ID. - ID *string `json:"id,omitempty"` - - // The account GUID that the action control assignments belong to. - AccountID *string `json:"account_id,omitempty"` - - // The href URL that links to the action control assignments API by action control assignment ID. - Href *string `json:"href,omitempty"` - - // The UTC timestamp when the action control assignment was created. - CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` - - // The IAM ID of the entity that created the action control assignment. - CreatedByID *string `json:"created_by_id,omitempty"` - // The UTC timestamp when the action control assignment was last modified. - LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates`, nil) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } - // The IAM ID of the entity that last modified the action control assignment. - LastModifiedByID *string `json:"last_modified_by_id,omitempty"` + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "ListRoleTemplates") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // The current operation of the action control assignment. - Operation *string `json:"operation,omitempty"` + for headerName, headerValue := range listRoleTemplatesOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + if listRoleTemplatesOptions.AcceptLanguage != nil { + builder.AddHeader("Accept-Language", fmt.Sprint(*listRoleTemplatesOptions.AcceptLanguage)) + } - // Resources created when action control template is assigned. - Resources []ActionControlAssignmentResource `json:"resources,omitempty"` + builder.AddQuery("account_id", fmt.Sprint(*listRoleTemplatesOptions.AccountID)) + if listRoleTemplatesOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listRoleTemplatesOptions.Name)) + } + if listRoleTemplatesOptions.RoleName != nil { + builder.AddQuery("role_name", fmt.Sprint(*listRoleTemplatesOptions.RoleName)) + } + if listRoleTemplatesOptions.RoleServiceName != nil { + builder.AddQuery("role_service_name", fmt.Sprint(*listRoleTemplatesOptions.RoleServiceName)) + } + if listRoleTemplatesOptions.State != nil { + builder.AddQuery("state", fmt.Sprint(*listRoleTemplatesOptions.State)) + } + if listRoleTemplatesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listRoleTemplatesOptions.Limit)) + } + if listRoleTemplatesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listRoleTemplatesOptions.Start)) + } - // The action control template id and version that will be assigned. - Template *ActionControlAssignmentTemplate `json:"template" validate:"required"` + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } - // assignment target account and type. - Target *AssignmentTargetDetails `json:"target" validate:"required"` + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_role_templates", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplateCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } - // The action control assignment status. - Status *string `json:"status,omitempty"` + return } -// Constants associated with the ActionControlAssignment.Operation property. -// The current operation of the action control assignment. -const ( - ActionControlAssignmentOperationApplyConst = "apply" - ActionControlAssignmentOperationCreateConst = "create" - ActionControlAssignmentOperationRemoveConst = "remove" - ActionControlAssignmentOperationUpdateConst = "update" -) - -// Constants associated with the ActionControlAssignment.Status property. -// The action control assignment status. -const ( - ActionControlAssignmentStatusAcceptedConst = "accepted" - ActionControlAssignmentStatusFailureConst = "failure" - ActionControlAssignmentStatusInProgressConst = "in_progress" - ActionControlAssignmentStatusSupersededConst = "superseded" -) +// CreateRoleTemplate : Create role template +// Create a role template. Role templates define roles from an existing system or service defined role. +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplate(createRoleTemplateOptions *CreateRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.CreateRoleTemplateWithContext(context.Background(), createRoleTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return +} -// UnmarshalActionControlAssignment unmarshals an instance of ActionControlAssignment from the specified map of raw messages. -func UnmarshalActionControlAssignment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignment) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// CreateRoleTemplateWithContext is an alternate form of the CreateRoleTemplate method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplateWithContext(ctx context.Context, createRoleTemplateOptions *CreateRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createRoleTemplateOptions, "createRoleTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + err = core.ValidateStruct(createRoleTemplateOptions, "createRoleTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates`, nil) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "CreateRoleTemplate") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) - if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) - return + + for headerName, headerValue := range createRoleTemplateOptions.Headers { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) - return + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + if createRoleTemplateOptions.AcceptLanguage != nil { + builder.AddHeader("Accept-Language", fmt.Sprint(*createRoleTemplateOptions.AcceptLanguage)) } - err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) - return + + body := make(map[string]interface{}) + if createRoleTemplateOptions.Name != nil { + body["name"] = createRoleTemplateOptions.Name } - err = core.UnmarshalPrimitive(m, "operation", &obj.Operation) - if err != nil { - err = core.SDKErrorf(err, "", "operation-error", common.GetComponentInfo()) - return + if createRoleTemplateOptions.AccountID != nil { + body["account_id"] = createRoleTemplateOptions.AccountID } - err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalActionControlAssignmentResource) - if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) - return + if createRoleTemplateOptions.Description != nil { + body["description"] = createRoleTemplateOptions.Description } - err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalActionControlAssignmentTemplate) + if createRoleTemplateOptions.Committed != nil { + body["committed"] = createRoleTemplateOptions.Committed + } + if createRoleTemplateOptions.Role != nil { + body["role"] = createRoleTemplateOptions.Role + } + _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "create_role_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// ActionControlAssignmentCollection : A collection of action control assignments. -type ActionControlAssignmentCollection struct { - // The number of documents to include per each page of the collection. - Limit *int64 `json:"limit,omitempty"` - - // Details with linking href to first page of requested collection. - First *First `json:"first,omitempty"` - - // Details with href linking to the following page of requested collection. - Next *Next `json:"next,omitempty"` - - // Details with linking href to previous page of requested collection. - Previous *Previous `json:"previous,omitempty"` - - // List of action control assignments. - Assignments []ActionControlAssignment `json:"assignments" validate:"required"` +// GetRoleTemplate : Retrieve the latest version of a role template +// Retrieve the latest version of a role template by providing a role template ID. +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleTemplate(getRoleTemplateOptions *GetRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.GetRoleTemplateWithContext(context.Background(), getRoleTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalActionControlAssignmentCollection unmarshals an instance of ActionControlAssignmentCollection from the specified map of raw messages. -func UnmarshalActionControlAssignmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignmentCollection) - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) +// GetRoleTemplateWithContext is an alternate form of the GetRoleTemplate method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleTemplateWithContext(ctx context.Context, getRoleTemplateOptions *GetRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getRoleTemplateOptions, "getRoleTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + err = core.ValidateStruct(getRoleTemplateOptions, "getRoleTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + + pathParamsMap := map[string]string{ + "role_template_id": *getRoleTemplateOptions.RoleTemplateID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "GetRoleTemplate") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getRoleTemplateOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + if getRoleTemplateOptions.State != nil { + builder.AddQuery("state", fmt.Sprint(*getRoleTemplateOptions.State)) + } + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "assignments", &obj.Assignments, UnmarshalActionControlAssignment) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "assignments-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "get_role_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ActionControlAssignmentCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - return resp.Next.Start, nil +// DeleteRoleTemplate : Delete a Role template +// Delete a role template by providing the role template ID. This deletes all versions of this template. A role template +// can't be deleted if any version of the template is assigned to one or more child accounts. You must remove the role +// assignments first. +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleTemplate(deleteRoleTemplateOptions *DeleteRoleTemplateOptions) (response *core.DetailedResponse, err error) { + response, err = iamPolicyManagement.DeleteRoleTemplateWithContext(context.Background(), deleteRoleTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// ActionControlAssignmentResource : The action control assignment resources and target where the template is assigned. -type ActionControlAssignmentResource struct { - // assignment target account and type. - Target *AssignmentTargetDetails `json:"target" validate:"required"` +// DeleteRoleTemplateWithContext is an alternate form of the DeleteRoleTemplate method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleTemplateWithContext(ctx context.Context, deleteRoleTemplateOptions *DeleteRoleTemplateOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteRoleTemplateOptions, "deleteRoleTemplateOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(deleteRoleTemplateOptions, "deleteRoleTemplateOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } - // Set of properties of the assigned resource or error message if assignment failed. - ActionControl *ActionControlAssignmentResourceActionControl `json:"action_control,omitempty"` -} + pathParamsMap := map[string]string{ + "role_template_id": *deleteRoleTemplateOptions.RoleTemplateID, + } -// UnmarshalActionControlAssignmentResource unmarshals an instance of ActionControlAssignmentResource from the specified map of raw messages. -func UnmarshalActionControlAssignmentResource(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignmentResource) - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "action_control", &obj.ActionControl, UnmarshalActionControlAssignmentResourceActionControl) + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "DeleteRoleTemplate") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range deleteRoleTemplateOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "action_control-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + + response, err = iamPolicyManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_role_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + return } -// ActionControlAssignmentResourceActionControl : Set of properties of the assigned resource or error message if assignment failed. -type ActionControlAssignmentResourceActionControl struct { - // On success, it includes the action control assigned. - ResourceCreated *ActionControlAssignmentResourceCreated `json:"resource_created,omitempty"` - - // Body parameters for assignment error. - ErrorMessage *AssignmentResourceError `json:"error_message,omitempty"` +// CreateRoleTemplateVersion : Create a new role template version +// Create a new version of a role template. Use this if you need to make updates to a role template that is committed. +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplateVersion(createRoleTemplateVersionOptions *CreateRoleTemplateVersionOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.CreateRoleTemplateVersionWithContext(context.Background(), createRoleTemplateVersionOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalActionControlAssignmentResourceActionControl unmarshals an instance of ActionControlAssignmentResourceActionControl from the specified map of raw messages. -func UnmarshalActionControlAssignmentResourceActionControl(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignmentResourceActionControl) - err = core.UnmarshalModel(m, "resource_created", &obj.ResourceCreated, UnmarshalActionControlAssignmentResourceCreated) +// CreateRoleTemplateVersionWithContext is an alternate form of the CreateRoleTemplateVersion method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplateVersionWithContext(ctx context.Context, createRoleTemplateVersionOptions *CreateRoleTemplateVersionOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createRoleTemplateVersionOptions, "createRoleTemplateVersionOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "resource_created-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "error_message", &obj.ErrorMessage, UnmarshalAssignmentResourceError) + err = core.ValidateStruct(createRoleTemplateVersionOptions, "createRoleTemplateVersionOptions") if err != nil { - err = core.SDKErrorf(err, "", "error_message-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// ActionControlAssignmentResourceCreated : On success, it includes the action control assigned. -type ActionControlAssignmentResourceCreated struct { - // action control id. - ID *string `json:"id,omitempty"` -} + pathParamsMap := map[string]string{ + "role_template_id": *createRoleTemplateVersionOptions.RoleTemplateID, + } -// UnmarshalActionControlAssignmentResourceCreated unmarshals an instance of ActionControlAssignmentResourceCreated from the specified map of raw messages. -func UnmarshalActionControlAssignmentResourceCreated(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignmentResourceCreated) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// ActionControlAssignmentTemplate : The action control template id and version that will be assigned. -type ActionControlAssignmentTemplate struct { - // Action control template ID. - ID *string `json:"id" validate:"required"` + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "CreateRoleTemplateVersion") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // Action control template version. - Version *string `json:"version" validate:"required"` -} + for headerName, headerValue := range createRoleTemplateVersionOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") -// NewActionControlAssignmentTemplate : Instantiate ActionControlAssignmentTemplate (Generic Model Constructor) -func (*IamPolicyManagementV1) NewActionControlAssignmentTemplate(id string, version string) (_model *ActionControlAssignmentTemplate, err error) { - _model = &ActionControlAssignmentTemplate{ - ID: core.StringPtr(id), - Version: core.StringPtr(version), + body := make(map[string]interface{}) + if createRoleTemplateVersionOptions.Name != nil { + body["name"] = createRoleTemplateVersionOptions.Name } - err = core.ValidateStruct(_model, "required parameters") + if createRoleTemplateVersionOptions.Description != nil { + body["description"] = createRoleTemplateVersionOptions.Description + } + if createRoleTemplateVersionOptions.Role != nil { + body["role"] = createRoleTemplateVersionOptions.Role + } + if createRoleTemplateVersionOptions.Committed != nil { + body["committed"] = createRoleTemplateVersionOptions.Committed + } + _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return } - return -} -// UnmarshalActionControlAssignmentTemplate unmarshals an instance of ActionControlAssignmentTemplate from the specified map of raw messages. -func UnmarshalActionControlAssignmentTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignmentTemplate) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "version", &obj.Version) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "create_role_template_version", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// ActionControlTemplate : The set of properties associated with the action control template. -type ActionControlTemplate struct { - // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes - // the name value for all existing versions of the template. - Name *string `json:"name" validate:"required"` - - // Description of the action control template. This is shown to users in the enterprise account. Use this to describe - // the purpose or context of the action control for enterprise users managing IAM templates. - Description *string `json:"description" validate:"required"` - - // Enterprise account ID where this template is created. - AccountID *string `json:"account_id" validate:"required"` - - // Committed status of the template. If committed is set to true, then the template version can no longer be updated. - Committed *bool `json:"committed,omitempty"` - - // The action control properties that are created in an action resource when the template is assigned. - ActionControl *TemplateActionControl `json:"action_control,omitempty"` - - // The action control template ID. - ID *string `json:"id,omitempty"` - - // The href URL that links to the action control templates API by action control template ID. - Href *string `json:"href,omitempty"` - - // The UTC timestamp when the action control template was created. - CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` - - // The IAM ID of the entity that created the action control template. - CreatedByID *string `json:"created_by_id,omitempty"` - - // The UTC timestamp when the action control template was last modified. - LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` - - // The IAM ID of the entity that last modified the action control template. - LastModifiedByID *string `json:"last_modified_by_id,omitempty"` - - // The version number of the template used to identify different versions of same template. - Version *string `json:"version" validate:"required"` - - // State of action control template. - State *string `json:"state" validate:"required"` +// ListRoleTemplateVersions : Retrieve role template versions +// Retrieve the versions of a role template by providing a role template ID. +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleTemplateVersions(listRoleTemplateVersionsOptions *ListRoleTemplateVersionsOptions) (result *RoleTemplateVersionsCollection, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.ListRoleTemplateVersionsWithContext(context.Background(), listRoleTemplateVersionsOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// Constants associated with the ActionControlTemplate.State property. -// State of action control template. -const ( - ActionControlTemplateStateActiveConst = "active" - ActionControlTemplateStateDeletedConst = "deleted" -) - -// UnmarshalActionControlTemplate unmarshals an instance of ActionControlTemplate from the specified map of raw messages. -func UnmarshalActionControlTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlTemplate) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// ListRoleTemplateVersionsWithContext is an alternate form of the ListRoleTemplateVersions method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleTemplateVersionsWithContext(ctx context.Context, listRoleTemplateVersionsOptions *ListRoleTemplateVersionsOptions) (result *RoleTemplateVersionsCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listRoleTemplateVersionsOptions, "listRoleTemplateVersionsOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) + err = core.ValidateStruct(listRoleTemplateVersionsOptions, "listRoleTemplateVersionsOptions") if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) - if err != nil { - err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) - return + + pathParamsMap := map[string]string{ + "role_template_id": *listRoleTemplateVersionsOptions.RoleTemplateID, } - err = core.UnmarshalPrimitive(m, "committed", &obj.Committed) + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "action_control", &obj.ActionControl, UnmarshalTemplateActionControl) - if err != nil { - err = core.SDKErrorf(err, "", "action_control-error", common.GetComponentInfo()) - return + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "ListRoleTemplateVersions") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return + + for headerName, headerValue := range listRoleTemplateVersionsOptions.Headers { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return + builder.AddHeader("Accept", "application/json") + + if listRoleTemplateVersionsOptions.State != nil { + builder.AddQuery("state", fmt.Sprint(*listRoleTemplateVersionsOptions.State)) } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return + if listRoleTemplateVersionsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listRoleTemplateVersionsOptions.Limit)) } - err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) - if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) - return + if listRoleTemplateVersionsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listRoleTemplateVersionsOptions.Start)) } - err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "list_role_template_versions", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "version", &obj.Version) - if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "state", &obj.State) - if err != nil { - err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) - return + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplateVersionsCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ActionControlTemplateCollection : A collection of action control templates. -type ActionControlTemplateCollection struct { - // The number of documents to include per each page of the collection. - Limit *int64 `json:"limit,omitempty"` - - // Details with linking href to first page of requested collection. - First *First `json:"first,omitempty"` - - // Details with href linking to the following page of requested collection. - Next *Next `json:"next,omitempty"` - - // Details with linking href to previous page of requested collection. - Previous *Previous `json:"previous,omitempty"` - - // List of action control templates. - ActionControlTemplates []ActionControlTemplate `json:"action_control_templates" validate:"required"` +// ReplaceRoleTemplate : Update a role template version +// Update a specific version of a role template. You can use this only if the version isn't committed. +func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleTemplate(replaceRoleTemplateOptions *ReplaceRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.ReplaceRoleTemplateWithContext(context.Background(), replaceRoleTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalActionControlTemplateCollection unmarshals an instance of ActionControlTemplateCollection from the specified map of raw messages. -func UnmarshalActionControlTemplateCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlTemplateCollection) - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) +// ReplaceRoleTemplateWithContext is an alternate form of the ReplaceRoleTemplate method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleTemplateWithContext(ctx context.Context, replaceRoleTemplateOptions *ReplaceRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(replaceRoleTemplateOptions, "replaceRoleTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + err = core.ValidateStruct(replaceRoleTemplateOptions, "replaceRoleTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + + pathParamsMap := map[string]string{ + "role_template_id": *replaceRoleTemplateOptions.RoleTemplateID, + "version": *replaceRoleTemplateOptions.Version, + } + + builder := core.NewRequestBuilder(core.PUT) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions/{version}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "ReplaceRoleTemplate") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range replaceRoleTemplateOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + if replaceRoleTemplateOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*replaceRoleTemplateOptions.IfMatch)) + } + + body := make(map[string]interface{}) + if replaceRoleTemplateOptions.Name != nil { + body["name"] = replaceRoleTemplateOptions.Name + } + if replaceRoleTemplateOptions.Description != nil { + body["description"] = replaceRoleTemplateOptions.Description + } + if replaceRoleTemplateOptions.Role != nil { + body["role"] = replaceRoleTemplateOptions.Role + } + if replaceRoleTemplateOptions.Committed != nil { + body["committed"] = replaceRoleTemplateOptions.Committed + } + _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "action_control_templates", &obj.ActionControlTemplates, UnmarshalActionControlTemplate) + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "action_control_templates-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) 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 *ActionControlTemplateCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "replace_role_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result } - return resp.Next.Start, nil -} - -// ActionControlTemplateVersionsCollection : A collection of versions for a specific action control template. -type ActionControlTemplateVersionsCollection struct { - // The number of documents to include per each page of the collection. - Limit *int64 `json:"limit,omitempty"` - - // Details with linking href to first page of requested collection. - First *First `json:"first,omitempty"` - - // Details with href linking to the following page of requested collection. - Next *Next `json:"next,omitempty"` - // Details with linking href to previous page of requested collection. - Previous *Previous `json:"previous,omitempty"` + return +} - // List of action control templates versions. - Versions []ActionControlTemplate `json:"versions" validate:"required"` +// DeleteRoleTemplateVersion : Delete a role template version +// Delete a specific version of a role template by providing a role template ID and version number. You can't delete a +// role template version that is assigned to one or more child accounts. You must remove the role assignments first. +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleTemplateVersion(deleteRoleTemplateVersionOptions *DeleteRoleTemplateVersionOptions) (response *core.DetailedResponse, err error) { + response, err = iamPolicyManagement.DeleteRoleTemplateVersionWithContext(context.Background(), deleteRoleTemplateVersionOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalActionControlTemplateVersionsCollection unmarshals an instance of ActionControlTemplateVersionsCollection from the specified map of raw messages. -func UnmarshalActionControlTemplateVersionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlTemplateVersionsCollection) - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) +// DeleteRoleTemplateVersionWithContext is an alternate form of the DeleteRoleTemplateVersion method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleTemplateVersionWithContext(ctx context.Context, deleteRoleTemplateVersionOptions *DeleteRoleTemplateVersionOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteRoleTemplateVersionOptions, "deleteRoleTemplateVersionOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + err = core.ValidateStruct(deleteRoleTemplateVersionOptions, "deleteRoleTemplateVersionOptions") if err != nil { - err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) - if err != nil { - err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) - return + + pathParamsMap := map[string]string{ + "role_template_id": *deleteRoleTemplateVersionOptions.RoleTemplateID, + "version": *deleteRoleTemplateVersionOptions.Version, } - err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions/{version}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalActionControlTemplate) - if err != nil { - err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) - return + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "DeleteRoleTemplateVersion") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - 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 *ActionControlTemplateVersionsCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil + for headerName, headerValue := range deleteRoleTemplateVersionOptions.Headers { + builder.AddHeader(headerName, headerValue) } - return resp.Next.Start, nil -} -// AssignmentResourceCreated : On success, includes the policy that is assigned. -type AssignmentResourceCreated struct { - // Policy id. - ID *string `json:"id,omitempty"` -} + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } -// UnmarshalAssignmentResourceCreated unmarshals an instance of AssignmentResourceCreated from the specified map of raw messages. -func UnmarshalAssignmentResourceCreated(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AssignmentResourceCreated) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + response, err = iamPolicyManagement.Service.Request(request, nil) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "delete_role_template_version", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// AssignmentResourceError : Body parameters for assignment error. -type AssignmentResourceError struct { - // Name of the error. - Name *string `json:"name,omitempty"` - - // error code. - ErrorCode *string `json:"errorCode,omitempty"` - - // Error message detailing the nature of the error. - Message *string `json:"message,omitempty"` - - // Internal status code for the error. - Code *string `json:"code,omitempty"` - - // The errors encountered during the response. - Errors []ErrorObject `json:"errors,omitempty"` +// GetRoleTemplateVersion : Retrieve a role template version +// Retrieve a role template by providing a role template ID and version number. +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleTemplateVersion(getRoleTemplateVersionOptions *GetRoleTemplateVersionOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.GetRoleTemplateVersionWithContext(context.Background(), getRoleTemplateVersionOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalAssignmentResourceError unmarshals an instance of AssignmentResourceError from the specified map of raw messages. -func UnmarshalAssignmentResourceError(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AssignmentResourceError) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// GetRoleTemplateVersionWithContext is an alternate form of the GetRoleTemplateVersion method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleTemplateVersionWithContext(ctx context.Context, getRoleTemplateVersionOptions *GetRoleTemplateVersionOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getRoleTemplateVersionOptions, "getRoleTemplateVersionOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "errorCode", &obj.ErrorCode) + err = core.ValidateStruct(getRoleTemplateVersionOptions, "getRoleTemplateVersionOptions") if err != nil { - err = core.SDKErrorf(err, "", "errorCode-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + + pathParamsMap := map[string]string{ + "role_template_id": *getRoleTemplateVersionOptions.RoleTemplateID, + "version": *getRoleTemplateVersionOptions.Version, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions/{version}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "GetRoleTemplateVersion") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getRoleTemplateVersionOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "errors", &obj.Errors, UnmarshalErrorObject) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "get_role_template_version", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// AssignmentTargetDetails : assignment target account and type. -type AssignmentTargetDetails struct { - // Assignment target type. - Type *string `json:"type" validate:"required"` - - // ID of the target account. - ID *string `json:"id" validate:"required"` +// CommitRoleTemplate : Commit a role template version +// Commit a role template version. You cannot make any further changes to the role template once it's committed. If you +// have to make updates after committing a version, create a new version. +func (iamPolicyManagement *IamPolicyManagementV1) CommitRoleTemplate(commitRoleTemplateOptions *CommitRoleTemplateOptions) (response *core.DetailedResponse, err error) { + response, err = iamPolicyManagement.CommitRoleTemplateWithContext(context.Background(), commitRoleTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// Constants associated with the AssignmentTargetDetails.Type property. -// Assignment target type. -const ( - AssignmentTargetDetailsTypeAccountConst = "Account" -) - -// NewAssignmentTargetDetails : Instantiate AssignmentTargetDetails (Generic Model Constructor) -func (*IamPolicyManagementV1) NewAssignmentTargetDetails(typeVar string, id string) (_model *AssignmentTargetDetails, err error) { - _model = &AssignmentTargetDetails{ - Type: core.StringPtr(typeVar), - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") +// CommitRoleTemplateWithContext is an alternate form of the CommitRoleTemplate method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) CommitRoleTemplateWithContext(ctx context.Context, commitRoleTemplateOptions *CommitRoleTemplateOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(commitRoleTemplateOptions, "commitRoleTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return } - return -} - -// UnmarshalAssignmentTargetDetails unmarshals an instance of AssignmentTargetDetails from the specified map of raw messages. -func UnmarshalAssignmentTargetDetails(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AssignmentTargetDetails) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.ValidateStruct(commitRoleTemplateOptions, "commitRoleTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + + pathParamsMap := map[string]string{ + "role_template_id": *commitRoleTemplateOptions.RoleTemplateID, + "version": *commitRoleTemplateOptions.Version, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions/{version}/commit`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// AssignmentTemplateDetails : policy template details. -type AssignmentTemplateDetails struct { - // Policy template ID. - ID *string `json:"id,omitempty"` + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "CommitRoleTemplate") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // Policy template version. - Version *string `json:"version,omitempty"` -} + for headerName, headerValue := range commitRoleTemplateOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// UnmarshalAssignmentTemplateDetails unmarshals an instance of AssignmentTemplateDetails from the specified map of raw messages. -func UnmarshalAssignmentTemplateDetails(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AssignmentTemplateDetails) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "version", &obj.Version) + + response, err = iamPolicyManagement.Service.Request(request, nil) if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "commit_role_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CommitActionControlTemplateOptions : The CommitActionControlTemplate options. -type CommitActionControlTemplateOptions struct { - // Action control template ID. - ActionControlTemplateID *string `json:"action_control_template_id" validate:"required,ne="` - - // The action control template version. - Version *string `json:"version" validate:"required,ne="` - - // Allows users to set headers on API requests. - Headers map[string]string +// ListRoleAssignments : Get role template assignments +// Get role template assignments by attributes. The following attributes are supported: +// `account_id`, `template_id`, `template_version`, `target`, `target_type`, `limit`, `start`. +// `account_id` is a required query parameter. Only role template assignments with the specified attributes and +// accessible by the caller are returned. If the caller does not have read access to any role template assignments, an +// empty array is returned. +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleAssignments(listRoleAssignmentsOptions *ListRoleAssignmentsOptions) (result *RoleAssignmentCollection, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.ListRoleAssignmentsWithContext(context.Background(), listRoleAssignmentsOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// NewCommitActionControlTemplateOptions : Instantiate CommitActionControlTemplateOptions -func (*IamPolicyManagementV1) NewCommitActionControlTemplateOptions(actionControlTemplateID string, version string) *CommitActionControlTemplateOptions { - return &CommitActionControlTemplateOptions{ - ActionControlTemplateID: core.StringPtr(actionControlTemplateID), - Version: core.StringPtr(version), +// ListRoleAssignmentsWithContext is an alternate form of the ListRoleAssignments method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleAssignmentsWithContext(ctx context.Context, listRoleAssignmentsOptions *ListRoleAssignmentsOptions) (result *RoleAssignmentCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listRoleAssignmentsOptions, "listRoleAssignmentsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(listRoleAssignmentsOptions, "listRoleAssignmentsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return } -} - -// SetActionControlTemplateID : Allow user to set ActionControlTemplateID -func (_options *CommitActionControlTemplateOptions) SetActionControlTemplateID(actionControlTemplateID string) *CommitActionControlTemplateOptions { - _options.ActionControlTemplateID = core.StringPtr(actionControlTemplateID) - return _options -} -// SetVersion : Allow user to set Version -func (_options *CommitActionControlTemplateOptions) SetVersion(version string) *CommitActionControlTemplateOptions { - _options.Version = core.StringPtr(version) - return _options -} + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_assignments`, nil) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } -// SetHeaders : Allow user to set Headers -func (options *CommitActionControlTemplateOptions) SetHeaders(param map[string]string) *CommitActionControlTemplateOptions { - options.Headers = param - return options -} + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "ListRoleAssignments") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } -// CommitPolicyTemplateOptions : The CommitPolicyTemplate options. -type CommitPolicyTemplateOptions struct { - // The policy template ID. - PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` + for headerName, headerValue := range listRoleAssignmentsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + if listRoleAssignmentsOptions.AcceptLanguage != nil { + builder.AddHeader("Accept-Language", fmt.Sprint(*listRoleAssignmentsOptions.AcceptLanguage)) + } - // The policy template version. - Version *string `json:"version" validate:"required,ne="` + builder.AddQuery("account_id", fmt.Sprint(*listRoleAssignmentsOptions.AccountID)) + if listRoleAssignmentsOptions.TemplateID != nil { + builder.AddQuery("template_id", fmt.Sprint(*listRoleAssignmentsOptions.TemplateID)) + } + if listRoleAssignmentsOptions.TemplateVersion != nil { + builder.AddQuery("template_version", fmt.Sprint(*listRoleAssignmentsOptions.TemplateVersion)) + } + if listRoleAssignmentsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listRoleAssignmentsOptions.Limit)) + } + if listRoleAssignmentsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listRoleAssignmentsOptions.Start)) + } - // Allows users to set headers on API requests. - Headers map[string]string -} + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } -// NewCommitPolicyTemplateOptions : Instantiate CommitPolicyTemplateOptions -func (*IamPolicyManagementV1) NewCommitPolicyTemplateOptions(policyTemplateID string, version string) *CommitPolicyTemplateOptions { - return &CommitPolicyTemplateOptions{ - PolicyTemplateID: core.StringPtr(policyTemplateID), - Version: core.StringPtr(version), + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_role_assignments", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleAssignmentCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result } -} -// SetPolicyTemplateID : Allow user to set PolicyTemplateID -func (_options *CommitPolicyTemplateOptions) SetPolicyTemplateID(policyTemplateID string) *CommitPolicyTemplateOptions { - _options.PolicyTemplateID = core.StringPtr(policyTemplateID) - return _options + return } -// SetVersion : Allow user to set Version -func (_options *CommitPolicyTemplateOptions) SetVersion(version string) *CommitPolicyTemplateOptions { - _options.Version = core.StringPtr(version) - return _options +// CreateRoleTemplateAssignment : Create a role template assignment +// Assign a role template to child accounts and account groups. This creates the role in the accounts and account groups +// that you specify. +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplateAssignment(createRoleTemplateAssignmentOptions *CreateRoleTemplateAssignmentOptions) (result *RoleAssignmentCollection, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.CreateRoleTemplateAssignmentWithContext(context.Background(), createRoleTemplateAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// SetHeaders : Allow user to set Headers -func (options *CommitPolicyTemplateOptions) SetHeaders(param map[string]string) *CommitPolicyTemplateOptions { - options.Headers = param - return options -} +// CreateRoleTemplateAssignmentWithContext is an alternate form of the CreateRoleTemplateAssignment method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplateAssignmentWithContext(ctx context.Context, createRoleTemplateAssignmentOptions *CreateRoleTemplateAssignmentOptions) (result *RoleAssignmentCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createRoleTemplateAssignmentOptions, "createRoleTemplateAssignmentOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(createRoleTemplateAssignmentOptions, "createRoleTemplateAssignmentOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } -// ConflictsWith : Details of conflicting resource. -type ConflictsWith struct { - // The revision number of the resource. - Etag *string `json:"etag,omitempty"` + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_assignments`, nil) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } - // The conflicting role of ID. - Role *string `json:"role,omitempty"` + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "CreateRoleTemplateAssignment") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // The conflicting policy ID. - Policy *string `json:"policy,omitempty"` -} + for headerName, headerValue := range createRoleTemplateAssignmentOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + if createRoleTemplateAssignmentOptions.AcceptLanguage != nil { + builder.AddHeader("Accept-Language", fmt.Sprint(*createRoleTemplateAssignmentOptions.AcceptLanguage)) + } -// UnmarshalConflictsWith unmarshals an instance of ConflictsWith from the specified map of raw messages. -func UnmarshalConflictsWith(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ConflictsWith) - err = core.UnmarshalPrimitive(m, "etag", &obj.Etag) + body := make(map[string]interface{}) + if createRoleTemplateAssignmentOptions.Target != nil { + body["target"] = createRoleTemplateAssignmentOptions.Target + } + if createRoleTemplateAssignmentOptions.Templates != nil { + body["templates"] = createRoleTemplateAssignmentOptions.Templates + } + _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "etag-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "role", &obj.Role) + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "role-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "create_role_template_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleAssignmentCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// Control : Specifies the type of access that is granted by the policy. -type Control struct { - // Permission is granted by the policy. - Grant *Grant `json:"grant" validate:"required"` +// GetRoleAssignment : Retrieve a role assignment +// Retrieve a role template assignment by providing a role assignment ID. +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleAssignment(getRoleAssignmentOptions *GetRoleAssignmentOptions) (result *RoleAssignment, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.GetRoleAssignmentWithContext(context.Background(), getRoleAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// NewControl : Instantiate Control (Generic Model Constructor) -func (*IamPolicyManagementV1) NewControl(grant *Grant) (_model *Control, err error) { - _model = &Control{ - Grant: grant, - } - err = core.ValidateStruct(_model, "required parameters") +// GetRoleAssignmentWithContext is an alternate form of the GetRoleAssignment method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleAssignmentWithContext(ctx context.Context, getRoleAssignmentOptions *GetRoleAssignmentOptions) (result *RoleAssignment, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getRoleAssignmentOptions, "getRoleAssignmentOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return } - return -} - -// UnmarshalControl unmarshals an instance of Control from the specified map of raw messages. -func UnmarshalControl(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Control) - err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) + err = core.ValidateStruct(getRoleAssignmentOptions, "getRoleAssignmentOptions") if err != nil { - err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// ControlResponse : ControlResponse struct -// Models which "extend" this model: -// - ControlResponseControl -// - ControlResponseControlWithEnrichedRoles -type ControlResponse struct { - // Permission is granted by the policy. - Grant *Grant `json:"grant,omitempty"` -} -func (*ControlResponse) isaControlResponse() bool { - return true -} + pathParamsMap := map[string]string{ + "assignment_id": *getRoleAssignmentOptions.AssignmentID, + } -type ControlResponseIntf interface { - isaControlResponse() bool -} + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_assignments/{assignment_id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } -// UnmarshalControlResponse unmarshals an instance of ControlResponse from the specified map of raw messages. -func UnmarshalControlResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ControlResponse) - err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "GetRoleAssignment") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getRoleAssignmentOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "get_role_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleAssignment) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// CreateActionControlTemplateAssignmentOptions : The CreateActionControlTemplateAssignment options. -type CreateActionControlTemplateAssignmentOptions struct { - // assignment target account and type. - Target *AssignmentTargetDetails `json:"target" validate:"required"` +// UpdateRoleAssignment : Update a role assignment +// Update a role assignment by providing a role assignment ID. +func (iamPolicyManagement *IamPolicyManagementV1) UpdateRoleAssignment(updateRoleAssignmentOptions *UpdateRoleAssignmentOptions) (result *RoleAssignment, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.UpdateRoleAssignmentWithContext(context.Background(), updateRoleAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return +} - // List of action control template details for action control assignment. - Templates []ActionControlAssignmentTemplate `json:"templates" validate:"required"` +// UpdateRoleAssignmentWithContext is an alternate form of the UpdateRoleAssignment method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) UpdateRoleAssignmentWithContext(ctx context.Context, updateRoleAssignmentOptions *UpdateRoleAssignmentOptions) (result *RoleAssignment, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateRoleAssignmentOptions, "updateRoleAssignmentOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(updateRoleAssignmentOptions, "updateRoleAssignmentOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } - // Language code for translations - // * `default` - English - // * `de` - German (Standard) - // * `en` - English - // * `es` - Spanish (Spain) - // * `fr` - French (Standard) - // * `it` - Italian (Standard) - // * `ja` - Japanese - // * `ko` - Korean - // * `pt-br` - Portuguese (Brazil) - // * `zh-cn` - Chinese (Simplified, PRC) - // * `zh-tw` - (Chinese, Taiwan). - AcceptLanguage *string `json:"Accept-Language,omitempty"` + pathParamsMap := map[string]string{ + "assignment_id": *updateRoleAssignmentOptions.AssignmentID, + } - // Allows users to set headers on API requests. - Headers map[string]string -} + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_assignments/{assignment_id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } -// NewCreateActionControlTemplateAssignmentOptions : Instantiate CreateActionControlTemplateAssignmentOptions -func (*IamPolicyManagementV1) NewCreateActionControlTemplateAssignmentOptions(target *AssignmentTargetDetails, templates []ActionControlAssignmentTemplate) *CreateActionControlTemplateAssignmentOptions { - return &CreateActionControlTemplateAssignmentOptions{ - Target: target, - Templates: templates, + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "UpdateRoleAssignment") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } -} -// SetTarget : Allow user to set Target -func (_options *CreateActionControlTemplateAssignmentOptions) SetTarget(target *AssignmentTargetDetails) *CreateActionControlTemplateAssignmentOptions { - _options.Target = target - return _options -} + for headerName, headerValue := range updateRoleAssignmentOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + if updateRoleAssignmentOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateRoleAssignmentOptions.IfMatch)) + } -// SetTemplates : Allow user to set Templates -func (_options *CreateActionControlTemplateAssignmentOptions) SetTemplates(templates []ActionControlAssignmentTemplate) *CreateActionControlTemplateAssignmentOptions { - _options.Templates = templates - return _options -} + body := make(map[string]interface{}) + if updateRoleAssignmentOptions.TemplateVersion != nil { + body["template_version"] = updateRoleAssignmentOptions.TemplateVersion + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } -// SetAcceptLanguage : Allow user to set AcceptLanguage -func (_options *CreateActionControlTemplateAssignmentOptions) SetAcceptLanguage(acceptLanguage string) *CreateActionControlTemplateAssignmentOptions { - _options.AcceptLanguage = core.StringPtr(acceptLanguage) - return _options -} + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } -// SetHeaders : Allow user to set Headers -func (options *CreateActionControlTemplateAssignmentOptions) SetHeaders(param map[string]string) *CreateActionControlTemplateAssignmentOptions { - options.Headers = param - return options + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "update_role_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleAssignment) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return } -// CreateActionControlTemplateOptions : The CreateActionControlTemplate options. -type CreateActionControlTemplateOptions struct { - // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes - // the name value for all existing versions of the template. - Name *string `json:"name" validate:"required"` +// DeleteRoleAssignment : Remove a role assignment +// Remove a role template assignment by providing a role assignment ID. You can't delete a role assignment if the status +// is "in_progress". +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleAssignment(deleteRoleAssignmentOptions *DeleteRoleAssignmentOptions) (response *core.DetailedResponse, err error) { + response, err = iamPolicyManagement.DeleteRoleAssignmentWithContext(context.Background(), deleteRoleAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return +} - // Enterprise account ID where this template is created. - AccountID *string `json:"account_id" validate:"required"` +// DeleteRoleAssignmentWithContext is an alternate form of the DeleteRoleAssignment method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleAssignmentWithContext(ctx context.Context, deleteRoleAssignmentOptions *DeleteRoleAssignmentOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteRoleAssignmentOptions, "deleteRoleAssignmentOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(deleteRoleAssignmentOptions, "deleteRoleAssignmentOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } - // Description of the action control template. This is shown to users in the enterprise account. Use this to describe - // the purpose or context of the action control for enterprise users managing IAM templates. - Description *string `json:"description,omitempty"` + pathParamsMap := map[string]string{ + "assignment_id": *deleteRoleAssignmentOptions.AssignmentID, + } - // Committed status of the template. If committed is set to true, then the template version can no longer be updated. - Committed *bool `json:"committed,omitempty"` + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_assignments/{assignment_id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } - // The action control properties that are created in an action resource when the template is assigned. - ActionControl *TemplateActionControl `json:"action_control,omitempty"` + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "DeleteRoleAssignment") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // Language code for translations - // * `default` - English - // * `de` - German (Standard) - // * `en` - English - // * `es` - Spanish (Spain) - // * `fr` - French (Standard) - // * `it` - Italian (Standard) - // * `ja` - Japanese - // * `ko` - Korean - // * `pt-br` - Portuguese (Brazil) - // * `zh-cn` - Chinese (Simplified, PRC) - // * `zh-tw` - (Chinese, Taiwan). - AcceptLanguage *string `json:"Accept-Language,omitempty"` + for headerName, headerValue := range deleteRoleAssignmentOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // Allows users to set headers on API requests. - Headers map[string]string -} + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } -// NewCreateActionControlTemplateOptions : Instantiate CreateActionControlTemplateOptions -func (*IamPolicyManagementV1) NewCreateActionControlTemplateOptions(name string, accountID string) *CreateActionControlTemplateOptions { - return &CreateActionControlTemplateOptions{ - Name: core.StringPtr(name), - AccountID: core.StringPtr(accountID), + response, err = iamPolicyManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_role_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return } -} -// SetName : Allow user to set Name -func (_options *CreateActionControlTemplateOptions) SetName(name string) *CreateActionControlTemplateOptions { - _options.Name = core.StringPtr(name) - return _options + return +} +func getServiceComponentInfo() *core.ProblemComponent { + return core.NewProblemComponent(DefaultServiceName, "1.0.1") } -// SetAccountID : Allow user to set AccountID -func (_options *CreateActionControlTemplateOptions) SetAccountID(accountID string) *CreateActionControlTemplateOptions { - _options.AccountID = core.StringPtr(accountID) - return _options +// AccountSettingsAccessManagement : The Access Management Account Settings that are currently set for the requested account. +type AccountSettingsAccessManagement struct { + // How external accounts can interact in relation to the requested account. + ExternalAccountIdentityInteraction *ExternalAccountIdentityInteraction `json:"external_account_identity_interaction" validate:"required"` } -// SetDescription : Allow user to set Description -func (_options *CreateActionControlTemplateOptions) SetDescription(description string) *CreateActionControlTemplateOptions { - _options.Description = core.StringPtr(description) - return _options +// UnmarshalAccountSettingsAccessManagement unmarshals an instance of AccountSettingsAccessManagement from the specified map of raw messages. +func UnmarshalAccountSettingsAccessManagement(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsAccessManagement) + err = core.UnmarshalModel(m, "external_account_identity_interaction", &obj.ExternalAccountIdentityInteraction, UnmarshalExternalAccountIdentityInteraction) + if err != nil { + err = core.SDKErrorf(err, "", "external_account_identity_interaction-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetCommitted : Allow user to set Committed -func (_options *CreateActionControlTemplateOptions) SetCommitted(committed bool) *CreateActionControlTemplateOptions { - _options.Committed = core.BoolPtr(committed) +// ActionControlAssignment : The set of properties associated with the assigned action control template. +type ActionControlAssignment struct { + // Action control assignment ID. + ID *string `json:"id,omitempty"` + + // The account GUID that the action control assignments belong to. + AccountID *string `json:"account_id,omitempty"` + + // The href URL that links to the action control assignments API by action control assignment ID. + Href *string `json:"href,omitempty"` + + // The UTC timestamp when the action control assignment was created. + CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` + + // The IAM ID of the entity that created the action control assignment. + CreatedByID *string `json:"created_by_id,omitempty"` + + // The UTC timestamp when the action control assignment was last modified. + LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` + + // The IAM ID of the entity that last modified the action control assignment. + LastModifiedByID *string `json:"last_modified_by_id,omitempty"` + + // The current operation of the action control assignment. + Operation *string `json:"operation,omitempty"` + + // Resources created when action control template is assigned. + Resources []ActionControlAssignmentResource `json:"resources,omitempty"` + + // The action control template id and version that will be assigned. + Template *ActionControlAssignmentTemplate `json:"template" validate:"required"` + + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` + + // The action control assignment status. + Status *string `json:"status,omitempty"` +} + +// Constants associated with the ActionControlAssignment.Operation property. +// The current operation of the action control assignment. +const ( + ActionControlAssignmentOperationApplyConst = "apply" + ActionControlAssignmentOperationCreateConst = "create" + ActionControlAssignmentOperationRemoveConst = "remove" + ActionControlAssignmentOperationUpdateConst = "update" +) + +// Constants associated with the ActionControlAssignment.Status property. +// The action control assignment status. +const ( + ActionControlAssignmentStatusAcceptedConst = "accepted" + ActionControlAssignmentStatusFailureConst = "failure" + ActionControlAssignmentStatusInProgressConst = "in_progress" + ActionControlAssignmentStatusSupersededConst = "superseded" +) + +// UnmarshalActionControlAssignment unmarshals an instance of ActionControlAssignment from the specified map of raw messages. +func UnmarshalActionControlAssignment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignment) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + if err != nil { + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) + if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "operation", &obj.Operation) + if err != nil { + err = core.SDKErrorf(err, "", "operation-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalActionControlAssignmentResource) + if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalActionControlAssignmentTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlAssignmentCollection : A collection of action control assignments. +type ActionControlAssignmentCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` + + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` + + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of action control assignments. + Assignments []ActionControlAssignment `json:"assignments" validate:"required"` +} + +// UnmarshalActionControlAssignmentCollection unmarshals an instance of ActionControlAssignmentCollection from the specified map of raw messages. +func UnmarshalActionControlAssignmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignmentCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "assignments", &obj.Assignments, UnmarshalActionControlAssignment) + if err != nil { + err = core.SDKErrorf(err, "", "assignments-error", common.GetComponentInfo()) + 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 *ActionControlAssignmentCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + +// ActionControlAssignmentResource : The action control assignment resources and target where the template is assigned. +type ActionControlAssignmentResource struct { + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` + + // Set of properties of the assigned resource or error message if assignment failed. + ActionControl *ActionControlAssignmentResourceActionControl `json:"action_control,omitempty"` +} + +// UnmarshalActionControlAssignmentResource unmarshals an instance of ActionControlAssignmentResource from the specified map of raw messages. +func UnmarshalActionControlAssignmentResource(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignmentResource) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "action_control", &obj.ActionControl, UnmarshalActionControlAssignmentResourceActionControl) + if err != nil { + err = core.SDKErrorf(err, "", "action_control-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlAssignmentResourceActionControl : Set of properties of the assigned resource or error message if assignment failed. +type ActionControlAssignmentResourceActionControl struct { + // On success, it includes the action control assigned. + ResourceCreated *ActionControlAssignmentResourceCreated `json:"resource_created,omitempty"` + + // Body parameters for assignment error. + ErrorMessage *AssignmentResourceError `json:"error_message,omitempty"` +} + +// UnmarshalActionControlAssignmentResourceActionControl unmarshals an instance of ActionControlAssignmentResourceActionControl from the specified map of raw messages. +func UnmarshalActionControlAssignmentResourceActionControl(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignmentResourceActionControl) + err = core.UnmarshalModel(m, "resource_created", &obj.ResourceCreated, UnmarshalActionControlAssignmentResourceCreated) + if err != nil { + err = core.SDKErrorf(err, "", "resource_created-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "error_message", &obj.ErrorMessage, UnmarshalAssignmentResourceError) + if err != nil { + err = core.SDKErrorf(err, "", "error_message-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlAssignmentResourceCreated : On success, it includes the action control assigned. +type ActionControlAssignmentResourceCreated struct { + // action control id. + ID *string `json:"id,omitempty"` +} + +// UnmarshalActionControlAssignmentResourceCreated unmarshals an instance of ActionControlAssignmentResourceCreated from the specified map of raw messages. +func UnmarshalActionControlAssignmentResourceCreated(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignmentResourceCreated) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlAssignmentTemplate : The action control template id and version that will be assigned. +type ActionControlAssignmentTemplate struct { + // Action control template ID. + ID *string `json:"id" validate:"required"` + + // Action control template version. + Version *string `json:"version" validate:"required"` +} + +// NewActionControlAssignmentTemplate : Instantiate ActionControlAssignmentTemplate (Generic Model Constructor) +func (*IamPolicyManagementV1) NewActionControlAssignmentTemplate(id string, version string) (_model *ActionControlAssignmentTemplate, err error) { + _model = &ActionControlAssignmentTemplate{ + ID: core.StringPtr(id), + Version: core.StringPtr(version), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalActionControlAssignmentTemplate unmarshals an instance of ActionControlAssignmentTemplate from the specified map of raw messages. +func UnmarshalActionControlAssignmentTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignmentTemplate) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "version", &obj.Version) + if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlTemplate : The set of properties associated with the action control template. +type ActionControlTemplate struct { + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes + // the name value for all existing versions of the template. + Name *string `json:"name" validate:"required"` + + // Description of the action control template. This is shown to users in the enterprise account. Use this to describe + // the purpose or context of the action control for enterprise users managing IAM templates. + Description *string `json:"description" validate:"required"` + + // Enterprise account ID where this template is created. + AccountID *string `json:"account_id" validate:"required"` + + // Committed status of the template. If committed is set to true, then the template version can no longer be updated. + Committed *bool `json:"committed,omitempty"` + + // The action control properties that are created in an action resource when the template is assigned. + ActionControl *TemplateActionControl `json:"action_control,omitempty"` + + // The action control template ID. + ID *string `json:"id,omitempty"` + + // The href URL that links to the action control templates API by action control template ID. + Href *string `json:"href,omitempty"` + + // The UTC timestamp when the action control template was created. + CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` + + // The IAM ID of the entity that created the action control template. + CreatedByID *string `json:"created_by_id,omitempty"` + + // The UTC timestamp when the action control template was last modified. + LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` + + // The IAM ID of the entity that last modified the action control template. + LastModifiedByID *string `json:"last_modified_by_id,omitempty"` + + // The version number of the template used to identify different versions of same template. + Version *string `json:"version" validate:"required"` + + // State of action control template. + State *string `json:"state" validate:"required"` +} + +// Constants associated with the ActionControlTemplate.State property. +// State of action control template. +const ( + ActionControlTemplateStateActiveConst = "active" + ActionControlTemplateStateDeletedConst = "deleted" +) + +// UnmarshalActionControlTemplate unmarshals an instance of ActionControlTemplate from the specified map of raw messages. +func UnmarshalActionControlTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlTemplate) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + if err != nil { + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "committed", &obj.Committed) + if err != nil { + err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "action_control", &obj.ActionControl, UnmarshalTemplateActionControl) + if err != nil { + err = core.SDKErrorf(err, "", "action_control-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) + if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "version", &obj.Version) + if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "state", &obj.State) + if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlTemplateCollection : A collection of action control templates. +type ActionControlTemplateCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` + + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` + + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of action control templates. + ActionControlTemplates []ActionControlTemplate `json:"action_control_templates" validate:"required"` +} + +// UnmarshalActionControlTemplateCollection unmarshals an instance of ActionControlTemplateCollection from the specified map of raw messages. +func UnmarshalActionControlTemplateCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlTemplateCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "action_control_templates", &obj.ActionControlTemplates, UnmarshalActionControlTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "action_control_templates-error", common.GetComponentInfo()) + 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 *ActionControlTemplateCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + +// ActionControlTemplateVersionsCollection : A collection of versions for a specific action control template. +type ActionControlTemplateVersionsCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` + + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` + + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of action control templates versions. + Versions []ActionControlTemplate `json:"versions" validate:"required"` +} + +// UnmarshalActionControlTemplateVersionsCollection unmarshals an instance of ActionControlTemplateVersionsCollection from the specified map of raw messages. +func UnmarshalActionControlTemplateVersionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlTemplateVersionsCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalActionControlTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) + 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 *ActionControlTemplateVersionsCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + +// AssignmentResourceCreated : On success, includes the policy that is assigned. +type AssignmentResourceCreated struct { + // Policy id. + ID *string `json:"id,omitempty"` +} + +// UnmarshalAssignmentResourceCreated unmarshals an instance of AssignmentResourceCreated from the specified map of raw messages. +func UnmarshalAssignmentResourceCreated(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AssignmentResourceCreated) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AssignmentResourceError : Body parameters for assignment error. +type AssignmentResourceError struct { + // Name of the error. + Name *string `json:"name,omitempty"` + + // error code. + ErrorCode *string `json:"errorCode,omitempty"` + + // Error message detailing the nature of the error. + Message *string `json:"message,omitempty"` + + // Internal status code for the error. + Code *string `json:"code,omitempty"` + + // The errors encountered during the response. + Errors []ErrorObject `json:"errors,omitempty"` +} + +// UnmarshalAssignmentResourceError unmarshals an instance of AssignmentResourceError from the specified map of raw messages. +func UnmarshalAssignmentResourceError(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AssignmentResourceError) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "errorCode", &obj.ErrorCode) + if err != nil { + err = core.SDKErrorf(err, "", "errorCode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "errors", &obj.Errors, UnmarshalErrorObject) + if err != nil { + err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AssignmentTargetDetails : assignment target account and type. +type AssignmentTargetDetails struct { + // Assignment target type. + Type *string `json:"type" validate:"required"` + + // ID of the target account. + ID *string `json:"id" validate:"required"` +} + +// Constants associated with the AssignmentTargetDetails.Type property. +// Assignment target type. +const ( + AssignmentTargetDetailsTypeAccountConst = "Account" +) + +// NewAssignmentTargetDetails : Instantiate AssignmentTargetDetails (Generic Model Constructor) +func (*IamPolicyManagementV1) NewAssignmentTargetDetails(typeVar string, id string) (_model *AssignmentTargetDetails, err error) { + _model = &AssignmentTargetDetails{ + Type: core.StringPtr(typeVar), + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalAssignmentTargetDetails unmarshals an instance of AssignmentTargetDetails from the specified map of raw messages. +func UnmarshalAssignmentTargetDetails(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AssignmentTargetDetails) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AssignmentTemplateDetails : policy template details. +type AssignmentTemplateDetails struct { + // Policy template ID. + ID *string `json:"id,omitempty"` + + // Policy template version. + Version *string `json:"version,omitempty"` +} + +// UnmarshalAssignmentTemplateDetails unmarshals an instance of AssignmentTemplateDetails from the specified map of raw messages. +func UnmarshalAssignmentTemplateDetails(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AssignmentTemplateDetails) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "version", &obj.Version) + if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CommitActionControlTemplateOptions : The CommitActionControlTemplate options. +type CommitActionControlTemplateOptions struct { + // Action control template ID. + ActionControlTemplateID *string `json:"action_control_template_id" validate:"required,ne="` + + // The action control template version. + Version *string `json:"version" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCommitActionControlTemplateOptions : Instantiate CommitActionControlTemplateOptions +func (*IamPolicyManagementV1) NewCommitActionControlTemplateOptions(actionControlTemplateID string, version string) *CommitActionControlTemplateOptions { + return &CommitActionControlTemplateOptions{ + ActionControlTemplateID: core.StringPtr(actionControlTemplateID), + Version: core.StringPtr(version), + } +} + +// SetActionControlTemplateID : Allow user to set ActionControlTemplateID +func (_options *CommitActionControlTemplateOptions) SetActionControlTemplateID(actionControlTemplateID string) *CommitActionControlTemplateOptions { + _options.ActionControlTemplateID = core.StringPtr(actionControlTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *CommitActionControlTemplateOptions) SetVersion(version string) *CommitActionControlTemplateOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CommitActionControlTemplateOptions) SetHeaders(param map[string]string) *CommitActionControlTemplateOptions { + options.Headers = param + return options +} + +// CommitPolicyTemplateOptions : The CommitPolicyTemplate options. +type CommitPolicyTemplateOptions struct { + // The policy template ID. + PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` + + // The policy template version. + Version *string `json:"version" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCommitPolicyTemplateOptions : Instantiate CommitPolicyTemplateOptions +func (*IamPolicyManagementV1) NewCommitPolicyTemplateOptions(policyTemplateID string, version string) *CommitPolicyTemplateOptions { + return &CommitPolicyTemplateOptions{ + PolicyTemplateID: core.StringPtr(policyTemplateID), + Version: core.StringPtr(version), + } +} + +// SetPolicyTemplateID : Allow user to set PolicyTemplateID +func (_options *CommitPolicyTemplateOptions) SetPolicyTemplateID(policyTemplateID string) *CommitPolicyTemplateOptions { + _options.PolicyTemplateID = core.StringPtr(policyTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *CommitPolicyTemplateOptions) SetVersion(version string) *CommitPolicyTemplateOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CommitPolicyTemplateOptions) SetHeaders(param map[string]string) *CommitPolicyTemplateOptions { + options.Headers = param + return options +} + +// CommitRoleTemplateOptions : The CommitRoleTemplate options. +type CommitRoleTemplateOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // The role template version. + Version *string `json:"version" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCommitRoleTemplateOptions : Instantiate CommitRoleTemplateOptions +func (*IamPolicyManagementV1) NewCommitRoleTemplateOptions(roleTemplateID string, version string) *CommitRoleTemplateOptions { + return &CommitRoleTemplateOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + Version: core.StringPtr(version), + } +} + +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *CommitRoleTemplateOptions) SetRoleTemplateID(roleTemplateID string) *CommitRoleTemplateOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *CommitRoleTemplateOptions) SetVersion(version string) *CommitRoleTemplateOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CommitRoleTemplateOptions) SetHeaders(param map[string]string) *CommitRoleTemplateOptions { + options.Headers = param + return options +} + +// ConflictsWith : Details of conflicting resource. +type ConflictsWith struct { + // The revision number of the resource. + Etag *string `json:"etag,omitempty"` + + // The conflicting role of ID. + Role *string `json:"role,omitempty"` + + // The conflicting policy ID. + Policy *string `json:"policy,omitempty"` +} + +// UnmarshalConflictsWith unmarshals an instance of ConflictsWith from the specified map of raw messages. +func UnmarshalConflictsWith(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ConflictsWith) + err = core.UnmarshalPrimitive(m, "etag", &obj.Etag) + if err != nil { + err = core.SDKErrorf(err, "", "etag-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "role", &obj.Role) + if err != nil { + err = core.SDKErrorf(err, "", "role-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + if err != nil { + err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Control : Specifies the type of access that is granted by the policy. +type Control struct { + // Permission is granted by the policy. + Grant *Grant `json:"grant" validate:"required"` +} + +// NewControl : Instantiate Control (Generic Model Constructor) +func (*IamPolicyManagementV1) NewControl(grant *Grant) (_model *Control, err error) { + _model = &Control{ + Grant: grant, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalControl unmarshals an instance of Control from the specified map of raw messages. +func UnmarshalControl(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Control) + err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) + if err != nil { + err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ControlResponse : ControlResponse struct +// Models which "extend" this model: +// - ControlResponseControl +// - ControlResponseControlWithEnrichedRoles +type ControlResponse struct { + // Permission is granted by the policy. + Grant *Grant `json:"grant,omitempty"` +} +func (*ControlResponse) isaControlResponse() bool { + return true +} + +type ControlResponseIntf interface { + isaControlResponse() bool +} + +// UnmarshalControlResponse unmarshals an instance of ControlResponse from the specified map of raw messages. +func UnmarshalControlResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ControlResponse) + err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) + if err != nil { + err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CreateActionControlTemplateAssignmentOptions : The CreateActionControlTemplateAssignment options. +type CreateActionControlTemplateAssignmentOptions struct { + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` + + // List of action control template details for action control assignment. + Templates []ActionControlAssignmentTemplate `json:"templates" validate:"required"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCreateActionControlTemplateAssignmentOptions : Instantiate CreateActionControlTemplateAssignmentOptions +func (*IamPolicyManagementV1) NewCreateActionControlTemplateAssignmentOptions(target *AssignmentTargetDetails, templates []ActionControlAssignmentTemplate) *CreateActionControlTemplateAssignmentOptions { + return &CreateActionControlTemplateAssignmentOptions{ + Target: target, + Templates: templates, + } +} + +// SetTarget : Allow user to set Target +func (_options *CreateActionControlTemplateAssignmentOptions) SetTarget(target *AssignmentTargetDetails) *CreateActionControlTemplateAssignmentOptions { + _options.Target = target + return _options +} + +// SetTemplates : Allow user to set Templates +func (_options *CreateActionControlTemplateAssignmentOptions) SetTemplates(templates []ActionControlAssignmentTemplate) *CreateActionControlTemplateAssignmentOptions { + _options.Templates = templates + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *CreateActionControlTemplateAssignmentOptions) SetAcceptLanguage(acceptLanguage string) *CreateActionControlTemplateAssignmentOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateActionControlTemplateAssignmentOptions) SetHeaders(param map[string]string) *CreateActionControlTemplateAssignmentOptions { + options.Headers = param + return options +} + +// CreateActionControlTemplateOptions : The CreateActionControlTemplate options. +type CreateActionControlTemplateOptions struct { + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes + // the name value for all existing versions of the template. + Name *string `json:"name" validate:"required"` + + // Enterprise account ID where this template is created. + AccountID *string `json:"account_id" validate:"required"` + + // Description of the action control template. This is shown to users in the enterprise account. Use this to describe + // the purpose or context of the action control for enterprise users managing IAM templates. + Description *string `json:"description,omitempty"` + + // Committed status of the template. If committed is set to true, then the template version can no longer be updated. + Committed *bool `json:"committed,omitempty"` + + // The action control properties that are created in an action resource when the template is assigned. + ActionControl *TemplateActionControl `json:"action_control,omitempty"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCreateActionControlTemplateOptions : Instantiate CreateActionControlTemplateOptions +func (*IamPolicyManagementV1) NewCreateActionControlTemplateOptions(name string, accountID string) *CreateActionControlTemplateOptions { + return &CreateActionControlTemplateOptions{ + Name: core.StringPtr(name), + AccountID: core.StringPtr(accountID), + } +} + +// SetName : Allow user to set Name +func (_options *CreateActionControlTemplateOptions) SetName(name string) *CreateActionControlTemplateOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetAccountID : Allow user to set AccountID +func (_options *CreateActionControlTemplateOptions) SetAccountID(accountID string) *CreateActionControlTemplateOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetDescription : Allow user to set Description +func (_options *CreateActionControlTemplateOptions) SetDescription(description string) *CreateActionControlTemplateOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetCommitted : Allow user to set Committed +func (_options *CreateActionControlTemplateOptions) SetCommitted(committed bool) *CreateActionControlTemplateOptions { + _options.Committed = core.BoolPtr(committed) return _options } @@ -5673,51 +6862,205 @@ func (_options *CreatePolicyTemplateVersionOptions) SetPolicy(policy *TemplatePo return _options } -// SetName : Allow user to set Name -func (_options *CreatePolicyTemplateVersionOptions) SetName(name string) *CreatePolicyTemplateVersionOptions { - _options.Name = core.StringPtr(name) +// SetName : Allow user to set Name +func (_options *CreatePolicyTemplateVersionOptions) SetName(name string) *CreatePolicyTemplateVersionOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetDescription : Allow user to set Description +func (_options *CreatePolicyTemplateVersionOptions) SetDescription(description string) *CreatePolicyTemplateVersionOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetCommitted : Allow user to set Committed +func (_options *CreatePolicyTemplateVersionOptions) SetCommitted(committed bool) *CreatePolicyTemplateVersionOptions { + _options.Committed = core.BoolPtr(committed) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreatePolicyTemplateVersionOptions) SetHeaders(param map[string]string) *CreatePolicyTemplateVersionOptions { + options.Headers = param + return options +} + +// CreateRoleOptions : The CreateRole options. +type CreateRoleOptions struct { + // The display the name of the role that is shown in the console. + DisplayName *string `json:"display_name" validate:"required"` + + // The actions of the role. For more information, see [IAM roles and + // actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions). + Actions []string `json:"actions" validate:"required"` + + // The name of the role that is used in the CRN. This must be alphanumeric and capitalized. + Name *string `json:"name" validate:"required"` + + // The account GUID. + AccountID *string `json:"account_id" validate:"required"` + + // The service name. + ServiceName *string `json:"service_name" validate:"required"` + + // The description of the role. + Description *string `json:"description,omitempty"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCreateRoleOptions : Instantiate CreateRoleOptions +func (*IamPolicyManagementV1) NewCreateRoleOptions(displayName string, actions []string, name string, accountID string, serviceName string) *CreateRoleOptions { + return &CreateRoleOptions{ + DisplayName: core.StringPtr(displayName), + Actions: actions, + Name: core.StringPtr(name), + AccountID: core.StringPtr(accountID), + ServiceName: core.StringPtr(serviceName), + } +} + +// SetDisplayName : Allow user to set DisplayName +func (_options *CreateRoleOptions) SetDisplayName(displayName string) *CreateRoleOptions { + _options.DisplayName = core.StringPtr(displayName) + return _options +} + +// SetActions : Allow user to set Actions +func (_options *CreateRoleOptions) SetActions(actions []string) *CreateRoleOptions { + _options.Actions = actions + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateRoleOptions) SetName(name string) *CreateRoleOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetAccountID : Allow user to set AccountID +func (_options *CreateRoleOptions) SetAccountID(accountID string) *CreateRoleOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetServiceName : Allow user to set ServiceName +func (_options *CreateRoleOptions) SetServiceName(serviceName string) *CreateRoleOptions { + _options.ServiceName = core.StringPtr(serviceName) + return _options +} + +// SetDescription : Allow user to set Description +func (_options *CreateRoleOptions) SetDescription(description string) *CreateRoleOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *CreateRoleOptions) SetAcceptLanguage(acceptLanguage string) *CreateRoleOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateRoleOptions) SetHeaders(param map[string]string) *CreateRoleOptions { + options.Headers = param + return options +} + +// CreateRoleTemplateAssignmentOptions : The CreateRoleTemplateAssignment options. +type CreateRoleTemplateAssignmentOptions struct { + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` + + // List of role template details for role assignment. + Templates []RoleAssignmentTemplate `json:"templates" validate:"required"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCreateRoleTemplateAssignmentOptions : Instantiate CreateRoleTemplateAssignmentOptions +func (*IamPolicyManagementV1) NewCreateRoleTemplateAssignmentOptions(target *AssignmentTargetDetails, templates []RoleAssignmentTemplate) *CreateRoleTemplateAssignmentOptions { + return &CreateRoleTemplateAssignmentOptions{ + Target: target, + Templates: templates, + } +} + +// SetTarget : Allow user to set Target +func (_options *CreateRoleTemplateAssignmentOptions) SetTarget(target *AssignmentTargetDetails) *CreateRoleTemplateAssignmentOptions { + _options.Target = target return _options } -// SetDescription : Allow user to set Description -func (_options *CreatePolicyTemplateVersionOptions) SetDescription(description string) *CreatePolicyTemplateVersionOptions { - _options.Description = core.StringPtr(description) +// SetTemplates : Allow user to set Templates +func (_options *CreateRoleTemplateAssignmentOptions) SetTemplates(templates []RoleAssignmentTemplate) *CreateRoleTemplateAssignmentOptions { + _options.Templates = templates return _options } -// SetCommitted : Allow user to set Committed -func (_options *CreatePolicyTemplateVersionOptions) SetCommitted(committed bool) *CreatePolicyTemplateVersionOptions { - _options.Committed = core.BoolPtr(committed) +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *CreateRoleTemplateAssignmentOptions) SetAcceptLanguage(acceptLanguage string) *CreateRoleTemplateAssignmentOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) return _options } // SetHeaders : Allow user to set Headers -func (options *CreatePolicyTemplateVersionOptions) SetHeaders(param map[string]string) *CreatePolicyTemplateVersionOptions { +func (options *CreateRoleTemplateAssignmentOptions) SetHeaders(param map[string]string) *CreateRoleTemplateAssignmentOptions { options.Headers = param return options } -// CreateRoleOptions : The CreateRole options. -type CreateRoleOptions struct { - // The display the name of the role that is shown in the console. - DisplayName *string `json:"display_name" validate:"required"` - - // The actions of the role. For more information, see [IAM roles and - // actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions). - Actions []string `json:"actions" validate:"required"` - - // The name of the role that is used in the CRN. This must be alphanumeric and capitalized. +// CreateRoleTemplateOptions : The CreateRoleTemplate options. +type CreateRoleTemplateOptions struct { + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes + // the name value for all existing versions of the template. Name *string `json:"name" validate:"required"` - // The account GUID. + // Enterprise account ID where this template is created. AccountID *string `json:"account_id" validate:"required"` - // The service name. - ServiceName *string `json:"service_name" validate:"required"` - - // The description of the role. + // Description of the role template. This is shown to users in the enterprise account. Use this to describe the purpose + // or context of the role for enterprise users managing IAM templates. Description *string `json:"description,omitempty"` + // Committed status of the template. If committed is set to true, then the template version can no longer be updated. + Committed *bool `json:"committed,omitempty"` + + // The role properties that are created in an action resource when the template is assigned. + Role *RoleTemplatePrototypeRole `json:"role,omitempty"` + // Language code for translations // * `default` - English // * `de` - German (Standard) @@ -5736,61 +7079,119 @@ type CreateRoleOptions struct { Headers map[string]string } -// NewCreateRoleOptions : Instantiate CreateRoleOptions -func (*IamPolicyManagementV1) NewCreateRoleOptions(displayName string, actions []string, name string, accountID string, serviceName string) *CreateRoleOptions { - return &CreateRoleOptions{ - DisplayName: core.StringPtr(displayName), - Actions: actions, +// NewCreateRoleTemplateOptions : Instantiate CreateRoleTemplateOptions +func (*IamPolicyManagementV1) NewCreateRoleTemplateOptions(name string, accountID string) *CreateRoleTemplateOptions { + return &CreateRoleTemplateOptions{ Name: core.StringPtr(name), AccountID: core.StringPtr(accountID), - ServiceName: core.StringPtr(serviceName), } } -// SetDisplayName : Allow user to set DisplayName -func (_options *CreateRoleOptions) SetDisplayName(displayName string) *CreateRoleOptions { - _options.DisplayName = core.StringPtr(displayName) +// SetName : Allow user to set Name +func (_options *CreateRoleTemplateOptions) SetName(name string) *CreateRoleTemplateOptions { + _options.Name = core.StringPtr(name) return _options } -// SetActions : Allow user to set Actions -func (_options *CreateRoleOptions) SetActions(actions []string) *CreateRoleOptions { - _options.Actions = actions +// SetAccountID : Allow user to set AccountID +func (_options *CreateRoleTemplateOptions) SetAccountID(accountID string) *CreateRoleTemplateOptions { + _options.AccountID = core.StringPtr(accountID) return _options } -// SetName : Allow user to set Name -func (_options *CreateRoleOptions) SetName(name string) *CreateRoleOptions { - _options.Name = core.StringPtr(name) +// SetDescription : Allow user to set Description +func (_options *CreateRoleTemplateOptions) SetDescription(description string) *CreateRoleTemplateOptions { + _options.Description = core.StringPtr(description) return _options } -// SetAccountID : Allow user to set AccountID -func (_options *CreateRoleOptions) SetAccountID(accountID string) *CreateRoleOptions { - _options.AccountID = core.StringPtr(accountID) +// SetCommitted : Allow user to set Committed +func (_options *CreateRoleTemplateOptions) SetCommitted(committed bool) *CreateRoleTemplateOptions { + _options.Committed = core.BoolPtr(committed) return _options } -// SetServiceName : Allow user to set ServiceName -func (_options *CreateRoleOptions) SetServiceName(serviceName string) *CreateRoleOptions { - _options.ServiceName = core.StringPtr(serviceName) +// SetRole : Allow user to set Role +func (_options *CreateRoleTemplateOptions) SetRole(role *RoleTemplatePrototypeRole) *CreateRoleTemplateOptions { + _options.Role = role + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *CreateRoleTemplateOptions) SetAcceptLanguage(acceptLanguage string) *CreateRoleTemplateOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateRoleTemplateOptions) SetHeaders(param map[string]string) *CreateRoleTemplateOptions { + options.Headers = param + return options +} + +// CreateRoleTemplateVersionOptions : The CreateRoleTemplateVersion options. +type CreateRoleTemplateVersionOptions struct { + // The role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it will + // change the name value for all existing versions of the template. + Name *string `json:"name,omitempty"` + + // Description of the role template. This is shown to users in the enterprise account. Use this to describe the purpose + // or context of the role for enterprise users managing IAM templates. + Description *string `json:"description,omitempty"` + + // The role properties that are created in an action resource when the template is assigned. + Role *TemplateRole `json:"role,omitempty"` + + // Committed status of the template version. If committed is set to true, then the template version can no longer be + // updated. + Committed *bool `json:"committed,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCreateRoleTemplateVersionOptions : Instantiate CreateRoleTemplateVersionOptions +func (*IamPolicyManagementV1) NewCreateRoleTemplateVersionOptions(roleTemplateID string) *CreateRoleTemplateVersionOptions { + return &CreateRoleTemplateVersionOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + } +} + +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *CreateRoleTemplateVersionOptions) SetRoleTemplateID(roleTemplateID string) *CreateRoleTemplateVersionOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateRoleTemplateVersionOptions) SetName(name string) *CreateRoleTemplateVersionOptions { + _options.Name = core.StringPtr(name) return _options } // SetDescription : Allow user to set Description -func (_options *CreateRoleOptions) SetDescription(description string) *CreateRoleOptions { +func (_options *CreateRoleTemplateVersionOptions) SetDescription(description string) *CreateRoleTemplateVersionOptions { _options.Description = core.StringPtr(description) return _options } -// SetAcceptLanguage : Allow user to set AcceptLanguage -func (_options *CreateRoleOptions) SetAcceptLanguage(acceptLanguage string) *CreateRoleOptions { - _options.AcceptLanguage = core.StringPtr(acceptLanguage) +// SetRole : Allow user to set Role +func (_options *CreateRoleTemplateVersionOptions) SetRole(role *TemplateRole) *CreateRoleTemplateVersionOptions { + _options.Role = role + return _options +} + +// SetCommitted : Allow user to set Committed +func (_options *CreateRoleTemplateVersionOptions) SetCommitted(committed bool) *CreateRoleTemplateVersionOptions { + _options.Committed = core.BoolPtr(committed) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateRoleOptions) SetHeaders(param map[string]string) *CreateRoleOptions { +func (options *CreateRoleTemplateVersionOptions) SetHeaders(param map[string]string) *CreateRoleTemplateVersionOptions { options.Headers = param return options } @@ -6238,6 +7639,34 @@ func (options *DeletePolicyTemplateVersionOptions) SetHeaders(param map[string]s return options } +// DeleteRoleAssignmentOptions : The DeleteRoleAssignment options. +type DeleteRoleAssignmentOptions struct { + // Role template assignment ID. + AssignmentID *string `json:"assignment_id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewDeleteRoleAssignmentOptions : Instantiate DeleteRoleAssignmentOptions +func (*IamPolicyManagementV1) NewDeleteRoleAssignmentOptions(assignmentID string) *DeleteRoleAssignmentOptions { + return &DeleteRoleAssignmentOptions{ + AssignmentID: core.StringPtr(assignmentID), + } +} + +// SetAssignmentID : Allow user to set AssignmentID +func (_options *DeleteRoleAssignmentOptions) SetAssignmentID(assignmentID string) *DeleteRoleAssignmentOptions { + _options.AssignmentID = core.StringPtr(assignmentID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteRoleAssignmentOptions) SetHeaders(param map[string]string) *DeleteRoleAssignmentOptions { + options.Headers = param + return options +} + // DeleteRoleOptions : The DeleteRole options. type DeleteRoleOptions struct { // The role ID. @@ -6266,6 +7695,72 @@ func (options *DeleteRoleOptions) SetHeaders(param map[string]string) *DeleteRol return options } +// DeleteRoleTemplateOptions : The DeleteRoleTemplate options. +type DeleteRoleTemplateOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewDeleteRoleTemplateOptions : Instantiate DeleteRoleTemplateOptions +func (*IamPolicyManagementV1) NewDeleteRoleTemplateOptions(roleTemplateID string) *DeleteRoleTemplateOptions { + return &DeleteRoleTemplateOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + } +} + +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *DeleteRoleTemplateOptions) SetRoleTemplateID(roleTemplateID string) *DeleteRoleTemplateOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteRoleTemplateOptions) SetHeaders(param map[string]string) *DeleteRoleTemplateOptions { + options.Headers = param + return options +} + +// DeleteRoleTemplateVersionOptions : The DeleteRoleTemplateVersion options. +type DeleteRoleTemplateVersionOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Role template version. + Version *string `json:"version" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewDeleteRoleTemplateVersionOptions : Instantiate DeleteRoleTemplateVersionOptions +func (*IamPolicyManagementV1) NewDeleteRoleTemplateVersionOptions(roleTemplateID string, version string) *DeleteRoleTemplateVersionOptions { + return &DeleteRoleTemplateVersionOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + Version: core.StringPtr(version), + } +} + +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *DeleteRoleTemplateVersionOptions) SetRoleTemplateID(roleTemplateID string) *DeleteRoleTemplateVersionOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *DeleteRoleTemplateVersionOptions) SetVersion(version string) *DeleteRoleTemplateVersionOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteRoleTemplateVersionOptions) SetHeaders(param map[string]string) *DeleteRoleTemplateVersionOptions { + options.Headers = param + return options +} + // DeleteV2PolicyOptions : The DeleteV2Policy options. type DeleteV2PolicyOptions struct { // The policy ID. @@ -6389,8 +7884,11 @@ const ( ErrorObjectCodePolicyTemplateNotFoundConst = "policy_template_not_found" ErrorObjectCodeRequestNotProcessedConst = "request_not_processed" ErrorObjectCodeResourceNotFoundConst = "resource_not_found" + ErrorObjectCodeRoleAssignmentNotFoundConst = "role_assignment_not_found" ErrorObjectCodeRoleConflictErrorConst = "role_conflict_error" ErrorObjectCodeRoleNotFoundConst = "role_not_found" + ErrorObjectCodeRoleTemplateConflictErrorConst = "role_template_conflict_error" + ErrorObjectCodeRoleTemplateNotFoundConst = "role_template_not_found" ErrorObjectCodeTooManyRequestsConst = "too_many_requests" ErrorObjectCodeUnableToProcessConst = "unable_to_process" ErrorObjectCodeUnsupportedContentTypeConst = "unsupported_content_type" @@ -6702,63 +8200,173 @@ type GetPolicyTemplateVersionOptions struct { // The policy template ID. PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` - // The policy template version. - Version *string `json:"version" validate:"required,ne="` + // The policy template version. + Version *string `json:"version" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetPolicyTemplateVersionOptions : Instantiate GetPolicyTemplateVersionOptions +func (*IamPolicyManagementV1) NewGetPolicyTemplateVersionOptions(policyTemplateID string, version string) *GetPolicyTemplateVersionOptions { + return &GetPolicyTemplateVersionOptions{ + PolicyTemplateID: core.StringPtr(policyTemplateID), + Version: core.StringPtr(version), + } +} + +// SetPolicyTemplateID : Allow user to set PolicyTemplateID +func (_options *GetPolicyTemplateVersionOptions) SetPolicyTemplateID(policyTemplateID string) *GetPolicyTemplateVersionOptions { + _options.PolicyTemplateID = core.StringPtr(policyTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *GetPolicyTemplateVersionOptions) SetVersion(version string) *GetPolicyTemplateVersionOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetPolicyTemplateVersionOptions) SetHeaders(param map[string]string) *GetPolicyTemplateVersionOptions { + options.Headers = param + return options +} + +// GetRoleAssignmentOptions : The GetRoleAssignment options. +type GetRoleAssignmentOptions struct { + // Role template assignment ID. + AssignmentID *string `json:"assignment_id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetRoleAssignmentOptions : Instantiate GetRoleAssignmentOptions +func (*IamPolicyManagementV1) NewGetRoleAssignmentOptions(assignmentID string) *GetRoleAssignmentOptions { + return &GetRoleAssignmentOptions{ + AssignmentID: core.StringPtr(assignmentID), + } +} + +// SetAssignmentID : Allow user to set AssignmentID +func (_options *GetRoleAssignmentOptions) SetAssignmentID(assignmentID string) *GetRoleAssignmentOptions { + _options.AssignmentID = core.StringPtr(assignmentID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetRoleAssignmentOptions) SetHeaders(param map[string]string) *GetRoleAssignmentOptions { + options.Headers = param + return options +} + +// GetRoleOptions : The GetRole options. +type GetRoleOptions struct { + // The role ID. + RoleID *string `json:"role_id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetRoleOptions : Instantiate GetRoleOptions +func (*IamPolicyManagementV1) NewGetRoleOptions(roleID string) *GetRoleOptions { + return &GetRoleOptions{ + RoleID: core.StringPtr(roleID), + } +} + +// SetRoleID : Allow user to set RoleID +func (_options *GetRoleOptions) SetRoleID(roleID string) *GetRoleOptions { + _options.RoleID = core.StringPtr(roleID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetRoleOptions) SetHeaders(param map[string]string) *GetRoleOptions { + options.Headers = param + return options +} + +// GetRoleTemplateOptions : The GetRoleTemplate options. +type GetRoleTemplateOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // The role template state. + State *string `json:"state,omitempty"` // Allows users to set headers on API requests. Headers map[string]string } -// NewGetPolicyTemplateVersionOptions : Instantiate GetPolicyTemplateVersionOptions -func (*IamPolicyManagementV1) NewGetPolicyTemplateVersionOptions(policyTemplateID string, version string) *GetPolicyTemplateVersionOptions { - return &GetPolicyTemplateVersionOptions{ - PolicyTemplateID: core.StringPtr(policyTemplateID), - Version: core.StringPtr(version), +// Constants associated with the GetRoleTemplateOptions.State property. +// The role template state. +const ( + GetRoleTemplateOptionsStateActiveConst = "active" + GetRoleTemplateOptionsStateDeletedConst = "deleted" +) + +// NewGetRoleTemplateOptions : Instantiate GetRoleTemplateOptions +func (*IamPolicyManagementV1) NewGetRoleTemplateOptions(roleTemplateID string) *GetRoleTemplateOptions { + return &GetRoleTemplateOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), } } -// SetPolicyTemplateID : Allow user to set PolicyTemplateID -func (_options *GetPolicyTemplateVersionOptions) SetPolicyTemplateID(policyTemplateID string) *GetPolicyTemplateVersionOptions { - _options.PolicyTemplateID = core.StringPtr(policyTemplateID) +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *GetRoleTemplateOptions) SetRoleTemplateID(roleTemplateID string) *GetRoleTemplateOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) return _options } -// SetVersion : Allow user to set Version -func (_options *GetPolicyTemplateVersionOptions) SetVersion(version string) *GetPolicyTemplateVersionOptions { - _options.Version = core.StringPtr(version) +// SetState : Allow user to set State +func (_options *GetRoleTemplateOptions) SetState(state string) *GetRoleTemplateOptions { + _options.State = core.StringPtr(state) return _options } // SetHeaders : Allow user to set Headers -func (options *GetPolicyTemplateVersionOptions) SetHeaders(param map[string]string) *GetPolicyTemplateVersionOptions { +func (options *GetRoleTemplateOptions) SetHeaders(param map[string]string) *GetRoleTemplateOptions { options.Headers = param return options } -// GetRoleOptions : The GetRole options. -type GetRoleOptions struct { - // The role ID. - RoleID *string `json:"role_id" validate:"required,ne="` +// GetRoleTemplateVersionOptions : The GetRoleTemplateVersion options. +type GetRoleTemplateVersionOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Role template version. + Version *string `json:"version" validate:"required,ne="` // Allows users to set headers on API requests. Headers map[string]string } -// NewGetRoleOptions : Instantiate GetRoleOptions -func (*IamPolicyManagementV1) NewGetRoleOptions(roleID string) *GetRoleOptions { - return &GetRoleOptions{ - RoleID: core.StringPtr(roleID), +// NewGetRoleTemplateVersionOptions : Instantiate GetRoleTemplateVersionOptions +func (*IamPolicyManagementV1) NewGetRoleTemplateVersionOptions(roleTemplateID string, version string) *GetRoleTemplateVersionOptions { + return &GetRoleTemplateVersionOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + Version: core.StringPtr(version), } } -// SetRoleID : Allow user to set RoleID -func (_options *GetRoleOptions) SetRoleID(roleID string) *GetRoleOptions { - _options.RoleID = core.StringPtr(roleID) +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *GetRoleTemplateVersionOptions) SetRoleTemplateID(roleTemplateID string) *GetRoleTemplateVersionOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *GetRoleTemplateVersionOptions) SetVersion(version string) *GetRoleTemplateVersionOptions { + _options.Version = core.StringPtr(version) return _options } // SetHeaders : Allow user to set Headers -func (options *GetRoleOptions) SetHeaders(param map[string]string) *GetRoleOptions { +func (options *GetRoleTemplateVersionOptions) SetHeaders(param map[string]string) *GetRoleTemplateVersionOptions { options.Headers = param return options } @@ -7696,67 +9304,322 @@ func (*IamPolicyManagementV1) NewListPolicyTemplatesOptions(accountID string) *L } // SetAccountID : Allow user to set AccountID -func (_options *ListPolicyTemplatesOptions) SetAccountID(accountID string) *ListPolicyTemplatesOptions { +func (_options *ListPolicyTemplatesOptions) SetAccountID(accountID string) *ListPolicyTemplatesOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *ListPolicyTemplatesOptions) SetAcceptLanguage(acceptLanguage string) *ListPolicyTemplatesOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) + return _options +} + +// SetState : Allow user to set State +func (_options *ListPolicyTemplatesOptions) SetState(state string) *ListPolicyTemplatesOptions { + _options.State = core.StringPtr(state) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListPolicyTemplatesOptions) SetName(name string) *ListPolicyTemplatesOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetPolicyServiceType : Allow user to set PolicyServiceType +func (_options *ListPolicyTemplatesOptions) SetPolicyServiceType(policyServiceType string) *ListPolicyTemplatesOptions { + _options.PolicyServiceType = core.StringPtr(policyServiceType) + return _options +} + +// SetPolicyServiceName : Allow user to set PolicyServiceName +func (_options *ListPolicyTemplatesOptions) SetPolicyServiceName(policyServiceName string) *ListPolicyTemplatesOptions { + _options.PolicyServiceName = core.StringPtr(policyServiceName) + return _options +} + +// SetPolicyServiceGroupID : Allow user to set PolicyServiceGroupID +func (_options *ListPolicyTemplatesOptions) SetPolicyServiceGroupID(policyServiceGroupID string) *ListPolicyTemplatesOptions { + _options.PolicyServiceGroupID = core.StringPtr(policyServiceGroupID) + return _options +} + +// SetPolicyType : Allow user to set PolicyType +func (_options *ListPolicyTemplatesOptions) SetPolicyType(policyType string) *ListPolicyTemplatesOptions { + _options.PolicyType = core.StringPtr(policyType) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListPolicyTemplatesOptions) SetLimit(limit int64) *ListPolicyTemplatesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListPolicyTemplatesOptions) SetStart(start string) *ListPolicyTemplatesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListPolicyTemplatesOptions) SetHeaders(param map[string]string) *ListPolicyTemplatesOptions { + options.Headers = param + return options +} + +// ListRoleAssignmentsOptions : The ListRoleAssignments options. +type ListRoleAssignmentsOptions struct { + // The account GUID in which the role assignment belongs to. + AccountID *string `json:"account_id" validate:"required"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Optional template ID. + TemplateID *string `json:"template_id,omitempty"` + + // Optional role template version. + TemplateVersion *string `json:"template_version,omitempty"` + + // The number of documents to include in the collection. + Limit *int64 `json:"limit,omitempty"` + + // Page token that refers to the page of the collection to return. + Start *string `json:"start,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewListRoleAssignmentsOptions : Instantiate ListRoleAssignmentsOptions +func (*IamPolicyManagementV1) NewListRoleAssignmentsOptions(accountID string) *ListRoleAssignmentsOptions { + return &ListRoleAssignmentsOptions{ + AccountID: core.StringPtr(accountID), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *ListRoleAssignmentsOptions) SetAccountID(accountID string) *ListRoleAssignmentsOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *ListRoleAssignmentsOptions) SetAcceptLanguage(acceptLanguage string) *ListRoleAssignmentsOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) + return _options +} + +// SetTemplateID : Allow user to set TemplateID +func (_options *ListRoleAssignmentsOptions) SetTemplateID(templateID string) *ListRoleAssignmentsOptions { + _options.TemplateID = core.StringPtr(templateID) + return _options +} + +// SetTemplateVersion : Allow user to set TemplateVersion +func (_options *ListRoleAssignmentsOptions) SetTemplateVersion(templateVersion string) *ListRoleAssignmentsOptions { + _options.TemplateVersion = core.StringPtr(templateVersion) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListRoleAssignmentsOptions) SetLimit(limit int64) *ListRoleAssignmentsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListRoleAssignmentsOptions) SetStart(start string) *ListRoleAssignmentsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListRoleAssignmentsOptions) SetHeaders(param map[string]string) *ListRoleAssignmentsOptions { + options.Headers = param + return options +} + +// ListRoleTemplateVersionsOptions : The ListRoleTemplateVersions options. +type ListRoleTemplateVersionsOptions struct { + // The role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Role template state. + State *string `json:"state,omitempty"` + + // The number of documents to include in the collection. + Limit *int64 `json:"limit,omitempty"` + + // Page token that refers to the page of the collection to return. + Start *string `json:"start,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// Constants associated with the ListRoleTemplateVersionsOptions.State property. +// Role template state. +const ( + ListRoleTemplateVersionsOptionsStateActiveConst = "active" + ListRoleTemplateVersionsOptionsStateDeletedConst = "deleted" +) + +// NewListRoleTemplateVersionsOptions : Instantiate ListRoleTemplateVersionsOptions +func (*IamPolicyManagementV1) NewListRoleTemplateVersionsOptions(roleTemplateID string) *ListRoleTemplateVersionsOptions { + return &ListRoleTemplateVersionsOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + } +} + +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *ListRoleTemplateVersionsOptions) SetRoleTemplateID(roleTemplateID string) *ListRoleTemplateVersionsOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetState : Allow user to set State +func (_options *ListRoleTemplateVersionsOptions) SetState(state string) *ListRoleTemplateVersionsOptions { + _options.State = core.StringPtr(state) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListRoleTemplateVersionsOptions) SetLimit(limit int64) *ListRoleTemplateVersionsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListRoleTemplateVersionsOptions) SetStart(start string) *ListRoleTemplateVersionsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListRoleTemplateVersionsOptions) SetHeaders(param map[string]string) *ListRoleTemplateVersionsOptions { + options.Headers = param + return options +} + +// ListRoleTemplatesOptions : The ListRoleTemplates options. +type ListRoleTemplatesOptions struct { + // The account GUID that the role templates belong to. + AccountID *string `json:"account_id" validate:"required"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // The role template name. + Name *string `json:"name,omitempty"` + + // The template role name. + RoleName *string `json:"role_name,omitempty"` + + // The template role service name. + RoleServiceName *string `json:"role_service_name,omitempty"` + + // The role template state. + State *string `json:"state,omitempty"` + + // The number of documents to include in the collection. + Limit *int64 `json:"limit,omitempty"` + + // Page token that refers to the page of the collection to return. + Start *string `json:"start,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// Constants associated with the ListRoleTemplatesOptions.State property. +// The role template state. +const ( + ListRoleTemplatesOptionsStateActiveConst = "active" + ListRoleTemplatesOptionsStateDeletedConst = "deleted" +) + +// NewListRoleTemplatesOptions : Instantiate ListRoleTemplatesOptions +func (*IamPolicyManagementV1) NewListRoleTemplatesOptions(accountID string) *ListRoleTemplatesOptions { + return &ListRoleTemplatesOptions{ + AccountID: core.StringPtr(accountID), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *ListRoleTemplatesOptions) SetAccountID(accountID string) *ListRoleTemplatesOptions { _options.AccountID = core.StringPtr(accountID) return _options } // SetAcceptLanguage : Allow user to set AcceptLanguage -func (_options *ListPolicyTemplatesOptions) SetAcceptLanguage(acceptLanguage string) *ListPolicyTemplatesOptions { +func (_options *ListRoleTemplatesOptions) SetAcceptLanguage(acceptLanguage string) *ListRoleTemplatesOptions { _options.AcceptLanguage = core.StringPtr(acceptLanguage) return _options } -// SetState : Allow user to set State -func (_options *ListPolicyTemplatesOptions) SetState(state string) *ListPolicyTemplatesOptions { - _options.State = core.StringPtr(state) - return _options -} - // SetName : Allow user to set Name -func (_options *ListPolicyTemplatesOptions) SetName(name string) *ListPolicyTemplatesOptions { +func (_options *ListRoleTemplatesOptions) SetName(name string) *ListRoleTemplatesOptions { _options.Name = core.StringPtr(name) return _options } -// SetPolicyServiceType : Allow user to set PolicyServiceType -func (_options *ListPolicyTemplatesOptions) SetPolicyServiceType(policyServiceType string) *ListPolicyTemplatesOptions { - _options.PolicyServiceType = core.StringPtr(policyServiceType) - return _options -} - -// SetPolicyServiceName : Allow user to set PolicyServiceName -func (_options *ListPolicyTemplatesOptions) SetPolicyServiceName(policyServiceName string) *ListPolicyTemplatesOptions { - _options.PolicyServiceName = core.StringPtr(policyServiceName) +// SetRoleName : Allow user to set RoleName +func (_options *ListRoleTemplatesOptions) SetRoleName(roleName string) *ListRoleTemplatesOptions { + _options.RoleName = core.StringPtr(roleName) return _options } -// SetPolicyServiceGroupID : Allow user to set PolicyServiceGroupID -func (_options *ListPolicyTemplatesOptions) SetPolicyServiceGroupID(policyServiceGroupID string) *ListPolicyTemplatesOptions { - _options.PolicyServiceGroupID = core.StringPtr(policyServiceGroupID) +// SetRoleServiceName : Allow user to set RoleServiceName +func (_options *ListRoleTemplatesOptions) SetRoleServiceName(roleServiceName string) *ListRoleTemplatesOptions { + _options.RoleServiceName = core.StringPtr(roleServiceName) return _options } -// SetPolicyType : Allow user to set PolicyType -func (_options *ListPolicyTemplatesOptions) SetPolicyType(policyType string) *ListPolicyTemplatesOptions { - _options.PolicyType = core.StringPtr(policyType) +// SetState : Allow user to set State +func (_options *ListRoleTemplatesOptions) SetState(state string) *ListRoleTemplatesOptions { + _options.State = core.StringPtr(state) return _options } // SetLimit : Allow user to set Limit -func (_options *ListPolicyTemplatesOptions) SetLimit(limit int64) *ListPolicyTemplatesOptions { +func (_options *ListRoleTemplatesOptions) SetLimit(limit int64) *ListRoleTemplatesOptions { _options.Limit = core.Int64Ptr(limit) return _options } // SetStart : Allow user to set Start -func (_options *ListPolicyTemplatesOptions) SetStart(start string) *ListPolicyTemplatesOptions { +func (_options *ListRoleTemplatesOptions) SetStart(start string) *ListRoleTemplatesOptions { _options.Start = core.StringPtr(start) return _options } // SetHeaders : Allow user to set Headers -func (options *ListPolicyTemplatesOptions) SetHeaders(param map[string]string) *ListPolicyTemplatesOptions { +func (options *ListRoleTemplatesOptions) SetHeaders(param map[string]string) *ListRoleTemplatesOptions { options.Headers = param return options } @@ -9247,21 +11110,317 @@ func UnmarshalPolicyTemplateLimitData(m map[string]json.RawMessage, result inter err = core.SDKErrorf(err, "", "counts-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PolicyTemplateMetaData : The core set of properties associated with a policy. +type PolicyTemplateMetaData struct { + // The policy ID. + ID *string `json:"id,omitempty"` + + // The policy type; either 'access' or 'authorization'. + Type *string `json:"type" validate:"required"` + + // Customer-defined description. + Description *string `json:"description,omitempty"` + + // The subjects associated with a policy. + Subjects []PolicySubject `json:"subjects" validate:"required"` + + // A set of role Cloud Resource Names (CRNs) granted by the policy. + Roles []PolicyRole `json:"roles" validate:"required"` + + // The resources associated with a policy. + Resources []PolicyResource `json:"resources" validate:"required"` + + // The href links back to the policy. + Href *string `json:"href,omitempty"` + + // The UTC timestamp when the policy was created. + CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` + + // The IAM ID of the entity that created the policy. + CreatedByID *string `json:"created_by_id,omitempty"` + + // The UTC timestamp when the policy was last modified. + LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` + + // The IAM ID of the entity that last modified the policy. + LastModifiedByID *string `json:"last_modified_by_id,omitempty"` + + // The policy state. + State *string `json:"state,omitempty"` + + // The details of the IAM template that was used to create an enterprise-managed policy in your account. When returned, + // this indicates that the policy is created from and managed by a template in the root enterprise account. + Template *TemplateMetadata `json:"template,omitempty"` +} + +// Constants associated with the PolicyTemplateMetaData.State property. +// The policy state. +const ( + PolicyTemplateMetaDataStateActiveConst = "active" + PolicyTemplateMetaDataStateDeletedConst = "deleted" +) + +// UnmarshalPolicyTemplateMetaData unmarshals an instance of PolicyTemplateMetaData from the specified map of raw messages. +func UnmarshalPolicyTemplateMetaData(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PolicyTemplateMetaData) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "subjects", &obj.Subjects, UnmarshalPolicySubject) + if err != nil { + err = core.SDKErrorf(err, "", "subjects-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalPolicyRole) + if err != nil { + err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyResource) + if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) + if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "state", &obj.State) + if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalTemplateMetadata) + if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PolicyTemplateVersionsCollection : A collection of versions for a specific policy template. +type PolicyTemplateVersionsCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` + + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` + + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of policy templates versions. + Versions []PolicyTemplate `json:"versions" validate:"required"` +} + +// UnmarshalPolicyTemplateVersionsCollection unmarshals an instance of PolicyTemplateVersionsCollection from the specified map of raw messages. +func UnmarshalPolicyTemplateVersionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PolicyTemplateVersionsCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalPolicyTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) + 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 *PolicyTemplateVersionsCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + +// Previous : Details with linking href to previous page of requested collection. +type Previous struct { + // The href linking to the page of requested collection. + Href *string `json:"href,omitempty"` + + // Page token that refers to the page of the collection. + Start *string `json:"start,omitempty"` +} + +// UnmarshalPrevious unmarshals an instance of Previous from the specified map of raw messages. +func UnmarshalPrevious(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Previous) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "start", &obj.Start) + if err != nil { + err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReplaceActionControlTemplateOptions : The ReplaceActionControlTemplate options. +type ReplaceActionControlTemplateOptions struct { + // Action control template ID. + ActionControlTemplateID *string `json:"action_control_template_id" validate:"required,ne="` + + // Action control template version. + Version *string `json:"version" validate:"required,ne="` + + // The revision number for updating an action control template version must match the Etag value of the existing action + // control template version. The Etag can be retrieved using the GET + // /v1/action_control_templates/{template_id}/versions/{version} API and looking at the Etag response header. + IfMatch *string `json:"If-Match" validate:"required"` + + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it will + // change the name value for all existing versions of the template. + Name *string `json:"name,omitempty"` + + // Description of the action control template. This is shown to users in the enterprise account. Use this to describe + // the purpose or context of the action control for enterprise users managing IAM templates. + Description *string `json:"description,omitempty"` + + // The action control properties that are created in an action resource when the template is assigned. + ActionControl *TemplateActionControl `json:"action_control,omitempty"` + + // Committed status of the template version. If committed is set to true, then the template version can no longer be + // updated. + Committed *bool `json:"committed,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewReplaceActionControlTemplateOptions : Instantiate ReplaceActionControlTemplateOptions +func (*IamPolicyManagementV1) NewReplaceActionControlTemplateOptions(actionControlTemplateID string, version string, ifMatch string) *ReplaceActionControlTemplateOptions { + return &ReplaceActionControlTemplateOptions{ + ActionControlTemplateID: core.StringPtr(actionControlTemplateID), + Version: core.StringPtr(version), + IfMatch: core.StringPtr(ifMatch), + } } -// PolicyTemplateMetaData : The core set of properties associated with a policy. -type PolicyTemplateMetaData struct { +// SetActionControlTemplateID : Allow user to set ActionControlTemplateID +func (_options *ReplaceActionControlTemplateOptions) SetActionControlTemplateID(actionControlTemplateID string) *ReplaceActionControlTemplateOptions { + _options.ActionControlTemplateID = core.StringPtr(actionControlTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *ReplaceActionControlTemplateOptions) SetVersion(version string) *ReplaceActionControlTemplateOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetIfMatch : Allow user to set IfMatch +func (_options *ReplaceActionControlTemplateOptions) SetIfMatch(ifMatch string) *ReplaceActionControlTemplateOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + +// SetName : Allow user to set Name +func (_options *ReplaceActionControlTemplateOptions) SetName(name string) *ReplaceActionControlTemplateOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetDescription : Allow user to set Description +func (_options *ReplaceActionControlTemplateOptions) SetDescription(description string) *ReplaceActionControlTemplateOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetActionControl : Allow user to set ActionControl +func (_options *ReplaceActionControlTemplateOptions) SetActionControl(actionControl *TemplateActionControl) *ReplaceActionControlTemplateOptions { + _options.ActionControl = actionControl + return _options +} + +// SetCommitted : Allow user to set Committed +func (_options *ReplaceActionControlTemplateOptions) SetCommitted(committed bool) *ReplaceActionControlTemplateOptions { + _options.Committed = core.BoolPtr(committed) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ReplaceActionControlTemplateOptions) SetHeaders(param map[string]string) *ReplaceActionControlTemplateOptions { + options.Headers = param + return options +} + +// ReplacePolicyOptions : The ReplacePolicy options. +type ReplacePolicyOptions struct { // The policy ID. - ID *string `json:"id,omitempty"` + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // The revision number for updating a policy and must match the ETag value of the existing policy. The Etag can be + // retrieved using the GET /v1/policies/{policy_id} API and looking at the ETag response header. + IfMatch *string `json:"If-Match" validate:"required"` // The policy type; either 'access' or 'authorization'. Type *string `json:"type" validate:"required"` - // Customer-defined description. - Description *string `json:"description,omitempty"` - // The subjects associated with a policy. Subjects []PolicySubject `json:"subjects" validate:"required"` @@ -9271,215 +11430,254 @@ type PolicyTemplateMetaData struct { // The resources associated with a policy. Resources []PolicyResource `json:"resources" validate:"required"` - // The href links back to the policy. - Href *string `json:"href,omitempty"` + // Customer-defined description. + Description *string `json:"description,omitempty"` - // The UTC timestamp when the policy was created. - CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` + // Allows users to set headers on API requests. + Headers map[string]string +} - // The IAM ID of the entity that created the policy. - CreatedByID *string `json:"created_by_id,omitempty"` +// NewReplacePolicyOptions : Instantiate ReplacePolicyOptions +func (*IamPolicyManagementV1) NewReplacePolicyOptions(policyID string, ifMatch string, typeVar string, subjects []PolicySubject, roles []PolicyRole, resources []PolicyResource) *ReplacePolicyOptions { + return &ReplacePolicyOptions{ + PolicyID: core.StringPtr(policyID), + IfMatch: core.StringPtr(ifMatch), + Type: core.StringPtr(typeVar), + Subjects: subjects, + Roles: roles, + Resources: resources, + } +} - // The UTC timestamp when the policy was last modified. - LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` +// SetPolicyID : Allow user to set PolicyID +func (_options *ReplacePolicyOptions) SetPolicyID(policyID string) *ReplacePolicyOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options +} - // The IAM ID of the entity that last modified the policy. - LastModifiedByID *string `json:"last_modified_by_id,omitempty"` +// SetIfMatch : Allow user to set IfMatch +func (_options *ReplacePolicyOptions) SetIfMatch(ifMatch string) *ReplacePolicyOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} - // The policy state. - State *string `json:"state,omitempty"` +// SetType : Allow user to set Type +func (_options *ReplacePolicyOptions) SetType(typeVar string) *ReplacePolicyOptions { + _options.Type = core.StringPtr(typeVar) + return _options +} - // The details of the IAM template that was used to create an enterprise-managed policy in your account. When returned, - // this indicates that the policy is created from and managed by a template in the root enterprise account. - Template *TemplateMetadata `json:"template,omitempty"` +// SetSubjects : Allow user to set Subjects +func (_options *ReplacePolicyOptions) SetSubjects(subjects []PolicySubject) *ReplacePolicyOptions { + _options.Subjects = subjects + return _options } -// Constants associated with the PolicyTemplateMetaData.State property. -// The policy state. -const ( - PolicyTemplateMetaDataStateActiveConst = "active" - PolicyTemplateMetaDataStateDeletedConst = "deleted" -) +// SetRoles : Allow user to set Roles +func (_options *ReplacePolicyOptions) SetRoles(roles []PolicyRole) *ReplacePolicyOptions { + _options.Roles = roles + return _options +} -// UnmarshalPolicyTemplateMetaData unmarshals an instance of PolicyTemplateMetaData from the specified map of raw messages. -func UnmarshalPolicyTemplateMetaData(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PolicyTemplateMetaData) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) - if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "subjects", &obj.Subjects, UnmarshalPolicySubject) - if err != nil { - err = core.SDKErrorf(err, "", "subjects-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalPolicyRole) - if err != nil { - err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyResource) - if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) - if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "state", &obj.State) - if err != nil { - err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalTemplateMetadata) - if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) - return +// SetResources : Allow user to set Resources +func (_options *ReplacePolicyOptions) SetResources(resources []PolicyResource) *ReplacePolicyOptions { + _options.Resources = resources + return _options +} + +// SetDescription : Allow user to set Description +func (_options *ReplacePolicyOptions) SetDescription(description string) *ReplacePolicyOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ReplacePolicyOptions) SetHeaders(param map[string]string) *ReplacePolicyOptions { + options.Headers = param + return options +} + +// ReplacePolicyTemplateOptions : The ReplacePolicyTemplate options. +type ReplacePolicyTemplateOptions struct { + // The policy template ID. + PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` + + // The policy template version. + Version *string `json:"version" validate:"required,ne="` + + // The revision number for updating a policy template version and must match the Etag value of the existing policy + // template version. The Etag can be retrieved using the GET + // /v1/policy_templates/{policy_template_id}/versions/{version} API and looking at the Etag response header. + IfMatch *string `json:"If-Match" validate:"required"` + + // The core set of properties associated with the template's policy object. + Policy *TemplatePolicy `json:"policy" validate:"required"` + + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes + // the name value for all existing versions of the template. + Name *string `json:"name,omitempty"` + + // Description of the policy template. This is shown to users in the enterprise account. Use this to describe the + // purpose or context of the policy for enterprise users managing IAM templates. + Description *string `json:"description,omitempty"` + + // Committed status of the template version. + Committed *bool `json:"committed,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewReplacePolicyTemplateOptions : Instantiate ReplacePolicyTemplateOptions +func (*IamPolicyManagementV1) NewReplacePolicyTemplateOptions(policyTemplateID string, version string, ifMatch string, policy *TemplatePolicy) *ReplacePolicyTemplateOptions { + return &ReplacePolicyTemplateOptions{ + PolicyTemplateID: core.StringPtr(policyTemplateID), + Version: core.StringPtr(version), + IfMatch: core.StringPtr(ifMatch), + Policy: policy, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// PolicyTemplateVersionsCollection : A collection of versions for a specific policy template. -type PolicyTemplateVersionsCollection struct { - // The number of documents to include per each page of the collection. - Limit *int64 `json:"limit,omitempty"` +// SetPolicyTemplateID : Allow user to set PolicyTemplateID +func (_options *ReplacePolicyTemplateOptions) SetPolicyTemplateID(policyTemplateID string) *ReplacePolicyTemplateOptions { + _options.PolicyTemplateID = core.StringPtr(policyTemplateID) + return _options +} - // Details with linking href to first page of requested collection. - First *First `json:"first,omitempty"` +// SetVersion : Allow user to set Version +func (_options *ReplacePolicyTemplateOptions) SetVersion(version string) *ReplacePolicyTemplateOptions { + _options.Version = core.StringPtr(version) + return _options +} - // Details with href linking to the following page of requested collection. - Next *Next `json:"next,omitempty"` +// SetIfMatch : Allow user to set IfMatch +func (_options *ReplacePolicyTemplateOptions) SetIfMatch(ifMatch string) *ReplacePolicyTemplateOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} - // Details with linking href to previous page of requested collection. - Previous *Previous `json:"previous,omitempty"` +// SetPolicy : Allow user to set Policy +func (_options *ReplacePolicyTemplateOptions) SetPolicy(policy *TemplatePolicy) *ReplacePolicyTemplateOptions { + _options.Policy = policy + return _options +} - // List of policy templates versions. - Versions []PolicyTemplate `json:"versions" validate:"required"` +// SetName : Allow user to set Name +func (_options *ReplacePolicyTemplateOptions) SetName(name string) *ReplacePolicyTemplateOptions { + _options.Name = core.StringPtr(name) + return _options } -// UnmarshalPolicyTemplateVersionsCollection unmarshals an instance of PolicyTemplateVersionsCollection from the specified map of raw messages. -func UnmarshalPolicyTemplateVersionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PolicyTemplateVersionsCollection) - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) - if err != nil { - err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) - if err != nil { - err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) - if err != nil { - err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalPolicyTemplate) - if err != nil { - err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetDescription : Allow user to set Description +func (_options *ReplacePolicyTemplateOptions) SetDescription(description string) *ReplacePolicyTemplateOptions { + _options.Description = core.StringPtr(description) + return _options } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *PolicyTemplateVersionsCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - return resp.Next.Start, nil +// SetCommitted : Allow user to set Committed +func (_options *ReplacePolicyTemplateOptions) SetCommitted(committed bool) *ReplacePolicyTemplateOptions { + _options.Committed = core.BoolPtr(committed) + return _options } -// Previous : Details with linking href to previous page of requested collection. -type Previous struct { - // The href linking to the page of requested collection. - Href *string `json:"href,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ReplacePolicyTemplateOptions) SetHeaders(param map[string]string) *ReplacePolicyTemplateOptions { + options.Headers = param + return options +} - // Page token that refers to the page of the collection. - Start *string `json:"start,omitempty"` +// ReplaceRoleOptions : The ReplaceRole options. +type ReplaceRoleOptions struct { + // The role ID. + RoleID *string `json:"role_id" validate:"required,ne="` + + // The revision number for updating a role and must match the ETag value of the existing role. The Etag can be + // retrieved using the GET /v2/roles/{role_id} API and looking at the ETag response header. + IfMatch *string `json:"If-Match" validate:"required"` + + // The display the name of the role that is shown in the console. + DisplayName *string `json:"display_name" validate:"required"` + + // The actions of the role. For more information, see [IAM roles and + // actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions). + Actions []string `json:"actions" validate:"required"` + + // The description of the role. + Description *string `json:"description,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string } -// UnmarshalPrevious unmarshals an instance of Previous from the specified map of raw messages. -func UnmarshalPrevious(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Previous) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "start", &obj.Start) - if err != nil { - err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) - return +// NewReplaceRoleOptions : Instantiate ReplaceRoleOptions +func (*IamPolicyManagementV1) NewReplaceRoleOptions(roleID string, ifMatch string, displayName string, actions []string) *ReplaceRoleOptions { + return &ReplaceRoleOptions{ + RoleID: core.StringPtr(roleID), + IfMatch: core.StringPtr(ifMatch), + DisplayName: core.StringPtr(displayName), + Actions: actions, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ReplaceActionControlTemplateOptions : The ReplaceActionControlTemplate options. -type ReplaceActionControlTemplateOptions struct { - // Action control template ID. - ActionControlTemplateID *string `json:"action_control_template_id" validate:"required,ne="` +// SetRoleID : Allow user to set RoleID +func (_options *ReplaceRoleOptions) SetRoleID(roleID string) *ReplaceRoleOptions { + _options.RoleID = core.StringPtr(roleID) + return _options +} - // Action control template version. +// SetIfMatch : Allow user to set IfMatch +func (_options *ReplaceRoleOptions) SetIfMatch(ifMatch string) *ReplaceRoleOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + +// SetDisplayName : Allow user to set DisplayName +func (_options *ReplaceRoleOptions) SetDisplayName(displayName string) *ReplaceRoleOptions { + _options.DisplayName = core.StringPtr(displayName) + return _options +} + +// SetActions : Allow user to set Actions +func (_options *ReplaceRoleOptions) SetActions(actions []string) *ReplaceRoleOptions { + _options.Actions = actions + return _options +} + +// SetDescription : Allow user to set Description +func (_options *ReplaceRoleOptions) SetDescription(description string) *ReplaceRoleOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ReplaceRoleOptions) SetHeaders(param map[string]string) *ReplaceRoleOptions { + options.Headers = param + return options +} + +// ReplaceRoleTemplateOptions : The ReplaceRoleTemplate options. +type ReplaceRoleTemplateOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Role template version. Version *string `json:"version" validate:"required,ne="` - // The revision number for updating an action control template version must match the Etag value of the existing action - // control template version. The Etag can be retrieved using the GET - // /v1/action_control_templates/{template_id}/versions/{version} API and looking at the Etag response header. + // The revision number for updating a role template version must match the Etag value of the existing role template + // version. The Etag can be retrieved using the GET /v1/role_templates/{template_id}/versions/{version} API and looking + // at the Etag response header. IfMatch *string `json:"If-Match" validate:"required"` // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it will // change the name value for all existing versions of the template. Name *string `json:"name,omitempty"` - // Description of the action control template. This is shown to users in the enterprise account. Use this to describe - // the purpose or context of the action control for enterprise users managing IAM templates. + // Description of the role template. This is shown to users in the enterprise account. Use this to describe the purpose + // or context of the role for enterprise users managing IAM templates. Description *string `json:"description,omitempty"` - // The action control properties that are created in an action resource when the template is assigned. - ActionControl *TemplateActionControl `json:"action_control,omitempty"` + // The role properties that are created in an action resource when the template is assigned. + Role *TemplateRole `json:"role,omitempty"` // Committed status of the template version. If committed is set to true, then the template version can no longer be // updated. @@ -9489,438 +11687,626 @@ type ReplaceActionControlTemplateOptions struct { Headers map[string]string } -// NewReplaceActionControlTemplateOptions : Instantiate ReplaceActionControlTemplateOptions -func (*IamPolicyManagementV1) NewReplaceActionControlTemplateOptions(actionControlTemplateID string, version string, ifMatch string) *ReplaceActionControlTemplateOptions { - return &ReplaceActionControlTemplateOptions{ - ActionControlTemplateID: core.StringPtr(actionControlTemplateID), +// NewReplaceRoleTemplateOptions : Instantiate ReplaceRoleTemplateOptions +func (*IamPolicyManagementV1) NewReplaceRoleTemplateOptions(roleTemplateID string, version string, ifMatch string) *ReplaceRoleTemplateOptions { + return &ReplaceRoleTemplateOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), Version: core.StringPtr(version), IfMatch: core.StringPtr(ifMatch), } } -// SetActionControlTemplateID : Allow user to set ActionControlTemplateID -func (_options *ReplaceActionControlTemplateOptions) SetActionControlTemplateID(actionControlTemplateID string) *ReplaceActionControlTemplateOptions { - _options.ActionControlTemplateID = core.StringPtr(actionControlTemplateID) +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *ReplaceRoleTemplateOptions) SetRoleTemplateID(roleTemplateID string) *ReplaceRoleTemplateOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) return _options } // SetVersion : Allow user to set Version -func (_options *ReplaceActionControlTemplateOptions) SetVersion(version string) *ReplaceActionControlTemplateOptions { +func (_options *ReplaceRoleTemplateOptions) SetVersion(version string) *ReplaceRoleTemplateOptions { _options.Version = core.StringPtr(version) return _options } // SetIfMatch : Allow user to set IfMatch -func (_options *ReplaceActionControlTemplateOptions) SetIfMatch(ifMatch string) *ReplaceActionControlTemplateOptions { +func (_options *ReplaceRoleTemplateOptions) SetIfMatch(ifMatch string) *ReplaceRoleTemplateOptions { _options.IfMatch = core.StringPtr(ifMatch) return _options } // SetName : Allow user to set Name -func (_options *ReplaceActionControlTemplateOptions) SetName(name string) *ReplaceActionControlTemplateOptions { +func (_options *ReplaceRoleTemplateOptions) SetName(name string) *ReplaceRoleTemplateOptions { _options.Name = core.StringPtr(name) return _options } // SetDescription : Allow user to set Description -func (_options *ReplaceActionControlTemplateOptions) SetDescription(description string) *ReplaceActionControlTemplateOptions { +func (_options *ReplaceRoleTemplateOptions) SetDescription(description string) *ReplaceRoleTemplateOptions { _options.Description = core.StringPtr(description) return _options } -// SetActionControl : Allow user to set ActionControl -func (_options *ReplaceActionControlTemplateOptions) SetActionControl(actionControl *TemplateActionControl) *ReplaceActionControlTemplateOptions { - _options.ActionControl = actionControl +// SetRole : Allow user to set Role +func (_options *ReplaceRoleTemplateOptions) SetRole(role *TemplateRole) *ReplaceRoleTemplateOptions { + _options.Role = role return _options } // SetCommitted : Allow user to set Committed -func (_options *ReplaceActionControlTemplateOptions) SetCommitted(committed bool) *ReplaceActionControlTemplateOptions { +func (_options *ReplaceRoleTemplateOptions) SetCommitted(committed bool) *ReplaceRoleTemplateOptions { _options.Committed = core.BoolPtr(committed) return _options } // SetHeaders : Allow user to set Headers -func (options *ReplaceActionControlTemplateOptions) SetHeaders(param map[string]string) *ReplaceActionControlTemplateOptions { +func (options *ReplaceRoleTemplateOptions) SetHeaders(param map[string]string) *ReplaceRoleTemplateOptions { options.Headers = param return options } -// ReplacePolicyOptions : The ReplacePolicy options. -type ReplacePolicyOptions struct { +// ReplaceV2PolicyOptions : The ReplaceV2Policy options. +type ReplaceV2PolicyOptions struct { // The policy ID. - PolicyID *string `json:"policy_id" validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // The revision number for updating a policy and must match the ETag value of the existing policy. The Etag can be - // retrieved using the GET /v1/policies/{policy_id} API and looking at the ETag response header. + // retrieved using the GET /v2/policies/{id} API and looking at the ETag response header. IfMatch *string `json:"If-Match" validate:"required"` + // Specifies the type of access that is granted by the policy. + Control *Control `json:"control" validate:"required"` + // The policy type; either 'access' or 'authorization'. Type *string `json:"type" validate:"required"` - // The subjects associated with a policy. - Subjects []PolicySubject `json:"subjects" validate:"required"` + // Description of the policy. + Description *string `json:"description,omitempty"` - // A set of role Cloud Resource Names (CRNs) granted by the policy. - Roles []PolicyRole `json:"roles" validate:"required"` + // The subject attributes for whom the policy grants access. + Subject *V2PolicySubject `json:"subject,omitempty"` - // The resources associated with a policy. - Resources []PolicyResource `json:"resources" validate:"required"` + // The resource attributes to which the policy grants access. + Resource *V2PolicyResource `json:"resource,omitempty"` - // Customer-defined description. - Description *string `json:"description,omitempty"` + // Indicates pattern of rule, either 'time-based-conditions:once', 'time-based-conditions:weekly:all-day', or + // 'time-based-conditions:weekly:custom-hours'. + Pattern *string `json:"pattern,omitempty"` + + // Additional access conditions associated with the policy. + Rule V2PolicyRuleIntf `json:"rule,omitempty"` // Allows users to set headers on API requests. Headers map[string]string } -// NewReplacePolicyOptions : Instantiate ReplacePolicyOptions -func (*IamPolicyManagementV1) NewReplacePolicyOptions(policyID string, ifMatch string, typeVar string, subjects []PolicySubject, roles []PolicyRole, resources []PolicyResource) *ReplacePolicyOptions { - return &ReplacePolicyOptions{ - PolicyID: core.StringPtr(policyID), +// Constants associated with the ReplaceV2PolicyOptions.Type property. +// The policy type; either 'access' or 'authorization'. +const ( + ReplaceV2PolicyOptionsTypeAccessConst = "access" + ReplaceV2PolicyOptionsTypeAuthorizationConst = "authorization" +) + +// NewReplaceV2PolicyOptions : Instantiate ReplaceV2PolicyOptions +func (*IamPolicyManagementV1) NewReplaceV2PolicyOptions(id string, ifMatch string, control *Control, typeVar string) *ReplaceV2PolicyOptions { + return &ReplaceV2PolicyOptions{ + ID: core.StringPtr(id), IfMatch: core.StringPtr(ifMatch), + Control: control, Type: core.StringPtr(typeVar), - Subjects: subjects, - Roles: roles, - Resources: resources, } } -// SetPolicyID : Allow user to set PolicyID -func (_options *ReplacePolicyOptions) SetPolicyID(policyID string) *ReplacePolicyOptions { - _options.PolicyID = core.StringPtr(policyID) +// SetID : Allow user to set ID +func (_options *ReplaceV2PolicyOptions) SetID(id string) *ReplaceV2PolicyOptions { + _options.ID = core.StringPtr(id) return _options } // SetIfMatch : Allow user to set IfMatch -func (_options *ReplacePolicyOptions) SetIfMatch(ifMatch string) *ReplacePolicyOptions { +func (_options *ReplaceV2PolicyOptions) SetIfMatch(ifMatch string) *ReplaceV2PolicyOptions { _options.IfMatch = core.StringPtr(ifMatch) return _options } +// SetControl : Allow user to set Control +func (_options *ReplaceV2PolicyOptions) SetControl(control *Control) *ReplaceV2PolicyOptions { + _options.Control = control + return _options +} + // SetType : Allow user to set Type -func (_options *ReplacePolicyOptions) SetType(typeVar string) *ReplacePolicyOptions { +func (_options *ReplaceV2PolicyOptions) SetType(typeVar string) *ReplaceV2PolicyOptions { _options.Type = core.StringPtr(typeVar) return _options } -// SetSubjects : Allow user to set Subjects -func (_options *ReplacePolicyOptions) SetSubjects(subjects []PolicySubject) *ReplacePolicyOptions { - _options.Subjects = subjects +// SetDescription : Allow user to set Description +func (_options *ReplaceV2PolicyOptions) SetDescription(description string) *ReplaceV2PolicyOptions { + _options.Description = core.StringPtr(description) return _options } -// SetRoles : Allow user to set Roles -func (_options *ReplacePolicyOptions) SetRoles(roles []PolicyRole) *ReplacePolicyOptions { - _options.Roles = roles +// SetSubject : Allow user to set Subject +func (_options *ReplaceV2PolicyOptions) SetSubject(subject *V2PolicySubject) *ReplaceV2PolicyOptions { + _options.Subject = subject return _options } -// SetResources : Allow user to set Resources -func (_options *ReplacePolicyOptions) SetResources(resources []PolicyResource) *ReplacePolicyOptions { - _options.Resources = resources +// SetResource : Allow user to set Resource +func (_options *ReplaceV2PolicyOptions) SetResource(resource *V2PolicyResource) *ReplaceV2PolicyOptions { + _options.Resource = resource return _options } -// SetDescription : Allow user to set Description -func (_options *ReplacePolicyOptions) SetDescription(description string) *ReplacePolicyOptions { - _options.Description = core.StringPtr(description) +// SetPattern : Allow user to set Pattern +func (_options *ReplaceV2PolicyOptions) SetPattern(pattern string) *ReplaceV2PolicyOptions { + _options.Pattern = core.StringPtr(pattern) + return _options +} + +// SetRule : Allow user to set Rule +func (_options *ReplaceV2PolicyOptions) SetRule(rule V2PolicyRuleIntf) *ReplaceV2PolicyOptions { + _options.Rule = rule return _options } // SetHeaders : Allow user to set Headers -func (options *ReplacePolicyOptions) SetHeaders(param map[string]string) *ReplacePolicyOptions { +func (options *ReplaceV2PolicyOptions) SetHeaders(param map[string]string) *ReplaceV2PolicyOptions { options.Headers = param return options } -// ReplacePolicyTemplateOptions : The ReplacePolicyTemplate options. -type ReplacePolicyTemplateOptions struct { - // The policy template ID. - PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` - - // The policy template version. - Version *string `json:"version" validate:"required,ne="` - - // The revision number for updating a policy template version and must match the ETag value of the existing policy - // template version. The Etag can be retrieved using the GET - // /v1/policy_templates/{policy_template_id}/versions/{version} API and looking at the ETag response header. - IfMatch *string `json:"If-Match" validate:"required"` - - // The core set of properties associated with the template's policy object. - Policy *TemplatePolicy `json:"policy" validate:"required"` - - // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes - // the name value for all existing versions of the template. - Name *string `json:"name,omitempty"` - - // Description of the policy template. This is shown to users in the enterprise account. Use this to describe the - // purpose or context of the policy for enterprise users managing IAM templates. - Description *string `json:"description,omitempty"` +// ResourceAttribute : An attribute associated with a resource. +type ResourceAttribute struct { + // The name of an attribute. + Name *string `json:"name" validate:"required"` - // Committed status of the template version. - Committed *bool `json:"committed,omitempty"` + // The value of an attribute. + Value *string `json:"value" validate:"required"` - // Allows users to set headers on API requests. - Headers map[string]string + // The operator of an attribute. + Operator *string `json:"operator,omitempty"` } -// NewReplacePolicyTemplateOptions : Instantiate ReplacePolicyTemplateOptions -func (*IamPolicyManagementV1) NewReplacePolicyTemplateOptions(policyTemplateID string, version string, ifMatch string, policy *TemplatePolicy) *ReplacePolicyTemplateOptions { - return &ReplacePolicyTemplateOptions{ - PolicyTemplateID: core.StringPtr(policyTemplateID), - Version: core.StringPtr(version), - IfMatch: core.StringPtr(ifMatch), - Policy: policy, +// NewResourceAttribute : Instantiate ResourceAttribute (Generic Model Constructor) +func (*IamPolicyManagementV1) NewResourceAttribute(name string, value string) (_model *ResourceAttribute, err error) { + _model = &ResourceAttribute{ + Name: core.StringPtr(name), + Value: core.StringPtr(value), } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } -// SetPolicyTemplateID : Allow user to set PolicyTemplateID -func (_options *ReplacePolicyTemplateOptions) SetPolicyTemplateID(policyTemplateID string) *ReplacePolicyTemplateOptions { - _options.PolicyTemplateID = core.StringPtr(policyTemplateID) - return _options -} - -// SetVersion : Allow user to set Version -func (_options *ReplacePolicyTemplateOptions) SetVersion(version string) *ReplacePolicyTemplateOptions { - _options.Version = core.StringPtr(version) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *ReplacePolicyTemplateOptions) SetIfMatch(ifMatch string) *ReplacePolicyTemplateOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options +// UnmarshalResourceAttribute unmarshals an instance of ResourceAttribute from the specified map of raw messages. +func UnmarshalResourceAttribute(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ResourceAttribute) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) + if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPolicy : Allow user to set Policy -func (_options *ReplacePolicyTemplateOptions) SetPolicy(policy *TemplatePolicy) *ReplacePolicyTemplateOptions { - _options.Policy = policy - return _options -} +// ResourceTag : A tag associated with a resource. +type ResourceTag struct { + // The name of an access management tag. + Name *string `json:"name" validate:"required"` -// SetName : Allow user to set Name -func (_options *ReplacePolicyTemplateOptions) SetName(name string) *ReplacePolicyTemplateOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The value of an access management tag. + Value *string `json:"value" validate:"required"` -// SetDescription : Allow user to set Description -func (_options *ReplacePolicyTemplateOptions) SetDescription(description string) *ReplacePolicyTemplateOptions { - _options.Description = core.StringPtr(description) - return _options + // The operator of an access management tag. + Operator *string `json:"operator,omitempty"` } -// SetCommitted : Allow user to set Committed -func (_options *ReplacePolicyTemplateOptions) SetCommitted(committed bool) *ReplacePolicyTemplateOptions { - _options.Committed = core.BoolPtr(committed) - return _options +// NewResourceTag : Instantiate ResourceTag (Generic Model Constructor) +func (*IamPolicyManagementV1) NewResourceTag(name string, value string) (_model *ResourceTag, err error) { + _model = &ResourceTag{ + Name: core.StringPtr(name), + Value: core.StringPtr(value), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } -// SetHeaders : Allow user to set Headers -func (options *ReplacePolicyTemplateOptions) SetHeaders(param map[string]string) *ReplacePolicyTemplateOptions { - options.Headers = param - return options +// UnmarshalResourceTag unmarshals an instance of ResourceTag from the specified map of raw messages. +func UnmarshalResourceTag(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ResourceTag) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) + if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ReplaceRoleOptions : The ReplaceRole options. -type ReplaceRoleOptions struct { - // The role ID. - RoleID *string `json:"role_id" validate:"required,ne="` - - // The revision number for updating a role and must match the ETag value of the existing role. The Etag can be - // retrieved using the GET /v2/roles/{role_id} API and looking at the ETag response header. - IfMatch *string `json:"If-Match" validate:"required"` - +// Role : A role resource. +type Role struct { // The display the name of the role that is shown in the console. DisplayName *string `json:"display_name" validate:"required"` + // The description of the role. + Description *string `json:"description,omitempty"` + // The actions of the role. For more information, see [IAM roles and // actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions). Actions []string `json:"actions" validate:"required"` - // The description of the role. - Description *string `json:"description,omitempty"` - - // Allows users to set headers on API requests. - Headers map[string]string + // The role Cloud Resource Name (CRN). Example CRN: + // 'crn:v1:ibmcloud:public:iam-access-management::a/exampleAccountId::customRole:ExampleRoleName'. + CRN *string `json:"crn,omitempty"` } -// NewReplaceRoleOptions : Instantiate ReplaceRoleOptions -func (*IamPolicyManagementV1) NewReplaceRoleOptions(roleID string, ifMatch string, displayName string, actions []string) *ReplaceRoleOptions { - return &ReplaceRoleOptions{ - RoleID: core.StringPtr(roleID), - IfMatch: core.StringPtr(ifMatch), +// NewRole : Instantiate Role (Generic Model Constructor) +func (*IamPolicyManagementV1) NewRole(displayName string, actions []string) (_model *Role, err error) { + _model = &Role{ DisplayName: core.StringPtr(displayName), Actions: actions, } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalRole unmarshals an instance of Role from the specified map of raw messages. +func UnmarshalRole(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Role) + err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) + if err != nil { + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "actions", &obj.Actions) + if err != nil { + err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetRoleID : Allow user to set RoleID -func (_options *ReplaceRoleOptions) SetRoleID(roleID string) *ReplaceRoleOptions { - _options.RoleID = core.StringPtr(roleID) - return _options -} +// RoleAction : An action that can be performed by the policy subject when assigned a role. +type RoleAction struct { + // Unique identifier for action with structure service.resource.action. For example, cbr.rule.read. + ID *string `json:"id" validate:"required"` -// SetIfMatch : Allow user to set IfMatch -func (_options *ReplaceRoleOptions) SetIfMatch(ifMatch string) *ReplaceRoleOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} + // Services defined display name for action. + DisplayName *string `json:"display_name" validate:"required"` -// SetDisplayName : Allow user to set DisplayName -func (_options *ReplaceRoleOptions) SetDisplayName(displayName string) *ReplaceRoleOptions { - _options.DisplayName = core.StringPtr(displayName) - return _options + // Service defined description for action. + Description *string `json:"description" validate:"required"` } -// SetActions : Allow user to set Actions -func (_options *ReplaceRoleOptions) SetActions(actions []string) *ReplaceRoleOptions { - _options.Actions = actions - return _options +// UnmarshalRoleAction unmarshals an instance of RoleAction from the specified map of raw messages. +func UnmarshalRoleAction(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAction) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) + if err != nil { + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetDescription : Allow user to set Description -func (_options *ReplaceRoleOptions) SetDescription(description string) *ReplaceRoleOptions { - _options.Description = core.StringPtr(description) - return _options -} +// RoleAssignment : The set of properties associated with the assigned role template. +type RoleAssignment struct { + // Action control assignment ID. + ID *string `json:"id,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ReplaceRoleOptions) SetHeaders(param map[string]string) *ReplaceRoleOptions { - options.Headers = param - return options -} + // The account GUID that the role assignments belong to. + AccountID *string `json:"account_id,omitempty"` -// ReplaceV2PolicyOptions : The ReplaceV2Policy options. -type ReplaceV2PolicyOptions struct { - // The policy ID. - ID *string `json:"id" validate:"required,ne="` + // The href URL that links to the role assignments API by role assignment ID. + Href *string `json:"href,omitempty"` - // The revision number for updating a policy and must match the ETag value of the existing policy. The Etag can be - // retrieved using the GET /v2/policies/{id} API and looking at the ETag response header. - IfMatch *string `json:"If-Match" validate:"required"` + // The UTC timestamp when the role assignment was created. + CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` - // Specifies the type of access that is granted by the policy. - Control *Control `json:"control" validate:"required"` + // The IAM ID of the entity that created the role assignment. + CreatedByID *string `json:"created_by_id,omitempty"` - // The policy type; either 'access' or 'authorization'. - Type *string `json:"type" validate:"required"` + // The UTC timestamp when the role assignment was last modified. + LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` - // Description of the policy. - Description *string `json:"description,omitempty"` + // The IAM ID of the entity that last modified the role assignment. + LastModifiedByID *string `json:"last_modified_by_id,omitempty"` - // The subject attributes for whom the policy grants access. - Subject *V2PolicySubject `json:"subject,omitempty"` + // The current operation of the role assignment. + Operation *string `json:"operation,omitempty"` - // The resource attributes to which the policy grants access. - Resource *V2PolicyResource `json:"resource,omitempty"` + // Resources created when role template is assigned. + Resources []RoleAssignmentResource `json:"resources,omitempty"` - // Indicates pattern of rule, either 'time-based-conditions:once', 'time-based-conditions:weekly:all-day', or - // 'time-based-conditions:weekly:custom-hours'. - Pattern *string `json:"pattern,omitempty"` + // The role template id and version that will be assigned. + Template *RoleAssignmentTemplate `json:"template" validate:"required"` - // Additional access conditions associated with the policy. - Rule V2PolicyRuleIntf `json:"rule,omitempty"` + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` - // Allows users to set headers on API requests. - Headers map[string]string + // The role assignment status. + Status *string `json:"status,omitempty"` } -// Constants associated with the ReplaceV2PolicyOptions.Type property. -// The policy type; either 'access' or 'authorization'. +// Constants associated with the RoleAssignment.Operation property. +// The current operation of the role assignment. const ( - ReplaceV2PolicyOptionsTypeAccessConst = "access" - ReplaceV2PolicyOptionsTypeAuthorizationConst = "authorization" + RoleAssignmentOperationApplyConst = "apply" + RoleAssignmentOperationCreateConst = "create" + RoleAssignmentOperationRemoveConst = "remove" + RoleAssignmentOperationUpdateConst = "update" ) -// NewReplaceV2PolicyOptions : Instantiate ReplaceV2PolicyOptions -func (*IamPolicyManagementV1) NewReplaceV2PolicyOptions(id string, ifMatch string, control *Control, typeVar string) *ReplaceV2PolicyOptions { - return &ReplaceV2PolicyOptions{ - ID: core.StringPtr(id), - IfMatch: core.StringPtr(ifMatch), - Control: control, - Type: core.StringPtr(typeVar), +// Constants associated with the RoleAssignment.Status property. +// The role assignment status. +const ( + RoleAssignmentStatusAcceptedConst = "accepted" + RoleAssignmentStatusFailureConst = "failure" + RoleAssignmentStatusInProgressConst = "in_progress" + RoleAssignmentStatusSupersededConst = "superseded" +) + +// UnmarshalRoleAssignment unmarshals an instance of RoleAssignment from the specified map of raw messages. +func UnmarshalRoleAssignment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignment) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + if err != nil { + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) + if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "operation", &obj.Operation) + if err != nil { + err = core.SDKErrorf(err, "", "operation-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalRoleAssignmentResource) + if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalRoleAssignmentTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) + return } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *ReplaceV2PolicyOptions) SetID(id string) *ReplaceV2PolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} +// RoleAssignmentCollection : A collection of role assignments. +type RoleAssignmentCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` -// SetIfMatch : Allow user to set IfMatch -func (_options *ReplaceV2PolicyOptions) SetIfMatch(ifMatch string) *ReplaceV2PolicyOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` -// SetControl : Allow user to set Control -func (_options *ReplaceV2PolicyOptions) SetControl(control *Control) *ReplaceV2PolicyOptions { - _options.Control = control - return _options + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of role assignments. + Assignments []RoleAssignment `json:"assignments" validate:"required"` } -// SetType : Allow user to set Type -func (_options *ReplaceV2PolicyOptions) SetType(typeVar string) *ReplaceV2PolicyOptions { - _options.Type = core.StringPtr(typeVar) - return _options +// UnmarshalRoleAssignmentCollection unmarshals an instance of RoleAssignmentCollection from the specified map of raw messages. +func UnmarshalRoleAssignmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignmentCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "assignments", &obj.Assignments, UnmarshalRoleAssignment) + if err != nil { + err = core.SDKErrorf(err, "", "assignments-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetDescription : Allow user to set Description -func (_options *ReplaceV2PolicyOptions) SetDescription(description string) *ReplaceV2PolicyOptions { - _options.Description = core.StringPtr(description) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *RoleAssignmentCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil } -// SetSubject : Allow user to set Subject -func (_options *ReplaceV2PolicyOptions) SetSubject(subject *V2PolicySubject) *ReplaceV2PolicyOptions { - _options.Subject = subject - return _options +// RoleAssignmentResource : The role assignment resources and target where the template is assigned. +type RoleAssignmentResource struct { + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` + + // Set of properties of the assigned resource or error message if assignment failed. + Role *RoleAssignmentResourceRole `json:"role,omitempty"` } -// SetResource : Allow user to set Resource -func (_options *ReplaceV2PolicyOptions) SetResource(resource *V2PolicyResource) *ReplaceV2PolicyOptions { - _options.Resource = resource - return _options +// UnmarshalRoleAssignmentResource unmarshals an instance of RoleAssignmentResource from the specified map of raw messages. +func UnmarshalRoleAssignmentResource(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignmentResource) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "role", &obj.Role, UnmarshalRoleAssignmentResourceRole) + if err != nil { + err = core.SDKErrorf(err, "", "role-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPattern : Allow user to set Pattern -func (_options *ReplaceV2PolicyOptions) SetPattern(pattern string) *ReplaceV2PolicyOptions { - _options.Pattern = core.StringPtr(pattern) - return _options +// RoleAssignmentResourceCreated : On success, it includes the role assigned. +type RoleAssignmentResourceCreated struct { + // role id. + ID *string `json:"id,omitempty"` } -// SetRule : Allow user to set Rule -func (_options *ReplaceV2PolicyOptions) SetRule(rule V2PolicyRuleIntf) *ReplaceV2PolicyOptions { - _options.Rule = rule - return _options +// UnmarshalRoleAssignmentResourceCreated unmarshals an instance of RoleAssignmentResourceCreated from the specified map of raw messages. +func UnmarshalRoleAssignmentResourceCreated(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignmentResourceCreated) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ReplaceV2PolicyOptions) SetHeaders(param map[string]string) *ReplaceV2PolicyOptions { - options.Headers = param - return options +// RoleAssignmentResourceRole : Set of properties of the assigned resource or error message if assignment failed. +type RoleAssignmentResourceRole struct { + // On success, it includes the role assigned. + ResourceCreated *RoleAssignmentResourceCreated `json:"resource_created,omitempty"` + + // Body parameters for assignment error. + ErrorMessage *AssignmentResourceError `json:"error_message,omitempty"` } -// ResourceAttribute : An attribute associated with a resource. -type ResourceAttribute struct { - // The name of an attribute. - Name *string `json:"name" validate:"required"` +// UnmarshalRoleAssignmentResourceRole unmarshals an instance of RoleAssignmentResourceRole from the specified map of raw messages. +func UnmarshalRoleAssignmentResourceRole(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignmentResourceRole) + err = core.UnmarshalModel(m, "resource_created", &obj.ResourceCreated, UnmarshalRoleAssignmentResourceCreated) + if err != nil { + err = core.SDKErrorf(err, "", "resource_created-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "error_message", &obj.ErrorMessage, UnmarshalAssignmentResourceError) + if err != nil { + err = core.SDKErrorf(err, "", "error_message-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The value of an attribute. - Value *string `json:"value" validate:"required"` +// RoleAssignmentTemplate : The role template id and version that will be assigned. +type RoleAssignmentTemplate struct { + // Action control template ID. + ID *string `json:"id" validate:"required"` - // The operator of an attribute. - Operator *string `json:"operator,omitempty"` + // Action control template version. + Version *string `json:"version" validate:"required"` } -// NewResourceAttribute : Instantiate ResourceAttribute (Generic Model Constructor) -func (*IamPolicyManagementV1) NewResourceAttribute(name string, value string) (_model *ResourceAttribute, err error) { - _model = &ResourceAttribute{ - Name: core.StringPtr(name), - Value: core.StringPtr(value), +// NewRoleAssignmentTemplate : Instantiate RoleAssignmentTemplate (Generic Model Constructor) +func (*IamPolicyManagementV1) NewRoleAssignmentTemplate(id string, version string) (_model *RoleAssignmentTemplate, err error) { + _model = &RoleAssignmentTemplate{ + ID: core.StringPtr(id), + Version: core.StringPtr(version), } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -9929,95 +12315,260 @@ func (*IamPolicyManagementV1) NewResourceAttribute(name string, value string) (_ return } -// UnmarshalResourceAttribute unmarshals an instance of ResourceAttribute from the specified map of raw messages. -func UnmarshalResourceAttribute(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceAttribute) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalRoleAssignmentTemplate unmarshals an instance of RoleAssignmentTemplate from the specified map of raw messages. +func UnmarshalRoleAssignmentTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignmentTemplate) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RoleCollection : A collection of roles returned by the 'list roles' operation. +type RoleCollection struct { + // List of custom roles. + CustomRoles []CustomRole `json:"custom_roles" validate:"required"` + + // List of service roles. + ServiceRoles []Role `json:"service_roles" validate:"required"` + + // List of system roles. + SystemRoles []Role `json:"system_roles" validate:"required"` +} + +// UnmarshalRoleCollection unmarshals an instance of RoleCollection from the specified map of raw messages. +func UnmarshalRoleCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleCollection) + err = core.UnmarshalModel(m, "custom_roles", &obj.CustomRoles, UnmarshalCustomRole) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "custom_roles-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "service_roles", &obj.ServiceRoles, UnmarshalRole) + if err != nil { + err = core.SDKErrorf(err, "", "service_roles-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "system_roles", &obj.SystemRoles, UnmarshalRole) + if err != nil { + err = core.SDKErrorf(err, "", "system_roles-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// ResourceTag : A tag associated with a resource. -type ResourceTag struct { - // The name of an access management tag. +// RoleTemplate : The set of properties associated with the role template. +type RoleTemplate struct { + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes + // the name value for all existing versions of the template. Name *string `json:"name" validate:"required"` - // The value of an access management tag. - Value *string `json:"value" validate:"required"` + // Description of the role template. This is shown to users in the enterprise account. Use this to describe the purpose + // or context of the role for enterprise users managing IAM templates. + Description *string `json:"description" validate:"required"` - // The operator of an access management tag. - Operator *string `json:"operator,omitempty"` + // Enterprise account ID where this template is created. + AccountID *string `json:"account_id" validate:"required"` + + // Committed status of the template. If committed is set to true, then the template version can no longer be updated. + Committed *bool `json:"committed,omitempty"` + + // The role properties that are created in an action resource when the template is assigned. + Role *RoleTemplatePrototypeRole `json:"role,omitempty"` + + // The role template ID. + ID *string `json:"id,omitempty"` + + // The href URL that links to the role templates API by role template ID. + Href *string `json:"href,omitempty"` + + // The UTC timestamp when the role template was created. + CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` + + // The IAM ID of the entity that created the role template. + CreatedByID *string `json:"created_by_id,omitempty"` + + // The UTC timestamp when the role template was last modified. + LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` + + // The IAM ID of the entity that last modified the role template. + LastModifiedByID *string `json:"last_modified_by_id,omitempty"` + + // The version number of the template used to identify different versions of same template. + Version *string `json:"version" validate:"required"` + + // State of role template. + State *string `json:"state" validate:"required"` } -// NewResourceTag : Instantiate ResourceTag (Generic Model Constructor) -func (*IamPolicyManagementV1) NewResourceTag(name string, value string) (_model *ResourceTag, err error) { - _model = &ResourceTag{ - Name: core.StringPtr(name), - Value: core.StringPtr(value), +// Constants associated with the RoleTemplate.State property. +// State of role template. +const ( + RoleTemplateStateActiveConst = "active" + RoleTemplateStateDeletedConst = "deleted" +) + +// UnmarshalRoleTemplate unmarshals an instance of RoleTemplate from the specified map of raw messages. +func UnmarshalRoleTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleTemplate) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return } - err = core.ValidateStruct(_model, "required parameters") + err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + if err != nil { + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "committed", &obj.Committed) + if err != nil { + err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "role", &obj.Role, UnmarshalRoleTemplatePrototypeRole) + if err != nil { + err = core.SDKErrorf(err, "", "role-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) + if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "version", &obj.Version) + if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "state", &obj.State) + if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// UnmarshalResourceTag unmarshals an instance of ResourceTag from the specified map of raw messages. -func UnmarshalResourceTag(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceTag) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// RoleTemplateCollection : A collection of role templates. +type RoleTemplateCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` + + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` + + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of role templates. + RoleTemplates []RoleTemplate `json:"role_templates" validate:"required"` +} + +// UnmarshalRoleTemplateCollection unmarshals an instance of RoleTemplateCollection from the specified map of raw messages. +func UnmarshalRoleTemplateCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleTemplateCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "role_templates", &obj.RoleTemplates, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "role_templates-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// Role : A role resource. -type Role struct { +// Retrieve the value to be passed to a request to access the next page of results +func (resp *RoleTemplateCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + +// RoleTemplatePrototypeRole : The role properties that are created in an action resource when the template is assigned. +type RoleTemplatePrototypeRole struct { + // The name of the role that is used in the CRN. This must be alphanumeric and capitalized. + Name *string `json:"name" validate:"required"` + // The display the name of the role that is shown in the console. DisplayName *string `json:"display_name" validate:"required"` - // The description of the role. + // The service name that the role refers. + ServiceName *string `json:"service_name,omitempty"` + + // Description of the role. Description *string `json:"description,omitempty"` - // The actions of the role. For more information, see [IAM roles and - // actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions). + // The actions of the role. Actions []string `json:"actions" validate:"required"` - - // The role Cloud Resource Name (CRN). Example CRN: - // 'crn:v1:ibmcloud:public:iam-access-management::a/exampleAccountId::customRole:ExampleRoleName'. - CRN *string `json:"crn,omitempty"` } -// NewRole : Instantiate Role (Generic Model Constructor) -func (*IamPolicyManagementV1) NewRole(displayName string, actions []string) (_model *Role, err error) { - _model = &Role{ +// NewRoleTemplatePrototypeRole : Instantiate RoleTemplatePrototypeRole (Generic Model Constructor) +func (*IamPolicyManagementV1) NewRoleTemplatePrototypeRole(name string, displayName string, actions []string) (_model *RoleTemplatePrototypeRole, err error) { + _model = &RoleTemplatePrototypeRole{ + Name: core.StringPtr(name), DisplayName: core.StringPtr(displayName), Actions: actions, } @@ -10028,14 +12579,24 @@ func (*IamPolicyManagementV1) NewRole(displayName string, actions []string) (_mo return } -// UnmarshalRole unmarshals an instance of Role from the specified map of raw messages. -func UnmarshalRole(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Role) +// UnmarshalRoleTemplatePrototypeRole unmarshals an instance of RoleTemplatePrototypeRole from the specified map of raw messages. +func UnmarshalRoleTemplatePrototypeRole(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleTemplatePrototypeRole) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "service_name", &obj.ServiceName) + if err != nil { + err = core.SDKErrorf(err, "", "service_name-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) @@ -10046,83 +12607,107 @@ func UnmarshalRole(m map[string]json.RawMessage, result interface{}) (err error) err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// RoleAction : An action that can be performed by the policy subject when assigned a role. -type RoleAction struct { - // Unique identifier for action with structure service.resource.action. For example, cbr.rule.read. +// RoleTemplateReferencesItem : A role template reference associated with a policy template. +type RoleTemplateReferencesItem struct { + // The role template ID. ID *string `json:"id" validate:"required"` - // Services defined display name for action. - DisplayName *string `json:"display_name" validate:"required"` + // Role template version. + Version *string `json:"version" validate:"required"` +} - // Service defined description for action. - Description *string `json:"description" validate:"required"` +// NewRoleTemplateReferencesItem : Instantiate RoleTemplateReferencesItem (Generic Model Constructor) +func (*IamPolicyManagementV1) NewRoleTemplateReferencesItem(id string, version string) (_model *RoleTemplateReferencesItem, err error) { + _model = &RoleTemplateReferencesItem{ + ID: core.StringPtr(id), + Version: core.StringPtr(version), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } -// UnmarshalRoleAction unmarshals an instance of RoleAction from the specified map of raw messages. -func UnmarshalRoleAction(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoleAction) +// UnmarshalRoleTemplateReferencesItem unmarshals an instance of RoleTemplateReferencesItem from the specified map of raw messages. +func UnmarshalRoleTemplateReferencesItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleTemplateReferencesItem) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) - if err != nil { - err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) + err = core.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// RoleCollection : A collection of roles returned by the 'list roles' operation. -type RoleCollection struct { - // List of custom roles. - CustomRoles []CustomRole `json:"custom_roles" validate:"required"` +// RoleTemplateVersionsCollection : A collection of versions for a specific role template. +type RoleTemplateVersionsCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` - // List of service roles. - ServiceRoles []Role `json:"service_roles" validate:"required"` + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` - // List of system roles. - SystemRoles []Role `json:"system_roles" validate:"required"` + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of role templates versions. + Versions []RoleTemplate `json:"versions" validate:"required"` } -// UnmarshalRoleCollection unmarshals an instance of RoleCollection from the specified map of raw messages. -func UnmarshalRoleCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoleCollection) - err = core.UnmarshalModel(m, "custom_roles", &obj.CustomRoles, UnmarshalCustomRole) +// UnmarshalRoleTemplateVersionsCollection unmarshals an instance of RoleTemplateVersionsCollection from the specified map of raw messages. +func UnmarshalRoleTemplateVersionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleTemplateVersionsCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { - err = core.SDKErrorf(err, "", "custom_roles-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "service_roles", &obj.ServiceRoles, UnmarshalRole) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) if err != nil { - err = core.SDKErrorf(err, "", "service_roles-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "system_roles", &obj.SystemRoles, UnmarshalRole) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) if err != nil { - err = core.SDKErrorf(err, "", "system_roles-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) 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 *RoleTemplateVersionsCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + // Roles : A role associated with a policy. type Roles struct { // The role Cloud Resource Name (CRN) granted by the policy. Example CRN: 'crn:v1:bluemix:public:iam::::role:Editor'. @@ -10312,6 +12897,36 @@ func UnmarshalTemplateActionControl(m map[string]json.RawMessage, result interfa return } +// TemplateControl : Specifies the type of access that is granted by the policy. +type TemplateControl struct { + // Permission is granted by the policy. + Grant TemplateGrantIntf `json:"grant" validate:"required"` +} + +// NewTemplateControl : Instantiate TemplateControl (Generic Model Constructor) +func (*IamPolicyManagementV1) NewTemplateControl(grant TemplateGrantIntf) (_model *TemplateControl, err error) { + _model = &TemplateControl{ + Grant: grant, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalTemplateControl unmarshals an instance of TemplateControl from the specified map of raw messages. +func UnmarshalTemplateControl(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateControl) + err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalTemplateGrant) + if err != nil { + err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // TemplateCountData : policy template count details. type TemplateCountData struct { // policy template current and limit details with in an account. @@ -10338,6 +12953,42 @@ func UnmarshalTemplateCountData(m map[string]json.RawMessage, result interface{} return } +// TemplateGrant : Permission is granted by the policy. +// Models which "extend" this model: +// - TemplateGrantRoles +// - TemplateGrantRoleReferences +type TemplateGrant struct { + // A set of role Cloud Resource Names (CRNs) granted by the policy. + Roles []Roles `json:"roles,omitempty"` + + // A set of role template reference IDs granted by the policy. + RoleTemplateReferences []RoleTemplateReferencesItem `json:"role_template_references,omitempty"` +} +func (*TemplateGrant) isaTemplateGrant() bool { + return true +} + +type TemplateGrantIntf interface { + isaTemplateGrant() bool +} + +// UnmarshalTemplateGrant unmarshals an instance of TemplateGrant from the specified map of raw messages. +func UnmarshalTemplateGrant(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateGrant) + err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalRoles) + if err != nil { + err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "role_template_references", &obj.RoleTemplateReferences, UnmarshalRoleTemplateReferencesItem) + if err != nil { + err = core.SDKErrorf(err, "", "role_template_references-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // TemplateMetadata : The details of the IAM template that was used to create an enterprise-managed policy in your account. When returned, // this indicates that the policy is created from and managed by a template in the root enterprise account. type TemplateMetadata struct { @@ -10412,7 +13063,7 @@ type TemplatePolicy struct { Rule V2PolicyRuleIntf `json:"rule,omitempty"` // Specifies the type of access that is granted by the policy. - Control *Control `json:"control,omitempty"` + Control *TemplateControl `json:"control,omitempty"` } // Constants associated with the TemplatePolicy.Type property. @@ -10467,7 +13118,7 @@ func UnmarshalTemplatePolicy(m map[string]json.RawMessage, result interface{}) ( err = core.SDKErrorf(err, "", "rule-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "control", &obj.Control, UnmarshalControl) + err = core.UnmarshalModel(m, "control", &obj.Control, UnmarshalTemplateControl) if err != nil { err = core.SDKErrorf(err, "", "control-error", common.GetComponentInfo()) return @@ -10476,6 +13127,61 @@ func UnmarshalTemplatePolicy(m map[string]json.RawMessage, result interface{}) ( return } +// TemplateRole : The role properties that are created in an action resource when the template is assigned. +type TemplateRole struct { + // The display the name of the role that is shown in the console. + DisplayName *string `json:"display_name" validate:"required"` + + // The service name that the role refers. + ServiceName *string `json:"service_name,omitempty"` + + // Description of the role. + Description *string `json:"description,omitempty"` + + // The actions of the role. + Actions []string `json:"actions" validate:"required"` +} + +// NewTemplateRole : Instantiate TemplateRole (Generic Model Constructor) +func (*IamPolicyManagementV1) NewTemplateRole(displayName string, actions []string) (_model *TemplateRole, err error) { + _model = &TemplateRole{ + DisplayName: core.StringPtr(displayName), + Actions: actions, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalTemplateRole unmarshals an instance of TemplateRole from the specified map of raw messages. +func UnmarshalTemplateRole(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateRole) + err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) + if err != nil { + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "service_name", &obj.ServiceName) + if err != nil { + err = core.SDKErrorf(err, "", "service_name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "actions", &obj.Actions) + if err != nil { + err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // UpdateActionControlAssignmentOptions : The UpdateActionControlAssignment options. type UpdateActionControlAssignmentOptions struct { // Action control template assignment ID. @@ -10641,6 +13347,56 @@ func (options *UpdatePolicyStateOptions) SetHeaders(param map[string]string) *Up return options } +// UpdateRoleAssignmentOptions : The UpdateRoleAssignment options. +type UpdateRoleAssignmentOptions struct { + // Role template assignment ID. + AssignmentID *string `json:"assignment_id" validate:"required,ne="` + + // The revision number for updating a role assignment and must match the Etag value of the existing role assignment. + // The Etag can be retrieved using the GET /v1/role_assignments/{assignment_id} API and looking at the Etag response + // header. + IfMatch *string `json:"If-Match" validate:"required"` + + // The version number of the template used to identify different versions of same template. + TemplateVersion *string `json:"template_version" validate:"required"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewUpdateRoleAssignmentOptions : Instantiate UpdateRoleAssignmentOptions +func (*IamPolicyManagementV1) NewUpdateRoleAssignmentOptions(assignmentID string, ifMatch string, templateVersion string) *UpdateRoleAssignmentOptions { + return &UpdateRoleAssignmentOptions{ + AssignmentID: core.StringPtr(assignmentID), + IfMatch: core.StringPtr(ifMatch), + TemplateVersion: core.StringPtr(templateVersion), + } +} + +// SetAssignmentID : Allow user to set AssignmentID +func (_options *UpdateRoleAssignmentOptions) SetAssignmentID(assignmentID string) *UpdateRoleAssignmentOptions { + _options.AssignmentID = core.StringPtr(assignmentID) + return _options +} + +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateRoleAssignmentOptions) SetIfMatch(ifMatch string) *UpdateRoleAssignmentOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + +// SetTemplateVersion : Allow user to set TemplateVersion +func (_options *UpdateRoleAssignmentOptions) SetTemplateVersion(templateVersion string) *UpdateRoleAssignmentOptions { + _options.TemplateVersion = core.StringPtr(templateVersion) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateRoleAssignmentOptions) SetHeaders(param map[string]string) *UpdateRoleAssignmentOptions { + options.Headers = param + return options +} + // UpdateSettingsOptions : The UpdateSettings options. type UpdateSettingsOptions struct { // The account GUID that the settings belong to. @@ -11816,24 +14572,94 @@ func UnmarshalPolicyTemplateAssignmentItemsPolicyAssignmentV1(m map[string]json. err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) + err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) + if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalPolicyAssignmentV1Subject) + if err != nil { + err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) + if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// TemplateGrantRoleReferences : TemplateGrantRoleReferences struct +// This model "extends" TemplateGrant +type TemplateGrantRoleReferences struct { + // A set of role template reference IDs granted by the policy. + RoleTemplateReferences []RoleTemplateReferencesItem `json:"role_template_references" validate:"required"` +} + +// NewTemplateGrantRoleReferences : Instantiate TemplateGrantRoleReferences (Generic Model Constructor) +func (*IamPolicyManagementV1) NewTemplateGrantRoleReferences(roleTemplateReferences []RoleTemplateReferencesItem) (_model *TemplateGrantRoleReferences, err error) { + _model = &TemplateGrantRoleReferences{ + RoleTemplateReferences: roleTemplateReferences, + } + err = core.ValidateStruct(_model, "required parameters") if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) - return + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) } - err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalPolicyAssignmentV1Subject) + return +} + +func (*TemplateGrantRoleReferences) isaTemplateGrant() bool { + return true +} + +// UnmarshalTemplateGrantRoleReferences unmarshals an instance of TemplateGrantRoleReferences from the specified map of raw messages. +func UnmarshalTemplateGrantRoleReferences(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateGrantRoleReferences) + err = core.UnmarshalModel(m, "role_template_references", &obj.RoleTemplateReferences, UnmarshalRoleTemplateReferencesItem) if err != nil { - err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "role_template_references-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// TemplateGrantRoles : TemplateGrantRoles struct +// This model "extends" TemplateGrant +type TemplateGrantRoles struct { + // A set of role Cloud Resource Names (CRNs) granted by the policy. + Roles []Roles `json:"roles" validate:"required"` +} + +// NewTemplateGrantRoles : Instantiate TemplateGrantRoles (Generic Model Constructor) +func (*IamPolicyManagementV1) NewTemplateGrantRoles(roles []Roles) (_model *TemplateGrantRoles, err error) { + _model = &TemplateGrantRoles{ + Roles: roles, + } + err = core.ValidateStruct(_model, "required parameters") if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) - return + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + return +} + +func (*TemplateGrantRoles) isaTemplateGrant() bool { + return true +} + +// UnmarshalTemplateGrantRoles unmarshals an instance of TemplateGrantRoles from the specified map of raw messages. +func UnmarshalTemplateGrantRoles(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateGrantRoles) + err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalRoles) if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -12666,3 +15492,264 @@ func (pager *ActionControlAssignmentsPager) GetAll() (allItems []ActionControlAs err = core.RepurposeSDKProblem(err, "") return } + +// +// RoleTemplatesPager can be used to simplify the use of the "ListRoleTemplates" method. +// +type RoleTemplatesPager struct { + hasNext bool + options *ListRoleTemplatesOptions + client *IamPolicyManagementV1 + pageContext struct { + next *string + } +} + +// NewRoleTemplatesPager returns a new RoleTemplatesPager instance. +func (iamPolicyManagement *IamPolicyManagementV1) NewRoleTemplatesPager(options *ListRoleTemplatesOptions) (pager *RoleTemplatesPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListRoleTemplatesOptions = *options + pager = &RoleTemplatesPager{ + hasNext: true, + options: &optionsCopy, + client: iamPolicyManagement, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *RoleTemplatesPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *RoleTemplatesPager) GetNextWithContext(ctx context.Context) (page []RoleTemplate, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListRoleTemplatesWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + next = result.Next.Start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.RoleTemplates + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *RoleTemplatesPager) GetAllWithContext(ctx context.Context) (allItems []RoleTemplate, err error) { + for pager.HasNext() { + var nextPage []RoleTemplate + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *RoleTemplatesPager) GetNext() (page []RoleTemplate, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *RoleTemplatesPager) GetAll() (allItems []RoleTemplate, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// +// RoleTemplateVersionsPager can be used to simplify the use of the "ListRoleTemplateVersions" method. +// +type RoleTemplateVersionsPager struct { + hasNext bool + options *ListRoleTemplateVersionsOptions + client *IamPolicyManagementV1 + pageContext struct { + next *string + } +} + +// NewRoleTemplateVersionsPager returns a new RoleTemplateVersionsPager instance. +func (iamPolicyManagement *IamPolicyManagementV1) NewRoleTemplateVersionsPager(options *ListRoleTemplateVersionsOptions) (pager *RoleTemplateVersionsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListRoleTemplateVersionsOptions = *options + pager = &RoleTemplateVersionsPager{ + hasNext: true, + options: &optionsCopy, + client: iamPolicyManagement, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *RoleTemplateVersionsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *RoleTemplateVersionsPager) GetNextWithContext(ctx context.Context) (page []RoleTemplate, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListRoleTemplateVersionsWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + next = result.Next.Start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.Versions + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *RoleTemplateVersionsPager) GetAllWithContext(ctx context.Context) (allItems []RoleTemplate, err error) { + for pager.HasNext() { + var nextPage []RoleTemplate + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *RoleTemplateVersionsPager) GetNext() (page []RoleTemplate, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *RoleTemplateVersionsPager) GetAll() (allItems []RoleTemplate, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// +// RoleAssignmentsPager can be used to simplify the use of the "ListRoleAssignments" method. +// +type RoleAssignmentsPager struct { + hasNext bool + options *ListRoleAssignmentsOptions + client *IamPolicyManagementV1 + pageContext struct { + next *string + } +} + +// NewRoleAssignmentsPager returns a new RoleAssignmentsPager instance. +func (iamPolicyManagement *IamPolicyManagementV1) NewRoleAssignmentsPager(options *ListRoleAssignmentsOptions) (pager *RoleAssignmentsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListRoleAssignmentsOptions = *options + pager = &RoleAssignmentsPager{ + hasNext: true, + options: &optionsCopy, + client: iamPolicyManagement, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *RoleAssignmentsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *RoleAssignmentsPager) GetNextWithContext(ctx context.Context) (page []RoleAssignment, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListRoleAssignmentsWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + next = result.Next.Start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.Assignments + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *RoleAssignmentsPager) GetAllWithContext(ctx context.Context) (allItems []RoleAssignment, err error) { + for pager.HasNext() { + var nextPage []RoleAssignment + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *RoleAssignmentsPager) GetNext() (page []RoleAssignment, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *RoleAssignmentsPager) GetAll() (allItems []RoleAssignment, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} diff --git a/vendor/github.com/IBM/vpc-go-sdk/common/version.go b/vendor/github.com/IBM/vpc-go-sdk/common/version.go index f4a88168c839..d6fe0b8aa72f 100644 --- a/vendor/github.com/IBM/vpc-go-sdk/common/version.go +++ b/vendor/github.com/IBM/vpc-go-sdk/common/version.go @@ -1,4 +1,4 @@ package common // Version of the SDK -const Version = "0.71.1" +const Version = "0.85.0" diff --git a/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go b/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go index ee4742fca3e9..36d89ddfc5aa 100644 --- a/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2023, 2024, 2025. + * (C) Copyright IBM Corp. 2024, 2025, 2026. * * 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.105.1-067d600b-20250616-154447 + * IBM OpenAPI SDK Code Generator Version: 3.114.0-a902401e-20260427-192904 */ // Package vpcv1 : Operations and models for the VpcV1 service @@ -38,7 +38,7 @@ 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: 2025-09-01 +// API Version: 2026-06-09 type VpcV1 struct { Service *core.BaseService @@ -46,8 +46,8 @@ type VpcV1 struct { // `2`. Generation *int64 - // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2025-08-26` - // and `2025-09-01`. + // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2026-04-07` + // and `2026-06-10`. Version *string } @@ -67,8 +67,8 @@ type VpcV1Options struct { // `2`. Generation *int64 - // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2025-08-26` - // and `2025-09-01`. + // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2026-04-07` + // and `2026-06-10`. Version *string } @@ -133,7 +133,7 @@ func NewVpcV1(options *VpcV1Options) (service *VpcV1, err error) { } if options.Version == nil { - options.Version = core.StringPtr("2025-08-26") + options.Version = core.StringPtr("2026-06-09") } service = &VpcV1{ @@ -159,6 +159,7 @@ func GetServiceURLForRegion(region string) (string, error) { "eu-de": "https://eu-de.iaas.cloud.ibm.com/v1", // Germany (Frankfurt) "eu-es": "https://eu-es.iaas.cloud.ibm.com/v1", // Spain (Madrid) "eu-gb": "https://eu-gb.iaas.cloud.ibm.com/v1", // United Kingdom (London) + "in-che": "https://in-che.iaas.cloud.ibm.com/v1", // India (Chennai) "jp-osa": "https://jp-osa.iaas.cloud.ibm.com/v1", // Japan (Osaka) "jp-tok": "https://jp-tok.iaas.cloud.ibm.com/v1", // Japan (Tokyo) "us-east": "https://us-east.iaas.cloud.ibm.com/v1", // US East (Washington DC) @@ -6716,8 +6717,8 @@ func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpo if listEndpointGatewaysOptions.VPCName != nil { builder.AddQuery("vpc.name", fmt.Sprint(*listEndpointGatewaysOptions.VPCName)) } - if listEndpointGatewaysOptions.AllowDnsResolutionBinding != nil { - builder.AddQuery("allow_dns_resolution_binding", fmt.Sprint(*listEndpointGatewaysOptions.AllowDnsResolutionBinding)) + if listEndpointGatewaysOptions.DnsResolutionBindingMode != nil { + builder.AddQuery("dns_resolution_binding_mode", strings.Join(listEndpointGatewaysOptions.DnsResolutionBindingMode, ",")) } request, err := builder.Build() @@ -6798,8 +6799,8 @@ func (vpc *VpcV1) CreateEndpointGatewayWithContext(ctx context.Context, createEn if createEndpointGatewayOptions.VPC != nil { body["vpc"] = createEndpointGatewayOptions.VPC } - if createEndpointGatewayOptions.AllowDnsResolutionBinding != nil { - body["allow_dns_resolution_binding"] = createEndpointGatewayOptions.AllowDnsResolutionBinding + if createEndpointGatewayOptions.DnsResolutionBindingMode != nil { + body["dns_resolution_binding_mode"] = createEndpointGatewayOptions.DnsResolutionBindingMode } if createEndpointGatewayOptions.Ips != nil { body["ips"] = createEndpointGatewayOptions.Ips @@ -7138,11 +7139,411 @@ func (vpc *VpcV1) AddEndpointGatewayIPWithContext(ctx context.Context, addEndpoi return } +// ListEndpointGatewayResourceBindings : List resource bindings for an endpoint gateway +// This request lists resource bindings for an endpoint gateway. A resource binding is an association between the +// endpoint gateway and a resource in the endpoint gateway's `target` service. The resource binding provides a fully +// qualified domain name for the +// `service_endpoint` to access the resource from the endpoint gateway's VPC. +// +// The resource bindings will be sorted by their `created_at` property values, with newest resource bindings first. +// Resource bindings with identical `created_at` property values will in turn be sorted by ascending `name` property +// values. +func (vpc *VpcV1) ListEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptions *ListEndpointGatewayResourceBindingsOptions) (result *EndpointGatewayResourceBindingCollection, response *core.DetailedResponse, err error) { + result, response, err = vpc.ListEndpointGatewayResourceBindingsWithContext(context.Background(), listEndpointGatewayResourceBindingsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// ListEndpointGatewayResourceBindingsWithContext is an alternate form of the ListEndpointGatewayResourceBindings method which supports a Context parameter +func (vpc *VpcV1) ListEndpointGatewayResourceBindingsWithContext(ctx context.Context, listEndpointGatewayResourceBindingsOptions *ListEndpointGatewayResourceBindingsOptions) (result *EndpointGatewayResourceBindingCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listEndpointGatewayResourceBindingsOptions, "listEndpointGatewayResourceBindingsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(listEndpointGatewayResourceBindingsOptions, "listEndpointGatewayResourceBindingsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *listEndpointGatewayResourceBindingsOptions.EndpointGatewayID, + } + + 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}/resource_bindings`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGatewayResourceBindings") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range listEndpointGatewayResourceBindingsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + if listEndpointGatewayResourceBindingsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listEndpointGatewayResourceBindingsOptions.Start)) + } + if listEndpointGatewayResourceBindingsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewayResourceBindingsOptions.Limit)) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_endpoint_gateway_resource_bindings", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayResourceBindingCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// CreateEndpointGatewayResourceBinding : Create a resource binding for an endpoint gateway +// This request creates a new resource binding for an endpoint gateway from an endpoint gateway resource binding +// prototype object. The prototype object is structured in the same way as a retrieved endpoint gateway resource +// binding, and contains the information necessary to create the new resource binding. +// +// For this request to succeed, resource binding must be enabled for this endpoint gateway's +// `target` service and this endpoint gateway resource binding must not conflict with another resource binding in the +// [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected topology. +func (vpc *VpcV1) CreateEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptions *CreateEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + result, response, err = vpc.CreateEndpointGatewayResourceBindingWithContext(context.Background(), createEndpointGatewayResourceBindingOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// CreateEndpointGatewayResourceBindingWithContext is an alternate form of the CreateEndpointGatewayResourceBinding method which supports a Context parameter +func (vpc *VpcV1) CreateEndpointGatewayResourceBindingWithContext(ctx context.Context, createEndpointGatewayResourceBindingOptions *CreateEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createEndpointGatewayResourceBindingOptions, "createEndpointGatewayResourceBindingOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(createEndpointGatewayResourceBindingOptions, "createEndpointGatewayResourceBindingOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *createEndpointGatewayResourceBindingOptions.EndpointGatewayID, + } + + 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}/resource_bindings`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateEndpointGatewayResourceBinding") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range createEndpointGatewayResourceBindingOptions.Headers { + 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 createEndpointGatewayResourceBindingOptions.Target != nil { + body["target"] = createEndpointGatewayResourceBindingOptions.Target + } + if createEndpointGatewayResourceBindingOptions.Name != nil { + body["name"] = createEndpointGatewayResourceBindingOptions.Name + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "create_endpoint_gateway_resource_binding", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayResourceBinding) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// DeleteEndpointGatewayResourceBinding : Delete a resource binding from an endpoint gateway +// This request deletes the specified resource binding from the specified endpoint gateway. This operation cannot be +// reversed. +func (vpc *VpcV1) DeleteEndpointGatewayResourceBinding(deleteEndpointGatewayResourceBindingOptions *DeleteEndpointGatewayResourceBindingOptions) (response *core.DetailedResponse, err error) { + response, err = vpc.DeleteEndpointGatewayResourceBindingWithContext(context.Background(), deleteEndpointGatewayResourceBindingOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// DeleteEndpointGatewayResourceBindingWithContext is an alternate form of the DeleteEndpointGatewayResourceBinding method which supports a Context parameter +func (vpc *VpcV1) DeleteEndpointGatewayResourceBindingWithContext(ctx context.Context, deleteEndpointGatewayResourceBindingOptions *DeleteEndpointGatewayResourceBindingOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteEndpointGatewayResourceBindingOptions, "deleteEndpointGatewayResourceBindingOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(deleteEndpointGatewayResourceBindingOptions, "deleteEndpointGatewayResourceBindingOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *deleteEndpointGatewayResourceBindingOptions.EndpointGatewayID, + "id": *deleteEndpointGatewayResourceBindingOptions.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}/resource_bindings/{id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteEndpointGatewayResourceBinding") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range deleteEndpointGatewayResourceBindingOptions.Headers { + 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 { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + response, err = vpc.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_endpoint_gateway_resource_binding", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + + return +} + +// GetEndpointGatewayResourceBinding : Retrieve an endpoint gateway resource binding +// This request retrieves a single endpoint gateway resource binding specified by the identifier in the URL. +func (vpc *VpcV1) GetEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptions *GetEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + result, response, err = vpc.GetEndpointGatewayResourceBindingWithContext(context.Background(), getEndpointGatewayResourceBindingOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetEndpointGatewayResourceBindingWithContext is an alternate form of the GetEndpointGatewayResourceBinding method which supports a Context parameter +func (vpc *VpcV1) GetEndpointGatewayResourceBindingWithContext(ctx context.Context, getEndpointGatewayResourceBindingOptions *GetEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getEndpointGatewayResourceBindingOptions, "getEndpointGatewayResourceBindingOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(getEndpointGatewayResourceBindingOptions, "getEndpointGatewayResourceBindingOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *getEndpointGatewayResourceBindingOptions.EndpointGatewayID, + "id": *getEndpointGatewayResourceBindingOptions.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}/resource_bindings/{id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGatewayResourceBinding") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getEndpointGatewayResourceBindingOptions.Headers { + 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 { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "get_endpoint_gateway_resource_binding", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayResourceBinding) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// UpdateEndpointGatewayResourceBinding : Update an endpoint gateway resource binding +// This request updates an endpoint gateway resource binding with the information in a provided endpoint gateway +// resource binding patch. The endpoint gateway resource binding patch object is structured in the same way as a +// retrieved endpoint gateway resource binding and contains only the information to be updated. +func (vpc *VpcV1) UpdateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptions *UpdateEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + result, response, err = vpc.UpdateEndpointGatewayResourceBindingWithContext(context.Background(), updateEndpointGatewayResourceBindingOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// UpdateEndpointGatewayResourceBindingWithContext is an alternate form of the UpdateEndpointGatewayResourceBinding method which supports a Context parameter +func (vpc *VpcV1) UpdateEndpointGatewayResourceBindingWithContext(ctx context.Context, updateEndpointGatewayResourceBindingOptions *UpdateEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateEndpointGatewayResourceBindingOptions, "updateEndpointGatewayResourceBindingOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(updateEndpointGatewayResourceBindingOptions, "updateEndpointGatewayResourceBindingOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *updateEndpointGatewayResourceBindingOptions.EndpointGatewayID, + "id": *updateEndpointGatewayResourceBindingOptions.ID, + } + + 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}/resource_bindings/{id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateEndpointGatewayResourceBinding") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range updateEndpointGatewayResourceBindingOptions.Headers { + 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(updateEndpointGatewayResourceBindingOptions.EndpointGatewayResourceBindingPatch) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "update_endpoint_gateway_resource_binding", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayResourceBinding) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + 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. +// +// If the VPC this endpoint gateway resides in has `dns.enable_hub` set to `true`, then no other VPC in the [DNS +// sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) topology must contain an endpoint gateway with the same `target` +// service as this endpoint gateway. func (vpc *VpcV1) DeleteEndpointGateway(deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { response, err = vpc.DeleteEndpointGatewayWithContext(context.Background(), deleteEndpointGatewayOptions) err = core.RepurposeSDKProblem(err, "") @@ -8591,10 +8992,8 @@ func (vpc *VpcV1) CreateImageWithContext(ctx context.Context, createImageOptions // This request deletes an image. Any active image export jobs will be completed first. This operation cannot be // reversed. An image with `remote.account` set is not allowed to be deleted. Additionally, an image cannot be deleted // if it: -// - has a `status` of `deleting` -// - has a `status` of `pending` with a `status_reasons` code of -// `image_request_in_progress` -// - has `catalog_offering.managed` set to `true`. +// - has a `status` of `deleting` +// - has `catalog_offering.managed` set to `true`. func (vpc *VpcV1) DeleteImage(deleteImageOptions *DeleteImageOptions) (response *core.DetailedResponse, err error) { response, err = vpc.DeleteImageWithContext(context.Background(), deleteImageOptions) err = core.RepurposeSDKProblem(err, "") @@ -11970,6 +12369,12 @@ func (vpc *VpcV1) ListInstanceProfilesWithContext(ctx context.Context, listInsta builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + if listInstanceProfilesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listInstanceProfilesOptions.Start)) + } + if listInstanceProfilesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listInstanceProfilesOptions.Limit)) + } request, err := builder.Build() if err != nil { @@ -12117,6 +12522,9 @@ func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOpt if listInstancesOptions.Name != nil { builder.AddQuery("name", fmt.Sprint(*listInstancesOptions.Name)) } + if listInstancesOptions.AvailabilityClass != nil { + builder.AddQuery("availability.class", fmt.Sprint(*listInstancesOptions.AvailabilityClass)) + } if listInstancesOptions.ClusterNetworkID != nil { builder.AddQuery("cluster_network.id", fmt.Sprint(*listInstancesOptions.ClusterNetworkID)) } @@ -12135,6 +12543,12 @@ func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOpt if listInstancesOptions.DedicatedHostName != nil { builder.AddQuery("dedicated_host.name", fmt.Sprint(*listInstancesOptions.DedicatedHostName)) } + if listInstancesOptions.InstanceGroupMembershipInstanceGroupID != nil { + builder.AddQuery("instance_group_membership.instance_group.id", fmt.Sprint(*listInstancesOptions.InstanceGroupMembershipInstanceGroupID)) + } + if listInstancesOptions.InstanceGroupMembershipInstanceGroupCRN != nil { + builder.AddQuery("instance_group_membership.instance_group.crn", fmt.Sprint(*listInstancesOptions.InstanceGroupMembershipInstanceGroupCRN)) + } if listInstancesOptions.PlacementGroupID != nil { builder.AddQuery("placement_group.id", fmt.Sprint(*listInstancesOptions.PlacementGroupID)) } @@ -20472,6 +20886,10 @@ func (vpc *VpcV1) UnpublishPrivatePathServiceGatewayWithContext(ctx context.Cont // public address range is a contiguous block of public IP addresses that can be bound to a `target` that specifies a // `vpc` and a `zone`. Incoming traffic for these IP addresses will be routed according to the VPC's ingress routing // table. +// +// The public address ranges will be sorted by their `created_at` property values, with newest public address ranges +// first. Public address ranges with identical `created_at` property values will in turn be sorted by ascending `id` +// property values. func (vpc *VpcV1) ListPublicAddressRanges(listPublicAddressRangesOptions *ListPublicAddressRangesOptions) (result *PublicAddressRangeCollection, response *core.DetailedResponse, err error) { result, response, err = vpc.ListPublicAddressRangesWithContext(context.Background(), listPublicAddressRangesOptions) err = core.RepurposeSDKProblem(err, "") @@ -24122,7 +24540,8 @@ func (vpc *VpcV1) ListShareSnapshotsWithContext(ctx context.Context, listShareSn // in the same way as a retrieved share snapshot, and contains the information necessary to create the new share // snapshot. // -// The share must have an `access_control_mode` of `security_group` and a `replication_role` of `source` or `none`. +// The share must have an `access_control_mode` of `security_group`, and a +// `replication_role` of `source` or `none`. // // The snapshot will inherit its `resource_group` and encryption settings from the share. // @@ -24651,6 +25070,9 @@ func (vpc *VpcV1) ListSnapshotConsistencyGroupsWithContext(ctx context.Context, if listSnapshotConsistencyGroupsOptions.BackupPolicyPlanID != nil { builder.AddQuery("backup_policy_plan.id", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.BackupPolicyPlanID)) } + if listSnapshotConsistencyGroupsOptions.BackupPolicyJobID != nil { + builder.AddQuery("backup_policy_job.id", fmt.Sprint(*listSnapshotConsistencyGroupsOptions.BackupPolicyJobID)) + } request, err := builder.Build() if err != nil { @@ -27377,6 +27799,9 @@ func (vpc *VpcV1) DeleteVirtualNetworkInterfacesWithContext(ctx context.Context, builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + if deleteVirtualNetworkInterfacesOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteVirtualNetworkInterfacesOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) @@ -27524,6 +27949,9 @@ func (vpc *VpcV1) UpdateVirtualNetworkInterfaceWithContext(ctx context.Context, } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateVirtualNetworkInterfaceOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateVirtualNetworkInterfaceOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) @@ -28089,8 +28517,9 @@ func (vpc *VpcV1) GetVirtualNetworkInterfaceIPWithContext(ctx context.Context, g // AddVirtualNetworkInterfaceIP : Bind a reserved IP to a virtual network interface // This request binds the specified reserved IP to the specified virtual network interface. // -// The reserved IP must currently be unbound and in the primary IP's subnet. The virtual network interface's `target` -// must not currently be a file share mount target. +// The reserved IP must currently be unbound and in the primary IP's subnet. +// +// The virtual network interface's `target` must not currently be a file share mount target. func (vpc *VpcV1) AddVirtualNetworkInterfaceIP(addVirtualNetworkInterfaceIPOptions *AddVirtualNetworkInterfaceIPOptions) (result *ReservedIPReference, response *core.DetailedResponse, err error) { result, response, err = vpc.AddVirtualNetworkInterfaceIPWithContext(context.Background(), addVirtualNetworkInterfaceIPOptions) err = core.RepurposeSDKProblem(err, "") @@ -28363,6 +28792,9 @@ func (vpc *VpcV1) ListVolumesWithContext(ctx context.Context, listVolumesOptions if listVolumesOptions.OperatingSystemArchitecture != nil { builder.AddQuery("operating_system.architecture", fmt.Sprint(*listVolumesOptions.OperatingSystemArchitecture)) } + if listVolumesOptions.StorageGeneration != nil { + builder.AddQuery("storage_generation", fmt.Sprint(*listVolumesOptions.StorageGeneration)) + } if listVolumesOptions.Tag != nil { builder.AddQuery("tag", fmt.Sprint(*listVolumesOptions.Tag)) } @@ -28773,6 +29205,467 @@ func (vpc *VpcV1) ListVolumeInstanceProfilesWithContext(ctx context.Context, lis return } +// ListVolumeJobs : List jobs for a volume +// This request lists jobs for a volume. Each job represents an action performed on the volume and includes metadata +// such as: +// +// - `job_type`: Currently, only the `migrate` job type is supported. +// - `status`: Indicates the current state of the job (e.g., queued, running, +// succeeded, failed). +// +// The jobs will be sorted by their `created_at` property values, with newest jobs first. +func (vpc *VpcV1) ListVolumeJobs(listVolumeJobsOptions *ListVolumeJobsOptions) (result *VolumeJobCollection, response *core.DetailedResponse, err error) { + result, response, err = vpc.ListVolumeJobsWithContext(context.Background(), listVolumeJobsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// ListVolumeJobsWithContext is an alternate form of the ListVolumeJobs method which supports a Context parameter +func (vpc *VpcV1) ListVolumeJobsWithContext(ctx context.Context, listVolumeJobsOptions *ListVolumeJobsOptions) (result *VolumeJobCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVolumeJobsOptions, "listVolumeJobsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(listVolumeJobsOptions, "listVolumeJobsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "volume_id": *listVolumeJobsOptions.VolumeID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{volume_id}/jobs`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVolumeJobs") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range listVolumeJobsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + if listVolumeJobsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVolumeJobsOptions.Start)) + } + if listVolumeJobsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVolumeJobsOptions.Limit)) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_volume_jobs", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeJobCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// CreateVolumeJob : Create a job for a volume +// This request creates and queues a new job for the volume specified in the URL using the volume job prototype object. +func (vpc *VpcV1) CreateVolumeJob(createVolumeJobOptions *CreateVolumeJobOptions) (result VolumeJobIntf, response *core.DetailedResponse, err error) { + result, response, err = vpc.CreateVolumeJobWithContext(context.Background(), createVolumeJobOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// CreateVolumeJobWithContext is an alternate form of the CreateVolumeJob method which supports a Context parameter +func (vpc *VpcV1) CreateVolumeJobWithContext(ctx context.Context, createVolumeJobOptions *CreateVolumeJobOptions) (result VolumeJobIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createVolumeJobOptions, "createVolumeJobOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(createVolumeJobOptions, "createVolumeJobOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "volume_id": *createVolumeJobOptions.VolumeID, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{volume_id}/jobs`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateVolumeJob") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range createVolumeJobOptions.Headers { + 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 createVolumeJobOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*createVolumeJobOptions.Start)) + } + if createVolumeJobOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*createVolumeJobOptions.Limit)) + } + + _, err = builder.SetBodyContentJSON(createVolumeJobOptions.VolumeJobPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "create_volume_job", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeJob) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// DeleteVolumeJob : Delete a volume job +// This request deletes a volume job. This operation cannot be reversed. If the job has not completed, the job will be +// canceled, and the incomplete volume job will be deleted. +func (vpc *VpcV1) DeleteVolumeJob(deleteVolumeJobOptions *DeleteVolumeJobOptions) (response *core.DetailedResponse, err error) { + response, err = vpc.DeleteVolumeJobWithContext(context.Background(), deleteVolumeJobOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// DeleteVolumeJobWithContext is an alternate form of the DeleteVolumeJob method which supports a Context parameter +func (vpc *VpcV1) DeleteVolumeJobWithContext(ctx context.Context, deleteVolumeJobOptions *DeleteVolumeJobOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVolumeJobOptions, "deleteVolumeJobOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(deleteVolumeJobOptions, "deleteVolumeJobOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "volume_id": *deleteVolumeJobOptions.VolumeID, + "id": *deleteVolumeJobOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{volume_id}/jobs/{id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteVolumeJob") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range deleteVolumeJobOptions.Headers { + 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 { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + response, err = vpc.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_volume_job", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + + return +} + +// GetVolumeJob : Retrieve a volume job +// This request retrieves a single volume job specified by the identifier in the URL. +func (vpc *VpcV1) GetVolumeJob(getVolumeJobOptions *GetVolumeJobOptions) (result VolumeJobIntf, response *core.DetailedResponse, err error) { + result, response, err = vpc.GetVolumeJobWithContext(context.Background(), getVolumeJobOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetVolumeJobWithContext is an alternate form of the GetVolumeJob method which supports a Context parameter +func (vpc *VpcV1) GetVolumeJobWithContext(ctx context.Context, getVolumeJobOptions *GetVolumeJobOptions) (result VolumeJobIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVolumeJobOptions, "getVolumeJobOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(getVolumeJobOptions, "getVolumeJobOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "volume_id": *getVolumeJobOptions.VolumeID, + "id": *getVolumeJobOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{volume_id}/jobs/{id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVolumeJob") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getVolumeJobOptions.Headers { + 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 { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "get_volume_job", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeJob) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// UpdateVolumeJob : Update a volume job +// This request updates an volume job with the information in a provided volume job patch. The volume job patch object +// is structured in the same way as a retrieved volume job and contains only the information to be updated. +func (vpc *VpcV1) UpdateVolumeJob(updateVolumeJobOptions *UpdateVolumeJobOptions) (result VolumeJobIntf, response *core.DetailedResponse, err error) { + result, response, err = vpc.UpdateVolumeJobWithContext(context.Background(), updateVolumeJobOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// UpdateVolumeJobWithContext is an alternate form of the UpdateVolumeJob method which supports a Context parameter +func (vpc *VpcV1) UpdateVolumeJobWithContext(ctx context.Context, updateVolumeJobOptions *UpdateVolumeJobOptions) (result VolumeJobIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVolumeJobOptions, "updateVolumeJobOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(updateVolumeJobOptions, "updateVolumeJobOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "volume_id": *updateVolumeJobOptions.VolumeID, + "id": *updateVolumeJobOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{volume_id}/jobs/{id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateVolumeJob") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range updateVolumeJobOptions.Headers { + 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(updateVolumeJobOptions.VolumeJobPatch) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "update_volume_job", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeJob) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// CancelVolumeJob : Cancel a queued or running volume job +// This request cancels a `queued` or `running` volume job. +func (vpc *VpcV1) CancelVolumeJob(cancelVolumeJobOptions *CancelVolumeJobOptions) (result VolumeJobIntf, response *core.DetailedResponse, err error) { + result, response, err = vpc.CancelVolumeJobWithContext(context.Background(), cancelVolumeJobOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// CancelVolumeJobWithContext is an alternate form of the CancelVolumeJob method which supports a Context parameter +func (vpc *VpcV1) CancelVolumeJobWithContext(ctx context.Context, cancelVolumeJobOptions *CancelVolumeJobOptions) (result VolumeJobIntf, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(cancelVolumeJobOptions, "cancelVolumeJobOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(cancelVolumeJobOptions, "cancelVolumeJobOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "volume_id": *cancelVolumeJobOptions.VolumeID, + "id": *cancelVolumeJobOptions.ID, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/volumes/{volume_id}/jobs/{id}/cancel`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CancelVolumeJob") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range cancelVolumeJobOptions.Headers { + 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 { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "cancel_volume_job", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVolumeJob) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + // ListVpcs : List VPCs // This request lists VPCs in the region. A VPC is a virtual network that belongs to an account and provides logical // isolation from other networks. A VPC is made up of resources in one or more zones. VPCs are regional, and each VPC @@ -29792,17 +30685,14 @@ func (vpc *VpcV1) UpdateVPCAddressPrefixWithContext(ctx context.Context, updateV // // If the VPC specified by the identifier in the URL is a DNS hub VPC (has `dns.enable_hub` set to `true`) then there is // one binding for each VPC bound to the hub VPC. The endpoint gateways in the bound VPCs can allow (using -// `allow_dns_resolution_binding`) the hub VPC to centralize resolution of their DNS names. +// `dns_resolution_binding_mode`) the hub VPC to centralize resolution of their DNS names. // // If the VPC specified by the identifier in the URL is not a DNS hub VPC, then there is at most one binding (to a hub // VPC). The endpoint gateways in the VPC specified by the identifier in the URL can allow (using -// `allow_dns_resolution_binding`) its hub VPC to centralize resolution of their DNS names. +// `dns_resolution_binding_mode`) its hub VPC to centralize resolution of their DNS names. // // To make use of centralized DNS resolution, a VPC bound to a DNS hub VPC must delegate DNS resolution to its hub VPC // by setting `dns.resolver.type` to `delegate`. -// -// The bindings will be sorted by their `created_at` property values, with newest bindings first. Bindings with -// identical `created_at` property values will in turn be sorted by ascending `name` property values. func (vpc *VpcV1) ListVPCDnsResolutionBindings(listVPCDnsResolutionBindingsOptions *ListVPCDnsResolutionBindingsOptions) (result *VpcdnsResolutionBindingCollection, response *core.DetailedResponse, err error) { result, response, err = vpc.ListVPCDnsResolutionBindingsWithContext(context.Background(), listVPCDnsResolutionBindingsOptions) err = core.RepurposeSDKProblem(err, "") @@ -29905,7 +30795,18 @@ func (vpc *VpcV1) ListVPCDnsResolutionBindingsWithContext(ctx context.Context, l // - The VPC specified by the identifier in the URL must have `dns.enable_hub` set to // `false` // - The updated DNS sharing connected topology must not contain more than one endpoint -// gateway with `allow_dns_resolution_binding` set to `true` targeting the same service. +// gateway with `dns_resolution_binding_mode` set to `primary` targeting the same service. +// +// Additionally, if the VPC specified by the identifier in the URL has endpoint gateways that have +// `dns_resolution_binding_mode` set to `per_resource_binding`, then those endpoint gateways will participate in [DNS +// sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) with all VPCs in the connected topology. If this VPC contains an +// endpoint gateway targeting a service that has resource binding enabled, then for this request to succeed: +// - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint +// gateway with the same `target` as the endpoint gateway in this VPC, and with +// `dns_resolution_binding_mode` set to `primary`. +// - No other VPC in the topology can have an endpoint gateway with a resource binding +// using the same `service_endpoint` as a resource binding for the endpoint gateway in +// this VPC. // // See [About DNS sharing for VPE gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) for more information. func (vpc *VpcV1) CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptions *CreateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { @@ -31579,17 +32480,26 @@ func (vpc *VpcV1) CreateIkePolicyWithContext(ctx context.Context, createIkePolic builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) body := make(map[string]interface{}) + if createIkePolicyOptions.IkeVersion != nil { + body["ike_version"] = createIkePolicyOptions.IkeVersion + } if createIkePolicyOptions.AuthenticationAlgorithm != nil { body["authentication_algorithm"] = createIkePolicyOptions.AuthenticationAlgorithm } + if createIkePolicyOptions.AuthenticationAlgorithms != nil { + body["authentication_algorithms"] = createIkePolicyOptions.AuthenticationAlgorithms + } if createIkePolicyOptions.DhGroup != nil { body["dh_group"] = createIkePolicyOptions.DhGroup } + if createIkePolicyOptions.DhGroups != nil { + body["dh_groups"] = createIkePolicyOptions.DhGroups + } if createIkePolicyOptions.EncryptionAlgorithm != nil { body["encryption_algorithm"] = createIkePolicyOptions.EncryptionAlgorithm } - if createIkePolicyOptions.IkeVersion != nil { - body["ike_version"] = createIkePolicyOptions.IkeVersion + if createIkePolicyOptions.EncryptionAlgorithms != nil { + body["encryption_algorithms"] = createIkePolicyOptions.EncryptionAlgorithms } if createIkePolicyOptions.KeyLifetime != nil { body["key_lifetime"] = createIkePolicyOptions.KeyLifetime @@ -32040,11 +32950,14 @@ func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecP if createIpsecPolicyOptions.AuthenticationAlgorithm != nil { body["authentication_algorithm"] = createIpsecPolicyOptions.AuthenticationAlgorithm } + if createIpsecPolicyOptions.AuthenticationAlgorithms != nil { + body["authentication_algorithms"] = createIpsecPolicyOptions.AuthenticationAlgorithms + } if createIpsecPolicyOptions.EncryptionAlgorithm != nil { body["encryption_algorithm"] = createIpsecPolicyOptions.EncryptionAlgorithm } - if createIpsecPolicyOptions.Pfs != nil { - body["pfs"] = createIpsecPolicyOptions.Pfs + if createIpsecPolicyOptions.EncryptionAlgorithms != nil { + body["encryption_algorithms"] = createIpsecPolicyOptions.EncryptionAlgorithms } if createIpsecPolicyOptions.KeyLifetime != nil { body["key_lifetime"] = createIpsecPolicyOptions.KeyLifetime @@ -32052,6 +32965,12 @@ func (vpc *VpcV1) CreateIpsecPolicyWithContext(ctx context.Context, createIpsecP if createIpsecPolicyOptions.Name != nil { body["name"] = createIpsecPolicyOptions.Name } + if createIpsecPolicyOptions.Pfs != nil { + body["pfs"] = createIpsecPolicyOptions.Pfs + } + if createIpsecPolicyOptions.PfsGroups != nil { + body["pfs_groups"] = createIpsecPolicyOptions.PfsGroups + } if createIpsecPolicyOptions.ResourceGroup != nil { body["resource_group"] = createIpsecPolicyOptions.ResourceGroup } @@ -32746,6 +33665,276 @@ func (vpc *VpcV1) UpdateVPNGatewayWithContext(ctx context.Context, updateVPNGate return } +// ListVPNGatewayAdvertisedCIDRs : List advertised CIDRs for a VPN gateway +// This request lists advertised CIDRs for a VPN gateway. +// +// This request is only supported for route mode VPN gateways. +func (vpc *VpcV1) ListVPNGatewayAdvertisedCIDRs(listVPNGatewayAdvertisedCIDRsOptions *ListVPNGatewayAdvertisedCIDRsOptions) (result *VPNGatewayAdvertisedCIDRCollection, response *core.DetailedResponse, err error) { + result, response, err = vpc.ListVPNGatewayAdvertisedCIDRsWithContext(context.Background(), listVPNGatewayAdvertisedCIDRsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// ListVPNGatewayAdvertisedCIDRsWithContext is an alternate form of the ListVPNGatewayAdvertisedCIDRs method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewayAdvertisedCIDRsWithContext(ctx context.Context, listVPNGatewayAdvertisedCIDRsOptions *ListVPNGatewayAdvertisedCIDRsOptions) (result *VPNGatewayAdvertisedCIDRCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNGatewayAdvertisedCIDRsOptions, "listVPNGatewayAdvertisedCIDRsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(listVPNGatewayAdvertisedCIDRsOptions, "listVPNGatewayAdvertisedCIDRsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *listVPNGatewayAdvertisedCIDRsOptions.VPNGatewayID, + } + + 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}/advertised_cidrs`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayAdvertisedCIDRs") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range listVPNGatewayAdvertisedCIDRsOptions.Headers { + 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 { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_vpn_gateway_advertised_cidrs", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayAdvertisedCIDRCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// RemoveVPNGatewayAdvertisedCIDR : Remove an advertised CIDR from a VPN gateway +// This request removes a CIDR from a VPN gateway advertised CIDRs. +// +// This request is only supported for route mode VPN gateways. +func (vpc *VpcV1) RemoveVPNGatewayAdvertisedCIDR(removeVPNGatewayAdvertisedCIDROptions *RemoveVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + response, err = vpc.RemoveVPNGatewayAdvertisedCIDRWithContext(context.Background(), removeVPNGatewayAdvertisedCIDROptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// RemoveVPNGatewayAdvertisedCIDRWithContext is an alternate form of the RemoveVPNGatewayAdvertisedCIDR method which supports a Context parameter +func (vpc *VpcV1) RemoveVPNGatewayAdvertisedCIDRWithContext(ctx context.Context, removeVPNGatewayAdvertisedCIDROptions *RemoveVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeVPNGatewayAdvertisedCIDROptions, "removeVPNGatewayAdvertisedCIDROptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(removeVPNGatewayAdvertisedCIDROptions, "removeVPNGatewayAdvertisedCIDROptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *removeVPNGatewayAdvertisedCIDROptions.VPNGatewayID, + "cidr": *removeVPNGatewayAdvertisedCIDROptions.CIDR, + } + + 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}/advertised_cidrs/{cidr}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayAdvertisedCIDR") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range removeVPNGatewayAdvertisedCIDROptions.Headers { + 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 { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + response, err = vpc.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "remove_vpn_gateway_advertised_cidr", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + + return +} + +// CheckVPNGatewayAdvertisedCIDR : Check if the specified advertised CIDR exists on a VPN gateway +// This request succeeds if an advertised CIDR exists on the specified VPN gateway, and fails otherwise. +// +// This request is only supported for route mode VPN gateways. +func (vpc *VpcV1) CheckVPNGatewayAdvertisedCIDR(checkVPNGatewayAdvertisedCIDROptions *CheckVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + response, err = vpc.CheckVPNGatewayAdvertisedCIDRWithContext(context.Background(), checkVPNGatewayAdvertisedCIDROptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// CheckVPNGatewayAdvertisedCIDRWithContext is an alternate form of the CheckVPNGatewayAdvertisedCIDR method which supports a Context parameter +func (vpc *VpcV1) CheckVPNGatewayAdvertisedCIDRWithContext(ctx context.Context, checkVPNGatewayAdvertisedCIDROptions *CheckVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(checkVPNGatewayAdvertisedCIDROptions, "checkVPNGatewayAdvertisedCIDROptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(checkVPNGatewayAdvertisedCIDROptions, "checkVPNGatewayAdvertisedCIDROptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *checkVPNGatewayAdvertisedCIDROptions.VPNGatewayID, + "cidr": *checkVPNGatewayAdvertisedCIDROptions.CIDR, + } + + 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}/advertised_cidrs/{cidr}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayAdvertisedCIDR") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range checkVPNGatewayAdvertisedCIDROptions.Headers { + 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 { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + response, err = vpc.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "check_vpn_gateway_advertised_cidr", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + + return +} + +// AddVPNGatewayAdvertisedCIDR : Set an advertised CIDR on a VPN gateway +// This request adds the specified CIDR to the specified VPN gateway advertised CIDRs. This request succeeds if the +// specified CIDR already exists. A request body is not required, and if provided, is ignored. +// +// This request is only supported for route mode VPN gateways. +func (vpc *VpcV1) AddVPNGatewayAdvertisedCIDR(addVPNGatewayAdvertisedCIDROptions *AddVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + response, err = vpc.AddVPNGatewayAdvertisedCIDRWithContext(context.Background(), addVPNGatewayAdvertisedCIDROptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// AddVPNGatewayAdvertisedCIDRWithContext is an alternate form of the AddVPNGatewayAdvertisedCIDR method which supports a Context parameter +func (vpc *VpcV1) AddVPNGatewayAdvertisedCIDRWithContext(ctx context.Context, addVPNGatewayAdvertisedCIDROptions *AddVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addVPNGatewayAdvertisedCIDROptions, "addVPNGatewayAdvertisedCIDROptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(addVPNGatewayAdvertisedCIDROptions, "addVPNGatewayAdvertisedCIDROptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *addVPNGatewayAdvertisedCIDROptions.VPNGatewayID, + "cidr": *addVPNGatewayAdvertisedCIDROptions.CIDR, + } + + 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}/advertised_cidrs/{cidr}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayAdvertisedCIDR") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range addVPNGatewayAdvertisedCIDROptions.Headers { + 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 { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + response, err = vpc.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "add_vpn_gateway_advertised_cidr", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + + return +} + // ListVPNGatewayConnections : List connections of a VPN gateway // This request lists connections of a VPN gateway. func (vpc *VpcV1) ListVPNGatewayConnections(listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { @@ -32950,6 +34139,9 @@ func (vpc *VpcV1) DeleteVPNGatewayConnectionWithContext(ctx context.Context, del for headerName, headerValue := range deleteVPNGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } + if deleteVPNGatewayConnectionOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteVPNGatewayConnectionOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) @@ -33088,6 +34280,9 @@ func (vpc *VpcV1) UpdateVPNGatewayConnectionWithContext(ctx context.Context, upd } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateVPNGatewayConnectionOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateVPNGatewayConnectionOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) @@ -33671,6 +34866,160 @@ func (vpc *VpcV1) AddVPNGatewayConnectionsPeerCIDRWithContext(ctx context.Contex return } +// ListVPNGatewayServiceConnections : List VPN gateway service connections +// This request lists service connections on a VPN gateway. The VPN gateway service connections will be sorted by +// ascending `created_at` property values. A VPN gateway service connection connects services such as transit gateway to +// a VPN gateway. This facilitates the propagation of routes learned from VPN gateway peer connections to the connected +// service (for example, a transit gateway). +func (vpc *VpcV1) ListVPNGatewayServiceConnections(listVPNGatewayServiceConnectionsOptions *ListVPNGatewayServiceConnectionsOptions) (result *VPNGatewayServiceConnectionCollection, response *core.DetailedResponse, err error) { + result, response, err = vpc.ListVPNGatewayServiceConnectionsWithContext(context.Background(), listVPNGatewayServiceConnectionsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// ListVPNGatewayServiceConnectionsWithContext is an alternate form of the ListVPNGatewayServiceConnections method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewayServiceConnectionsWithContext(ctx context.Context, listVPNGatewayServiceConnectionsOptions *ListVPNGatewayServiceConnectionsOptions) (result *VPNGatewayServiceConnectionCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNGatewayServiceConnectionsOptions, "listVPNGatewayServiceConnectionsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(listVPNGatewayServiceConnectionsOptions, "listVPNGatewayServiceConnectionsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *listVPNGatewayServiceConnectionsOptions.VPNGatewayID, + } + + 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}/service_connections`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayServiceConnections") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range listVPNGatewayServiceConnectionsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + if listVPNGatewayServiceConnectionsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVPNGatewayServiceConnectionsOptions.Start)) + } + if listVPNGatewayServiceConnectionsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVPNGatewayServiceConnectionsOptions.Limit)) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_vpn_gateway_service_connections", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayServiceConnectionCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// GetVPNGatewayServiceConnection : Retrieve a VPN gateway service connection +// This request retrieves VPN gateway service connection specified by the identifier in the URL. +func (vpc *VpcV1) GetVPNGatewayServiceConnection(getVPNGatewayServiceConnectionOptions *GetVPNGatewayServiceConnectionOptions) (result *VPNGatewayServiceConnection, response *core.DetailedResponse, err error) { + result, response, err = vpc.GetVPNGatewayServiceConnectionWithContext(context.Background(), getVPNGatewayServiceConnectionOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetVPNGatewayServiceConnectionWithContext is an alternate form of the GetVPNGatewayServiceConnection method which supports a Context parameter +func (vpc *VpcV1) GetVPNGatewayServiceConnectionWithContext(ctx context.Context, getVPNGatewayServiceConnectionOptions *GetVPNGatewayServiceConnectionOptions) (result *VPNGatewayServiceConnection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPNGatewayServiceConnectionOptions, "getVPNGatewayServiceConnectionOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(getVPNGatewayServiceConnectionOptions, "getVPNGatewayServiceConnectionOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *getVPNGatewayServiceConnectionOptions.VPNGatewayID, + "id": *getVPNGatewayServiceConnectionOptions.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}/service_connections/{id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGatewayServiceConnection") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getVPNGatewayServiceConnectionOptions.Headers { + 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 { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "get_vpn_gateway_service_connection", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayServiceConnection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + // ListVPNServers : List VPN servers // This request lists VPN servers. func (vpc *VpcV1) ListVPNServers(listVPNServersOptions *ListVPNServersOptions) (result *VPNServerCollection, response *core.DetailedResponse, err error) { @@ -34821,7 +36170,7 @@ func (vpc *VpcV1) UpdateVPNServerRouteWithContext(ctx context.Context, updateVPN return } func getServiceComponentInfo() *core.ProblemComponent { - return core.NewProblemComponent(DefaultServiceName, "2025-08-26") + return core.NewProblemComponent(DefaultServiceName, "2026-06-09") } // AccountIdentity : Identifies an account by a unique property. @@ -35122,6 +36471,44 @@ func (options *AddVirtualNetworkInterfaceIPOptions) SetHeaders(param map[string] return options } +// AddVPNGatewayAdvertisedCIDROptions : The AddVPNGatewayAdvertisedCIDR options. +type AddVPNGatewayAdvertisedCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The IP address range in CIDR block notation. + CIDR *string `json:"cidr" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewAddVPNGatewayAdvertisedCIDROptions : Instantiate AddVPNGatewayAdvertisedCIDROptions +func (*VpcV1) NewAddVPNGatewayAdvertisedCIDROptions(vpnGatewayID string, cidr string) *AddVPNGatewayAdvertisedCIDROptions { + return &AddVPNGatewayAdvertisedCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + CIDR: core.StringPtr(cidr), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *AddVPNGatewayAdvertisedCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayAdvertisedCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetCIDR : Allow user to set CIDR +func (_options *AddVPNGatewayAdvertisedCIDROptions) SetCIDR(cidr string) *AddVPNGatewayAdvertisedCIDROptions { + _options.CIDR = core.StringPtr(cidr) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *AddVPNGatewayAdvertisedCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayAdvertisedCIDROptions { + options.Headers = param + return options +} + // AddVPNGatewayConnectionsLocalCIDROptions : The AddVPNGatewayConnectionsLocalCIDR options. type AddVPNGatewayConnectionsLocalCIDROptions struct { // The VPN gateway identifier. @@ -35947,6 +37334,55 @@ func (resp *BackupPolicyJobCollection) GetNextStart() (*string, error) { return start, nil } +// BackupPolicyJobReference : BackupPolicyJobReference struct +type BackupPolicyJobReference struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *Deleted `json:"deleted,omitempty"` + + // The URL for this backup policy job. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this backup policy job. + ID *string `json:"id" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the BackupPolicyJobReference.ResourceType property. +// The resource type. +const ( + BackupPolicyJobReferenceResourceTypeBackupPolicyJobConst = "backup_policy_job" +) + +// UnmarshalBackupPolicyJobReference unmarshals an instance of BackupPolicyJobReference from the specified map of raw messages. +func UnmarshalBackupPolicyJobReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(BackupPolicyJobReference) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDeleted) + if err != nil { + err = core.SDKErrorf(err, "", "deleted-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // BackupPolicyJobSource : The source this backup was created from (may be // [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). // Models which "extend" this model: @@ -37952,7 +39388,7 @@ type BareMetalServerDiskAllowedUse struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variable is supported, corresponding // to the `BareMetalServer` property: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + // - `enable_secure_boot` (boolean): Whether secure boot is enabled. BareMetalServer *string `json:"bare_metal_server" validate:"required"` } @@ -40851,7 +42287,13 @@ func UnmarshalBareMetalServerProfileDiskSize(m map[string]json.RawMessage, resul // BareMetalServerProfileDiskSupportedInterfaces : BareMetalServerProfileDiskSupportedInterfaces struct type BareMetalServerProfileDiskSupportedInterfaces struct { - // The default value for this profile field. + // The default interface type supported by a bare metal server with this profile. + // - `fcp`: Fiber Channel Protocol + // - `sata`: Serial Advanced Technology Attachment + // - `nvme`: Non-Volatile Memory Express + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. Default *string `json:"default" validate:"required"` // The type for this profile field. @@ -40862,7 +42304,13 @@ type BareMetalServerProfileDiskSupportedInterfaces struct { } // Constants associated with the BareMetalServerProfileDiskSupportedInterfaces.Default property. -// The default value for this profile field. +// The default interface type supported by a bare metal server with this profile. +// - `fcp`: Fiber Channel Protocol +// - `sata`: Serial Advanced Technology Attachment +// - `nvme`: Non-Volatile Memory Express +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. const ( BareMetalServerProfileDiskSupportedInterfacesDefaultFcpConst = "fcp" BareMetalServerProfileDiskSupportedInterfacesDefaultNvmeConst = "nvme" @@ -41256,7 +42704,7 @@ func UnmarshalBareMetalServerProfileReservationTerms(m map[string]json.RawMessag // BareMetalServerProfileSupportedTrustedPlatformModuleModes : The supported trusted platform module modes for this bare metal server profile. type BareMetalServerProfileSupportedTrustedPlatformModuleModes struct { // The default trusted platform module for a bare metal server with this profile. - Default *string `json:"default,omitempty"` + Default *string `json:"default" validate:"required"` // The type for this profile field. Type *string `json:"type" validate:"required"` @@ -41867,6 +43315,44 @@ func UnmarshalBareMetalServerTrustedPlatformModulePrototype(m map[string]json.Ra return } +// CancelVolumeJobOptions : The CancelVolumeJob options. +type CancelVolumeJobOptions struct { + // The volume identifier. + VolumeID *string `json:"volume_id" validate:"required,ne="` + + // The volume job identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCancelVolumeJobOptions : Instantiate CancelVolumeJobOptions +func (*VpcV1) NewCancelVolumeJobOptions(volumeID string, id string) *CancelVolumeJobOptions { + return &CancelVolumeJobOptions{ + VolumeID: core.StringPtr(volumeID), + ID: core.StringPtr(id), + } +} + +// SetVolumeID : Allow user to set VolumeID +func (_options *CancelVolumeJobOptions) SetVolumeID(volumeID string) *CancelVolumeJobOptions { + _options.VolumeID = core.StringPtr(volumeID) + return _options +} + +// SetID : Allow user to set ID +func (_options *CancelVolumeJobOptions) SetID(id string) *CancelVolumeJobOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CancelVolumeJobOptions) SetHeaders(param map[string]string) *CancelVolumeJobOptions { + options.Headers = param + return options +} + // CatalogOfferingIdentity : Identifies a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering by a unique // property. // Models which "extend" this model: @@ -42060,6 +43546,44 @@ func UnmarshalCertificateInstanceReference(m map[string]json.RawMessage, result return } +// CheckVPNGatewayAdvertisedCIDROptions : The CheckVPNGatewayAdvertisedCIDR options. +type CheckVPNGatewayAdvertisedCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The IP address range in CIDR block notation. + CIDR *string `json:"cidr" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCheckVPNGatewayAdvertisedCIDROptions : Instantiate CheckVPNGatewayAdvertisedCIDROptions +func (*VpcV1) NewCheckVPNGatewayAdvertisedCIDROptions(vpnGatewayID string, cidr string) *CheckVPNGatewayAdvertisedCIDROptions { + return &CheckVPNGatewayAdvertisedCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + CIDR: core.StringPtr(cidr), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *CheckVPNGatewayAdvertisedCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayAdvertisedCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetCIDR : Allow user to set CIDR +func (_options *CheckVPNGatewayAdvertisedCIDROptions) SetCIDR(cidr string) *CheckVPNGatewayAdvertisedCIDROptions { + _options.CIDR = core.StringPtr(cidr) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CheckVPNGatewayAdvertisedCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayAdvertisedCIDROptions { + options.Headers = param + return options +} + // CheckVPNGatewayConnectionsLocalCIDROptions : The CheckVPNGatewayConnectionsLocalCIDR options. type CheckVPNGatewayConnectionsLocalCIDROptions struct { // The VPN gateway identifier. @@ -44997,30 +46521,49 @@ type CreateEndpointGatewayOptions struct { // - Must not have a service endpoint that overlaps with any `service_endpoints` of // another endpoint gateway in the VPC. // - // If `allow_dns_resolution_binding` is `true`, then there must not be another endpoint - // gateway with `allow_dns_resolution_binding` set to `true` in the [DNS - // sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected topology that: + // If `dns_resolution_binding_mode` is set to `primary`, then there must not be + // another endpoint gateway in the [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) + // connected topology that: // - Has the same `target` as this endpoint gateway // - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint // gateway. + // + // If `dns_resolution_binding_mode` is set to `per_resource_binding`, then: + // - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint + // gateway with the same `target` as this endpoint gateway. + // - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint + // gateway with `dns_resolution_binding_mode` set to `primary`. + // - No other VPC in the topology can have an endpoint gateway with a resource binding + // using the same `service_endpoint` as a resource binding for this endpoint gateway. Target EndpointGatewayTargetPrototypeIntf `json:"target" validate:"required"` // The VPC this endpoint gateway will reside in. VPC VPCIdentityIntf `json:"vpc" validate:"required"` - // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. - // - // If `true`, then there must not be another endpoint gateway with - // `allow_dns_resolution_binding` set to `true` in the [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected - // topology that: - // - Has the same `target` as this endpoint gateway - // - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint - // gateway. - // - // Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to - // `true`. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` + // The DNS resolution binding mode to use for this endpoint gateway: + // - `disabled`: The endpoint gateway will not participate in [DNS sharing for VPE + // gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) with other VPCs in a connected + // topology. + // - `primary`: The endpoint gateway will participate in [DNS sharing for VPE gateways] + // (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in + // has a DNS resolution binding to another VPC. If the VPC this endpoint gateway + // resides in has a DNS resolution binding to another VPC, then no other VPC in the + // topology can have an endpoint gateway with the same `target` as this endpoint + // gateway. + // - `per_resource_binding`: The endpoint gateway will participate in [DNS sharing for VPE + // gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway + // resides in has a DNS resolution binding to another VPC. Resource binding must be + // enabled for the `target` service. + // + // The VPC this endpoint gateway resides in must have `dns.enable_hub` set to + // `false`. + // + // If the VPC this endpoint gateway resides in has DNS resolution binding to another + // VPC, the other VPC must: + // - have `dns.enable_hub` set to `true` + // - contain an endpoint gateway for the same `target` service with + // `dns_resolution_binding_mode` set to `primary`. + DnsResolutionBindingMode *string `json:"dns_resolution_binding_mode,omitempty"` // The reserved IPs to bind to this endpoint gateway. At most one reserved IP per zone is allowed. Ips []EndpointGatewayReservedIPIntf `json:"ips,omitempty"` @@ -45040,6 +46583,41 @@ type CreateEndpointGatewayOptions struct { Headers map[string]string } +// Constants associated with the CreateEndpointGatewayOptions.DnsResolutionBindingMode property. +// The DNS resolution binding mode to use for this endpoint gateway: +// +// - `disabled`: The endpoint gateway will not participate in [DNS sharing for VPE +// gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) with other VPCs in a connected +// topology. +// +// - `primary`: The endpoint gateway will participate in [DNS sharing for VPE gateways] +// (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in +// has a DNS resolution binding to another VPC. If the VPC this endpoint gateway +// resides in has a DNS resolution binding to another VPC, then no other VPC in the +// topology can have an endpoint gateway with the same `target` as this endpoint +// gateway. +// +// - `per_resource_binding`: The endpoint gateway will participate in [DNS sharing for VPE +// gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway +// resides in has a DNS resolution binding to another VPC. Resource binding must be +// enabled for the `target` service. +// +// The VPC this endpoint gateway resides in must have `dns.enable_hub` set to +// `false`. +// +// If the VPC this endpoint gateway resides in has DNS resolution binding to another +// VPC, the other VPC must: +// +// - have `dns.enable_hub` set to `true` +// +// - contain an endpoint gateway for the same `target` service with +// `dns_resolution_binding_mode` set to `primary`. +const ( + CreateEndpointGatewayOptionsDnsResolutionBindingModeDisabledConst = "disabled" + CreateEndpointGatewayOptionsDnsResolutionBindingModePerResourceBindingConst = "per_resource_binding" + CreateEndpointGatewayOptionsDnsResolutionBindingModePrimaryConst = "primary" +) + // NewCreateEndpointGatewayOptions : Instantiate CreateEndpointGatewayOptions func (*VpcV1) NewCreateEndpointGatewayOptions(target EndpointGatewayTargetPrototypeIntf, vpc VPCIdentityIntf) *CreateEndpointGatewayOptions { return &CreateEndpointGatewayOptions{ @@ -45060,9 +46638,9 @@ func (_options *CreateEndpointGatewayOptions) SetVPC(vpc VPCIdentityIntf) *Creat return _options } -// SetAllowDnsResolutionBinding : Allow user to set AllowDnsResolutionBinding -func (_options *CreateEndpointGatewayOptions) SetAllowDnsResolutionBinding(allowDnsResolutionBinding bool) *CreateEndpointGatewayOptions { - _options.AllowDnsResolutionBinding = core.BoolPtr(allowDnsResolutionBinding) +// SetDnsResolutionBindingMode : Allow user to set DnsResolutionBindingMode +func (_options *CreateEndpointGatewayOptions) SetDnsResolutionBindingMode(dnsResolutionBindingMode string) *CreateEndpointGatewayOptions { + _options.DnsResolutionBindingMode = core.StringPtr(dnsResolutionBindingMode) return _options } @@ -45096,6 +46674,54 @@ func (options *CreateEndpointGatewayOptions) SetHeaders(param map[string]string) return options } +// CreateEndpointGatewayResourceBindingOptions : The CreateEndpointGatewayResourceBinding options. +type CreateEndpointGatewayResourceBindingOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // The target to use for this resource binding. + Target EndpointGatewayResourceBindingTargetPrototypeIntf `json:"target" validate:"required"` + + // The name for this resource binding. The name must not be used by another resource binding for the endpoint gateway. + // 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 +} + +// NewCreateEndpointGatewayResourceBindingOptions : Instantiate CreateEndpointGatewayResourceBindingOptions +func (*VpcV1) NewCreateEndpointGatewayResourceBindingOptions(endpointGatewayID string, target EndpointGatewayResourceBindingTargetPrototypeIntf) *CreateEndpointGatewayResourceBindingOptions { + return &CreateEndpointGatewayResourceBindingOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + Target: target, + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *CreateEndpointGatewayResourceBindingOptions) SetEndpointGatewayID(endpointGatewayID string) *CreateEndpointGatewayResourceBindingOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetTarget : Allow user to set Target +func (_options *CreateEndpointGatewayResourceBindingOptions) SetTarget(target EndpointGatewayResourceBindingTargetPrototypeIntf) *CreateEndpointGatewayResourceBindingOptions { + _options.Target = target + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateEndpointGatewayResourceBindingOptions) SetName(name string) *CreateEndpointGatewayResourceBindingOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateEndpointGatewayResourceBindingOptions) SetHeaders(param map[string]string) *CreateEndpointGatewayResourceBindingOptions { + options.Headers = param + return options +} + // CreateFloatingIPOptions : The CreateFloatingIP options. type CreateFloatingIPOptions struct { // The floating IP prototype object. @@ -45139,8 +46765,10 @@ type CreateFlowLogCollectorOptions struct { // instance network attachments, virtual network interfaces or instance network interfaces // within the target that are themselves the target of a more specific flow log collector. // - // The target must not be a virtual network interface that is attached to a bare metal server - // network attachment or to a file share mount target. + // For this request to succeed, the target must: + // - not be a virtual network interface that is attached to a bare metal server network + // attachment or to a file share mount target + // - not already be the target of another flow log collector. Target FlowLogCollectorTargetPrototypeIntf `json:"target" validate:"required"` // Indicates whether this collector will be active upon creation. @@ -45204,22 +46832,67 @@ func (options *CreateFlowLogCollectorOptions) SetHeaders(param map[string]string // CreateIkePolicyOptions : The CreateIkePolicy options. type CreateIkePolicyOptions struct { + // The IKE protocol version. + IkeVersion *int64 `json:"ike_version" validate:"required"` + // The authentication algorithm. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` + // + // `authentication_algorithm` has been deprecated. Use `authentication_algorithms` instead. + // + // If specified, `authentication_algorithms` must not be specified. + // Deprecated: this field is deprecated and may be removed in a future release. + AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` + + // The authentication algorithms to use for IKE Negotiation. + // + // If specified, `authentication_algorithm` must not be specified. + // + // If the IKE policy's `ike_version` is `1`, this array must contain exactly one algorithm. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + AuthenticationAlgorithms []string `json:"authentication_algorithms,omitempty"` // The Diffie-Hellman group. - DhGroup *int64 `json:"dh_group" validate:"required"` + // + // `dh_group` has been deprecated. Use `dh_groups` instead. + // + // If specified, `dh_groups` must not be specified. + // Deprecated: this field is deprecated and may be removed in a future release. + DhGroup *int64 `json:"dh_group,omitempty"` + + // The Diffie-Hellman groups to use for IKE negotiation. + // + // If specified, `dh_group` must not be specified. + // + // If the IKE policy's `ike_version` is `1`, this array must contain exactly one algorithm. + // + // The order of the Diffie-Hellman groups in this array indicates their priority for negotiation, with each + // Diffie-Hellman group having priority over the one after it. + DhGroups []int64 `json:"dh_groups,omitempty"` // The encryption algorithm. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + // + // `encryption_algorithm` has been deprecated. Use `encryption_algorithms` instead. + // + // If specified, `encryption_algorithms` must not be specified. + // Deprecated: this field is deprecated and may be removed in a future release. + EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` - // The IKE protocol version. - IkeVersion *int64 `json:"ike_version" validate:"required"` + // The encryption algorithms to use for IKE Negotiation. + // + // If specified, `encryption_algorithm` must not be specified. + // + // If the IKE policy's `ike_version` is `1`, this array must contain exactly one algorithm. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + EncryptionAlgorithms []string `json:"encryption_algorithms,omitempty"` // The key lifetime in seconds. KeyLifetime *int64 `json:"key_lifetime,omitempty"` - // The name for this IKE policy. The name must not be used by another IKE policies in the region. If unspecified, the + // The name for this IKE policy. The name must not be used by another IKE policy in the region. If unspecified, the // name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` @@ -45233,51 +46906,91 @@ type CreateIkePolicyOptions struct { // Constants associated with the CreateIkePolicyOptions.AuthenticationAlgorithm property. // The authentication algorithm. +// +// `authentication_algorithm` has been deprecated. Use `authentication_algorithms` instead. +// +// If specified, `authentication_algorithms` must not be specified. const ( CreateIkePolicyOptionsAuthenticationAlgorithmSha256Const = "sha256" CreateIkePolicyOptionsAuthenticationAlgorithmSha384Const = "sha384" CreateIkePolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" ) +// Constants associated with the CreateIkePolicyOptions.AuthenticationAlgorithms property. +const ( + CreateIkePolicyOptionsAuthenticationAlgorithmsSha256Const = "sha256" + CreateIkePolicyOptionsAuthenticationAlgorithmsSha384Const = "sha384" + CreateIkePolicyOptionsAuthenticationAlgorithmsSha512Const = "sha512" +) + // Constants associated with the CreateIkePolicyOptions.EncryptionAlgorithm property. // The encryption algorithm. +// +// `encryption_algorithm` has been deprecated. Use `encryption_algorithms` instead. +// +// If specified, `encryption_algorithms` must not be specified. const ( CreateIkePolicyOptionsEncryptionAlgorithmAes128Const = "aes128" CreateIkePolicyOptionsEncryptionAlgorithmAes192Const = "aes192" CreateIkePolicyOptionsEncryptionAlgorithmAes256Const = "aes256" ) +// Constants associated with the CreateIkePolicyOptions.EncryptionAlgorithms property. +const ( + CreateIkePolicyOptionsEncryptionAlgorithmsAes128Const = "aes128" + CreateIkePolicyOptionsEncryptionAlgorithmsAes192Const = "aes192" + CreateIkePolicyOptionsEncryptionAlgorithmsAes256Const = "aes256" +) + // NewCreateIkePolicyOptions : Instantiate CreateIkePolicyOptions -func (*VpcV1) NewCreateIkePolicyOptions(authenticationAlgorithm string, dhGroup int64, encryptionAlgorithm string, ikeVersion int64) *CreateIkePolicyOptions { +func (*VpcV1) NewCreateIkePolicyOptions(ikeVersion int64) *CreateIkePolicyOptions { return &CreateIkePolicyOptions{ - AuthenticationAlgorithm: core.StringPtr(authenticationAlgorithm), - DhGroup: core.Int64Ptr(dhGroup), - EncryptionAlgorithm: core.StringPtr(encryptionAlgorithm), - IkeVersion: core.Int64Ptr(ikeVersion), + IkeVersion: core.Int64Ptr(ikeVersion), } } +// SetIkeVersion : Allow user to set IkeVersion +func (_options *CreateIkePolicyOptions) SetIkeVersion(ikeVersion int64) *CreateIkePolicyOptions { + _options.IkeVersion = core.Int64Ptr(ikeVersion) + return _options +} + // SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm +// Deprecated: this method is deprecated and may be removed in a future release. func (_options *CreateIkePolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIkePolicyOptions { _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) return _options } +// SetAuthenticationAlgorithms : Allow user to set AuthenticationAlgorithms +func (_options *CreateIkePolicyOptions) SetAuthenticationAlgorithms(authenticationAlgorithms []string) *CreateIkePolicyOptions { + _options.AuthenticationAlgorithms = authenticationAlgorithms + return _options +} + // SetDhGroup : Allow user to set DhGroup +// Deprecated: this method is deprecated and may be removed in a future release. func (_options *CreateIkePolicyOptions) SetDhGroup(dhGroup int64) *CreateIkePolicyOptions { _options.DhGroup = core.Int64Ptr(dhGroup) return _options } +// SetDhGroups : Allow user to set DhGroups +func (_options *CreateIkePolicyOptions) SetDhGroups(dhGroups []int64) *CreateIkePolicyOptions { + _options.DhGroups = dhGroups + return _options +} + // SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm +// Deprecated: this method is deprecated and may be removed in a future release. 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) +// SetEncryptionAlgorithms : Allow user to set EncryptionAlgorithms +func (_options *CreateIkePolicyOptions) SetEncryptionAlgorithms(encryptionAlgorithms []string) *CreateIkePolicyOptions { + _options.EncryptionAlgorithms = encryptionAlgorithms return _options } @@ -45830,10 +47543,11 @@ type CreateInstanceNetworkInterfaceOptions struct { Name *string `json:"name,omitempty"` // The primary IP address to bind to the instance network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. + // specified using an existing reserved IP, or a prototype object for a new reserved + // IP. // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the instance network interface's subnet. Otherwise, an + // If an existing reserved IP or a prototype object with an address is specified, it + // must be available on the instance network interface's subnet. Otherwise, an // available address on the subnet will be automatically selected and reserved. PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` @@ -46011,34 +47725,85 @@ func (options *CreateInstanceVolumeAttachmentOptions) SetHeaders(param map[strin // CreateIpsecPolicyOptions : The CreateIpsecPolicy options. type CreateIpsecPolicyOptions struct { - // The authentication algorithm + // The authentication algorithm. + // + // `authentication_algorithm` has been deprecated. Use `authentication_algorithms` instead. + // + // If specified, `authentication_algorithms` must not be specified. // // Must be `disabled` if and only if the `encryption_algorithm` is `aes128gcm16`, // `aes192gcm16`, or `aes256gcm16` // // The `md5` and `sha1` algorithms have been deprecated. - AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` + // Deprecated: this field is deprecated and may be removed in a future release. + AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` - // The encryption algorithm + // The authentication algorithms to use for IPsec negotiation. + // + // If specified, `authentication_algorithm` must not be specified. + // + // Must be `["disabled"]` when `encryption_algorithms` has only combined-mode algorithms + // (`aes128gcm16`, `aes192gcm16`, and `aes256gcm16`). + // + // The `md5` and `sha1` algorithms have been deprecated. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + AuthenticationAlgorithms []string `json:"authentication_algorithms,omitempty"` + + // The encryption algorithm. + // + // `encryption_algorithm` has been deprecated. Use `encryption_algorithms` instead. + // + // If specified, `encryption_algorithms` must not be specified. // // The `authentication_algorithm` must be `disabled` if and only if // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or `aes256gcm16` // // The `triple_des` algorithm has been deprecated. - EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + // Deprecated: this field is deprecated and may be removed in a future release. + EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` - // The Perfect Forward Secrecy group. + // The encryption algorithms to use for IPsec negotiation. // - // Groups `group_2` and `group_5` have been deprecated. - Pfs *string `json:"pfs" validate:"required"` + // If specified, `encryption_algorithm` must not be specified. + // + // If only combined-mode encryption algorithms (`aes128gcm16`, `aes192gcm16`, and + // `aes256gcm16`) are to be used, then `authentication_algorithms` must be `["disabled"]`. + // + // The `triple_des` algorithm has been deprecated. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + EncryptionAlgorithms []string `json:"encryption_algorithms,omitempty"` // The key lifetime in seconds. KeyLifetime *int64 `json:"key_lifetime,omitempty"` - // The name for this IPsec policy. The name must not be used by another IPsec policies in the region. If unspecified, - // the name will be a hyphenated list of randomly-selected words. + // The name for this IPsec policy. The name must not be used by another IPsec policy in the region. If unspecified, the + // name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` + // The Perfect Forward Secrecy group. + // + // `pfs` has been deprecated. Use `pfs_groups` instead. + // + // If specified, `pfs_groups` must not be specified. + // + // Groups `group_2` and `group_5` have been deprecated. + // Deprecated: this field is deprecated and may be removed in a future release. + Pfs *string `json:"pfs,omitempty"` + + // The Perfect Forward Secrecy groups to use for IPsec negotiation. + // + // If specified, `pfs` must not be specified. + // + // Groups `group_2` and `group_5` have been deprecated. + // + // The order of the Perfect Forward Secrecy groups in this array indicates their priority for negotiation, with each + // Perfect Forward Secrecy group having priority over the one after it. + PfsGroups []string `json:"pfs_groups,omitempty"` + // The resource group to use. If unspecified, the account's [default resource // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -46048,7 +47813,11 @@ type CreateIpsecPolicyOptions struct { } // Constants associated with the CreateIpsecPolicyOptions.AuthenticationAlgorithm property. -// The authentication algorithm +// The authentication algorithm. +// +// `authentication_algorithm` has been deprecated. Use `authentication_algorithms` instead. +// +// If specified, `authentication_algorithms` must not be specified. // // Must be `disabled` if and only if the `encryption_algorithm` is `aes128gcm16`, // `aes192gcm16`, or `aes256gcm16` @@ -46061,8 +47830,20 @@ const ( CreateIpsecPolicyOptionsAuthenticationAlgorithmSha512Const = "sha512" ) +// Constants associated with the CreateIpsecPolicyOptions.AuthenticationAlgorithms property. +const ( + CreateIpsecPolicyOptionsAuthenticationAlgorithmsDisabledConst = "disabled" + CreateIpsecPolicyOptionsAuthenticationAlgorithmsSha256Const = "sha256" + CreateIpsecPolicyOptionsAuthenticationAlgorithmsSha384Const = "sha384" + CreateIpsecPolicyOptionsAuthenticationAlgorithmsSha512Const = "sha512" +) + // Constants associated with the CreateIpsecPolicyOptions.EncryptionAlgorithm property. -// The encryption algorithm +// The encryption algorithm. +// +// `encryption_algorithm` has been deprecated. Use `encryption_algorithms` instead. +// +// If specified, `encryption_algorithms` must not be specified. // // The `authentication_algorithm` must be `disabled` if and only if // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or `aes256gcm16` @@ -46077,9 +47858,23 @@ const ( CreateIpsecPolicyOptionsEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" ) +// Constants associated with the CreateIpsecPolicyOptions.EncryptionAlgorithms property. +const ( + CreateIpsecPolicyOptionsEncryptionAlgorithmsAes128Const = "aes128" + CreateIpsecPolicyOptionsEncryptionAlgorithmsAes128gcm16Const = "aes128gcm16" + CreateIpsecPolicyOptionsEncryptionAlgorithmsAes192Const = "aes192" + CreateIpsecPolicyOptionsEncryptionAlgorithmsAes192gcm16Const = "aes192gcm16" + CreateIpsecPolicyOptionsEncryptionAlgorithmsAes256Const = "aes256" + CreateIpsecPolicyOptionsEncryptionAlgorithmsAes256gcm16Const = "aes256gcm16" +) + // Constants associated with the CreateIpsecPolicyOptions.Pfs property. // The Perfect Forward Secrecy group. // +// `pfs` has been deprecated. Use `pfs_groups` instead. +// +// If specified, `pfs_groups` must not be specified. +// // Groups `group_2` and `group_5` have been deprecated. const ( CreateIpsecPolicyOptionsPfsDisabledConst = "disabled" @@ -46097,30 +47892,51 @@ const ( CreateIpsecPolicyOptionsPfsGroup31Const = "group_31" ) +// Constants associated with the CreateIpsecPolicyOptions.PfsGroups property. +const ( + CreateIpsecPolicyOptionsPfsGroupsDisabledConst = "disabled" + CreateIpsecPolicyOptionsPfsGroupsGroup14Const = "group_14" + CreateIpsecPolicyOptionsPfsGroupsGroup15Const = "group_15" + CreateIpsecPolicyOptionsPfsGroupsGroup16Const = "group_16" + CreateIpsecPolicyOptionsPfsGroupsGroup17Const = "group_17" + CreateIpsecPolicyOptionsPfsGroupsGroup18Const = "group_18" + CreateIpsecPolicyOptionsPfsGroupsGroup19Const = "group_19" + CreateIpsecPolicyOptionsPfsGroupsGroup20Const = "group_20" + CreateIpsecPolicyOptionsPfsGroupsGroup21Const = "group_21" + CreateIpsecPolicyOptionsPfsGroupsGroup22Const = "group_22" + CreateIpsecPolicyOptionsPfsGroupsGroup23Const = "group_23" + CreateIpsecPolicyOptionsPfsGroupsGroup24Const = "group_24" + CreateIpsecPolicyOptionsPfsGroupsGroup31Const = "group_31" +) + // 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), - } +func (*VpcV1) NewCreateIpsecPolicyOptions() *CreateIpsecPolicyOptions { + return &CreateIpsecPolicyOptions{} } // SetAuthenticationAlgorithm : Allow user to set AuthenticationAlgorithm +// Deprecated: this method is deprecated and may be removed in a future release. func (_options *CreateIpsecPolicyOptions) SetAuthenticationAlgorithm(authenticationAlgorithm string) *CreateIpsecPolicyOptions { _options.AuthenticationAlgorithm = core.StringPtr(authenticationAlgorithm) return _options } +// SetAuthenticationAlgorithms : Allow user to set AuthenticationAlgorithms +func (_options *CreateIpsecPolicyOptions) SetAuthenticationAlgorithms(authenticationAlgorithms []string) *CreateIpsecPolicyOptions { + _options.AuthenticationAlgorithms = authenticationAlgorithms + return _options +} + // SetEncryptionAlgorithm : Allow user to set EncryptionAlgorithm +// Deprecated: this method is deprecated and may be removed in a future release. func (_options *CreateIpsecPolicyOptions) SetEncryptionAlgorithm(encryptionAlgorithm string) *CreateIpsecPolicyOptions { _options.EncryptionAlgorithm = core.StringPtr(encryptionAlgorithm) return _options } -// SetPfs : Allow user to set Pfs -func (_options *CreateIpsecPolicyOptions) SetPfs(pfs string) *CreateIpsecPolicyOptions { - _options.Pfs = core.StringPtr(pfs) +// SetEncryptionAlgorithms : Allow user to set EncryptionAlgorithms +func (_options *CreateIpsecPolicyOptions) SetEncryptionAlgorithms(encryptionAlgorithms []string) *CreateIpsecPolicyOptions { + _options.EncryptionAlgorithms = encryptionAlgorithms return _options } @@ -46136,6 +47952,19 @@ func (_options *CreateIpsecPolicyOptions) SetName(name string) *CreateIpsecPolic return _options } +// SetPfs : Allow user to set Pfs +// Deprecated: this method is deprecated and may be removed in a future release. +func (_options *CreateIpsecPolicyOptions) SetPfs(pfs string) *CreateIpsecPolicyOptions { + _options.Pfs = core.StringPtr(pfs) + return _options +} + +// SetPfsGroups : Allow user to set PfsGroups +func (_options *CreateIpsecPolicyOptions) SetPfsGroups(pfsGroups []string) *CreateIpsecPolicyOptions { + _options.PfsGroups = pfsGroups + return _options +} + // SetResourceGroup : Allow user to set ResourceGroup func (_options *CreateIpsecPolicyOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateIpsecPolicyOptions { _options.ResourceGroup = resourceGroup @@ -46259,12 +48088,15 @@ type CreateLoadBalancerListenerOptions struct { // The default pool for this listener. If `https_redirect` is specified, the // default pool will not be used. - // If specified, the pool must: // + // If specified, the 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. + // - Not already be the `failsafe_policy.target` for another `default_pool` and + // `failsafe_policy.target` (applies only to load balancers in the `network` + // family). // // If unspecified, this listener will be created with no default pool, but one may be // subsequently set. @@ -46958,6 +48790,10 @@ type CreateLoadBalancerPoolOptions struct { // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if // `udp_supported` is `true`). Load balancers in the // `application` family support `tcp`, `http`, and `https`. + // + // **NOTE**: HTTP sends data in plain text, making it vulnerable to eavesdropping and tampering. Additionally, HTTP has + // no built-in mechanism to verify the identity of the server you are connecting to. It is recommended to choose + // `https` instead of `http`. For more details, see: https://www.cloudflare.com/learning/ssl/why-is-http-not-secure. Protocol *string `json:"protocol" validate:"required"` // The failsafe policy to use for this pool. @@ -47005,6 +48841,10 @@ const ( // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if // `udp_supported` is `true`). Load balancers in the // `application` family support `tcp`, `http`, and `https`. +// +// **NOTE**: HTTP sends data in plain text, making it vulnerable to eavesdropping and tampering. Additionally, HTTP has +// no built-in mechanism to verify the identity of the server you are connecting to. It is recommended to choose `https` +// instead of `http`. For more details, see: https://www.cloudflare.com/learning/ssl/why-is-http-not-secure. const ( CreateLoadBalancerPoolOptionsProtocolHTTPConst = "http" CreateLoadBalancerPoolOptionsProtocolHTTPSConst = "https" @@ -47397,8 +49237,9 @@ type CreatePublicAddressRangeOptions struct { // The total number of public IPv4 addresses required. Must be a power of 2. Ipv4AddressCount *int64 `json:"ipv4_address_count" validate:"required"` - // The name for this public address range. The name must not be used by another public address range in the region. If - // unspecified, the name will be a hyphenated list of randomly-selected words. + // The name for this public address range. The name must not be used by another public address range in the region. + // Names starting with `ibm-` are reserved for provider-managed resources, and 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 @@ -48228,6 +50069,62 @@ func (options *CreateVirtualNetworkInterfaceOptions) SetHeaders(param map[string return options } +// CreateVolumeJobOptions : The CreateVolumeJob options. +type CreateVolumeJobOptions struct { + // The volume identifier. + VolumeID *string `json:"volume_id" validate:"required,ne="` + + // The volume job prototype object. + VolumeJobPrototype VolumeJobPrototypeIntf `json:"VolumeJobPrototype" validate:"required"` + + // 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 +} + +// NewCreateVolumeJobOptions : Instantiate CreateVolumeJobOptions +func (*VpcV1) NewCreateVolumeJobOptions(volumeID string, volumeJobPrototype VolumeJobPrototypeIntf) *CreateVolumeJobOptions { + return &CreateVolumeJobOptions{ + VolumeID: core.StringPtr(volumeID), + VolumeJobPrototype: volumeJobPrototype, + } +} + +// SetVolumeID : Allow user to set VolumeID +func (_options *CreateVolumeJobOptions) SetVolumeID(volumeID string) *CreateVolumeJobOptions { + _options.VolumeID = core.StringPtr(volumeID) + return _options +} + +// SetVolumeJobPrototype : Allow user to set VolumeJobPrototype +func (_options *CreateVolumeJobOptions) SetVolumeJobPrototype(volumeJobPrototype VolumeJobPrototypeIntf) *CreateVolumeJobOptions { + _options.VolumeJobPrototype = volumeJobPrototype + return _options +} + +// SetStart : Allow user to set Start +func (_options *CreateVolumeJobOptions) SetStart(start string) *CreateVolumeJobOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *CreateVolumeJobOptions) SetLimit(limit int64) *CreateVolumeJobOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateVolumeJobOptions) SetHeaders(param map[string]string) *CreateVolumeJobOptions { + options.Headers = param + return options +} + // CreateVolumeOptions : The CreateVolume options. type CreateVolumeOptions struct { // The volume prototype object. @@ -49689,7 +51586,7 @@ type DedicatedHostDisk struct { InterfaceType *string `json:"interface_type" validate:"required"` // The lifecycle state of this dedicated host disk. - LifecycleState *string `json:"lifecycle_state,omitempty"` + LifecycleState *string `json:"lifecycle_state" validate:"required"` // The name for this dedicated host disk. The name is unique across all disks on the dedicated host. Name *string `json:"name" validate:"required"` @@ -51563,9 +53460,11 @@ type DefaultSecurityGroup struct { ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` // The rules for the default security group for a VPC. Created with: - // - A rule allowing inbound ICMP, TCP and UDP traffic from other interfaces in the - // VPC's default security group - // - A rule allowing outbound ICMP, TCP and UDP traffic to any destination + // - A rule named `inbound-icmp-tcp-udp-from-this-security-group` allowing inbound + // ICMP, TCP and UDP traffic from other interfaces in the VPC's default security + // group + // - A rule named `outbound-icmp-tcp-udp` allowing outbound ICMP, TCP and UDP traffic + // to any destination // // Rules for the default security group may be changed, added or removed. Rules []SecurityGroupRuleIntf `json:"rules" validate:"required"` @@ -52089,6 +53988,44 @@ func (options *DeleteEndpointGatewayOptions) SetHeaders(param map[string]string) return options } +// DeleteEndpointGatewayResourceBindingOptions : The DeleteEndpointGatewayResourceBinding options. +type DeleteEndpointGatewayResourceBindingOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // The resource binding identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewDeleteEndpointGatewayResourceBindingOptions : Instantiate DeleteEndpointGatewayResourceBindingOptions +func (*VpcV1) NewDeleteEndpointGatewayResourceBindingOptions(endpointGatewayID string, id string) *DeleteEndpointGatewayResourceBindingOptions { + return &DeleteEndpointGatewayResourceBindingOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *DeleteEndpointGatewayResourceBindingOptions) SetEndpointGatewayID(endpointGatewayID string) *DeleteEndpointGatewayResourceBindingOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *DeleteEndpointGatewayResourceBindingOptions) SetID(id string) *DeleteEndpointGatewayResourceBindingOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteEndpointGatewayResourceBindingOptions) SetHeaders(param map[string]string) *DeleteEndpointGatewayResourceBindingOptions { + options.Headers = param + return options +} + // DeleteFloatingIPOptions : The DeleteFloatingIP options. type DeleteFloatingIPOptions struct { // The floating IP identifier. @@ -53764,6 +55701,9 @@ type DeleteVirtualNetworkInterfacesOptions struct { // The virtual network interface identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -53781,12 +55721,56 @@ func (_options *DeleteVirtualNetworkInterfacesOptions) SetID(id string) *DeleteV return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteVirtualNetworkInterfacesOptions) SetIfMatch(ifMatch string) *DeleteVirtualNetworkInterfacesOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *DeleteVirtualNetworkInterfacesOptions) SetHeaders(param map[string]string) *DeleteVirtualNetworkInterfacesOptions { options.Headers = param return options } +// DeleteVolumeJobOptions : The DeleteVolumeJob options. +type DeleteVolumeJobOptions struct { + // The volume identifier. + VolumeID *string `json:"volume_id" validate:"required,ne="` + + // The volume job identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewDeleteVolumeJobOptions : Instantiate DeleteVolumeJobOptions +func (*VpcV1) NewDeleteVolumeJobOptions(volumeID string, id string) *DeleteVolumeJobOptions { + return &DeleteVolumeJobOptions{ + VolumeID: core.StringPtr(volumeID), + ID: core.StringPtr(id), + } +} + +// SetVolumeID : Allow user to set VolumeID +func (_options *DeleteVolumeJobOptions) SetVolumeID(volumeID string) *DeleteVolumeJobOptions { + _options.VolumeID = core.StringPtr(volumeID) + return _options +} + +// SetID : Allow user to set ID +func (_options *DeleteVolumeJobOptions) SetID(id string) *DeleteVolumeJobOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteVolumeJobOptions) SetHeaders(param map[string]string) *DeleteVolumeJobOptions { + options.Headers = param + return options +} + // DeleteVolumeOptions : The DeleteVolume options. type DeleteVolumeOptions struct { // The volume identifier. @@ -54078,6 +56062,9 @@ type DeleteVPNGatewayConnectionOptions struct { // The VPN gateway connection identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -54102,6 +56089,12 @@ func (_options *DeleteVPNGatewayConnectionOptions) SetID(id string) *DeleteVPNGa return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteVPNGatewayConnectionOptions) SetIfMatch(ifMatch string) *DeleteVPNGatewayConnectionOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *DeleteVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayConnectionOptions { options.Headers = param @@ -54396,8 +56389,9 @@ func (options *DisconnectVPNClientOptions) SetHeaders(param map[string]string) * // - 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 - // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. + // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) for this resource. + // + // The use of Hyper Protect Crypto Services for encryption keys has been deprecated. CRN *string `json:"crn,omitempty"` } @@ -54435,8 +56429,9 @@ func (encryptionKeyIdentity *EncryptionKeyIdentity) asPatch() (_patch map[string // 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 - // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. + // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) for this resource. + // + // The use of Hyper Protect Crypto Services for encryption keys has been deprecated. CRN *string `json:"crn" validate:"required"` } @@ -54454,16 +56449,24 @@ func UnmarshalEncryptionKeyReference(m map[string]json.RawMessage, result interf // EndpointGateway : EndpointGateway struct type EndpointGateway struct { - // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding" validate:"required"` - // 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"` + // The DNS resolution binding mode used for this endpoint gateway: + // - `disabled`: The endpoint gateway is not participating in [DNS sharing for VPE + // gateways](/docs/vpc?topic=vpc-vpe-dns-sharing). + // - `primary`: The endpoint gateway is participating in [DNS sharing for VPE gateways] + // (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in + // has a DNS resolution binding to another VPC. + // - `per_resource_binding`: The endpoint gateway is participating in [DNS sharing for VPE + // gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway + // resides in has a DNS resolution binding to another VPC, and resource binding is + // enabled for the `target` service. + DnsResolutionBindingMode *string `json:"dns_resolution_binding_mode" validate:"required"` + // The health of this resource: // - `ok`: No abnormal behavior detected // - `degraded`: Experiencing compromised performance, capacity, or connectivity @@ -54514,6 +56517,23 @@ type EndpointGateway struct { VPC *VPCReference `json:"vpc" validate:"required"` } +// Constants associated with the EndpointGateway.DnsResolutionBindingMode property. +// The DNS resolution binding mode used for this endpoint gateway: +// - `disabled`: The endpoint gateway is not participating in [DNS sharing for VPE +// gateways](/docs/vpc?topic=vpc-vpe-dns-sharing). +// - `primary`: The endpoint gateway is participating in [DNS sharing for VPE gateways] +// (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in +// has a DNS resolution binding to another VPC. +// - `per_resource_binding`: The endpoint gateway is participating in [DNS sharing for VPE +// gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway +// resides in has a DNS resolution binding to another VPC, and resource binding is +// enabled for the `target` service. +const ( + EndpointGatewayDnsResolutionBindingModeDisabledConst = "disabled" + EndpointGatewayDnsResolutionBindingModePerResourceBindingConst = "per_resource_binding" + EndpointGatewayDnsResolutionBindingModePrimaryConst = "primary" +) + // Constants associated with the EndpointGateway.HealthState property. // The health of this resource: // - `ok`: No abnormal behavior detected @@ -54550,11 +56570,6 @@ const ( // 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, "allow_dns_resolution_binding", &obj.AllowDnsResolutionBinding) - if err != nil { - err = core.SDKErrorf(err, "", "allow_dns_resolution_binding-error", common.GetComponentInfo()) - return - } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) @@ -54565,6 +56580,11 @@ func UnmarshalEndpointGateway(m map[string]json.RawMessage, result interface{}) err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "dns_resolution_binding_mode", &obj.DnsResolutionBindingMode) + if err != nil { + err = core.SDKErrorf(err, "", "dns_resolution_binding_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) if err != nil { err = core.SDKErrorf(err, "", "health_state-error", common.GetComponentInfo()) @@ -54772,30 +56792,76 @@ func UnmarshalEndpointGatewayLifecycleReason(m map[string]json.RawMessage, resul // EndpointGatewayPatch : EndpointGatewayPatch struct type EndpointGatewayPatch struct { - // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. - // - // If `true`, then there must not be another endpoint gateway with - // `allow_dns_resolution_binding` set to `true` in the [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected - // topology that: - // - Has the same `target` as this endpoint gateway - // - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint - // gateway. - // - // Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to - // `true`. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` + // The DNS resolution binding mode to use for this endpoint gateway: + // - `disabled`: The endpoint gateway will not participate in [DNS sharing for VPE + // gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) with other VPCs in a connected + // topology. + // - `primary`: The endpoint gateway will participate in [DNS sharing for VPE gateways] + // (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in + // has a DNS resolution binding to another VPC. If the VPC this endpoint gateway + // resides in has a DNS resolution binding to another VPC, then no other VPC in the + // topology can have an endpoint gateway with the same `target` as this endpoint + // gateway. + // - `per_resource_binding`: The endpoint gateway will participate in [DNS sharing for VPE + // gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway + // resides in has a DNS resolution binding to another VPC. Resource binding must be + // enabled for the `target` service. + // + // The VPC this endpoint gateway resides in must have `dns.enable_hub` set to + // `false`. + // + // If the VPC this endpoint gateway resides in has DNS resolution binding to another + // VPC, the other VPC must: + // - have `dns.enable_hub` set to `true` + // - contain an endpoint gateway for the same `target` service with + // `dns_resolution_binding_mode` set to `primary`. + DnsResolutionBindingMode *string `json:"dns_resolution_binding_mode,omitempty"` // The name for this endpoint gateway. The name must not be used by another endpoint gateway in the VPC. Name *string `json:"name,omitempty"` } +// Constants associated with the EndpointGatewayPatch.DnsResolutionBindingMode property. +// The DNS resolution binding mode to use for this endpoint gateway: +// +// - `disabled`: The endpoint gateway will not participate in [DNS sharing for VPE +// gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) with other VPCs in a connected +// topology. +// +// - `primary`: The endpoint gateway will participate in [DNS sharing for VPE gateways] +// (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in +// has a DNS resolution binding to another VPC. If the VPC this endpoint gateway +// resides in has a DNS resolution binding to another VPC, then no other VPC in the +// topology can have an endpoint gateway with the same `target` as this endpoint +// gateway. +// +// - `per_resource_binding`: The endpoint gateway will participate in [DNS sharing for VPE +// gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway +// resides in has a DNS resolution binding to another VPC. Resource binding must be +// enabled for the `target` service. +// +// The VPC this endpoint gateway resides in must have `dns.enable_hub` set to +// `false`. +// +// If the VPC this endpoint gateway resides in has DNS resolution binding to another +// VPC, the other VPC must: +// +// - have `dns.enable_hub` set to `true` +// +// - contain an endpoint gateway for the same `target` service with +// `dns_resolution_binding_mode` set to `primary`. +const ( + EndpointGatewayPatchDnsResolutionBindingModeDisabledConst = "disabled" + EndpointGatewayPatchDnsResolutionBindingModePerResourceBindingConst = "per_resource_binding" + EndpointGatewayPatchDnsResolutionBindingModePrimaryConst = "primary" +) + // 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, "allow_dns_resolution_binding", &obj.AllowDnsResolutionBinding) + err = core.UnmarshalPrimitive(m, "dns_resolution_binding_mode", &obj.DnsResolutionBindingMode) if err != nil { - err = core.SDKErrorf(err, "", "allow_dns_resolution_binding-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "dns_resolution_binding_mode-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) @@ -54810,8 +56876,8 @@ func UnmarshalEndpointGatewayPatch(m map[string]json.RawMessage, result interfac // AsPatch returns a generic map representation of the EndpointGatewayPatch func (endpointGatewayPatch *EndpointGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { _patch = map[string]interface{}{} - if !core.IsNil(endpointGatewayPatch.AllowDnsResolutionBinding) { - _patch["allow_dns_resolution_binding"] = endpointGatewayPatch.AllowDnsResolutionBinding + if !core.IsNil(endpointGatewayPatch.DnsResolutionBindingMode) { + _patch["dns_resolution_binding_mode"] = endpointGatewayPatch.DnsResolutionBindingMode } if !core.IsNil(endpointGatewayPatch.Name) { _patch["name"] = endpointGatewayPatch.Name @@ -54990,6 +57056,329 @@ func UnmarshalEndpointGatewayReservedIP(m map[string]json.RawMessage, result int return } +// EndpointGatewayResourceBinding : EndpointGatewayResourceBinding struct +type EndpointGatewayResourceBinding struct { + // The date and time that the resource binding was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this endpoint gateway resource binding. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this endpoint gateway resource binding. + ID *string `json:"id" validate:"required"` + + // The reasons for the current `lifecycle_state` (if any). + LifecycleReasons []EndpointGatewayResourceBindingLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the resource binding. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this resource binding. The name is unique across all resource bindings for the endpoint gateway. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The fully qualified domain name of the service endpoint for the resource targeted by this resource binding. + ServiceEndpoint *string `json:"service_endpoint" validate:"required"` + + // The target for this endpoint gateway resource binding. + Target EndpointGatewayResourceBindingTargetIntf `json:"target" validate:"required"` + + // The type of resource binding: + // - `weak`: The binding is not dependent on the existence of the target resource. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the EndpointGatewayResourceBinding.LifecycleState property. +// The lifecycle state of the resource binding. +const ( + EndpointGatewayResourceBindingLifecycleStateDeletingConst = "deleting" + EndpointGatewayResourceBindingLifecycleStateFailedConst = "failed" + EndpointGatewayResourceBindingLifecycleStatePendingConst = "pending" + EndpointGatewayResourceBindingLifecycleStateStableConst = "stable" + EndpointGatewayResourceBindingLifecycleStateSuspendedConst = "suspended" + EndpointGatewayResourceBindingLifecycleStateUpdatingConst = "updating" + EndpointGatewayResourceBindingLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the EndpointGatewayResourceBinding.ResourceType property. +// The resource type. +const ( + EndpointGatewayResourceBindingResourceTypeEndpointGatewayResourceBindingConst = "endpoint_gateway_resource_binding" +) + +// Constants associated with the EndpointGatewayResourceBinding.Type property. +// The type of resource binding: +// - `weak`: The binding is not dependent on the existence of the target resource. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + EndpointGatewayResourceBindingTypeWeakConst = "weak" +) + +// UnmarshalEndpointGatewayResourceBinding unmarshals an instance of EndpointGatewayResourceBinding from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBinding(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBinding) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalEndpointGatewayResourceBindingLifecycleReason) + if err != nil { + err = core.SDKErrorf(err, "", "lifecycle_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + err = core.SDKErrorf(err, "", "lifecycle_state-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "service_endpoint", &obj.ServiceEndpoint) + if err != nil { + err = core.SDKErrorf(err, "", "service_endpoint-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalEndpointGatewayResourceBindingTarget) + if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayResourceBindingCollection : EndpointGatewayResourceBindingCollection struct +type EndpointGatewayResourceBindingCollection struct { + // A link to the first page of resources. + First *PageLink `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 *PageLink `json:"next,omitempty"` + + // A page of resource bindings for the endpoint gateway. + ResourceBindings []EndpointGatewayResourceBinding `json:"resource_bindings" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalEndpointGatewayResourceBindingCollection unmarshals an instance of EndpointGatewayResourceBindingCollection from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resource_bindings", &obj.ResourceBindings, UnmarshalEndpointGatewayResourceBinding) + if err != nil { + err = core.SDKErrorf(err, "", "resource_bindings-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) + 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 *EndpointGatewayResourceBindingCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil { + err = core.SDKErrorf(err, "", "read-query-param-error", common.GetComponentInfo()) + return nil, err + } else if start == nil { + return nil, nil + } + return start, nil +} + +// EndpointGatewayResourceBindingLifecycleReason : EndpointGatewayResourceBindingLifecycleReason struct +type EndpointGatewayResourceBindingLifecycleReason struct { + // A reason code for this lifecycle state: + // - `internal_error`: internal error (contact IBM support) + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // A link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the EndpointGatewayResourceBindingLifecycleReason.Code property. +// A reason code for this lifecycle state: +// - `internal_error`: internal error (contact IBM support) +// - `resource_suspended_by_provider`: The resource has been suspended (contact IBM +// support) +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + EndpointGatewayResourceBindingLifecycleReasonCodeInternalErrorConst = "internal_error" + EndpointGatewayResourceBindingLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalEndpointGatewayResourceBindingLifecycleReason unmarshals an instance of EndpointGatewayResourceBindingLifecycleReason from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + err = core.SDKErrorf(err, "", "more_info-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayResourceBindingPatch : EndpointGatewayResourceBindingPatch struct +type EndpointGatewayResourceBindingPatch struct { + // The name for this resource binding. The name must not be used by another resource binding for the endpoint gateway. + Name *string `json:"name,omitempty"` +} + +// UnmarshalEndpointGatewayResourceBindingPatch unmarshals an instance of EndpointGatewayResourceBindingPatch from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the EndpointGatewayResourceBindingPatch +func (endpointGatewayResourceBindingPatch *EndpointGatewayResourceBindingPatch) AsPatch() (_patch map[string]interface{}, err error) { + _patch = map[string]interface{}{} + if !core.IsNil(endpointGatewayResourceBindingPatch.Name) { + _patch["name"] = endpointGatewayResourceBindingPatch.Name + } + + return +} + +// EndpointGatewayResourceBindingTarget : The target for this endpoint gateway resource binding. +// Models which "extend" this model: +// - EndpointGatewayResourceBindingTargetCRN +type EndpointGatewayResourceBindingTarget struct { + CRN *string `json:"crn,omitempty"` +} + +func (*EndpointGatewayResourceBindingTarget) isaEndpointGatewayResourceBindingTarget() bool { + return true +} + +type EndpointGatewayResourceBindingTargetIntf interface { + isaEndpointGatewayResourceBindingTarget() bool +} + +// UnmarshalEndpointGatewayResourceBindingTarget unmarshals an instance of EndpointGatewayResourceBindingTarget from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingTarget) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayResourceBindingTargetPrototype : The target to use for this resource binding. +// Models which "extend" this model: +// - EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN +type EndpointGatewayResourceBindingTargetPrototype struct { + CRN *string `json:"crn,omitempty"` +} + +func (*EndpointGatewayResourceBindingTargetPrototype) isaEndpointGatewayResourceBindingTargetPrototype() bool { + return true +} + +type EndpointGatewayResourceBindingTargetPrototypeIntf interface { + isaEndpointGatewayResourceBindingTargetPrototype() bool +} + +// UnmarshalEndpointGatewayResourceBindingTargetPrototype unmarshals an instance of EndpointGatewayResourceBindingTargetPrototype from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingTargetPrototype) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // EndpointGatewayTarget : The target for this endpoint gateway. // Models which "extend" this model: // - EndpointGatewayTargetPrivatePathServiceGatewayReference @@ -55084,13 +57473,20 @@ func UnmarshalEndpointGatewayTarget(m map[string]json.RawMessage, result interfa // - Must not have a service endpoint that overlaps with any `service_endpoints` of // another endpoint gateway in the VPC. // -// If `allow_dns_resolution_binding` is `true`, then there must not be another endpoint gateway with -// `allow_dns_resolution_binding` set to `true` in the [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected -// topology that: +// If `dns_resolution_binding_mode` is set to `primary`, then there must not be another endpoint gateway in the [DNS +// sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected topology that: // - Has the same `target` as this endpoint gateway // - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint // gateway. // +// If `dns_resolution_binding_mode` is set to `per_resource_binding`, then: +// - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint +// gateway with the same `target` as this endpoint gateway. +// - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint +// gateway with `dns_resolution_binding_mode` set to `primary`. +// - No other VPC in the topology can have an endpoint gateway with a resource binding +// using the same `service_endpoint` as a resource binding for this endpoint gateway. +// // Models which "extend" this model: // - EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype // - EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype @@ -55740,14 +58136,23 @@ type FloatingIPTargetPatch struct { // If this bare metal server has network attachments, this network interface is a // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. + // corresponding network attachment or the unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment or the unique identifier for this virtual network interface. ID *string `json:"id,omitempty"` // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. + // corresponding network attachment or the URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment or the URL for this virtual network interface. Href *string `json:"href,omitempty"` // The CRN for this virtual network interface. @@ -55818,14 +58223,23 @@ type FloatingIPTargetPrototype struct { // If this bare metal server has network attachments, this network interface is a // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. + // corresponding network attachment or the unique identifier for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment or the unique identifier for this virtual network interface. ID *string `json:"id,omitempty"` // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. + // corresponding network attachment or the URL for this instance network interface. + // + // If this instance has network attachments, this network interface is a + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment or the URL for this virtual network interface. Href *string `json:"href,omitempty"` // The CRN for this virtual network interface. @@ -56150,7 +58564,7 @@ func (flowLogCollectorPatch *FlowLogCollectorPatch) AsPatch() (_patch map[string // - FlowLogCollectorTargetInstanceReference // - FlowLogCollectorTargetSubnetReference // - FlowLogCollectorTargetVPCReference -// - FlowLogCollectorTargetInstanceNetworkAttachmentReference +// - FlowLogCollectorTargetInstanceNetworkAttachmentReferenceFlowLogCollectorContext // - FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext type FlowLogCollectorTarget struct { // If present, this property indicates the referenced resource has been deleted, and provides @@ -56161,7 +58575,8 @@ type FlowLogCollectorTarget struct { // // If this instance has network attachments, this network interface is a // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. + // corresponding network attachment or the URL for this virtual server instance or the URL for this subnet or the URL + // for this VPC or the URL for this instance network attachment or the URL for this virtual network interface. Href *string `json:"href,omitempty"` // The unique identifier for this instance network interface. @@ -56169,31 +58584,28 @@ type FlowLogCollectorTarget struct { // If this instance has network attachments, this network interface is a // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. + // corresponding network attachment or the unique identifier for this virtual server instance or the unique identifier + // for this subnet or the unique identifier for this VPC or the unique identifier for this instance network attachment + // or the unique identifier for this virtual network interface. ID *string `json:"id,omitempty"` - // The name for this instance network interface. + // The name for this instance network interface or the name for this virtual server instance. The name is unique across + // all virtual server instances in the region or the name for this subnet. The name is unique across all subnets in the + // VPC or the name for this VPC. The name is unique across all VPCs in the region or the name for this instance network + // attachment. The name is unique across all network attachments for the instance or the name for this virtual network + // interface. The name is unique across all virtual network interfaces in the VPC. Name *string `json:"name,omitempty"` - // The resource type. + // The resource type or the resource type or the resource type or the resource type or the resource type. ResourceType *string `json:"resource_type,omitempty"` - // The CRN for this virtual server instance. + // The CRN for this virtual server instance or the CRN for this subnet or the CRN for this VPC or the CRN for this + // virtual network interface. CRN *string `json:"crn,omitempty"` - - // The primary IP address of the virtual network interface for the instance network - // attachment. - PrimaryIP *ReservedIPReference `json:"primary_ip,omitempty"` - - // The subnet of the virtual network interface for the instance network attachment. - Subnet *SubnetReference `json:"subnet,omitempty"` - - // The virtual network interface for this instance network attachment. - VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface,omitempty"` } // Constants associated with the FlowLogCollectorTarget.ResourceType property. -// The resource type. +// The resource type or the resource type or the resource type or the resource type or the resource type. const ( FlowLogCollectorTargetResourceTypeNetworkInterfaceConst = "network_interface" ) @@ -56239,21 +58651,6 @@ func UnmarshalFlowLogCollectorTarget(m map[string]json.RawMessage, result interf err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - err = core.SDKErrorf(err, "", "primary_ip-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - err = core.SDKErrorf(err, "", "subnet-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) - if err != nil { - err = core.SDKErrorf(err, "", "virtual_network_interface-error", common.GetComponentInfo()) - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -56264,8 +58661,11 @@ func UnmarshalFlowLogCollectorTarget(m map[string]json.RawMessage, result interf // virtual network interfaces or instance network interfaces within the target that are themselves the target of a more // specific flow log collector. // -// The target must not be a virtual network interface that is attached to a bare metal server network attachment or to a -// file share mount target. +// For this request to succeed, the target must: +// - not be a virtual network interface that is attached to a bare metal server network +// attachment or to a file share mount target +// - not already be the target of another flow log collector. +// // Models which "extend" this model: // - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity // - FlowLogCollectorTargetPrototypeInstanceIdentity @@ -56279,17 +58679,21 @@ type FlowLogCollectorTargetPrototype struct { // If this instance has network attachments, this network interface is a // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its // corresponding network attachment and its attached virtual network interface, and the identifier is that of the - // corresponding network attachment. + // corresponding network attachment or the unique identifier for this virtual server instance or the unique identifier + // for this subnet or the unique identifier for this VPC or the unique identifier for this virtual network interface or + // the unique identifier for this instance network attachment. ID *string `json:"id,omitempty"` // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - // corresponding network attachment. + // corresponding network attachment or the URL for this virtual server instance or the URL for this subnet or the URL + // for this VPC or the URL for this virtual network interface or the URL for this instance network attachment. Href *string `json:"href,omitempty"` - // The CRN for this virtual server instance. + // The CRN for this virtual server instance or the CRN for this subnet or the CRN for this VPC or the CRN for this + // virtual network interface. CRN *string `json:"crn,omitempty"` } @@ -57089,6 +59493,44 @@ func (options *GetEndpointGatewayOptions) SetHeaders(param map[string]string) *G return options } +// GetEndpointGatewayResourceBindingOptions : The GetEndpointGatewayResourceBinding options. +type GetEndpointGatewayResourceBindingOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // The resource binding identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetEndpointGatewayResourceBindingOptions : Instantiate GetEndpointGatewayResourceBindingOptions +func (*VpcV1) NewGetEndpointGatewayResourceBindingOptions(endpointGatewayID string, id string) *GetEndpointGatewayResourceBindingOptions { + return &GetEndpointGatewayResourceBindingOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *GetEndpointGatewayResourceBindingOptions) SetEndpointGatewayID(endpointGatewayID string) *GetEndpointGatewayResourceBindingOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetEndpointGatewayResourceBindingOptions) SetID(id string) *GetEndpointGatewayResourceBindingOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetEndpointGatewayResourceBindingOptions) SetHeaders(param map[string]string) *GetEndpointGatewayResourceBindingOptions { + options.Headers = param + return options +} + // GetFloatingIPOptions : The GetFloatingIP options. type GetFloatingIPOptions struct { // The floating IP identifier. @@ -59233,6 +61675,44 @@ func (options *GetVirtualNetworkInterfaceOptions) SetHeaders(param map[string]st return options } +// GetVolumeJobOptions : The GetVolumeJob options. +type GetVolumeJobOptions struct { + // The volume identifier. + VolumeID *string `json:"volume_id" validate:"required,ne="` + + // The volume job identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetVolumeJobOptions : Instantiate GetVolumeJobOptions +func (*VpcV1) NewGetVolumeJobOptions(volumeID string, id string) *GetVolumeJobOptions { + return &GetVolumeJobOptions{ + VolumeID: core.StringPtr(volumeID), + ID: core.StringPtr(id), + } +} + +// SetVolumeID : Allow user to set VolumeID +func (_options *GetVolumeJobOptions) SetVolumeID(volumeID string) *GetVolumeJobOptions { + _options.VolumeID = core.StringPtr(volumeID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetVolumeJobOptions) SetID(id string) *GetVolumeJobOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVolumeJobOptions) SetHeaders(param map[string]string) *GetVolumeJobOptions { + options.Headers = param + return options +} + // GetVolumeOptions : The GetVolume options. type GetVolumeOptions struct { // The volume identifier. @@ -59667,6 +62147,44 @@ func (options *GetVPNGatewayOptions) SetHeaders(param map[string]string) *GetVPN return options } +// GetVPNGatewayServiceConnectionOptions : The GetVPNGatewayServiceConnection options. +type GetVPNGatewayServiceConnectionOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway service connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetVPNGatewayServiceConnectionOptions : Instantiate GetVPNGatewayServiceConnectionOptions +func (*VpcV1) NewGetVPNGatewayServiceConnectionOptions(vpnGatewayID string, id string) *GetVPNGatewayServiceConnectionOptions { + return &GetVPNGatewayServiceConnectionOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *GetVPNGatewayServiceConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *GetVPNGatewayServiceConnectionOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetVPNGatewayServiceConnectionOptions) SetID(id string) *GetVPNGatewayServiceConnectionOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPNGatewayServiceConnectionOptions) SetHeaders(param map[string]string) *GetVPNGatewayServiceConnectionOptions { + options.Headers = param + return options +} + // GetVPNServerClientConfigurationOptions : The GetVPNServerClientConfiguration options. type GetVPNServerClientConfigurationOptions struct { // The VPN server identifier. @@ -59807,8 +62325,18 @@ type IkePolicy struct { // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + // + // If `multiple`, the policy supports more than one authentication algorithm. Use the `authentication_algorithms` + // property to retrieve all supported algorithms. + // Deprecated: this field is deprecated and may be removed in a future release. AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` + // The authentication algorithms to use for IKE Negotiation. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + AuthenticationAlgorithms []string `json:"authentication_algorithms" validate:"required"` + // The VPN gateway connections that use this IKE policy. Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` @@ -59818,16 +62346,36 @@ type IkePolicy struct { // The Diffie-Hellman group // // Groups `2` and `5` have been deprecated. + // + // If `65535`, the policy supports more than one Diffie-Hellman group. Use the `dh_groups` property to retrieve all + // supported Diffie-Hellman groups. + // Deprecated: this field is deprecated and may be removed in a future release. DhGroup *int64 `json:"dh_group" validate:"required"` + // The Diffie-Hellman groups to use for IKE negotiation. + // + // The order of the Diffie-Hellman groups in this array indicates their priority for negotiation, with each + // Diffie-Hellman group having priority over the one after it. + DhGroups []int64 `json:"dh_groups" validate:"required"` + // The encryption algorithm. // + // If `multiple`, the policy supports more than one encryption algorithm. Use the `encryption_algorithms` property to + // retrieve all supported algorithms. + // // The `triple_des` algorithm has been deprecated. // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + // Deprecated: this field is deprecated and may be removed in a future release. EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + // The encryption algorithms to use for IKE Negotiation. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + EncryptionAlgorithms []string `json:"encryption_algorithms" validate:"required"` + // The URL for this IKE policy. Href *string `json:"href" validate:"required"` @@ -59863,17 +62411,31 @@ type IkePolicy struct { // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +// +// If `multiple`, the policy supports more than one authentication algorithm. Use the `authentication_algorithms` +// property to retrieve all supported algorithms. const ( - IkePolicyAuthenticationAlgorithmMd5Const = "md5" - IkePolicyAuthenticationAlgorithmSha1Const = "sha1" - IkePolicyAuthenticationAlgorithmSha256Const = "sha256" - IkePolicyAuthenticationAlgorithmSha384Const = "sha384" - IkePolicyAuthenticationAlgorithmSha512Const = "sha512" + IkePolicyAuthenticationAlgorithmMd5Const = "md5" + IkePolicyAuthenticationAlgorithmMultipleConst = "multiple" + IkePolicyAuthenticationAlgorithmSha1Const = "sha1" + IkePolicyAuthenticationAlgorithmSha256Const = "sha256" + IkePolicyAuthenticationAlgorithmSha384Const = "sha384" + IkePolicyAuthenticationAlgorithmSha512Const = "sha512" +) + +// Constants associated with the IkePolicy.AuthenticationAlgorithms property. +const ( + IkePolicyAuthenticationAlgorithmsSha256Const = "sha256" + IkePolicyAuthenticationAlgorithmsSha384Const = "sha384" + IkePolicyAuthenticationAlgorithmsSha512Const = "sha512" ) // Constants associated with the IkePolicy.EncryptionAlgorithm property. // The encryption algorithm. // +// If `multiple`, the policy supports more than one encryption algorithm. Use the `encryption_algorithms` property to +// retrieve all supported algorithms. +// // The `triple_des` algorithm has been deprecated. // // The enumerated values for this property may @@ -59882,9 +62444,17 @@ const ( IkePolicyEncryptionAlgorithmAes128Const = "aes128" IkePolicyEncryptionAlgorithmAes192Const = "aes192" IkePolicyEncryptionAlgorithmAes256Const = "aes256" + IkePolicyEncryptionAlgorithmMultipleConst = "multiple" IkePolicyEncryptionAlgorithmTripleDesConst = "triple_des" ) +// Constants associated with the IkePolicy.EncryptionAlgorithms property. +const ( + IkePolicyEncryptionAlgorithmsAes128Const = "aes128" + IkePolicyEncryptionAlgorithmsAes192Const = "aes192" + IkePolicyEncryptionAlgorithmsAes256Const = "aes256" +) + // Constants associated with the IkePolicy.NegotiationMode property. // The IKE negotiation mode. // @@ -59908,6 +62478,11 @@ func UnmarshalIkePolicy(m map[string]json.RawMessage, result interface{}) (err e err = core.SDKErrorf(err, "", "authentication_algorithm-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "authentication_algorithms", &obj.AuthenticationAlgorithms) + if err != nil { + err = core.SDKErrorf(err, "", "authentication_algorithms-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) if err != nil { err = core.SDKErrorf(err, "", "connections-error", common.GetComponentInfo()) @@ -59923,11 +62498,21 @@ func UnmarshalIkePolicy(m map[string]json.RawMessage, result interface{}) (err e err = core.SDKErrorf(err, "", "dh_group-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "dh_groups", &obj.DhGroups) + if err != nil { + err = core.SDKErrorf(err, "", "dh_groups-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) if err != nil { err = core.SDKErrorf(err, "", "encryption_algorithm-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "encryption_algorithms", &obj.EncryptionAlgorithms) + if err != nil { + err = core.SDKErrorf(err, "", "encryption_algorithms-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) @@ -60107,14 +62692,74 @@ func (resp *IkePolicyConnectionCollection) GetNextStart() (*string, error) { // IkePolicyPatch : IkePolicyPatch struct type IkePolicyPatch struct { // The authentication algorithm. + // + // `authentication_algorithm` has been deprecated. Use `authentication_algorithms` instead. + // + // If specified, `authentication_algorithms` must not be specified. + // + // Updating this property will also update the + // `authentication_algorithms` field accordingly. + // Deprecated: this field is deprecated and may be removed in a future release. AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` + // The authentication algorithms to use for IKE Negotiation. + // + // If specified, `authentication_algorithm` must not be specified. + // + // If the IKE policy's `ike_version` is `1`, this array must contain exactly one algorithm. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + // + // Updating this property will also update the + // `authentication_algorithm` field accordingly. + AuthenticationAlgorithms []string `json:"authentication_algorithms,omitempty"` + // The Diffie-Hellman group. + // + // `dh_group` has been deprecated. Use `dh_groups` instead. + // + // If specified, `dh_groups` must not be specified. + // + // Updating this property will also update the `dh_groups` field accordingly. + // Deprecated: this field is deprecated and may be removed in a future release. DhGroup *int64 `json:"dh_group,omitempty"` + // The Diffie-Hellman groups to use for IKE Negotiation. + // + // If specified, `dh_group` must not be specified. + // + // If the IKE policy's `ike_version` is `1`, this array must contain exactly one algorithm. + // + // The order of the Diffie-Hellman groups in this array indicates their priority for negotiation, with each + // Diffie-Hellman group having priority over the one after it. + // + // Updating this property will also update the `dh_group` field accordingly. + DhGroups []int64 `json:"dh_groups,omitempty"` + // The encryption algorithm. + // + // `encryption_algorithm` has been deprecated. Use `encryption_algorithms` instead. + // + // If specified, `encryption_algorithms` must not be specified. + // + // Updating this property will also update the + // `encryption_algorithms` field accordingly. + // Deprecated: this field is deprecated and may be removed in a future release. EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` + // The encryption algorithms to use for IKE negotiation. + // + // If specified, `encryption_algorithm` must not be specified. + // + // If the IKE policy's `ike_version` is `1`, this array must contain exactly one algorithm. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + // + // Updating this property will also update the `encryption_algorithm` field accordingly. + EncryptionAlgorithms []string `json:"encryption_algorithms,omitempty"` + // The IKE protocol version. IkeVersion *int64 `json:"ike_version,omitempty"` @@ -60127,20 +62772,48 @@ type IkePolicyPatch struct { // Constants associated with the IkePolicyPatch.AuthenticationAlgorithm property. // The authentication algorithm. +// +// `authentication_algorithm` has been deprecated. Use `authentication_algorithms` instead. +// +// If specified, `authentication_algorithms` must not be specified. +// +// Updating this property will also update the +// `authentication_algorithms` field accordingly. const ( IkePolicyPatchAuthenticationAlgorithmSha256Const = "sha256" IkePolicyPatchAuthenticationAlgorithmSha384Const = "sha384" IkePolicyPatchAuthenticationAlgorithmSha512Const = "sha512" ) +// Constants associated with the IkePolicyPatch.AuthenticationAlgorithms property. +const ( + IkePolicyPatchAuthenticationAlgorithmsSha256Const = "sha256" + IkePolicyPatchAuthenticationAlgorithmsSha384Const = "sha384" + IkePolicyPatchAuthenticationAlgorithmsSha512Const = "sha512" +) + // Constants associated with the IkePolicyPatch.EncryptionAlgorithm property. // The encryption algorithm. +// +// `encryption_algorithm` has been deprecated. Use `encryption_algorithms` instead. +// +// If specified, `encryption_algorithms` must not be specified. +// +// Updating this property will also update the +// `encryption_algorithms` field accordingly. const ( IkePolicyPatchEncryptionAlgorithmAes128Const = "aes128" IkePolicyPatchEncryptionAlgorithmAes192Const = "aes192" IkePolicyPatchEncryptionAlgorithmAes256Const = "aes256" ) +// Constants associated with the IkePolicyPatch.EncryptionAlgorithms property. +const ( + IkePolicyPatchEncryptionAlgorithmsAes128Const = "aes128" + IkePolicyPatchEncryptionAlgorithmsAes192Const = "aes192" + IkePolicyPatchEncryptionAlgorithmsAes256Const = "aes256" +) + // 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) @@ -60149,16 +62822,31 @@ func UnmarshalIkePolicyPatch(m map[string]json.RawMessage, result interface{}) ( err = core.SDKErrorf(err, "", "authentication_algorithm-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "authentication_algorithms", &obj.AuthenticationAlgorithms) + if err != nil { + err = core.SDKErrorf(err, "", "authentication_algorithms-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "dh_group", &obj.DhGroup) if err != nil { err = core.SDKErrorf(err, "", "dh_group-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "dh_groups", &obj.DhGroups) + if err != nil { + err = core.SDKErrorf(err, "", "dh_groups-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) if err != nil { err = core.SDKErrorf(err, "", "encryption_algorithm-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "encryption_algorithms", &obj.EncryptionAlgorithms) + if err != nil { + err = core.SDKErrorf(err, "", "encryption_algorithms-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "ike_version", &obj.IkeVersion) if err != nil { err = core.SDKErrorf(err, "", "ike_version-error", common.GetComponentInfo()) @@ -60184,12 +62872,21 @@ func (ikePolicyPatch *IkePolicyPatch) AsPatch() (_patch map[string]interface{}, if !core.IsNil(ikePolicyPatch.AuthenticationAlgorithm) { _patch["authentication_algorithm"] = ikePolicyPatch.AuthenticationAlgorithm } + if !core.IsNil(ikePolicyPatch.AuthenticationAlgorithms) { + _patch["authentication_algorithms"] = ikePolicyPatch.AuthenticationAlgorithms + } if !core.IsNil(ikePolicyPatch.DhGroup) { _patch["dh_group"] = ikePolicyPatch.DhGroup } + if !core.IsNil(ikePolicyPatch.DhGroups) { + _patch["dh_groups"] = ikePolicyPatch.DhGroups + } if !core.IsNil(ikePolicyPatch.EncryptionAlgorithm) { _patch["encryption_algorithm"] = ikePolicyPatch.EncryptionAlgorithm } + if !core.IsNil(ikePolicyPatch.EncryptionAlgorithms) { + _patch["encryption_algorithms"] = ikePolicyPatch.EncryptionAlgorithms + } if !core.IsNil(ikePolicyPatch.IkeVersion) { _patch["ike_version"] = ikePolicyPatch.IkeVersion } @@ -60305,14 +63002,24 @@ func (ip *IP) asPatch() (_patch map[string]interface{}) { // IPsecPolicy : IPsecPolicy struct type IPsecPolicy struct { - // The authentication algorithm + // The authentication algorithms. + // + // If `multiple`, the policy supports more than one authentication algorithm. Use the `authentication_algorithms` + // property to retrieve all supported algorithms. // // The `md5` and `sha1` algorithms have been deprecated // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + // Deprecated: this field is deprecated and may be removed in a future release. AuthenticationAlgorithm *string `json:"authentication_algorithm" validate:"required"` + // The authentication algorithms to use for IPsec Negotiation. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + AuthenticationAlgorithms []string `json:"authentication_algorithms" validate:"required"` + // The VPN gateway connections that use this IPsec policy. Connections []VPNGatewayConnectionReference `json:"connections" validate:"required"` @@ -60325,14 +63032,24 @@ type IPsecPolicy struct { // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. EncapsulationMode *string `json:"encapsulation_mode" validate:"required"` - // The encryption algorithm + // The encryption algorithm. + // + // If `multiple`, the policy supports more than one encryption algorithm. Use the `encryption_algorithms` property to + // retrieve all supported algorithms. // // The `triple_des` algorithm has been deprecated // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + // Deprecated: this field is deprecated and may be removed in a future release. EncryptionAlgorithm *string `json:"encryption_algorithm" validate:"required"` + // The encryption algorithms to use for IKE Negotiation. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + EncryptionAlgorithms []string `json:"encryption_algorithms" validate:"required"` + // The URL for this IPsec policy. Href *string `json:"href" validate:"required"` @@ -60345,14 +63062,24 @@ type IPsecPolicy struct { // The name for this IPsec policy. The name is unique across all IPsec policies in the region. Name *string `json:"name" validate:"required"` - // The Perfect Forward Secrecy group + // The Perfect Forward Secrecy group. + // + // If `multiple`, the policy supports more than one PFS group. Use the `pfs_groups` property to retrieve all supported + // PFS groups. // // Groups `group_2` and `group_5` have been deprecated // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + // Deprecated: this field is deprecated and may be removed in a future release. Pfs *string `json:"pfs" validate:"required"` + // The Perfect Forward Secrecy groups to use for IPsec negotiation. + // + // The order of the Perfect Forward Secrecy groups in this array indicates their priority for negotiation, with each + // Perfect Forward Secrecy group having priority over the one after it. + PfsGroups []string `json:"pfs_groups" validate:"required"` + // The resource group for this IPsec policy. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -60367,7 +63094,10 @@ type IPsecPolicy struct { } // Constants associated with the IPsecPolicy.AuthenticationAlgorithm property. -// The authentication algorithm +// The authentication algorithms. +// +// If `multiple`, the policy supports more than one authentication algorithm. Use the `authentication_algorithms` +// property to retrieve all supported algorithms. // // # The `md5` and `sha1` algorithms have been deprecated // @@ -60375,13 +63105,20 @@ type IPsecPolicy struct { // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. const ( IPsecPolicyAuthenticationAlgorithmDisabledConst = "disabled" - IPsecPolicyAuthenticationAlgorithmMd5Const = "md5" - IPsecPolicyAuthenticationAlgorithmSha1Const = "sha1" + IPsecPolicyAuthenticationAlgorithmMultipleConst = "multiple" IPsecPolicyAuthenticationAlgorithmSha256Const = "sha256" IPsecPolicyAuthenticationAlgorithmSha384Const = "sha384" IPsecPolicyAuthenticationAlgorithmSha512Const = "sha512" ) +// Constants associated with the IPsecPolicy.AuthenticationAlgorithms property. +const ( + IPsecPolicyAuthenticationAlgorithmsDisabledConst = "disabled" + IPsecPolicyAuthenticationAlgorithmsSha256Const = "sha256" + IPsecPolicyAuthenticationAlgorithmsSha384Const = "sha384" + IPsecPolicyAuthenticationAlgorithmsSha512Const = "sha512" +) + // Constants associated with the IPsecPolicy.EncapsulationMode property. // The encapsulation mode used. // @@ -60392,7 +63129,10 @@ const ( ) // Constants associated with the IPsecPolicy.EncryptionAlgorithm property. -// The encryption algorithm +// The encryption algorithm. +// +// If `multiple`, the policy supports more than one encryption algorithm. Use the `encryption_algorithms` property to +// retrieve all supported algorithms. // // The `triple_des` algorithm has been deprecated // @@ -60405,11 +63145,25 @@ const ( IPsecPolicyEncryptionAlgorithmAes192gcm16Const = "aes192gcm16" IPsecPolicyEncryptionAlgorithmAes256Const = "aes256" IPsecPolicyEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" + IPsecPolicyEncryptionAlgorithmMultipleConst = "multiple" IPsecPolicyEncryptionAlgorithmTripleDesConst = "triple_des" ) +// Constants associated with the IPsecPolicy.EncryptionAlgorithms property. +const ( + IPsecPolicyEncryptionAlgorithmsAes128Const = "aes128" + IPsecPolicyEncryptionAlgorithmsAes128gcm16Const = "aes128gcm16" + IPsecPolicyEncryptionAlgorithmsAes192Const = "aes192" + IPsecPolicyEncryptionAlgorithmsAes192gcm16Const = "aes192gcm16" + IPsecPolicyEncryptionAlgorithmsAes256Const = "aes256" + IPsecPolicyEncryptionAlgorithmsAes256gcm16Const = "aes256gcm16" +) + // Constants associated with the IPsecPolicy.Pfs property. -// The Perfect Forward Secrecy group +// The Perfect Forward Secrecy group. +// +// If `multiple`, the policy supports more than one PFS group. Use the `pfs_groups` property to retrieve all supported +// PFS groups. // // Groups `group_2` and `group_5` have been deprecated // @@ -60431,6 +63185,24 @@ const ( IPsecPolicyPfsGroup24Const = "group_24" IPsecPolicyPfsGroup31Const = "group_31" IPsecPolicyPfsGroup5Const = "group_5" + IPsecPolicyPfsMultipleConst = "multiple" +) + +// Constants associated with the IPsecPolicy.PfsGroups property. +const ( + IPsecPolicyPfsGroupsDisabledConst = "disabled" + IPsecPolicyPfsGroupsGroup14Const = "group_14" + IPsecPolicyPfsGroupsGroup15Const = "group_15" + IPsecPolicyPfsGroupsGroup16Const = "group_16" + IPsecPolicyPfsGroupsGroup17Const = "group_17" + IPsecPolicyPfsGroupsGroup18Const = "group_18" + IPsecPolicyPfsGroupsGroup19Const = "group_19" + IPsecPolicyPfsGroupsGroup20Const = "group_20" + IPsecPolicyPfsGroupsGroup21Const = "group_21" + IPsecPolicyPfsGroupsGroup22Const = "group_22" + IPsecPolicyPfsGroupsGroup23Const = "group_23" + IPsecPolicyPfsGroupsGroup24Const = "group_24" + IPsecPolicyPfsGroupsGroup31Const = "group_31" ) // Constants associated with the IPsecPolicy.ResourceType property. @@ -60456,6 +63228,11 @@ func UnmarshalIPsecPolicy(m map[string]json.RawMessage, result interface{}) (err err = core.SDKErrorf(err, "", "authentication_algorithm-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "authentication_algorithms", &obj.AuthenticationAlgorithms) + if err != nil { + err = core.SDKErrorf(err, "", "authentication_algorithms-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) if err != nil { err = core.SDKErrorf(err, "", "connections-error", common.GetComponentInfo()) @@ -60476,6 +63253,11 @@ func UnmarshalIPsecPolicy(m map[string]json.RawMessage, result interface{}) (err err = core.SDKErrorf(err, "", "encryption_algorithm-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "encryption_algorithms", &obj.EncryptionAlgorithms) + if err != nil { + err = core.SDKErrorf(err, "", "encryption_algorithms-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) @@ -60501,6 +63283,11 @@ func UnmarshalIPsecPolicy(m map[string]json.RawMessage, result interface{}) (err err = core.SDKErrorf(err, "", "pfs-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "pfs_groups", &obj.PfsGroups) + if err != nil { + err = core.SDKErrorf(err, "", "pfs_groups-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) @@ -60654,41 +63441,115 @@ func (resp *IPsecPolicyConnectionCollection) GetNextStart() (*string, error) { // IPsecPolicyPatch : IPsecPolicyPatch struct type IPsecPolicyPatch struct { - // The authentication algorithm + // The authentication algorithm. + // + // `authentication_algorithm` has been deprecated. Use `authentication_algorithms` instead. + // + // If specified, `authentication_algorithms` must not be specified. // // Must be `disabled` if and only if the `encryption_algorithm` is `aes128gcm16`, // `aes192gcm16`, or `aes256gcm16` // // The `md5` and `sha1` algorithms have been deprecated. + // + // Updating this property will also update the + // `authentication_algorithms` field accordingly. + // Deprecated: this field is deprecated and may be removed in a future release. AuthenticationAlgorithm *string `json:"authentication_algorithm,omitempty"` - // The encryption algorithm + // The authentication algorithms to use for IPsec negotiation. + // + // If specified, `authentication_algorithm` must not be specified. + // + // Must be `["disabled"]` when `encryption_algorithms` has only combined-mode algorithms + // (`aes128gcm16`, `aes192gcm16`, and `aes256gcm16`). + // + // The `md5` and `sha1` algorithms have been deprecated. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + // + // Updating this property will also update the + // `authentication_algorithm` field accordingly. + AuthenticationAlgorithms []string `json:"authentication_algorithms,omitempty"` + + // The encryption algorithm. + // + // `encryption_algorithm` has been deprecated. Use `encryption_algorithms` instead. + // + // If specified, `encryption_algorithms` must not be specified. // // The `authentication_algorithm` must be `disabled` if and only if // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or `aes256gcm16` // // The `triple_des` algorithm has been deprecated. + // + // Updating this property will also update the + // `encryption_algorithms` field accordingly. + // Deprecated: this field is deprecated and may be removed in a future release. EncryptionAlgorithm *string `json:"encryption_algorithm,omitempty"` + // The encryption algorithms to use for IPsec negotiation. + // + // If specified, `encryption_algorithm` must not be specified. + // + // If only combined-mode encryption algorithms (`aes128gcm16`, `aes192gcm16`, and + // `aes256gcm16`) are to be used, then `authentication_algorithms` must be `["disabled"]`. + // + // The `triple_des` algorithm has been deprecated. + // + // The order of the algorithms in this array indicates their priority for negotiation, with each algorithm having + // priority over the one after it. + // + // Updating this property will also update the `encryption_algorithm` field accordingly. + EncryptionAlgorithms []string `json:"encryption_algorithms,omitempty"` + // The key lifetime in seconds. KeyLifetime *int64 `json:"key_lifetime,omitempty"` - // The name for this IPsec policy. The name must not be used by another IPsec policy in the region. + // The name for this IPsec policy. The name is unique across all IPsec policies in the region. Name *string `json:"name,omitempty"` // The Perfect Forward Secrecy group. // + // `pfs` has been deprecated. Use `pfs_groups` instead. + // + // If specified, `pfs_groups` must not be specified. + // // Groups `group_2` and `group_5` have been deprecated. + // + // Updating this property will also update the + // `pfs_groups` field accordingly. + // Deprecated: this field is deprecated and may be removed in a future release. Pfs *string `json:"pfs,omitempty"` + + // The Perfect Forward Secrecy groups to use for IPsec negotiation. + // + // If specified, `pfs_groups` must not be specified. + // + // Groups `group_2` and `group_5` have been deprecated. + // + // The order of the Perfect Forward Secrecy groups in this array indicates their priority for negotiation, with each + // Perfect Forward Secrecy group having priority over the one after it. + // + // Updating this property will also update the `pfs` field accordingly. + PfsGroups []string `json:"pfs_groups,omitempty"` } // Constants associated with the IPsecPolicyPatch.AuthenticationAlgorithm property. -// The authentication algorithm +// The authentication algorithm. +// +// `authentication_algorithm` has been deprecated. Use `authentication_algorithms` instead. +// +// If specified, `authentication_algorithms` must not be specified. // // Must be `disabled` if and only if the `encryption_algorithm` is `aes128gcm16`, // `aes192gcm16`, or `aes256gcm16` // // The `md5` and `sha1` algorithms have been deprecated. +// +// Updating this property will also update the +// `authentication_algorithms` field accordingly. const ( IPsecPolicyPatchAuthenticationAlgorithmDisabledConst = "disabled" IPsecPolicyPatchAuthenticationAlgorithmSha256Const = "sha256" @@ -60696,13 +63557,28 @@ const ( IPsecPolicyPatchAuthenticationAlgorithmSha512Const = "sha512" ) +// Constants associated with the IPsecPolicyPatch.AuthenticationAlgorithms property. +const ( + IPsecPolicyPatchAuthenticationAlgorithmsDisabledConst = "disabled" + IPsecPolicyPatchAuthenticationAlgorithmsSha256Const = "sha256" + IPsecPolicyPatchAuthenticationAlgorithmsSha384Const = "sha384" + IPsecPolicyPatchAuthenticationAlgorithmsSha512Const = "sha512" +) + // Constants associated with the IPsecPolicyPatch.EncryptionAlgorithm property. -// The encryption algorithm +// The encryption algorithm. +// +// `encryption_algorithm` has been deprecated. Use `encryption_algorithms` instead. +// +// If specified, `encryption_algorithms` must not be specified. // // The `authentication_algorithm` must be `disabled` if and only if // `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or `aes256gcm16` // // The `triple_des` algorithm has been deprecated. +// +// Updating this property will also update the +// `encryption_algorithms` field accordingly. const ( IPsecPolicyPatchEncryptionAlgorithmAes128Const = "aes128" IPsecPolicyPatchEncryptionAlgorithmAes128gcm16Const = "aes128gcm16" @@ -60712,10 +63588,27 @@ const ( IPsecPolicyPatchEncryptionAlgorithmAes256gcm16Const = "aes256gcm16" ) +// Constants associated with the IPsecPolicyPatch.EncryptionAlgorithms property. +const ( + IPsecPolicyPatchEncryptionAlgorithmsAes128Const = "aes128" + IPsecPolicyPatchEncryptionAlgorithmsAes128gcm16Const = "aes128gcm16" + IPsecPolicyPatchEncryptionAlgorithmsAes192Const = "aes192" + IPsecPolicyPatchEncryptionAlgorithmsAes192gcm16Const = "aes192gcm16" + IPsecPolicyPatchEncryptionAlgorithmsAes256Const = "aes256" + IPsecPolicyPatchEncryptionAlgorithmsAes256gcm16Const = "aes256gcm16" +) + // Constants associated with the IPsecPolicyPatch.Pfs property. // The Perfect Forward Secrecy group. // +// `pfs` has been deprecated. Use `pfs_groups` instead. +// +// If specified, `pfs_groups` must not be specified. +// // Groups `group_2` and `group_5` have been deprecated. +// +// Updating this property will also update the +// `pfs_groups` field accordingly. const ( IPsecPolicyPatchPfsDisabledConst = "disabled" IPsecPolicyPatchPfsGroup14Const = "group_14" @@ -60732,6 +63625,23 @@ const ( IPsecPolicyPatchPfsGroup31Const = "group_31" ) +// Constants associated with the IPsecPolicyPatch.PfsGroups property. +const ( + IPsecPolicyPatchPfsGroupsDisabledConst = "disabled" + IPsecPolicyPatchPfsGroupsGroup14Const = "group_14" + IPsecPolicyPatchPfsGroupsGroup15Const = "group_15" + IPsecPolicyPatchPfsGroupsGroup16Const = "group_16" + IPsecPolicyPatchPfsGroupsGroup17Const = "group_17" + IPsecPolicyPatchPfsGroupsGroup18Const = "group_18" + IPsecPolicyPatchPfsGroupsGroup19Const = "group_19" + IPsecPolicyPatchPfsGroupsGroup20Const = "group_20" + IPsecPolicyPatchPfsGroupsGroup21Const = "group_21" + IPsecPolicyPatchPfsGroupsGroup22Const = "group_22" + IPsecPolicyPatchPfsGroupsGroup23Const = "group_23" + IPsecPolicyPatchPfsGroupsGroup24Const = "group_24" + IPsecPolicyPatchPfsGroupsGroup31Const = "group_31" +) + // 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) @@ -60740,11 +63650,21 @@ func UnmarshalIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) err = core.SDKErrorf(err, "", "authentication_algorithm-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "authentication_algorithms", &obj.AuthenticationAlgorithms) + if err != nil { + err = core.SDKErrorf(err, "", "authentication_algorithms-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "encryption_algorithm", &obj.EncryptionAlgorithm) if err != nil { err = core.SDKErrorf(err, "", "encryption_algorithm-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "encryption_algorithms", &obj.EncryptionAlgorithms) + if err != nil { + err = core.SDKErrorf(err, "", "encryption_algorithms-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "key_lifetime", &obj.KeyLifetime) if err != nil { err = core.SDKErrorf(err, "", "key_lifetime-error", common.GetComponentInfo()) @@ -60760,6 +63680,11 @@ func UnmarshalIPsecPolicyPatch(m map[string]json.RawMessage, result interface{}) err = core.SDKErrorf(err, "", "pfs-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "pfs_groups", &obj.PfsGroups) + if err != nil { + err = core.SDKErrorf(err, "", "pfs_groups-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -60770,9 +63695,15 @@ func (iPsecPolicyPatch *IPsecPolicyPatch) AsPatch() (_patch map[string]interface if !core.IsNil(iPsecPolicyPatch.AuthenticationAlgorithm) { _patch["authentication_algorithm"] = iPsecPolicyPatch.AuthenticationAlgorithm } + if !core.IsNil(iPsecPolicyPatch.AuthenticationAlgorithms) { + _patch["authentication_algorithms"] = iPsecPolicyPatch.AuthenticationAlgorithms + } if !core.IsNil(iPsecPolicyPatch.EncryptionAlgorithm) { _patch["encryption_algorithm"] = iPsecPolicyPatch.EncryptionAlgorithm } + if !core.IsNil(iPsecPolicyPatch.EncryptionAlgorithms) { + _patch["encryption_algorithms"] = iPsecPolicyPatch.EncryptionAlgorithms + } if !core.IsNil(iPsecPolicyPatch.KeyLifetime) { _patch["key_lifetime"] = iPsecPolicyPatch.KeyLifetime } @@ -60782,6 +63713,9 @@ func (iPsecPolicyPatch *IPsecPolicyPatch) AsPatch() (_patch map[string]interface if !core.IsNil(iPsecPolicyPatch.Pfs) { _patch["pfs"] = iPsecPolicyPatch.Pfs } + if !core.IsNil(iPsecPolicyPatch.PfsGroups) { + _patch["pfs_groups"] = iPsecPolicyPatch.PfsGroups + } return } @@ -60912,17 +63846,19 @@ type Image struct { SourceVolume *VolumeReference `json:"source_volume,omitempty"` // The status of this image: - // - available: image can be used to create resources - // - deleting: image is being deleted, and can no longer be used to create + // - `available`: image can be used to create resources + // - `deleting`: image is being deleted, and can no longer be used to create // resources - // - deprecated: image is slated to be deleted, but can still be used to create + // - `deprecated`: image is slated to be deleted, but can still be used to create // resources - // - failed: image was not created successfully, and cannot be used to create + // - `failed`: image was not created successfully, and cannot be used to create // resources - // - obsolete: image is slated to be deleted, and can no longer be used to create + // - `obsolete`: image is slated to be deleted, and can no longer be used to create // resources - // - pending: image is being imported, and cannot yet be used to create resources - // - unusable: image cannot be used (see `status_reasons[]` for possible remediation) + // - `partially_available`: image can be used to create resources in the + // zones listed in the `zones` property. + // - `pending`: image is being imported, and cannot yet be used to create resources + // - `unusable`: image cannot be used (see `status_reasons[]` for possible remediation) // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. @@ -60944,6 +63880,15 @@ type Image struct { // - `private`: Visible only to this account // - `public`: Visible to all accounts. Visibility *string `json:"visibility" validate:"required"` + + // The zones in which this image is available for use. + // + // If the image has a status of `available` or `deprecated`, this will include all zones in the region. + // + // If the image has a status of `partially_available`, this will include one or more zones in the region. + // + // If the image has a status of `failed`, `obsolete`, `pending`, `unusable`, or `deleting`, this will be empty. + Zones []ZoneReference `json:"zones" validate:"required"` } // Constants associated with the Image.Encryption property. @@ -60961,28 +63906,31 @@ const ( // Constants associated with the Image.Status property. // The status of this image: -// - available: image can be used to create resources -// - deleting: image is being deleted, and can no longer be used to create +// - `available`: image can be used to create resources +// - `deleting`: image is being deleted, and can no longer be used to create // resources -// - deprecated: image is slated to be deleted, but can still be used to create +// - `deprecated`: image is slated to be deleted, but can still be used to create // resources -// - failed: image was not created successfully, and cannot be used to create +// - `failed`: image was not created successfully, and cannot be used to create // resources -// - obsolete: image is slated to be deleted, and can no longer be used to create +// - `obsolete`: image is slated to be deleted, and can no longer be used to create // resources -// - pending: image is being imported, and cannot yet be used to create resources -// - unusable: image cannot be used (see `status_reasons[]` for possible remediation) +// - `partially_available`: image can be used to create resources in the +// zones listed in the `zones` property. +// - `pending`: image is being imported, and cannot yet be used to create resources +// - `unusable`: image cannot be used (see `status_reasons[]` for possible remediation) // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. const ( - ImageStatusAvailableConst = "available" - ImageStatusDeletingConst = "deleting" - ImageStatusDeprecatedConst = "deprecated" - ImageStatusFailedConst = "failed" - ImageStatusObsoleteConst = "obsolete" - ImageStatusPendingConst = "pending" - ImageStatusUnusableConst = "unusable" + ImageStatusAvailableConst = "available" + ImageStatusDeletingConst = "deleting" + ImageStatusDeprecatedConst = "deprecated" + ImageStatusFailedConst = "failed" + ImageStatusObsoleteConst = "obsolete" + ImageStatusPartiallyAvailableConst = "partially_available" + ImageStatusPendingConst = "pending" + ImageStatusUnusableConst = "unusable" ) // Constants associated with the Image.UserDataFormat property. @@ -61121,6 +64069,11 @@ func UnmarshalImage(m map[string]json.RawMessage, result interface{}) (err error err = core.SDKErrorf(err, "", "visibility-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneReference) + if err != nil { + err = core.SDKErrorf(err, "", "zones-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -61135,7 +64088,7 @@ type ImageAllowedUse struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variables are supported, // corresponding to `BareMetalServer` properties: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + // - `enable_secure_boot` (boolean): Whether secure boot is enabled. BareMetalServer *string `json:"bare_metal_server" validate:"required"` // The expression that must be satisfied by the properties of a virtual server instance provisioned using this image. @@ -61143,7 +64096,7 @@ type ImageAllowedUse struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variables are supported, // corresponding to `Instance` properties: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + // - `enable_secure_boot` (boolean): Whether secure boot is enabled // - `gpu.count` (integer): The number of GPUs // - `gpu.manufacturer` (string): The GPU manufacturer // - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) @@ -61185,7 +64138,7 @@ type ImageAllowedUsePatch struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variable is supported, corresponding // to the `BareMetalServer` property: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + // - `enable_secure_boot` (boolean): Whether secure boot is enabled. BareMetalServer *string `json:"bare_metal_server,omitempty"` // The expression that must be satisfied by the properties of a virtual server instance provisioned using this image. @@ -61193,7 +64146,7 @@ type ImageAllowedUsePatch struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variables are supported, // corresponding to `Instance` properties: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + // - `enable_secure_boot` (boolean): Whether secure boot is enabled // - `gpu.count` (integer): The number of GPUs // - `gpu.manufacturer` (string): The GPU manufacturer // - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) @@ -61254,7 +64207,7 @@ type ImageAllowedUsePrototype struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variable is supported, corresponding // to the `BareMetalServer` property: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + // - `enable_secure_boot` (boolean): Whether secure boot is enabled. BareMetalServer *string `json:"bare_metal_server,omitempty"` // The expression that must be satisfied by the properties of a virtual server instance provisioned using this image. @@ -61264,7 +64217,7 @@ type ImageAllowedUsePrototype struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variables are supported, // corresponding to `Instance` properties: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + // - `enable_secure_boot` (boolean): Whether secure boot is enabled // - `gpu.count` (integer): The number of GPUs // - `gpu.manufacturer` (string): The GPU manufacturer // - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) @@ -61469,10 +64422,11 @@ type ImageExportJob struct { CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // A base64-encoded, encrypted representation of the key that was used to encrypt the data for the exported image. This - // key can be unwrapped with the image's `encryption_key` root key using either Key Protect or Hyper Protect Crypto - // Services. + // key can be unwrapped with the image's `encryption_key` root key using Key Protect. // // If absent, the export job is for an unencrypted image. + // + // The use of Hyper Protect Crypto Services for image encryption keys has been deprecated. EncryptedDataKey *[]byte `json:"encrypted_data_key,omitempty"` // The format of the exported image. @@ -62062,10 +65016,11 @@ type ImagePrototype struct { // 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 Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). + // specified), using [Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys). // // If unspecified, the imported image is treated as unencrypted. + // + // The use of Hyper Protect Crypto Services for image encryption keys has been deprecated. EncryptedDataKey *string `json:"encrypted_data_key,omitempty"` // The root key that was used to wrap the data key (which is ultimately represented as @@ -62357,6 +65312,8 @@ func UnmarshalImageStatusReason(m map[string]json.RawMessage, result interface{} // Instance : Instance struct type Instance struct { + Availability *InstanceAvailability `json:"availability" validate:"required"` + // The availability policy for this virtual server instance. AvailabilityPolicy *InstanceAvailabilityPolicy `json:"availability_policy" validate:"required"` @@ -62421,6 +65378,9 @@ type Instance struct { // The image the virtual server instance was provisioned from. Image *ImageReference `json:"image,omitempty"` + // The instance group membership for this virtual server instance. + InstanceGroupMembership *InstanceGroupMembershipReferenceInstanceContext `json:"instance_group_membership,omitempty"` + // The reasons for the current `lifecycle_state` (if any). LifecycleReasons []InstanceLifecycleReason `json:"lifecycle_reasons" validate:"required"` @@ -62512,6 +65472,9 @@ type Instance struct { // The volume attachments for this virtual server instance, including the boot volume attachment. VolumeAttachments []VolumeAttachmentReferenceInstanceContext `json:"volume_attachments" validate:"required"` + // The volume bandwidth QoS mode for this virtual server instance. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode" validate:"required"` + // The VPC this virtual server instance resides in. VPC *VPCReference `json:"vpc" validate:"required"` @@ -62576,9 +65539,21 @@ const ( InstanceStatusStoppingConst = "stopping" ) +// Constants associated with the Instance.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode for this virtual server instance. +const ( + InstanceVolumeBandwidthQosModePooledConst = "pooled" + InstanceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // 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", &obj.Availability, UnmarshalInstanceAvailability) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicy) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -62669,6 +65644,11 @@ func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err er err = core.SDKErrorf(err, "", "image-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "instance_group_membership", &obj.InstanceGroupMembership, UnmarshalInstanceGroupMembershipReferenceInstanceContext) + if err != nil { + err = core.SDKErrorf(err, "", "instance_group_membership-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalInstanceLifecycleReason) if err != nil { err = core.SDKErrorf(err, "", "lifecycle_reasons-error", common.GetComponentInfo()) @@ -62784,6 +65764,11 @@ func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err er err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -62894,6 +65879,98 @@ func UnmarshalInstanceAction(m map[string]json.RawMessage, result interface{}) ( return } +// InstanceAvailability : InstanceAvailability struct +type InstanceAvailability struct { + // The availability class for the virtual server instance: + // - `spot`: The virtual server instance may be preempted. + // - `standard`: The virtual server instance will not be preempted. + // + // See [virtual server instance availability + // class](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers) for details. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Class *string `json:"class" validate:"required"` +} + +// Constants associated with the InstanceAvailability.Class property. +// The availability class for the virtual server instance: +// - `spot`: The virtual server instance may be preempted. +// - `standard`: The virtual server instance will not be preempted. +// +// See [virtual server instance availability +// class](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers) for details. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceAvailabilityClassSpotConst = "spot" + InstanceAvailabilityClassStandardConst = "standard" +) + +// UnmarshalInstanceAvailability unmarshals an instance of InstanceAvailability from the specified map of raw messages. +func UnmarshalInstanceAvailability(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceAvailability) + err = core.UnmarshalPrimitive(m, "class", &obj.Class) + if err != nil { + err = core.SDKErrorf(err, "", "class-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceAvailabilityPatch : InstanceAvailabilityPatch struct +type InstanceAvailabilityPatch struct { + // The availability class for the virtual server instance: + // - `spot`: The virtual server instance may be preempted. + // - `standard`: The virtual server instance will not be preempted. + // + // If `spot` is specified, the virtual server instance: + // - `reservation_affinity.policy` must be `disabled` + // - `placement_target` must not specify a dedicated host or dedicated host group. + // + // To change the availability class, the instance `status` must be `stopping` or `stopped`. + Class *string `json:"class,omitempty"` +} + +// Constants associated with the InstanceAvailabilityPatch.Class property. +// The availability class for the virtual server instance: +// - `spot`: The virtual server instance may be preempted. +// - `standard`: The virtual server instance will not be preempted. +// +// If `spot` is specified, the virtual server instance: +// - `reservation_affinity.policy` must be `disabled` +// - `placement_target` must not specify a dedicated host or dedicated host group. +// +// To change the availability class, the instance `status` must be `stopping` or `stopped`. +const ( + InstanceAvailabilityPatchClassSpotConst = "spot" + InstanceAvailabilityPatchClassStandardConst = "standard" +) + +// UnmarshalInstanceAvailabilityPatch unmarshals an instance of InstanceAvailabilityPatch from the specified map of raw messages. +func UnmarshalInstanceAvailabilityPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceAvailabilityPatch) + err = core.UnmarshalPrimitive(m, "class", &obj.Class) + if err != nil { + err = core.SDKErrorf(err, "", "class-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the InstanceAvailabilityPatch +func (instanceAvailabilityPatch *InstanceAvailabilityPatch) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(instanceAvailabilityPatch.Class) { + _patch["class"] = instanceAvailabilityPatch.Class + } + + return +} + // InstanceAvailabilityPolicy : The availability policy for this virtual server instance. type InstanceAvailabilityPolicy struct { // The action to perform if the compute host experiences a failure: @@ -62905,6 +65982,18 @@ type InstanceAvailabilityPolicy struct { // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. HostFailure *string `json:"host_failure" validate:"required"` + + // The action to perform if the virtual server instance is preempted: + // - `delete`: Delete the virtual server instance + // - `stop`: Leave the virtual server instance stopped + // + // See [virtual server instance + // preemption](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers#spot-instances-preemption) for + // details. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Preemption *string `json:"preemption" validate:"required"` } // Constants associated with the InstanceAvailabilityPolicy.HostFailure property. @@ -62921,6 +66010,22 @@ const ( InstanceAvailabilityPolicyHostFailureStopConst = "stop" ) +// Constants associated with the InstanceAvailabilityPolicy.Preemption property. +// The action to perform if the virtual server instance is preempted: +// - `delete`: Delete the virtual server instance +// - `stop`: Leave the virtual server instance stopped +// +// See [virtual server instance +// preemption](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers#spot-instances-preemption) for +// details. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceAvailabilityPolicyPreemptionDeleteConst = "delete" + InstanceAvailabilityPolicyPreemptionStopConst = "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) @@ -62929,6 +66034,11 @@ func UnmarshalInstanceAvailabilityPolicy(m map[string]json.RawMessage, result in err = core.SDKErrorf(err, "", "host_failure-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "preemption", &obj.Preemption) + if err != nil { + err = core.SDKErrorf(err, "", "preemption-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -62939,6 +66049,11 @@ type InstanceAvailabilityPolicyPatch struct { // - `restart`: Restart the virtual server instance // - `stop`: Leave the virtual server instance stopped. HostFailure *string `json:"host_failure,omitempty"` + + // The action to perform if the virtual server instance is preempted: + // - `delete`: Delete the virtual server instance + // - `stop`: Leave the virtual server instance stopped. + Preemption *string `json:"preemption,omitempty"` } // Constants associated with the InstanceAvailabilityPolicyPatch.HostFailure property. @@ -62950,6 +66065,15 @@ const ( InstanceAvailabilityPolicyPatchHostFailureStopConst = "stop" ) +// Constants associated with the InstanceAvailabilityPolicyPatch.Preemption property. +// The action to perform if the virtual server instance is preempted: +// - `delete`: Delete the virtual server instance +// - `stop`: Leave the virtual server instance stopped. +const ( + InstanceAvailabilityPolicyPatchPreemptionDeleteConst = "delete" + InstanceAvailabilityPolicyPatchPreemptionStopConst = "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) @@ -62958,6 +66082,11 @@ func UnmarshalInstanceAvailabilityPolicyPatch(m map[string]json.RawMessage, resu err = core.SDKErrorf(err, "", "host_failure-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "preemption", &obj.Preemption) + if err != nil { + err = core.SDKErrorf(err, "", "preemption-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -62968,6 +66097,9 @@ func (instanceAvailabilityPolicyPatch *InstanceAvailabilityPolicyPatch) asPatch( if !core.IsNil(instanceAvailabilityPolicyPatch.HostFailure) { _patch["host_failure"] = instanceAvailabilityPolicyPatch.HostFailure } + if !core.IsNil(instanceAvailabilityPolicyPatch.Preemption) { + _patch["preemption"] = instanceAvailabilityPolicyPatch.Preemption + } return } @@ -62980,6 +66112,15 @@ type InstanceAvailabilityPolicyPrototype struct { // // See [handling host failures](https://cloud.ibm.com/docs/vpc?topic=vpc-host-failure-recovery-policies) for details. HostFailure *string `json:"host_failure,omitempty"` + + // The action to perform if the virtual server instance is preempted: + // - `delete`: Delete the virtual server instance + // - `stop`: Leave the virtual server instance stopped + // + // See [virtual server instance + // preemption](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers#spot-instances-preemption) for + // details. + Preemption *string `json:"preemption,omitempty"` } // Constants associated with the InstanceAvailabilityPolicyPrototype.HostFailure property. @@ -62993,6 +66134,19 @@ const ( InstanceAvailabilityPolicyPrototypeHostFailureStopConst = "stop" ) +// Constants associated with the InstanceAvailabilityPolicyPrototype.Preemption property. +// The action to perform if the virtual server instance is preempted: +// - `delete`: Delete the virtual server instance +// - `stop`: Leave the virtual server instance stopped +// +// See [virtual server instance +// preemption](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers#spot-instances-preemption) for +// details. +const ( + InstanceAvailabilityPolicyPrototypePreemptionDeleteConst = "delete" + InstanceAvailabilityPolicyPrototypePreemptionStopConst = "stop" +) + // UnmarshalInstanceAvailabilityPolicyPrototype unmarshals an instance of InstanceAvailabilityPolicyPrototype from the specified map of raw messages. func UnmarshalInstanceAvailabilityPolicyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceAvailabilityPolicyPrototype) @@ -63001,6 +66155,52 @@ func UnmarshalInstanceAvailabilityPolicyPrototype(m map[string]json.RawMessage, err = core.SDKErrorf(err, "", "host_failure-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "preemption", &obj.Preemption) + if err != nil { + err = core.SDKErrorf(err, "", "preemption-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceAvailabilityPrototype : InstanceAvailabilityPrototype struct +type InstanceAvailabilityPrototype struct { + // The availability class for the virtual server instance: + // - `spot`: The virtual server instance may be preempted. + // - `standard`: The virtual server instance will not be preempted. + // + // If `spot` is specified, the virtual server instance: + // - `reservation_affinity.policy` must be `disabled` + // - `placement_target` must not specify a dedicated host or dedicated host group. + // + // If unspecified, the default for `availability_class` from the profile will be used. + Class *string `json:"class,omitempty"` +} + +// Constants associated with the InstanceAvailabilityPrototype.Class property. +// The availability class for the virtual server instance: +// - `spot`: The virtual server instance may be preempted. +// - `standard`: The virtual server instance will not be preempted. +// +// If `spot` is specified, the virtual server instance: +// - `reservation_affinity.policy` must be `disabled` +// - `placement_target` must not specify a dedicated host or dedicated host group. +// +// If unspecified, the default for `availability_class` from the profile will be used. +const ( + InstanceAvailabilityPrototypeClassSpotConst = "spot" + InstanceAvailabilityPrototypeClassStandardConst = "standard" +) + +// 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, "class", &obj.Class) + if err != nil { + err = core.SDKErrorf(err, "", "class-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -64812,16 +68012,16 @@ type InstanceGroupManagerActionPrototype struct { // 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. - RunAt *strfmt.DateTime `json:"run_at,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"` Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` 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"` + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at,omitempty"` } func (*InstanceGroupManagerActionPrototype) isaInstanceGroupManagerActionPrototype() bool { @@ -64840,9 +68040,9 @@ func UnmarshalInstanceGroupManagerActionPrototype(m map[string]json.RawMessage, err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) if err != nil { - err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) @@ -64855,9 +68055,9 @@ func UnmarshalInstanceGroupManagerActionPrototype(m map[string]json.RawMessage, err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) if err != nil { - err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -66002,6 +69202,57 @@ func (instanceGroupMembershipPatch *InstanceGroupMembershipPatch) AsPatch() (_pa return } +// InstanceGroupMembershipReferenceInstanceContext : InstanceGroupMembershipReferenceInstanceContext struct +type InstanceGroupMembershipReferenceInstanceContext struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *Deleted `json:"deleted,omitempty"` + + // The URL for this instance group membership. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group membership. + ID *string `json:"id" validate:"required"` + + // The instance group associated with this membership. + InstanceGroup *InstanceGroupReference `json:"instance_group" validate:"required"` + + // The name for this instance group membership. The name is unique across all memberships for the instance group. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalInstanceGroupMembershipReferenceInstanceContext unmarshals an instance of InstanceGroupMembershipReferenceInstanceContext from the specified map of raw messages. +func UnmarshalInstanceGroupMembershipReferenceInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembershipReferenceInstanceContext) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDeleted) + if err != nil { + err = core.SDKErrorf(err, "", "deleted-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "instance_group", &obj.InstanceGroup, UnmarshalInstanceGroupReference) + if err != nil { + err = core.SDKErrorf(err, "", "instance_group-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + 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 { // The port to use for new load balancer pool members created by this instance group. @@ -66314,11 +69565,11 @@ func UnmarshalInstanceInitializationPassword(m map[string]json.RawMessage, resul // InstanceLifecycleReason : InstanceLifecycleReason struct type InstanceLifecycleReason struct { // A reason code for this lifecycle state: - // - `failed_registration`: the instance's registration to Resource Controller has + // - `failed_registration`: The instance's registration to Resource Controller has // failed. Delete the instance and provision it again. If the problem persists, // contact IBM Support. - // - `internal_error`: internal error (contact IBM support) - // - `pending_registration`: the instance's registration to Resource Controller is + // - `internal_error`: Internal error (contact IBM support) + // - `pending_registration`: The instance's registration to Resource Controller is // being processed. // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM // support) @@ -66336,11 +69587,11 @@ type InstanceLifecycleReason struct { // Constants associated with the InstanceLifecycleReason.Code property. // A reason code for this lifecycle state: -// - `failed_registration`: the instance's registration to Resource Controller has +// - `failed_registration`: The instance's registration to Resource Controller has // failed. Delete the instance and provision it again. If the problem persists, // contact IBM Support. -// - `internal_error`: internal error (contact IBM support) -// - `pending_registration`: the instance's registration to Resource Controller is +// - `internal_error`: Internal error (contact IBM support) +// - `pending_registration`: The instance's registration to Resource Controller is // being processed. // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM // support) @@ -67023,6 +70274,8 @@ func UnmarshalInstanceNetworkAttachmentReference(m map[string]json.RawMessage, r // InstancePatch : InstancePatch struct type InstancePatch struct { + Availability *InstanceAvailabilityPatch `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPatch `json:"availability_policy,omitempty"` // The confidential compute mode to use for this virtual server instance. @@ -67048,7 +70301,9 @@ type InstancePatch struct { // placement restrictions to be changed, the instance `status` must be `stopping` or // `stopped`. // - // If set, `reservation_affinity.policy` must be `disabled`. + // If set, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated + // host or dedicated host group, the `vcpu.percentage` must be `100` and the instance must + // have two or more vCPUs. PlacementTarget InstancePlacementTargetPatchIntf `json:"placement_target,omitempty"` // The profile to use for this virtual server instance. Any disks associated with the @@ -67063,6 +70318,7 @@ type InstancePatch struct { // - Have the same `vcpu.architecture`. // - Support the number of network attachments or network interfaces the instance // currently has. + // - Have the `volume_bandwidth_qos_mode` listed in its `volume_bandwidth_qos_modes`. Profile InstancePatchProfileIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPatch `json:"reservation_affinity,omitempty"` @@ -67071,6 +70327,15 @@ type InstancePatch struct { // this value will result in a corresponding decrease to // `total_network_bandwidth`. TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + Vcpu *InstanceVcpuPatch `json:"vcpu,omitempty"` + + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // For this property to be changed, the virtual server instance `status` must be + // `stopping` or `stopped`. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` } // Constants associated with the InstancePatch.ConfidentialComputeMode property. @@ -67084,9 +70349,25 @@ const ( InstancePatchConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePatch.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// For this property to be changed, the virtual server instance `status` must be +// `stopping` or `stopped`. +const ( + InstancePatchVolumeBandwidthQosModePooledConst = "pooled" + InstancePatchVolumeBandwidthQosModeWeightedConst = "weighted" +) + // 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", &obj.Availability, UnmarshalInstanceAvailabilityPatch) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPatch) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -67132,6 +70413,16 @@ func UnmarshalInstancePatch(m map[string]json.RawMessage, result interface{}) (e err = core.SDKErrorf(err, "", "total_volume_bandwidth-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPatch) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -67139,6 +70430,9 @@ func UnmarshalInstancePatch(m map[string]json.RawMessage, result interface{}) (e // AsPatch returns a generic map representation of the InstancePatch func (instancePatch *InstancePatch) AsPatch() (_patch map[string]interface{}, err error) { _patch = map[string]interface{}{} + if !core.IsNil(instancePatch.Availability) { + _patch["availability"] = instancePatch.Availability.asPatch() + } if !core.IsNil(instancePatch.AvailabilityPolicy) { _patch["availability_policy"] = instancePatch.AvailabilityPolicy.asPatch() } @@ -67166,6 +70460,12 @@ func (instancePatch *InstancePatch) AsPatch() (_patch map[string]interface{}, er if !core.IsNil(instancePatch.TotalVolumeBandwidth) { _patch["total_volume_bandwidth"] = instancePatch.TotalVolumeBandwidth } + if !core.IsNil(instancePatch.Vcpu) { + _patch["vcpu"] = instancePatch.Vcpu.asPatch() + } + if !core.IsNil(instancePatch.VolumeBandwidthQosMode) { + _patch["volume_bandwidth_qos_mode"] = instancePatch.VolumeBandwidthQosMode + } return } @@ -67181,6 +70481,7 @@ func (instancePatch *InstancePatch) AsPatch() (_patch map[string]interface{}, er // - Have the same `vcpu.architecture`. // - Support the number of network attachments or network interfaces the instance // currently has. +// - Have the `volume_bandwidth_qos_mode` listed in its `volume_bandwidth_qos_modes`. // // Models which "extend" this model: // - InstancePatchProfileInstanceProfileIdentityByName @@ -67313,18 +70614,19 @@ func UnmarshalInstancePlacementTarget(m map[string]json.RawMessage, result inter // instance `status` must be `stopping` or // `stopped`. // -// If set, `reservation_affinity.policy` must be `disabled`. +// If set, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated host or dedicated host group, the +// `vcpu.percentage` must be `100` and the instance must have two or more vCPUs. // Models which "extend" this model: // - InstancePlacementTargetPatchDedicatedHostIdentity // - InstancePlacementTargetPatchDedicatedHostGroupIdentity type InstancePlacementTargetPatch struct { - // The unique identifier for this dedicated host. + // The unique identifier for this dedicated host or the unique identifier for this dedicated host group. ID *string `json:"id,omitempty"` - // The CRN for this dedicated host. + // The CRN for this dedicated host or the CRN for this dedicated host group. CRN *string `json:"crn,omitempty"` - // The URL for this dedicated host. + // The URL for this dedicated host or the URL for this dedicated host group. Href *string `json:"href,omitempty"` } @@ -67377,19 +70679,21 @@ func (instancePlacementTargetPatch *InstancePlacementTargetPatch) asPatch() (_pa // InstancePlacementTargetPrototype : The placement restrictions to use for the virtual server instance. // -// If specified, `reservation_affinity.policy` must be `disabled`. +// If specified, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated host or dedicated host +// group, the `vcpu.percentage` must be `100` and the instance must have two or more vCPUs. // Models which "extend" this model: // - InstancePlacementTargetPrototypeDedicatedHostIdentity // - InstancePlacementTargetPrototypeDedicatedHostGroupIdentity // - InstancePlacementTargetPrototypePlacementGroupIdentity type InstancePlacementTargetPrototype struct { - // The unique identifier for this dedicated host. + // The unique identifier for this dedicated host or the unique identifier for this dedicated host group or the unique + // identifier for this placement group. ID *string `json:"id,omitempty"` - // The CRN for this dedicated host. + // The CRN for this dedicated host or the CRN for this dedicated host group or the CRN for this placement group. CRN *string `json:"crn,omitempty"` - // The URL for this dedicated host. + // The URL for this dedicated host or the URL for this dedicated host group or the URL for this placement group. Href *string `json:"href,omitempty"` } @@ -67425,6 +70729,8 @@ func UnmarshalInstancePlacementTargetPrototype(m map[string]json.RawMessage, res // InstanceProfile : InstanceProfile struct type InstanceProfile struct { + AvailabilityClass InstanceProfileAvailabilityClassIntf `json:"availability_class" validate:"required"` + Bandwidth InstanceProfileBandwidthIntf `json:"bandwidth" validate:"required"` ClusterNetworkAttachmentCount InstanceProfileClusterNetworkAttachmentCountIntf `json:"cluster_network_attachment_count" validate:"required"` @@ -67455,6 +70761,8 @@ type InstanceProfile struct { NetworkAttachmentCount InstanceProfileNetworkAttachmentCountIntf `json:"network_attachment_count" validate:"required"` + NetworkBandwidthMode InstanceProfileNetworkBandwidthModeIntf `json:"network_bandwidth_mode" validate:"required"` + NetworkInterfaceCount InstanceProfileNetworkInterfaceCountIntf `json:"network_interface_count" validate:"required"` NumaCount InstanceProfileNumaCountIntf `json:"numa_count,omitempty"` @@ -67490,9 +70798,19 @@ type InstanceProfile struct { VcpuArchitecture *InstanceProfileVcpuArchitecture `json:"vcpu_architecture" validate:"required"` + VcpuBurstLimit InstanceProfileVcpuBurstLimitIntf `json:"vcpu_burst_limit" validate:"required"` + VcpuCount InstanceProfileVcpuIntf `json:"vcpu_count" validate:"required"` VcpuManufacturer InstanceProfileVcpuManufacturerIntf `json:"vcpu_manufacturer" validate:"required"` + + // The permitted values for VCPU percentage for an instance with this profile. + VcpuPercentage *InstanceProfileVcpuPercentage `json:"vcpu_percentage" validate:"required"` + + VolumeBandwidthQosModes InstanceProfileVolumeBandwidthQoSModesIntf `json:"volume_bandwidth_qos_modes" validate:"required"` + + // The zones in this region that support this instance profile. + Zones []ZoneReference `json:"zones" validate:"required"` } // Constants associated with the InstanceProfile.ResourceType property. @@ -67521,6 +70839,11 @@ const ( // 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, "availability_class", &obj.AvailabilityClass, UnmarshalInstanceProfileAvailabilityClass) + if err != nil { + err = core.SDKErrorf(err, "", "availability_class-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalInstanceProfileBandwidth) if err != nil { err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) @@ -67586,6 +70909,11 @@ func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) err = core.SDKErrorf(err, "", "network_attachment_count-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "network_bandwidth_mode", &obj.NetworkBandwidthMode, UnmarshalInstanceProfileNetworkBandwidthMode) + if err != nil { + err = core.SDKErrorf(err, "", "network_bandwidth_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "network_interface_count", &obj.NetworkInterfaceCount, UnmarshalInstanceProfileNetworkInterfaceCount) if err != nil { err = core.SDKErrorf(err, "", "network_interface_count-error", common.GetComponentInfo()) @@ -67641,6 +70969,11 @@ func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) err = core.SDKErrorf(err, "", "vcpu_architecture-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu_burst_limit", &obj.VcpuBurstLimit, UnmarshalInstanceProfileVcpuBurstLimit) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu_burst_limit-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vcpu_count", &obj.VcpuCount, UnmarshalInstanceProfileVcpu) if err != nil { err = core.SDKErrorf(err, "", "vcpu_count-error", common.GetComponentInfo()) @@ -67651,6 +70984,125 @@ func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) err = core.SDKErrorf(err, "", "vcpu_manufacturer-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu_percentage", &obj.VcpuPercentage, UnmarshalInstanceProfileVcpuPercentage) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu_percentage-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "volume_bandwidth_qos_modes", &obj.VolumeBandwidthQosModes, UnmarshalInstanceProfileVolumeBandwidthQoSModes) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_modes-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneReference) + if err != nil { + err = core.SDKErrorf(err, "", "zones-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileAvailabilityClass : InstanceProfileAvailabilityClass struct +// Models which "extend" this model: +// - InstanceProfileAvailabilityClassEnum +// - InstanceProfileAvailabilityClassFixed +type InstanceProfileAvailabilityClass struct { + // The default availability class for an instance with this profile. + Default *string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The permitted values for this profile field. + Values []string `json:"values,omitempty"` + + // The availability class for the virtual server instance: + // - `spot`: The virtual server instance may be preempted. + // - `standard`: The virtual server instance will not be preempted. + // + // See [virtual server instance availability + // class](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers) for details. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Value *string `json:"value,omitempty"` +} + +// Constants associated with the InstanceProfileAvailabilityClass.Default property. +// The default availability class for an instance with this profile. +const ( + InstanceProfileAvailabilityClassDefaultSpotConst = "spot" + InstanceProfileAvailabilityClassDefaultStandardConst = "standard" +) + +// Constants associated with the InstanceProfileAvailabilityClass.Type property. +// The type for this profile field. +const ( + InstanceProfileAvailabilityClassTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileAvailabilityClass.Values property. +// The availability class for the virtual server instance: +// - `spot`: The virtual server instance may be preempted. +// - `standard`: The virtual server instance will not be preempted. +// +// See [virtual server instance availability +// class](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers) for details. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileAvailabilityClassValuesSpotConst = "spot" + InstanceProfileAvailabilityClassValuesStandardConst = "standard" +) + +// Constants associated with the InstanceProfileAvailabilityClass.Value property. +// The availability class for the virtual server instance: +// - `spot`: The virtual server instance may be preempted. +// - `standard`: The virtual server instance will not be preempted. +// +// See [virtual server instance availability +// class](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers) for details. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileAvailabilityClassValueSpotConst = "spot" + InstanceProfileAvailabilityClassValueStandardConst = "standard" +) + +func (*InstanceProfileAvailabilityClass) isaInstanceProfileAvailabilityClass() bool { + return true +} + +type InstanceProfileAvailabilityClassIntf interface { + isaInstanceProfileAvailabilityClass() bool +} + +// UnmarshalInstanceProfileAvailabilityClass unmarshals an instance of InstanceProfileAvailabilityClass from the specified map of raw messages. +func UnmarshalInstanceProfileAvailabilityClass(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileAvailabilityClass) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -67816,22 +71268,70 @@ func UnmarshalInstanceProfileClusterNetworkAttachmentCount(m map[string]json.Raw // InstanceProfileCollection : InstanceProfileCollection struct type InstanceProfileCollection struct { + // A link to the first page of resources. + First *PageLink `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 *PageLink `json:"next,omitempty"` + // A page of virtual server instance profiles. Profiles []InstanceProfile `json:"profiles" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` } // 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, "first", &obj.First, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "profiles", &obj.Profiles, UnmarshalInstanceProfile) if err != nil { err = core.SDKErrorf(err, "", "profiles-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) + 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 *InstanceProfileCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil { + err = core.SDKErrorf(err, "", "read-query-param-error", common.GetComponentInfo()) + return nil, err + } else if start == nil { + return nil, nil + } + return start, nil +} + // InstanceProfileDisk : Disks provided by this profile. type InstanceProfileDisk struct { Quantity InstanceProfileDiskQuantityIntf `json:"quantity" validate:"required"` @@ -68557,6 +72057,110 @@ func UnmarshalInstanceProfileNetworkAttachmentCount(m map[string]json.RawMessage return } +// InstanceProfileNetworkBandwidthMode : InstanceProfileNetworkBandwidthMode struct +// Models which "extend" this model: +// - InstanceProfileNetworkBandwidthModeEnum +// - InstanceProfileNetworkBandwidthModeFixed +type InstanceProfileNetworkBandwidthMode struct { + // The default network bandwidth mode for this profile. + Default *string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The supported network bandwidth modes for an instance with this profile. + Values []string `json:"values,omitempty"` + + // A network bandwidth mode: + // + // - `divided`: network bandwidth divided equally across the instance's network attachments + // (or the instance's network interfaces). + // - `pooled`: network bandwidth pooled among instance network attachments + // (or the instance's network interfaces). + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Value *string `json:"value,omitempty"` +} + +// Constants associated with the InstanceProfileNetworkBandwidthMode.Default property. +// The default network bandwidth mode for this profile. +const ( + InstanceProfileNetworkBandwidthModeDefaultDividedConst = "divided" + InstanceProfileNetworkBandwidthModeDefaultPooledConst = "pooled" +) + +// Constants associated with the InstanceProfileNetworkBandwidthMode.Type property. +// The type for this profile field. +const ( + InstanceProfileNetworkBandwidthModeTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileNetworkBandwidthMode.Values property. +// A network bandwidth mode: +// +// - `divided`: network bandwidth divided equally across the instance's network attachments +// (or the instance's network interfaces). +// - `pooled`: network bandwidth pooled among instance network attachments +// (or the instance's network interfaces). +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileNetworkBandwidthModeValuesDividedConst = "divided" + InstanceProfileNetworkBandwidthModeValuesPooledConst = "pooled" +) + +// Constants associated with the InstanceProfileNetworkBandwidthMode.Value property. +// A network bandwidth mode: +// +// - `divided`: network bandwidth divided equally across the instance's network attachments +// (or the instance's network interfaces). +// - `pooled`: network bandwidth pooled among instance network attachments +// (or the instance's network interfaces). +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileNetworkBandwidthModeValueDividedConst = "divided" + InstanceProfileNetworkBandwidthModeValuePooledConst = "pooled" +) + +func (*InstanceProfileNetworkBandwidthMode) isaInstanceProfileNetworkBandwidthMode() bool { + return true +} + +type InstanceProfileNetworkBandwidthModeIntf interface { + isaInstanceProfileNetworkBandwidthMode() bool +} + +// UnmarshalInstanceProfileNetworkBandwidthMode unmarshals an instance of InstanceProfileNetworkBandwidthMode from the specified map of raw messages. +func UnmarshalInstanceProfileNetworkBandwidthMode(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNetworkBandwidthMode) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceProfileNetworkInterfaceCount : InstanceProfileNetworkInterfaceCount struct // Models which "extend" this model: // - InstanceProfileNetworkInterfaceCountRange @@ -68995,6 +72599,48 @@ func UnmarshalInstanceProfileVcpuArchitecture(m map[string]json.RawMessage, resu return } +// InstanceProfileVcpuBurstLimit : InstanceProfileVcpuBurstLimit struct +// Models which "extend" this model: +// - InstanceProfileVcpuBurstLimitFixed +type InstanceProfileVcpuBurstLimit struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` +} + +// Constants associated with the InstanceProfileVcpuBurstLimit.Type property. +// The type for this profile field. +const ( + InstanceProfileVcpuBurstLimitTypeFixedConst = "fixed" +) + +func (*InstanceProfileVcpuBurstLimit) isaInstanceProfileVcpuBurstLimit() bool { + return true +} + +type InstanceProfileVcpuBurstLimitIntf interface { + isaInstanceProfileVcpuBurstLimit() bool +} + +// UnmarshalInstanceProfileVcpuBurstLimit unmarshals an instance of InstanceProfileVcpuBurstLimit from the specified map of raw messages. +func UnmarshalInstanceProfileVcpuBurstLimit(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpuBurstLimit) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceProfileVcpuManufacturer : InstanceProfileVcpuManufacturer struct // Models which "extend" this model: // - InstanceProfileVcpuManufacturerFixed @@ -69046,6 +72692,46 @@ func UnmarshalInstanceProfileVcpuManufacturer(m map[string]json.RawMessage, resu return } +// InstanceProfileVcpuPercentage : The permitted values for VCPU percentage for an instance with this profile. +type InstanceProfileVcpuPercentage 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"` +} + +// Constants associated with the InstanceProfileVcpuPercentage.Type property. +// The type for this profile field. +const ( + InstanceProfileVcpuPercentageTypeEnumConst = "enum" +) + +// UnmarshalInstanceProfileVcpuPercentage unmarshals an instance of InstanceProfileVcpuPercentage from the specified map of raw messages. +func UnmarshalInstanceProfileVcpuPercentage(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpuPercentage) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceProfileVolumeBandwidth : InstanceProfileVolumeBandwidth struct // Models which "extend" this model: // - InstanceProfileVolumeBandwidthFixed @@ -69131,6 +72817,76 @@ func UnmarshalInstanceProfileVolumeBandwidth(m map[string]json.RawMessage, resul return } +// InstanceProfileVolumeBandwidthQoSModes : InstanceProfileVolumeBandwidthQoSModes struct +// Models which "extend" this model: +// - InstanceProfileVolumeBandwidthQoSModesEnum +// - InstanceProfileVolumeBandwidthQoSModesDependent +type InstanceProfileVolumeBandwidthQoSModes struct { + // The default volume bandwidth QoS mode for this profile. + Default *string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The permitted volume bandwidth QoS modes for an instance using this profile. + Values []string `json:"values,omitempty"` +} + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModes.Default property. +// The default volume bandwidth QoS mode for this profile. +const ( + InstanceProfileVolumeBandwidthQoSModesDefaultPooledConst = "pooled" + InstanceProfileVolumeBandwidthQoSModesDefaultWeightedConst = "weighted" +) + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModes.Type property. +// The type for this profile field. +const ( + InstanceProfileVolumeBandwidthQoSModesTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModes.Values property. +// A volume bandwidth QoS mode: +// - `pooled`: All volumes attached to an instance will pool and share bandwidth. +// - `weighted`: Each volume attached to an instance will have its own bandwidth, weighted according to its IOPS. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileVolumeBandwidthQoSModesValuesPooledConst = "pooled" + InstanceProfileVolumeBandwidthQoSModesValuesWeightedConst = "weighted" +) + +func (*InstanceProfileVolumeBandwidthQoSModes) isaInstanceProfileVolumeBandwidthQoSModes() bool { + return true +} + +type InstanceProfileVolumeBandwidthQoSModesIntf interface { + isaInstanceProfileVolumeBandwidthQoSModes() bool +} + +// UnmarshalInstanceProfileVolumeBandwidthQoSModes unmarshals an instance of InstanceProfileVolumeBandwidthQoSModes from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidthQoSModes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidthQoSModes) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstancePrototype : InstancePrototype struct // Models which "extend" this model: // - InstancePrototypeInstanceByImage @@ -69139,6 +72895,8 @@ func UnmarshalInstanceProfileVolumeBandwidth(m map[string]json.RawMessage, resul // - InstancePrototypeInstanceBySourceSnapshot // - InstancePrototypeInstanceBySourceTemplate type InstancePrototype struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + // The availability policy to use for this virtual server instance. AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` @@ -69190,18 +72948,20 @@ type InstancePrototype struct { // The placement restrictions to use for the virtual server instance. // - // If specified, `reservation_affinity.policy` must be `disabled`. + // If specified, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated + // host or dedicated host group, the `vcpu.percentage` must be `100` and the instance must + // have two or more vCPUs. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change + // in the future without changing the API version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` // The reservation affinity settings for this virtual server instance. If specified, - // `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. + // the instance must have two or more vCPUs, and `vcpu.percentage` must be `100`. ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` // The resource group to use. If unspecified, the account's [default resource @@ -69217,9 +72977,17 @@ type InstancePrototype struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network @@ -69270,6 +73038,16 @@ const ( InstancePrototypeConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototype.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstancePrototype) isaInstancePrototype() bool { return true } @@ -69281,6 +73059,11 @@ type InstancePrototypeIntf interface { // 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", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -69351,11 +73134,21 @@ func UnmarshalInstancePrototype(m map[string]json.RawMessage, result interface{} err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -69579,8 +73372,8 @@ func (instanceReservationAffinityPatch *InstanceReservationAffinityPatch) asPatc return } -// InstanceReservationAffinityPrototype : The reservation affinity settings for this virtual server instance. If specified, -// `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. +// InstanceReservationAffinityPrototype : The reservation affinity settings for this virtual server instance. If specified, the instance must have two or more +// vCPUs, and `vcpu.percentage` must be `100`. type InstanceReservationAffinityPrototype struct { // The reservation affinity policy to use for this virtual server instance: // - `disabled`: Reservations will not be used @@ -69589,7 +73382,8 @@ type InstanceReservationAffinityPrototype struct { // `profile` and `zone` as this virtual server instance will be available for use. // // The policy will default to `manual` if `pool` is not empty. The policy will default to - // `disabled` if a `placement_target` is set. The policy will default to `automatic` in all other cases. + // `disabled` if a `placement_target` is set. The policy will default to `disabled` if the provided instance + // configuration is restricted from enabling reservations. The policy will default to `automatic` in all other cases. // // The policy must be `disabled` if `placement_target` is specified. Policy *string `json:"policy,omitempty"` @@ -69613,7 +73407,8 @@ type InstanceReservationAffinityPrototype struct { // `profile` and `zone` as this virtual server instance will be available for use. // // The policy will default to `manual` if `pool` is not empty. The policy will default to -// `disabled` if a `placement_target` is set. The policy will default to `automatic` in all other cases. +// `disabled` if a `placement_target` is set. The policy will default to `disabled` if the provided instance +// configuration is restricted from enabling reservations. The policy will default to `automatic` in all other cases. // // The policy must be `disabled` if `placement_target` is specified. const ( @@ -69671,6 +73466,7 @@ const ( InstanceStatusReasonCodeCannotStartStorageConst = "cannot_start_storage" InstanceStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" InstanceStatusReasonCodeStoppedByHostFailureConst = "stopped_by_host_failure" + InstanceStatusReasonCodeStoppedByPreemptionConst = "stopped_by_preemption" InstanceStatusReasonCodeStoppedForImageCreationConst = "stopped_for_image_creation" ) @@ -69702,6 +73498,8 @@ func UnmarshalInstanceStatusReason(m map[string]json.RawMessage, result interfac // - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext // - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext type InstanceTemplate struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + // The availability policy to use for this virtual server instance. AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` @@ -69762,18 +73560,20 @@ type InstanceTemplate struct { // The placement restrictions to use for the virtual server instance. // - // If specified, `reservation_affinity.policy` must be `disabled`. + // If specified, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated + // host or dedicated host group, the `vcpu.percentage` must be `100` and the instance must + // have two or more vCPUs. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change + // in the future without changing the API version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` // The reservation affinity settings for this virtual server instance. If specified, - // `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. + // the instance must have two or more vCPUs, and `vcpu.percentage` must be `100`. ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` // The resource group for this instance template. @@ -69788,9 +73588,17 @@ type InstanceTemplate struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network @@ -69838,6 +73646,16 @@ const ( InstanceTemplateConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplate.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplate) isaInstanceTemplate() bool { return true } @@ -69848,149 +73666,189 @@ type InstanceTemplateIntf interface { // 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, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "cluster_network_attachments", &obj.ClusterNetworkAttachments, UnmarshalInstanceClusterNetworkAttachmentPrototypeInstanceContext) - if err != nil { - err = core.SDKErrorf(err, "", "cluster_network_attachments-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "confidential_compute_mode", &obj.ConfidentialComputeMode) - if err != nil { - err = core.SDKErrorf(err, "", "confidential_compute_mode-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - err = core.SDKErrorf(err, "", "default_trusted_profile-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) - if err != nil { - err = core.SDKErrorf(err, "", "enable_secure_boot-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "keys-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - err = core.SDKErrorf(err, "", "metadata_service-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "placement_target-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "profile-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "reservation_affinity-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - err = core.SDKErrorf(err, "", "total_volume_bandwidth-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - err = core.SDKErrorf(err, "", "boot_volume_attachment-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "image-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "network_attachments-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "primary_network_attachment-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - err = core.SDKErrorf(err, "", "network_interfaces-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - err = core.SDKErrorf(err, "", "primary_network_interface-error", common.GetComponentInfo()) - return + + // Check for source_snapshot presence to determine object type + var isSourceSnapshot bool + if bootVolumeRaw, exists := m["boot_volume_attachment"]; exists && len(bootVolumeRaw) > 0 && string(bootVolumeRaw) != "null" { + var bootVolumeMap map[string]json.RawMessage + if err = json.Unmarshal(bootVolumeRaw, &bootVolumeMap); err == nil { + if volumeRaw, volumeExists := bootVolumeMap["volume"]; volumeExists && len(volumeRaw) > 0 && string(volumeRaw) != "null" { + var volumeMap map[string]json.RawMessage + if err = json.Unmarshal(volumeRaw, &volumeMap); err == nil { + if _, snapshotExists := volumeMap["source_snapshot"]; snapshotExists { + isSourceSnapshot = true + } + } + } + } } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "catalog_offering-error", common.GetComponentInfo()) + + if isSourceSnapshot { + err = core.UnmarshalModel(m, "", result, UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext-error", common.GetComponentInfo()) + } + return err + } else { + obj := new(InstanceTemplate) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "cluster_network_attachments", &obj.ClusterNetworkAttachments, UnmarshalInstanceClusterNetworkAttachmentPrototypeInstanceContext) + if err != nil { + err = core.SDKErrorf(err, "", "cluster_network_attachments-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "confidential_compute_mode", &obj.ConfidentialComputeMode) + if err != nil { + err = core.SDKErrorf(err, "", "confidential_compute_mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "default_trusted_profile-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) + if err != nil { + err = core.SDKErrorf(err, "", "enable_secure_boot-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "keys-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "metadata_service-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "placement_target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "profile-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "reservation_affinity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "total_volume_bandwidth-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + err = core.SDKErrorf(err, "", "boot_volume_attachment-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "image-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "network_attachments-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "primary_network_attachment-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "network_interfaces-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "primary_network_interface-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "catalog_offering-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } // InstanceTemplateCollection : InstanceTemplateCollection struct @@ -70142,6 +74000,8 @@ func (instanceTemplatePatch *InstanceTemplatePatch) AsPatch() (_patch map[string // - InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot // - InstanceTemplatePrototypeInstanceTemplateByCatalogOffering type InstanceTemplatePrototype struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + // The availability policy to use for this virtual server instance. AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` @@ -70191,18 +74051,20 @@ type InstanceTemplatePrototype struct { // The placement restrictions to use for the virtual server instance. // - // If specified, `reservation_affinity.policy` must be `disabled`. + // If specified, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated + // host or dedicated host group, the `vcpu.percentage` must be `100` and the instance must + // have two or more vCPUs. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change + // in the future without changing the API version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` // The reservation affinity settings for this virtual server instance. If specified, - // `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. + // the instance must have two or more vCPUs, and `vcpu.percentage` must be `100`. ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` // The resource group to use. If unspecified, the account's [default resource @@ -70218,9 +74080,17 @@ type InstanceTemplatePrototype struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network @@ -70273,6 +74143,16 @@ const ( InstanceTemplatePrototypeConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototype.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplatePrototype) isaInstanceTemplatePrototype() bool { return true } @@ -70284,6 +74164,11 @@ type InstanceTemplatePrototypeIntf interface { // 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", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -70354,11 +74239,21 @@ func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result int err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -70472,14 +74367,25 @@ type InstanceVcpu struct { // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. Architecture *string `json:"architecture" validate:"required"` + Burst *InstanceVcpuBurst `json:"burst,omitempty"` + // The number of VCPUs assigned. Count *int64 `json:"count" validate:"required"` - // The VCPU manufacturer. + // The VCPU manufacturer for this instance. It may be `unassigned` when instance `status` is `failed`, `pending`, or + // `stopped`. // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. Manufacturer *string `json:"manufacturer" validate:"required"` + + // The percentage of VCPU time allocated to the virtual server instance. + // + // The virtual server instance `vcpu.percentage` will be `100` when: + // - The virtual server instance `placement_target` is a dedicated host or dedicated + // host group. + // - The virtual server instance `reservation_affinity.policy` is `disabled`. + Percentage *int64 `json:"percentage" validate:"required"` } // Constants associated with the InstanceVcpu.Architecture property. @@ -70493,14 +74399,16 @@ const ( ) // Constants associated with the InstanceVcpu.Manufacturer property. -// The VCPU manufacturer. +// The VCPU manufacturer for this instance. It may be `unassigned` when instance `status` is `failed`, `pending`, or +// `stopped`. // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. const ( - InstanceVcpuManufacturerAmdConst = "amd" - InstanceVcpuManufacturerIBMConst = "ibm" - InstanceVcpuManufacturerIntelConst = "intel" + InstanceVcpuManufacturerAmdConst = "amd" + InstanceVcpuManufacturerIBMConst = "ibm" + InstanceVcpuManufacturerIntelConst = "intel" + InstanceVcpuManufacturerUnassignedConst = "unassigned" ) // UnmarshalInstanceVcpu unmarshals an instance of InstanceVcpu from the specified map of raw messages. @@ -70511,6 +74419,11 @@ func UnmarshalInstanceVcpu(m map[string]json.RawMessage, result interface{}) (er err = core.SDKErrorf(err, "", "architecture-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "burst", &obj.Burst, UnmarshalInstanceVcpuBurst) + if err != nil { + err = core.SDKErrorf(err, "", "burst-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "count", &obj.Count) if err != nil { err = core.SDKErrorf(err, "", "count-error", common.GetComponentInfo()) @@ -70521,6 +74434,106 @@ func UnmarshalInstanceVcpu(m map[string]json.RawMessage, result interface{}) (er err = core.SDKErrorf(err, "", "manufacturer-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "percentage", &obj.Percentage) + if err != nil { + err = core.SDKErrorf(err, "", "percentage-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceVcpuBurst : InstanceVcpuBurst struct +type InstanceVcpuBurst struct { + // The maximum percentage of the base VCPU capacity the virtual server may exceed. For example, if `vcpu.count` is 1, + // `vcpu.percentage` is 50 and `vcpu.burst.limit` is 200, the instance may burst to using one full VCPU. + // + // The maximum value for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Limit *int64 `json:"limit" validate:"required"` +} + +// UnmarshalInstanceVcpuBurst unmarshals an instance of InstanceVcpuBurst from the specified map of raw messages. +func UnmarshalInstanceVcpuBurst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceVcpuBurst) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceVcpuPatch : InstanceVcpuPatch struct +type InstanceVcpuPatch struct { + // The percentage of VCPU time allocated to the virtual server instance. + // + // The virtual server instance `vcpu.percentage` must be `100` when: + // - The virtual server instance `placement_target` is a dedicated host or dedicated + // host group. + // - The virtual server instance `reservation_affinity.policy` is not `disabled`. + // + // For this property to be changed, the virtual server instance `status` must be + // `stopping` or `stopped`. + Percentage *int64 `json:"percentage" validate:"required"` +} + +// NewInstanceVcpuPatch : Instantiate InstanceVcpuPatch (Generic Model Constructor) +func (*VpcV1) NewInstanceVcpuPatch(percentage int64) (_model *InstanceVcpuPatch, err error) { + _model = &InstanceVcpuPatch{ + Percentage: core.Int64Ptr(percentage), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalInstanceVcpuPatch unmarshals an instance of InstanceVcpuPatch from the specified map of raw messages. +func UnmarshalInstanceVcpuPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceVcpuPatch) + err = core.UnmarshalPrimitive(m, "percentage", &obj.Percentage) + if err != nil { + err = core.SDKErrorf(err, "", "percentage-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the InstanceVcpuPatch +func (instanceVcpuPatch *InstanceVcpuPatch) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(instanceVcpuPatch.Percentage) { + _patch["percentage"] = instanceVcpuPatch.Percentage + } + + return +} + +// InstanceVcpuPrototype : InstanceVcpuPrototype struct +type InstanceVcpuPrototype struct { + // The percentage of VCPU clock cycles allocated to the instance. + // + // The virtual server instance `vcpu.percentage` must be `100` when: + // - The virtual server instance `placement_target` is a dedicated host or dedicated + // host group. + // - The virtual server instance `reservation_affinity.policy` is not `disabled`. + // + // If unspecified, the default for `vcpu_percentage` from the profile will be used. + Percentage *int64 `json:"percentage,omitempty"` +} + +// UnmarshalInstanceVcpuPrototype unmarshals an instance of InstanceVcpuPrototype from the specified map of raw messages. +func UnmarshalInstanceVcpuPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceVcpuPrototype) + err = core.UnmarshalPrimitive(m, "percentage", &obj.Percentage) + if err != nil { + err = core.SDKErrorf(err, "", "percentage-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -72088,6 +76101,52 @@ func (options *ListEndpointGatewayIpsOptions) SetHeaders(param map[string]string return options } +// ListEndpointGatewayResourceBindingsOptions : The ListEndpointGatewayResourceBindings options. +type ListEndpointGatewayResourceBindingsOptions 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"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewListEndpointGatewayResourceBindingsOptions : Instantiate ListEndpointGatewayResourceBindingsOptions +func (*VpcV1) NewListEndpointGatewayResourceBindingsOptions(endpointGatewayID string) *ListEndpointGatewayResourceBindingsOptions { + return &ListEndpointGatewayResourceBindingsOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *ListEndpointGatewayResourceBindingsOptions) SetEndpointGatewayID(endpointGatewayID string) *ListEndpointGatewayResourceBindingsOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListEndpointGatewayResourceBindingsOptions) SetStart(start string) *ListEndpointGatewayResourceBindingsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListEndpointGatewayResourceBindingsOptions) SetLimit(limit int64) *ListEndpointGatewayResourceBindingsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListEndpointGatewayResourceBindingsOptions) SetHeaders(param map[string]string) *ListEndpointGatewayResourceBindingsOptions { + options.Headers = param + return options +} + // ListEndpointGatewaysOptions : The ListEndpointGateways options. type ListEndpointGatewaysOptions struct { // Filters the collection to resources with a `name` property matching the exact specified name. @@ -72115,9 +76174,9 @@ type ListEndpointGatewaysOptions struct { // Filters the collection to resources with a `vpc.name` property matching the exact specified name. VPCName *string `json:"vpc.name,omitempty"` - // Filters the collection to endpoint gateways with an `allow_dns_resolution_binding` property matching the specified - // value. - AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` + // Filters the collection to endpoint gateways with a `dns_resolution_binding_mode` property matching one of the + // specified comma-separated values. + DnsResolutionBindingMode []string `json:"dns_resolution_binding_mode,omitempty"` // Allows users to set headers on API requests. Headers map[string]string @@ -72134,6 +76193,13 @@ const ( ListEndpointGatewaysOptionsLifecycleStateWaitingConst = "waiting" ) +// Constants associated with the ListEndpointGatewaysOptions.DnsResolutionBindingMode property. +const ( + ListEndpointGatewaysOptionsDnsResolutionBindingModeDisabledConst = "disabled" + ListEndpointGatewaysOptionsDnsResolutionBindingModePerResourceBindingConst = "per_resource_binding" + ListEndpointGatewaysOptionsDnsResolutionBindingModePrimaryConst = "primary" +) + // NewListEndpointGatewaysOptions : Instantiate ListEndpointGatewaysOptions func (*VpcV1) NewListEndpointGatewaysOptions() *ListEndpointGatewaysOptions { return &ListEndpointGatewaysOptions{} @@ -72187,9 +76253,9 @@ func (_options *ListEndpointGatewaysOptions) SetVPCName(vpcName string) *ListEnd return _options } -// SetAllowDnsResolutionBinding : Allow user to set AllowDnsResolutionBinding -func (_options *ListEndpointGatewaysOptions) SetAllowDnsResolutionBinding(allowDnsResolutionBinding bool) *ListEndpointGatewaysOptions { - _options.AllowDnsResolutionBinding = core.BoolPtr(allowDnsResolutionBinding) +// SetDnsResolutionBindingMode : Allow user to set DnsResolutionBindingMode +func (_options *ListEndpointGatewaysOptions) SetDnsResolutionBindingMode(dnsResolutionBindingMode []string) *ListEndpointGatewaysOptions { + _options.DnsResolutionBindingMode = dnsResolutionBindingMode return _options } @@ -72643,13 +76709,14 @@ type ListImagesOptions struct { // Constants associated with the ListImagesOptions.Status property. const ( - ListImagesOptionsStatusAvailableConst = "available" - ListImagesOptionsStatusDeletingConst = "deleting" - ListImagesOptionsStatusDeprecatedConst = "deprecated" - ListImagesOptionsStatusFailedConst = "failed" - ListImagesOptionsStatusObsoleteConst = "obsolete" - ListImagesOptionsStatusPendingConst = "pending" - ListImagesOptionsStatusUnusableConst = "unusable" + ListImagesOptionsStatusAvailableConst = "available" + ListImagesOptionsStatusDeletingConst = "deleting" + ListImagesOptionsStatusDeprecatedConst = "deprecated" + ListImagesOptionsStatusFailedConst = "failed" + ListImagesOptionsStatusObsoleteConst = "obsolete" + ListImagesOptionsStatusPartiallyAvailableConst = "partially_available" + ListImagesOptionsStatusPendingConst = "pending" + ListImagesOptionsStatusUnusableConst = "unusable" ) // Constants associated with the ListImagesOptions.Visibility property. @@ -73190,6 +77257,11 @@ func (options *ListInstanceNetworkInterfacesOptions) SetHeaders(param map[string // ListInstanceProfilesOptions : The ListInstanceProfiles options. type ListInstanceProfilesOptions 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 @@ -73200,6 +77272,18 @@ func (*VpcV1) NewListInstanceProfilesOptions() *ListInstanceProfilesOptions { return &ListInstanceProfilesOptions{} } +// SetStart : Allow user to set Start +func (_options *ListInstanceProfilesOptions) SetStart(start string) *ListInstanceProfilesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListInstanceProfilesOptions) SetLimit(limit int64) *ListInstanceProfilesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + // SetHeaders : Allow user to set Headers func (options *ListInstanceProfilesOptions) SetHeaders(param map[string]string) *ListInstanceProfilesOptions { options.Headers = param @@ -73266,6 +77350,9 @@ type ListInstancesOptions struct { // Filters the collection to resources with a `name` property matching the exact specified name. Name *string `json:"name,omitempty"` + // Filters the collection to instances with an `availability.class` property matching the specified value. + AvailabilityClass *string `json:"availability.class,omitempty"` + // Filters the collection to instances with a `cluster_network.id` property matching the specified identifier. ClusterNetworkID *string `json:"cluster_network.id,omitempty"` @@ -73284,6 +77371,14 @@ type ListInstancesOptions struct { // Filters the collection to resources with a `dedicated_host.name` property matching the exact specified name. DedicatedHostName *string `json:"dedicated_host.name,omitempty"` + // Filters the collection to instances with an `instance_group_membership.instance_group.id` property matching the + // specified instance group identifier. + InstanceGroupMembershipInstanceGroupID *string `json:"instance_group_membership.instance_group.id,omitempty"` + + // Filters the collection to instances with an `instance_group_membership.instance_group.crn` property matching the + // specified instance group CRN. + InstanceGroupMembershipInstanceGroupCRN *string `json:"instance_group_membership.instance_group.crn,omitempty"` + // Filters the collection to resources with a `placement_target.id` property matching the specified placement group // identifier. PlacementGroupID *string `json:"placement_group.id,omitempty"` @@ -73321,6 +77416,13 @@ type ListInstancesOptions struct { Headers map[string]string } +// Constants associated with the ListInstancesOptions.AvailabilityClass property. +// Filters the collection to instances with an `availability.class` property matching the specified value. +const ( + ListInstancesOptionsAvailabilityClassSpotConst = "spot" + ListInstancesOptionsAvailabilityClassStandardConst = "standard" +) + // Constants associated with the ListInstancesOptions.ReservationAffinityPolicy property. // Filters the collection to instances with a `reservation_affinity.policy` property matching the specified value. const ( @@ -73358,6 +77460,12 @@ func (_options *ListInstancesOptions) SetName(name string) *ListInstancesOptions return _options } +// SetAvailabilityClass : Allow user to set AvailabilityClass +func (_options *ListInstancesOptions) SetAvailabilityClass(availabilityClass string) *ListInstancesOptions { + _options.AvailabilityClass = core.StringPtr(availabilityClass) + return _options +} + // SetClusterNetworkID : Allow user to set ClusterNetworkID func (_options *ListInstancesOptions) SetClusterNetworkID(clusterNetworkID string) *ListInstancesOptions { _options.ClusterNetworkID = core.StringPtr(clusterNetworkID) @@ -73394,6 +77502,18 @@ func (_options *ListInstancesOptions) SetDedicatedHostName(dedicatedHostName str return _options } +// SetInstanceGroupMembershipInstanceGroupID : Allow user to set InstanceGroupMembershipInstanceGroupID +func (_options *ListInstancesOptions) SetInstanceGroupMembershipInstanceGroupID(instanceGroupMembershipInstanceGroupID string) *ListInstancesOptions { + _options.InstanceGroupMembershipInstanceGroupID = core.StringPtr(instanceGroupMembershipInstanceGroupID) + return _options +} + +// SetInstanceGroupMembershipInstanceGroupCRN : Allow user to set InstanceGroupMembershipInstanceGroupCRN +func (_options *ListInstancesOptions) SetInstanceGroupMembershipInstanceGroupCRN(instanceGroupMembershipInstanceGroupCRN string) *ListInstancesOptions { + _options.InstanceGroupMembershipInstanceGroupCRN = core.StringPtr(instanceGroupMembershipInstanceGroupCRN) + return _options +} + // SetPlacementGroupID : Allow user to set PlacementGroupID func (_options *ListInstancesOptions) SetPlacementGroupID(placementGroupID string) *ListInstancesOptions { _options.PlacementGroupID = core.StringPtr(placementGroupID) @@ -75000,6 +79120,10 @@ type ListSnapshotConsistencyGroupsOptions struct { // identifier. BackupPolicyPlanID *string `json:"backup_policy_plan.id,omitempty"` + // Filters the collection to snapshot consistency groups with a `backup_policy_job.id` property matching the specified + // identifier. + BackupPolicyJobID *string `json:"backup_policy_job.id,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -75054,6 +79178,12 @@ func (_options *ListSnapshotConsistencyGroupsOptions) SetBackupPolicyPlanID(back return _options } +// SetBackupPolicyJobID : Allow user to set BackupPolicyJobID +func (_options *ListSnapshotConsistencyGroupsOptions) SetBackupPolicyJobID(backupPolicyJobID string) *ListSnapshotConsistencyGroupsOptions { + _options.BackupPolicyJobID = core.StringPtr(backupPolicyJobID) + return _options +} + // SetHeaders : Allow user to set Headers func (options *ListSnapshotConsistencyGroupsOptions) SetHeaders(param map[string]string) *ListSnapshotConsistencyGroupsOptions { options.Headers = param @@ -75708,6 +79838,52 @@ func (options *ListVolumeInstanceProfilesOptions) SetHeaders(param map[string]st return options } +// ListVolumeJobsOptions : The ListVolumeJobs options. +type ListVolumeJobsOptions struct { + // The volume identifier. + VolumeID *string `json:"volume_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 +} + +// NewListVolumeJobsOptions : Instantiate ListVolumeJobsOptions +func (*VpcV1) NewListVolumeJobsOptions(volumeID string) *ListVolumeJobsOptions { + return &ListVolumeJobsOptions{ + VolumeID: core.StringPtr(volumeID), + } +} + +// SetVolumeID : Allow user to set VolumeID +func (_options *ListVolumeJobsOptions) SetVolumeID(volumeID string) *ListVolumeJobsOptions { + _options.VolumeID = core.StringPtr(volumeID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListVolumeJobsOptions) SetStart(start string) *ListVolumeJobsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVolumeJobsOptions) SetLimit(limit int64) *ListVolumeJobsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVolumeJobsOptions) SetHeaders(param map[string]string) *ListVolumeJobsOptions { + options.Headers = param + return options +} + // ListVolumeProfilesOptions : The ListVolumeProfiles options. type ListVolumeProfilesOptions struct { // A server-provided token determining what resource to start the page on. @@ -75774,6 +79950,9 @@ type ListVolumesOptions struct { // operating system or any operating system, respectively. OperatingSystemArchitecture *string `json:"operating_system.architecture,omitempty"` + // Filters the collection to volumes with a `storage_generation` property matching the specified value. + StorageGeneration *int64 `json:"storage_generation,omitempty"` + // Filters the collection to resources with an item in the `tags` property matching the exact specified tag. Tag *string `json:"tag,omitempty"` @@ -75846,6 +80025,12 @@ func (_options *ListVolumesOptions) SetOperatingSystemArchitecture(operatingSyst return _options } +// SetStorageGeneration : Allow user to set StorageGeneration +func (_options *ListVolumesOptions) SetStorageGeneration(storageGeneration int64) *ListVolumesOptions { + _options.StorageGeneration = core.Int64Ptr(storageGeneration) + return _options +} + // SetTag : Allow user to set Tag func (_options *ListVolumesOptions) SetTag(tag string) *ListVolumesOptions { _options.Tag = core.StringPtr(tag) @@ -76232,6 +80417,34 @@ func (options *ListVpcsOptions) SetHeaders(param map[string]string) *ListVpcsOpt return options } +// ListVPNGatewayAdvertisedCIDRsOptions : The ListVPNGatewayAdvertisedCIDRs options. +type ListVPNGatewayAdvertisedCIDRsOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewListVPNGatewayAdvertisedCIDRsOptions : Instantiate ListVPNGatewayAdvertisedCIDRsOptions +func (*VpcV1) NewListVPNGatewayAdvertisedCIDRsOptions(vpnGatewayID string) *ListVPNGatewayAdvertisedCIDRsOptions { + return &ListVPNGatewayAdvertisedCIDRsOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *ListVPNGatewayAdvertisedCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayAdvertisedCIDRsOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewayAdvertisedCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayAdvertisedCIDRsOptions { + options.Headers = param + return options +} + // ListVPNGatewayConnectionsLocalCIDRsOptions : The ListVPNGatewayConnectionsLocalCIDRs options. type ListVPNGatewayConnectionsLocalCIDRsOptions struct { // The VPN gateway identifier. @@ -76370,6 +80583,52 @@ func (options *ListVPNGatewayConnectionsPeerCIDRsOptions) SetHeaders(param map[s return options } +// ListVPNGatewayServiceConnectionsOptions : The ListVPNGatewayServiceConnections options. +type ListVPNGatewayServiceConnectionsOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_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"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewListVPNGatewayServiceConnectionsOptions : Instantiate ListVPNGatewayServiceConnectionsOptions +func (*VpcV1) NewListVPNGatewayServiceConnectionsOptions(vpnGatewayID string) *ListVPNGatewayServiceConnectionsOptions { + return &ListVPNGatewayServiceConnectionsOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *ListVPNGatewayServiceConnectionsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayServiceConnectionsOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListVPNGatewayServiceConnectionsOptions) SetStart(start string) *ListVPNGatewayServiceConnectionsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVPNGatewayServiceConnectionsOptions) SetLimit(limit int64) *ListVPNGatewayServiceConnectionsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewayServiceConnectionsOptions) SetHeaders(param map[string]string) *ListVPNGatewayServiceConnectionsOptions { + options.Headers = param + return options +} + // ListVPNGatewaysOptions : The ListVPNGateways options. type ListVPNGatewaysOptions struct { // A server-provided token determining what resource to start the page on. @@ -77481,13 +81740,16 @@ func UnmarshalLoadBalancerListenerCollection(m map[string]json.RawMessage, resul return } -// LoadBalancerListenerDefaultPoolPatch : The default pool for this listener. If `https_redirect` is set, the default pool will not be used. The specified pool -// must: +// LoadBalancerListenerDefaultPoolPatch : The default pool for this listener. If `https_redirect` is specified, the default pool will not be used. // +// 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 +// - Not already be the `default_pool` for another listener. +// - Not already be the `failsafe_policy.target` for another `default_pool` and +// `failsafe_policy.target` (applies only to load balancers in the `network` +// family). // // Specify `null` to remove an existing default pool. // Models which "extend" this model: @@ -77746,13 +82008,17 @@ type LoadBalancerListenerPatch struct { // Supported for load balancers in the `application` family. ConnectionLimit *int64 `json:"connection_limit,omitempty"` - // The default pool for this listener. If `https_redirect` is set, the default pool will not - // be used. The specified pool must: + // The default pool for this listener. If `https_redirect` is specified, the + // default pool will not be used. // + // 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 + // - Not already be the `default_pool` for another listener. + // - Not already be the `failsafe_policy.target` for another `default_pool` and + // `failsafe_policy.target` (applies only to load balancers in the `network` + // family). // // Specify `null` to remove an existing default pool. DefaultPool LoadBalancerListenerDefaultPoolPatchIntf `json:"default_pool,omitempty"` @@ -78798,13 +83064,13 @@ func UnmarshalLoadBalancerListenerPolicyTarget(m map[string]json.RawMessage, res // - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch // - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerIdentity type LoadBalancerListenerPolicyTargetPatch struct { - // The unique identifier for this load balancer pool. + // The unique identifier for this load balancer pool or the unique identifier for this load balancer listener. ID *string `json:"id,omitempty"` - // The URL for this load balancer pool. + // The URL for this load balancer pool or the URL for this load balancer listener. Href *string `json:"href,omitempty"` - // The HTTP status code for this redirect. + // The HTTP status code for this redirect or the HTTP status code for this redirect. HTTPStatusCode *int64 `json:"http_status_code,omitempty"` // The target listener. @@ -78924,13 +83190,13 @@ func (loadBalancerListenerPolicyTargetPatch *LoadBalancerListenerPolicyTargetPat // - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyHTTPSRedirectPrototype // - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype type LoadBalancerListenerPolicyTargetPrototype struct { - // The unique identifier for this load balancer pool. + // The unique identifier for this load balancer pool or the unique identifier for this load balancer listener. ID *string `json:"id,omitempty"` - // The URL for this load balancer pool. + // The URL for this load balancer pool or the URL for this load balancer listener. Href *string `json:"href,omitempty"` - // The HTTP status code for this redirect. + // The HTTP status code for this redirect or the HTTP status code for this redirect. HTTPStatusCode *int64 `json:"http_status_code,omitempty"` // The target listener. @@ -79726,11 +83992,24 @@ type LoadBalancerPoolFailsafePolicyPatch struct { // - Belong to this load balancer // - Have the same `protocol` as this pool, or have a compatible protocol. // At present, the compatible protocols are `http` and `https`. - // - Not have a `failsafe_policy.action` of `forward` or `bypass`. + // + // For load balancers in the `application` family, the failsafe target pool must not + // already be the default pool or a failsafe target pool for the same listener. + // + // For load balancers in the `network` family, the pool specified in the URL must not + // be a failsafe target pool for another pool. // // If specified, `action` must be `forward`. // // Specify `null` to remove an existing failsafe target pool. + // + // **For more information, see:** + // - [Creating an application load balancer]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers&interface=ui) + // - [Working with application load balancer pools]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-alb-pools&interface=ui) + // - [Working with network load balancer pools]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-nlb-pools&interface=ui). Target LoadBalancerPoolFailsafePolicyTargetPatchIntf `json:"target,omitempty"` } @@ -79798,9 +84077,22 @@ type LoadBalancerPoolFailsafePolicyPrototype struct { // - Belong to this load balancer // - Have the same `protocol` as this pool, or have a compatible protocol. // At present, the compatible protocols are `http` and `https`. - // - Have a `failsafe_policy.action` of `fail` or `drop` + // + // For load balancers in the `application` family, the failsafe target pool must not + // already be the default pool or a failsafe target pool for the same listener. + // + // For load balancers in the `network` family, the pool specified in the URL must not + // be a failsafe target pool for another pool. // // If specified, `action` must be `forward`. + // + // **For more information, see:** + // - [Creating an application load balancer]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers&interface=ui) + // - [Working with application load balancer pools]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-alb-pools&interface=ui) + // - [Working with network load balancer pools]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-nlb-pools&interface=ui). Target LoadBalancerPoolIdentityIntf `json:"target,omitempty"` } @@ -79843,11 +84135,25 @@ func UnmarshalLoadBalancerPoolFailsafePolicyPrototype(m map[string]json.RawMessa // - Belong to this load balancer // - Have the same `protocol` as this pool, or have a compatible protocol. // At present, the compatible protocols are `http` and `https`. -// - Not have a `failsafe_policy.action` of `forward` or `bypass`. +// +// For load balancers in the `application` family, the failsafe target pool must not already be the default pool or a +// failsafe target pool for the same listener. +// +// For load balancers in the `network` family, the pool specified in the URL must not be a failsafe target pool for +// another pool. // // If specified, `action` must be `forward`. // // Specify `null` to remove an existing failsafe target pool. +// +// **For more information, see:** +// - [Creating an application load balancer]( +// https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers&interface=ui) +// - [Working with application load balancer pools]( +// https://cloud.ibm.com/docs/vpc?topic=vpc-alb-pools&interface=ui) +// - [Working with network load balancer pools]( +// https://cloud.ibm.com/docs/vpc?topic=vpc-nlb-pools&interface=ui). +// // Models which "extend" this model: // - LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByID // - LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityByHref @@ -79900,8 +84206,8 @@ func (loadBalancerPoolFailsafePolicyTargetPatch *LoadBalancerPoolFailsafePolicyT // LoadBalancerPoolHealthMonitor : LoadBalancerPoolHealthMonitor struct // Models which "extend" this model: -// - LoadBalancerPoolHealthMonitorTypeTCP // - LoadBalancerPoolHealthMonitorTypeHttphttps +// - LoadBalancerPoolHealthMonitorTypeTCP type LoadBalancerPoolHealthMonitor struct { // The seconds to wait between health checks. Delay *int64 `json:"delay" validate:"required"` @@ -80563,7 +84869,8 @@ func UnmarshalLoadBalancerPoolMemberReference(m map[string]json.RawMessage, resu // LoadBalancerPoolMemberTarget : The pool member target. // Models which "extend" this model: // - LoadBalancerPoolMemberTargetInstanceReference -// - LoadBalancerPoolMemberTargetIP +// - LoadBalancerPoolMemberTargetByReservedIP +// - LoadBalancerPoolMemberTargetIPNotReservedIP // - LoadBalancerPoolMemberTargetLoadBalancerReference type LoadBalancerPoolMemberTarget struct { // The CRN for this virtual server instance. @@ -80584,6 +84891,8 @@ type LoadBalancerPoolMemberTarget struct { // The IP address. // + // If the address has not yet been selected, the value will be `0.0.0.0`. + // // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in // the future. Address *string `json:"address,omitempty"` @@ -80595,7 +84904,7 @@ type LoadBalancerPoolMemberTarget struct { // Constants associated with the LoadBalancerPoolMemberTarget.ResourceType property. // The resource type. const ( - LoadBalancerPoolMemberTargetResourceTypeLoadBalancerConst = "load_balancer" + LoadBalancerPoolMemberTargetResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" ) func (*LoadBalancerPoolMemberTarget) isaLoadBalancerPoolMemberTarget() bool { @@ -80656,16 +84965,18 @@ func UnmarshalLoadBalancerPoolMemberTarget(m map[string]json.RawMessage, result // any other load balancer in the same VPC. // Models which "extend" this model: // - LoadBalancerPoolMemberTargetPrototypeInstanceIdentity +// - LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity // - LoadBalancerPoolMemberTargetPrototypeIP // - LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentity type LoadBalancerPoolMemberTargetPrototype struct { - // The unique identifier for this virtual server instance. + // The unique identifier for this virtual server instance or the unique identifier for this reserved IP or the unique + // identifier for this load balancer. ID *string `json:"id,omitempty"` - // The CRN for this virtual server instance. + // The CRN for this virtual server instance or the CRN for this load balancer. CRN *string `json:"crn,omitempty"` - // The URL for this virtual server instance. + // The URL for this virtual server instance or the URL for this reserved IP or the URL for this load balancer. Href *string `json:"href,omitempty"` // The IP address. @@ -80923,6 +85234,10 @@ type LoadBalancerPoolPrototypeLoadBalancerContext struct { // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if // `udp_supported` is `true`). Load balancers in the // `application` family support `tcp`, `http`, and `https`. + // + // **NOTE**: HTTP sends data in plain text, making it vulnerable to eavesdropping and tampering. Additionally, HTTP has + // no built-in mechanism to verify the identity of the server you are connecting to. It is recommended to choose + // `https` instead of `http`. For more details, see: https://www.cloudflare.com/learning/ssl/why-is-http-not-secure. Protocol *string `json:"protocol" validate:"required"` // The PROXY protocol setting for this pool: @@ -80954,6 +85269,10 @@ const ( // The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if // `udp_supported` is `true`). Load balancers in the // `application` family support `tcp`, `http`, and `https`. +// +// **NOTE**: HTTP sends data in plain text, making it vulnerable to eavesdropping and tampering. Additionally, HTTP has +// no built-in mechanism to verify the identity of the server you are connecting to. It is recommended to choose `https` +// instead of `http`. For more details, see: https://www.cloudflare.com/learning/ssl/why-is-http-not-secure. const ( LoadBalancerPoolPrototypeLoadBalancerContextProtocolHTTPConst = "http" LoadBalancerPoolPrototypeLoadBalancerContextProtocolHTTPSConst = "https" @@ -81256,6 +85575,8 @@ type LoadBalancerProfile struct { // The load balancer profiles that load balancers with this profile can target. TargetableLoadBalancerProfiles []LoadBalancerProfileReference `json:"targetable_load_balancer_profiles" validate:"required"` + TargetableResourceTypes *LoadBalancerProfileTargetableResourceTypes `json:"targetable_resource_types" validate:"required"` + UDPSupported LoadBalancerProfileUDPSupportedIntf `json:"udp_supported" validate:"required"` } @@ -81332,6 +85653,11 @@ func UnmarshalLoadBalancerProfile(m map[string]json.RawMessage, result interface err = core.SDKErrorf(err, "", "targetable_load_balancer_profiles-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "targetable_resource_types", &obj.TargetableResourceTypes, UnmarshalLoadBalancerProfileTargetableResourceTypes) + if err != nil { + err = core.SDKErrorf(err, "", "targetable_resource_types-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "udp_supported", &obj.UDPSupported, UnmarshalLoadBalancerProfileUDPSupported) if err != nil { err = core.SDKErrorf(err, "", "udp_supported-error", common.GetComponentInfo()) @@ -81879,6 +86205,53 @@ func UnmarshalLoadBalancerProfileSourceIPSessionPersistenceSupported(m map[strin return } +// LoadBalancerProfileTargetableResourceTypes : LoadBalancerProfileTargetableResourceTypes struct +type LoadBalancerProfileTargetableResourceTypes struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The resource types that pool members of load balancers with this profile can target. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the LoadBalancerProfileTargetableResourceTypes.Type property. +// The type for this profile field. +const ( + LoadBalancerProfileTargetableResourceTypesTypeEnumConst = "enum" +) + +// Constants associated with the LoadBalancerProfileTargetableResourceTypes.Values property. +// The [resource types](https://cloud.ibm.com/docs/vpc?topic=vpc-nlb-vs-elb&interface=ui#lb-comparison-chart) that can +// be targeted by the load balancer pool member: +// - 'instance': Traffic is forwarded to the primary IP address for the instance's +// 'primary_network_interface' or 'primary_network_attachment'. +// - 'subnet_reserved_ip': Traffic is forwarded to the reserved IP address. +// - `load_balancer`: Traffic is forwarded to the load balancer. +// - `ip`: Traffic is forwarded to the IP address. +const ( + LoadBalancerProfileTargetableResourceTypesValuesIPConst = "ip" + LoadBalancerProfileTargetableResourceTypesValuesInstanceConst = "instance" + LoadBalancerProfileTargetableResourceTypesValuesLoadBalancerConst = "load_balancer" + LoadBalancerProfileTargetableResourceTypesValuesSubnetReservedIPConst = "subnet_reserved_ip" +) + +// UnmarshalLoadBalancerProfileTargetableResourceTypes unmarshals an instance of LoadBalancerProfileTargetableResourceTypes from the specified map of raw messages. +func UnmarshalLoadBalancerProfileTargetableResourceTypes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileTargetableResourceTypes) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // LoadBalancerProfileUDPSupported : LoadBalancerProfileUDPSupported struct // Models which "extend" this model: // - LoadBalancerProfileUDPSupportedFixed @@ -82385,9 +86758,11 @@ func UnmarshalNetworkACLReference(m map[string]json.RawMessage, result interface // NetworkACLRule : NetworkACLRule struct // Models which "extend" this model: -// - NetworkACLRuleNetworkACLRuleProtocolAll +// - NetworkACLRuleNetworkACLRuleProtocolAny +// - NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp // - NetworkACLRuleNetworkACLRuleProtocolIcmp // - NetworkACLRuleNetworkACLRuleProtocolTcpudp +// - NetworkACLRuleNetworkACLRuleProtocolIndividual type NetworkACLRule struct { // The action to perform for a packet matching the rule. Action *string `json:"action" validate:"required"` @@ -82399,6 +86774,9 @@ type NetworkACLRule struct { CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. @@ -82411,311 +86789,9 @@ type NetworkACLRule struct { ID *string `json:"id" validate:"required"` // The IP version for this rule. - IPVersion *string `json:"ip_version" validate:"required"` - - // The name for this network ACL rule. The name is unique across all rules for the network ACL. - Name *string `json:"name" validate:"required"` - - // The network protocol. // // The enumerated values for this property may - // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - Protocol *string `json:"protocol" validate:"required"` - - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. - Source *string `json:"source" validate:"required"` - - // The ICMP traffic code to match. - // - // If absent, all codes are matched. - Code *int64 `json:"code,omitempty"` - - // The ICMP traffic type to match. - // - // If absent, all types are matched. - Type *int64 `json:"type,omitempty"` - - // The inclusive upper bound of the TCP or UDP destination port range. - DestinationPortMax *int64 `json:"destination_port_max,omitempty"` - - // The inclusive lower bound of the TCP or UDP destination port range. - DestinationPortMin *int64 `json:"destination_port_min,omitempty"` - - // The inclusive upper bound of the TCP or UDP source port range. - SourcePortMax *int64 `json:"source_port_max,omitempty"` - - // The inclusive lower bound of the TCP or UDP source port range. - SourcePortMin *int64 `json:"source_port_min,omitempty"` -} - -// Constants associated with the NetworkACLRule.Action property. -// The action to perform for a packet matching the rule. -const ( - NetworkACLRuleActionAllowConst = "allow" - NetworkACLRuleActionDenyConst = "deny" -) - -// Constants associated with the NetworkACLRule.Direction property. -// The direction of traffic to match. -const ( - NetworkACLRuleDirectionInboundConst = "inbound" - NetworkACLRuleDirectionOutboundConst = "outbound" -) - -// Constants associated with the NetworkACLRule.IPVersion property. -// The IP version for this rule. -const ( - NetworkACLRuleIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the NetworkACLRule.Protocol property. -// The network protocol. -// -// The enumerated values for this property may -// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. -const ( - NetworkACLRuleProtocolAllConst = "all" - NetworkACLRuleProtocolIcmpConst = "icmp" - NetworkACLRuleProtocolTCPConst = "tcp" - NetworkACLRuleProtocolUDPConst = "udp" -) - -func (*NetworkACLRule) isaNetworkACLRule() bool { - return true -} - -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 { - errMsg := fmt.Sprintf("error unmarshalling discriminator property 'protocol': %s", err.Error()) - err = core.SDKErrorf(err, errMsg, "discriminator-unmarshal-error", common.GetComponentInfo()) - return - } - if discValue == "" { - err = core.SDKErrorf(err, "required discriminator property 'protocol' not found in JSON object", "missing-discriminator", common.GetComponentInfo()) - return - } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll) - if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolAll-error", common.GetComponentInfo()) - } - } else if discValue == "icmp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp) - if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIcmp-error", common.GetComponentInfo()) - } - } else if discValue == "tcp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) - if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolTcpudp-error", common.GetComponentInfo()) - } - } else if discValue == "udp" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) - if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolTcpudp-error", common.GetComponentInfo()) - } - } else { - errMsg := fmt.Sprintf("unrecognized value for discriminator property 'protocol': %s", discValue) - err = core.SDKErrorf(err, errMsg, "invalid-discriminator", common.GetComponentInfo()) - } - 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 - asPatch() map[string]interface{} -} - -// 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 { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// asPatch returns a generic map representation of the NetworkACLRuleBeforePatch -func (networkACLRuleBeforePatch *NetworkACLRuleBeforePatch) asPatch() (_patch map[string]interface{}) { - _patch = map[string]interface{}{} - if !core.IsNil(networkACLRuleBeforePatch.ID) { - _patch["id"] = networkACLRuleBeforePatch.ID - } - if !core.IsNil(networkACLRuleBeforePatch.Href) { - _patch["href"] = networkACLRuleBeforePatch.Href - } - - return -} - -// NetworkACLRuleBeforePrototype : The rule to insert this rule immediately before. -// -// If unspecified, 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 { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// NetworkACLRuleCollection : NetworkACLRuleCollection struct -type NetworkACLRuleCollection struct { - // A link to the first page of resources. - First *PageLink `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 *PageLink `json:"next,omitempty"` - - // A page of ordered rules (sorted based on the `before` property) for the network ACL. - Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" 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, UnmarshalPageLink) - if err != nil { - err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPageLink) - if err != nil { - err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) - if err != nil { - err = core.SDKErrorf(err, "", "rules-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) - 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 *NetworkACLRuleCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil { - err = core.SDKErrorf(err, "", "read-query-param-error", common.GetComponentInfo()) - return nil, err - } else if start == nil { - return nil, nil - } - return start, nil -} - -// NetworkACLRuleItem : NetworkACLRuleItem struct -// Models which "extend" this model: -// - NetworkACLRuleItemNetworkACLRuleProtocolAll -// - NetworkACLRuleItemNetworkACLRuleProtocolIcmp -// - NetworkACLRuleItemNetworkACLRuleProtocolTcpudp -type NetworkACLRuleItem struct { - // The action to perform for a packet matching the rule. - 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 IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - Destination *string `json:"destination" validate:"required"` - - // The direction of traffic to match. - 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. + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. IPVersion *string `json:"ip_version" validate:"required"` // The name for this network ACL rule. The name is unique across all rules for the network ACL. @@ -82728,6 +86804,1857 @@ type NetworkACLRuleItem struct { Protocol *string `json:"protocol" validate:"required"` // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. + Source *string `json:"source" validate:"required"` + + // The ICMP traffic code to match. + // + // If absent, all codes are matched. + Code *int64 `json:"code,omitempty"` + + // The ICMP traffic type to match. + // + // If absent, all types are matched. + Type *int64 `json:"type,omitempty"` + + // The inclusive upper bound of the TCP or UDP destination port range. + DestinationPortMax *int64 `json:"destination_port_max,omitempty"` + + // The inclusive lower bound of the TCP or UDP destination port range. + DestinationPortMin *int64 `json:"destination_port_min,omitempty"` + + // The inclusive upper bound of the TCP or UDP source port range. + SourcePortMax *int64 `json:"source_port_max,omitempty"` + + // The inclusive lower bound of the TCP or UDP source port range. + SourcePortMin *int64 `json:"source_port_min,omitempty"` +} + +// Constants associated with the NetworkACLRule.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRuleActionAllowConst = "allow" + NetworkACLRuleActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRule.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleDirectionInboundConst = "inbound" + NetworkACLRuleDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRule.IPVersion property. +// The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. +const ( + NetworkACLRuleIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRule.Protocol property. +// The network protocol. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + NetworkACLRuleProtocolAhConst = "ah" + NetworkACLRuleProtocolAnyConst = "any" + NetworkACLRuleProtocolEspConst = "esp" + NetworkACLRuleProtocolGreConst = "gre" + NetworkACLRuleProtocolIPInIPConst = "ip_in_ip" + NetworkACLRuleProtocolIcmpConst = "icmp" + NetworkACLRuleProtocolIcmpTCPUDPConst = "icmp_tcp_udp" + NetworkACLRuleProtocolL2tpConst = "l2tp" + NetworkACLRuleProtocolNumber0Const = "number_0" + NetworkACLRuleProtocolNumber10Const = "number_10" + NetworkACLRuleProtocolNumber100Const = "number_100" + NetworkACLRuleProtocolNumber101Const = "number_101" + NetworkACLRuleProtocolNumber102Const = "number_102" + NetworkACLRuleProtocolNumber103Const = "number_103" + NetworkACLRuleProtocolNumber104Const = "number_104" + NetworkACLRuleProtocolNumber105Const = "number_105" + NetworkACLRuleProtocolNumber106Const = "number_106" + NetworkACLRuleProtocolNumber107Const = "number_107" + NetworkACLRuleProtocolNumber108Const = "number_108" + NetworkACLRuleProtocolNumber109Const = "number_109" + NetworkACLRuleProtocolNumber11Const = "number_11" + NetworkACLRuleProtocolNumber110Const = "number_110" + NetworkACLRuleProtocolNumber111Const = "number_111" + NetworkACLRuleProtocolNumber113Const = "number_113" + NetworkACLRuleProtocolNumber114Const = "number_114" + NetworkACLRuleProtocolNumber116Const = "number_116" + NetworkACLRuleProtocolNumber117Const = "number_117" + NetworkACLRuleProtocolNumber118Const = "number_118" + NetworkACLRuleProtocolNumber119Const = "number_119" + NetworkACLRuleProtocolNumber12Const = "number_12" + NetworkACLRuleProtocolNumber120Const = "number_120" + NetworkACLRuleProtocolNumber121Const = "number_121" + NetworkACLRuleProtocolNumber122Const = "number_122" + NetworkACLRuleProtocolNumber123Const = "number_123" + NetworkACLRuleProtocolNumber124Const = "number_124" + NetworkACLRuleProtocolNumber125Const = "number_125" + NetworkACLRuleProtocolNumber126Const = "number_126" + NetworkACLRuleProtocolNumber127Const = "number_127" + NetworkACLRuleProtocolNumber128Const = "number_128" + NetworkACLRuleProtocolNumber129Const = "number_129" + NetworkACLRuleProtocolNumber13Const = "number_13" + NetworkACLRuleProtocolNumber130Const = "number_130" + NetworkACLRuleProtocolNumber131Const = "number_131" + NetworkACLRuleProtocolNumber133Const = "number_133" + NetworkACLRuleProtocolNumber134Const = "number_134" + NetworkACLRuleProtocolNumber135Const = "number_135" + NetworkACLRuleProtocolNumber136Const = "number_136" + NetworkACLRuleProtocolNumber137Const = "number_137" + NetworkACLRuleProtocolNumber138Const = "number_138" + NetworkACLRuleProtocolNumber139Const = "number_139" + NetworkACLRuleProtocolNumber14Const = "number_14" + NetworkACLRuleProtocolNumber140Const = "number_140" + NetworkACLRuleProtocolNumber141Const = "number_141" + NetworkACLRuleProtocolNumber142Const = "number_142" + NetworkACLRuleProtocolNumber143Const = "number_143" + NetworkACLRuleProtocolNumber144Const = "number_144" + NetworkACLRuleProtocolNumber145Const = "number_145" + NetworkACLRuleProtocolNumber146Const = "number_146" + NetworkACLRuleProtocolNumber147Const = "number_147" + NetworkACLRuleProtocolNumber148Const = "number_148" + NetworkACLRuleProtocolNumber149Const = "number_149" + NetworkACLRuleProtocolNumber15Const = "number_15" + NetworkACLRuleProtocolNumber150Const = "number_150" + NetworkACLRuleProtocolNumber151Const = "number_151" + NetworkACLRuleProtocolNumber152Const = "number_152" + NetworkACLRuleProtocolNumber153Const = "number_153" + NetworkACLRuleProtocolNumber154Const = "number_154" + NetworkACLRuleProtocolNumber155Const = "number_155" + NetworkACLRuleProtocolNumber156Const = "number_156" + NetworkACLRuleProtocolNumber157Const = "number_157" + NetworkACLRuleProtocolNumber158Const = "number_158" + NetworkACLRuleProtocolNumber159Const = "number_159" + NetworkACLRuleProtocolNumber16Const = "number_16" + NetworkACLRuleProtocolNumber160Const = "number_160" + NetworkACLRuleProtocolNumber161Const = "number_161" + NetworkACLRuleProtocolNumber162Const = "number_162" + NetworkACLRuleProtocolNumber163Const = "number_163" + NetworkACLRuleProtocolNumber164Const = "number_164" + NetworkACLRuleProtocolNumber165Const = "number_165" + NetworkACLRuleProtocolNumber166Const = "number_166" + NetworkACLRuleProtocolNumber167Const = "number_167" + NetworkACLRuleProtocolNumber168Const = "number_168" + NetworkACLRuleProtocolNumber169Const = "number_169" + NetworkACLRuleProtocolNumber170Const = "number_170" + NetworkACLRuleProtocolNumber171Const = "number_171" + NetworkACLRuleProtocolNumber172Const = "number_172" + NetworkACLRuleProtocolNumber173Const = "number_173" + NetworkACLRuleProtocolNumber174Const = "number_174" + NetworkACLRuleProtocolNumber175Const = "number_175" + NetworkACLRuleProtocolNumber176Const = "number_176" + NetworkACLRuleProtocolNumber177Const = "number_177" + NetworkACLRuleProtocolNumber178Const = "number_178" + NetworkACLRuleProtocolNumber179Const = "number_179" + NetworkACLRuleProtocolNumber18Const = "number_18" + NetworkACLRuleProtocolNumber180Const = "number_180" + NetworkACLRuleProtocolNumber181Const = "number_181" + NetworkACLRuleProtocolNumber182Const = "number_182" + NetworkACLRuleProtocolNumber183Const = "number_183" + NetworkACLRuleProtocolNumber184Const = "number_184" + NetworkACLRuleProtocolNumber185Const = "number_185" + NetworkACLRuleProtocolNumber186Const = "number_186" + NetworkACLRuleProtocolNumber187Const = "number_187" + NetworkACLRuleProtocolNumber188Const = "number_188" + NetworkACLRuleProtocolNumber189Const = "number_189" + NetworkACLRuleProtocolNumber19Const = "number_19" + NetworkACLRuleProtocolNumber190Const = "number_190" + NetworkACLRuleProtocolNumber191Const = "number_191" + NetworkACLRuleProtocolNumber192Const = "number_192" + NetworkACLRuleProtocolNumber193Const = "number_193" + NetworkACLRuleProtocolNumber194Const = "number_194" + NetworkACLRuleProtocolNumber195Const = "number_195" + NetworkACLRuleProtocolNumber196Const = "number_196" + NetworkACLRuleProtocolNumber197Const = "number_197" + NetworkACLRuleProtocolNumber198Const = "number_198" + NetworkACLRuleProtocolNumber199Const = "number_199" + NetworkACLRuleProtocolNumber2Const = "number_2" + NetworkACLRuleProtocolNumber20Const = "number_20" + NetworkACLRuleProtocolNumber200Const = "number_200" + NetworkACLRuleProtocolNumber201Const = "number_201" + NetworkACLRuleProtocolNumber202Const = "number_202" + NetworkACLRuleProtocolNumber203Const = "number_203" + NetworkACLRuleProtocolNumber204Const = "number_204" + NetworkACLRuleProtocolNumber205Const = "number_205" + NetworkACLRuleProtocolNumber206Const = "number_206" + NetworkACLRuleProtocolNumber207Const = "number_207" + NetworkACLRuleProtocolNumber208Const = "number_208" + NetworkACLRuleProtocolNumber209Const = "number_209" + NetworkACLRuleProtocolNumber21Const = "number_21" + NetworkACLRuleProtocolNumber210Const = "number_210" + NetworkACLRuleProtocolNumber211Const = "number_211" + NetworkACLRuleProtocolNumber212Const = "number_212" + NetworkACLRuleProtocolNumber213Const = "number_213" + NetworkACLRuleProtocolNumber214Const = "number_214" + NetworkACLRuleProtocolNumber215Const = "number_215" + NetworkACLRuleProtocolNumber216Const = "number_216" + NetworkACLRuleProtocolNumber217Const = "number_217" + NetworkACLRuleProtocolNumber218Const = "number_218" + NetworkACLRuleProtocolNumber219Const = "number_219" + NetworkACLRuleProtocolNumber22Const = "number_22" + NetworkACLRuleProtocolNumber220Const = "number_220" + NetworkACLRuleProtocolNumber221Const = "number_221" + NetworkACLRuleProtocolNumber222Const = "number_222" + NetworkACLRuleProtocolNumber223Const = "number_223" + NetworkACLRuleProtocolNumber224Const = "number_224" + NetworkACLRuleProtocolNumber225Const = "number_225" + NetworkACLRuleProtocolNumber226Const = "number_226" + NetworkACLRuleProtocolNumber227Const = "number_227" + NetworkACLRuleProtocolNumber228Const = "number_228" + NetworkACLRuleProtocolNumber229Const = "number_229" + NetworkACLRuleProtocolNumber23Const = "number_23" + NetworkACLRuleProtocolNumber230Const = "number_230" + NetworkACLRuleProtocolNumber231Const = "number_231" + NetworkACLRuleProtocolNumber232Const = "number_232" + NetworkACLRuleProtocolNumber233Const = "number_233" + NetworkACLRuleProtocolNumber234Const = "number_234" + NetworkACLRuleProtocolNumber235Const = "number_235" + NetworkACLRuleProtocolNumber236Const = "number_236" + NetworkACLRuleProtocolNumber237Const = "number_237" + NetworkACLRuleProtocolNumber238Const = "number_238" + NetworkACLRuleProtocolNumber239Const = "number_239" + NetworkACLRuleProtocolNumber24Const = "number_24" + NetworkACLRuleProtocolNumber240Const = "number_240" + NetworkACLRuleProtocolNumber241Const = "number_241" + NetworkACLRuleProtocolNumber242Const = "number_242" + NetworkACLRuleProtocolNumber243Const = "number_243" + NetworkACLRuleProtocolNumber244Const = "number_244" + NetworkACLRuleProtocolNumber245Const = "number_245" + NetworkACLRuleProtocolNumber246Const = "number_246" + NetworkACLRuleProtocolNumber247Const = "number_247" + NetworkACLRuleProtocolNumber248Const = "number_248" + NetworkACLRuleProtocolNumber249Const = "number_249" + NetworkACLRuleProtocolNumber25Const = "number_25" + NetworkACLRuleProtocolNumber250Const = "number_250" + NetworkACLRuleProtocolNumber251Const = "number_251" + NetworkACLRuleProtocolNumber252Const = "number_252" + NetworkACLRuleProtocolNumber253Const = "number_253" + NetworkACLRuleProtocolNumber254Const = "number_254" + NetworkACLRuleProtocolNumber255Const = "number_255" + NetworkACLRuleProtocolNumber26Const = "number_26" + NetworkACLRuleProtocolNumber27Const = "number_27" + NetworkACLRuleProtocolNumber28Const = "number_28" + NetworkACLRuleProtocolNumber29Const = "number_29" + NetworkACLRuleProtocolNumber3Const = "number_3" + NetworkACLRuleProtocolNumber30Const = "number_30" + NetworkACLRuleProtocolNumber31Const = "number_31" + NetworkACLRuleProtocolNumber32Const = "number_32" + NetworkACLRuleProtocolNumber33Const = "number_33" + NetworkACLRuleProtocolNumber34Const = "number_34" + NetworkACLRuleProtocolNumber35Const = "number_35" + NetworkACLRuleProtocolNumber36Const = "number_36" + NetworkACLRuleProtocolNumber37Const = "number_37" + NetworkACLRuleProtocolNumber38Const = "number_38" + NetworkACLRuleProtocolNumber39Const = "number_39" + NetworkACLRuleProtocolNumber40Const = "number_40" + NetworkACLRuleProtocolNumber41Const = "number_41" + NetworkACLRuleProtocolNumber42Const = "number_42" + NetworkACLRuleProtocolNumber43Const = "number_43" + NetworkACLRuleProtocolNumber44Const = "number_44" + NetworkACLRuleProtocolNumber45Const = "number_45" + NetworkACLRuleProtocolNumber48Const = "number_48" + NetworkACLRuleProtocolNumber49Const = "number_49" + NetworkACLRuleProtocolNumber5Const = "number_5" + NetworkACLRuleProtocolNumber52Const = "number_52" + NetworkACLRuleProtocolNumber53Const = "number_53" + NetworkACLRuleProtocolNumber54Const = "number_54" + NetworkACLRuleProtocolNumber55Const = "number_55" + NetworkACLRuleProtocolNumber56Const = "number_56" + NetworkACLRuleProtocolNumber57Const = "number_57" + NetworkACLRuleProtocolNumber58Const = "number_58" + NetworkACLRuleProtocolNumber59Const = "number_59" + NetworkACLRuleProtocolNumber60Const = "number_60" + NetworkACLRuleProtocolNumber61Const = "number_61" + NetworkACLRuleProtocolNumber62Const = "number_62" + NetworkACLRuleProtocolNumber63Const = "number_63" + NetworkACLRuleProtocolNumber64Const = "number_64" + NetworkACLRuleProtocolNumber65Const = "number_65" + NetworkACLRuleProtocolNumber66Const = "number_66" + NetworkACLRuleProtocolNumber67Const = "number_67" + NetworkACLRuleProtocolNumber68Const = "number_68" + NetworkACLRuleProtocolNumber69Const = "number_69" + NetworkACLRuleProtocolNumber7Const = "number_7" + NetworkACLRuleProtocolNumber70Const = "number_70" + NetworkACLRuleProtocolNumber71Const = "number_71" + NetworkACLRuleProtocolNumber72Const = "number_72" + NetworkACLRuleProtocolNumber73Const = "number_73" + NetworkACLRuleProtocolNumber74Const = "number_74" + NetworkACLRuleProtocolNumber75Const = "number_75" + NetworkACLRuleProtocolNumber76Const = "number_76" + NetworkACLRuleProtocolNumber77Const = "number_77" + NetworkACLRuleProtocolNumber78Const = "number_78" + NetworkACLRuleProtocolNumber79Const = "number_79" + NetworkACLRuleProtocolNumber8Const = "number_8" + NetworkACLRuleProtocolNumber80Const = "number_80" + NetworkACLRuleProtocolNumber81Const = "number_81" + NetworkACLRuleProtocolNumber82Const = "number_82" + NetworkACLRuleProtocolNumber83Const = "number_83" + NetworkACLRuleProtocolNumber84Const = "number_84" + NetworkACLRuleProtocolNumber85Const = "number_85" + NetworkACLRuleProtocolNumber86Const = "number_86" + NetworkACLRuleProtocolNumber87Const = "number_87" + NetworkACLRuleProtocolNumber88Const = "number_88" + NetworkACLRuleProtocolNumber89Const = "number_89" + NetworkACLRuleProtocolNumber9Const = "number_9" + NetworkACLRuleProtocolNumber90Const = "number_90" + NetworkACLRuleProtocolNumber91Const = "number_91" + NetworkACLRuleProtocolNumber92Const = "number_92" + NetworkACLRuleProtocolNumber93Const = "number_93" + NetworkACLRuleProtocolNumber94Const = "number_94" + NetworkACLRuleProtocolNumber95Const = "number_95" + NetworkACLRuleProtocolNumber96Const = "number_96" + NetworkACLRuleProtocolNumber97Const = "number_97" + NetworkACLRuleProtocolNumber98Const = "number_98" + NetworkACLRuleProtocolNumber99Const = "number_99" + NetworkACLRuleProtocolRsvpConst = "rsvp" + NetworkACLRuleProtocolSctpConst = "sctp" + NetworkACLRuleProtocolTCPConst = "tcp" + NetworkACLRuleProtocolUDPConst = "udp" + NetworkACLRuleProtocolVrrpConst = "vrrp" +) + +func (*NetworkACLRule) isaNetworkACLRule() bool { + return true +} + +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 { + errMsg := fmt.Sprintf("error unmarshalling discriminator property 'protocol': %s", err.Error()) + err = core.SDKErrorf(err, errMsg, "discriminator-unmarshal-error", common.GetComponentInfo()) + return + } + if discValue == "" { + err = core.SDKErrorf(err, "required discriminator property 'protocol' not found in JSON object", "missing-discriminator", common.GetComponentInfo()) + return + } + if discValue == "ah" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "any" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolAny) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolAny-error", common.GetComponentInfo()) + } + } else if discValue == "esp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "gre" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "icmp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIcmp-error", common.GetComponentInfo()) + } + } else if discValue == "icmp_tcp_udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmptcpudp) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp-error", common.GetComponentInfo()) + } + } else if discValue == "ip_in_ip" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "l2tp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_0" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_10" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_100" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_101" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_102" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_103" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_104" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_105" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_106" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_107" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_108" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_109" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_11" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_110" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_111" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_113" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_114" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_116" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_117" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_118" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_119" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_12" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_120" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_121" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_122" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_123" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_124" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_125" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_126" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_127" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_128" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_129" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_13" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_130" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_131" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_133" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_134" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_135" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_136" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_137" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_138" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_139" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_14" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_140" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_141" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_142" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_143" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_144" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_145" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_146" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_147" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_148" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_149" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_15" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_150" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_151" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_152" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_153" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_154" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_155" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_156" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_157" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_158" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_159" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_16" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_160" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_161" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_162" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_163" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_164" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_165" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_166" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_167" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_168" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_169" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_170" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_171" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_172" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_173" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_174" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_175" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_176" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_177" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_178" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_179" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_18" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_180" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_181" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_182" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_183" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_184" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_185" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_186" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_187" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_188" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_189" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_19" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_190" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_191" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_192" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_193" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_194" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_195" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_196" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_197" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_198" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_199" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_2" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_20" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_200" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_201" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_202" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_203" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_204" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_205" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_206" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_207" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_208" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_209" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_21" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_210" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_211" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_212" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_213" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_214" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_215" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_216" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_217" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_218" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_219" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_22" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_220" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_221" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_222" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_223" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_224" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_225" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_226" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_227" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_228" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_229" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_23" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_230" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_231" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_232" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_233" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_234" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_235" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_236" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_237" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_238" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_239" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_24" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_240" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_241" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_242" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_243" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_244" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_245" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_246" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_247" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_248" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_249" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_25" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_250" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_251" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_252" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_253" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_254" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_255" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_26" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_27" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_28" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_29" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_3" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_30" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_31" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_32" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_33" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_34" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_35" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_36" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_37" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_38" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_39" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_40" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_41" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_42" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_43" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_44" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_45" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_48" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_49" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_5" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_52" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_53" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_54" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_55" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_56" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_57" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_58" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_59" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_60" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_61" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_62" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_63" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_64" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_65" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_66" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_67" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_68" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_69" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_7" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_70" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_71" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_72" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_73" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_74" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_75" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_76" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_77" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_78" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_79" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_8" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_80" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_81" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_82" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_83" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_84" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_85" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_86" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_87" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_88" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_89" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_9" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_90" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_91" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_92" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_93" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_94" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_95" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_96" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_97" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_98" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_99" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "rsvp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "sctp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "tcp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolTcpudp-error", common.GetComponentInfo()) + } + } else if discValue == "udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolTcpudp) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolTcpudp-error", common.GetComponentInfo()) + } + } else if discValue == "vrrp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else { + // errMsg := fmt.Sprintf("unrecognized value for discriminator property 'protocol': %s", discValue) + // err = core.SDKErrorf(err, errMsg, "invalid-discriminator", common.GetComponentInfo()) + // Fallback to base NetworkACLRule for unknown protocols + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleGeneric) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemGeneric-error", common.GetComponentInfo()) + } + } + 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 + asPatch() map[string]interface{} +} + +// 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 { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the NetworkACLRuleBeforePatch +func (networkACLRuleBeforePatch *NetworkACLRuleBeforePatch) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(networkACLRuleBeforePatch.ID) { + _patch["id"] = networkACLRuleBeforePatch.ID + } + if !core.IsNil(networkACLRuleBeforePatch.Href) { + _patch["href"] = networkACLRuleBeforePatch.Href + } + + return +} + +// NetworkACLRuleBeforePrototype : The rule to insert this rule immediately before. +// +// If unspecified, 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 { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkACLRuleCollection : NetworkACLRuleCollection struct +type NetworkACLRuleCollection struct { + // A link to the first page of resources. + First *PageLink `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 *PageLink `json:"next,omitempty"` + + // A page of ordered rules (sorted based on the `before` property) for the network ACL. + Rules []NetworkACLRuleItemIntf `json:"rules" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" 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, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalNetworkACLRuleItem) + if err != nil { + err = core.SDKErrorf(err, "", "rules-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) + 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 *NetworkACLRuleCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil { + err = core.SDKErrorf(err, "", "read-query-param-error", common.GetComponentInfo()) + return nil, err + } else if start == nil { + return nil, nil + } + return start, nil +} + +// NetworkACLRuleItem : NetworkACLRuleItem struct +// Models which "extend" this model: +// - NetworkACLRuleItemNetworkACLRuleProtocolAny +// - NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp +// - NetworkACLRuleItemNetworkACLRuleProtocolIcmp +// - NetworkACLRuleItemNetworkACLRuleProtocolTcpudp +// - NetworkACLRuleItemNetworkACLRuleProtocolIndividual +type NetworkACLRuleItem struct { + // The action to perform for a packet matching the rule. + 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 IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. + Destination *string `json:"destination" validate:"required"` + + // The direction of traffic to match. + 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. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. + IPVersion *string `json:"ip_version" validate:"required"` + + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` + + // The network protocol. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Protocol *string `json:"protocol" validate:"required"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. Source *string `json:"source" validate:"required"` // The ICMP traffic code to match. @@ -82769,6 +88696,9 @@ const ( // Constants associated with the NetworkACLRuleItem.IPVersion property. // The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. const ( NetworkACLRuleItemIPVersionIpv4Const = "ipv4" ) @@ -82779,10 +88709,264 @@ const ( // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. const ( - NetworkACLRuleItemProtocolAllConst = "all" - NetworkACLRuleItemProtocolIcmpConst = "icmp" - NetworkACLRuleItemProtocolTCPConst = "tcp" - NetworkACLRuleItemProtocolUDPConst = "udp" + NetworkACLRuleItemProtocolAhConst = "ah" + NetworkACLRuleItemProtocolAnyConst = "any" + NetworkACLRuleItemProtocolEspConst = "esp" + NetworkACLRuleItemProtocolGreConst = "gre" + NetworkACLRuleItemProtocolIPInIPConst = "ip_in_ip" + NetworkACLRuleItemProtocolIcmpConst = "icmp" + NetworkACLRuleItemProtocolIcmpTCPUDPConst = "icmp_tcp_udp" + NetworkACLRuleItemProtocolL2tpConst = "l2tp" + NetworkACLRuleItemProtocolNumber0Const = "number_0" + NetworkACLRuleItemProtocolNumber10Const = "number_10" + NetworkACLRuleItemProtocolNumber100Const = "number_100" + NetworkACLRuleItemProtocolNumber101Const = "number_101" + NetworkACLRuleItemProtocolNumber102Const = "number_102" + NetworkACLRuleItemProtocolNumber103Const = "number_103" + NetworkACLRuleItemProtocolNumber104Const = "number_104" + NetworkACLRuleItemProtocolNumber105Const = "number_105" + NetworkACLRuleItemProtocolNumber106Const = "number_106" + NetworkACLRuleItemProtocolNumber107Const = "number_107" + NetworkACLRuleItemProtocolNumber108Const = "number_108" + NetworkACLRuleItemProtocolNumber109Const = "number_109" + NetworkACLRuleItemProtocolNumber11Const = "number_11" + NetworkACLRuleItemProtocolNumber110Const = "number_110" + NetworkACLRuleItemProtocolNumber111Const = "number_111" + NetworkACLRuleItemProtocolNumber113Const = "number_113" + NetworkACLRuleItemProtocolNumber114Const = "number_114" + NetworkACLRuleItemProtocolNumber116Const = "number_116" + NetworkACLRuleItemProtocolNumber117Const = "number_117" + NetworkACLRuleItemProtocolNumber118Const = "number_118" + NetworkACLRuleItemProtocolNumber119Const = "number_119" + NetworkACLRuleItemProtocolNumber12Const = "number_12" + NetworkACLRuleItemProtocolNumber120Const = "number_120" + NetworkACLRuleItemProtocolNumber121Const = "number_121" + NetworkACLRuleItemProtocolNumber122Const = "number_122" + NetworkACLRuleItemProtocolNumber123Const = "number_123" + NetworkACLRuleItemProtocolNumber124Const = "number_124" + NetworkACLRuleItemProtocolNumber125Const = "number_125" + NetworkACLRuleItemProtocolNumber126Const = "number_126" + NetworkACLRuleItemProtocolNumber127Const = "number_127" + NetworkACLRuleItemProtocolNumber128Const = "number_128" + NetworkACLRuleItemProtocolNumber129Const = "number_129" + NetworkACLRuleItemProtocolNumber13Const = "number_13" + NetworkACLRuleItemProtocolNumber130Const = "number_130" + NetworkACLRuleItemProtocolNumber131Const = "number_131" + NetworkACLRuleItemProtocolNumber133Const = "number_133" + NetworkACLRuleItemProtocolNumber134Const = "number_134" + NetworkACLRuleItemProtocolNumber135Const = "number_135" + NetworkACLRuleItemProtocolNumber136Const = "number_136" + NetworkACLRuleItemProtocolNumber137Const = "number_137" + NetworkACLRuleItemProtocolNumber138Const = "number_138" + NetworkACLRuleItemProtocolNumber139Const = "number_139" + NetworkACLRuleItemProtocolNumber14Const = "number_14" + NetworkACLRuleItemProtocolNumber140Const = "number_140" + NetworkACLRuleItemProtocolNumber141Const = "number_141" + NetworkACLRuleItemProtocolNumber142Const = "number_142" + NetworkACLRuleItemProtocolNumber143Const = "number_143" + NetworkACLRuleItemProtocolNumber144Const = "number_144" + NetworkACLRuleItemProtocolNumber145Const = "number_145" + NetworkACLRuleItemProtocolNumber146Const = "number_146" + NetworkACLRuleItemProtocolNumber147Const = "number_147" + NetworkACLRuleItemProtocolNumber148Const = "number_148" + NetworkACLRuleItemProtocolNumber149Const = "number_149" + NetworkACLRuleItemProtocolNumber15Const = "number_15" + NetworkACLRuleItemProtocolNumber150Const = "number_150" + NetworkACLRuleItemProtocolNumber151Const = "number_151" + NetworkACLRuleItemProtocolNumber152Const = "number_152" + NetworkACLRuleItemProtocolNumber153Const = "number_153" + NetworkACLRuleItemProtocolNumber154Const = "number_154" + NetworkACLRuleItemProtocolNumber155Const = "number_155" + NetworkACLRuleItemProtocolNumber156Const = "number_156" + NetworkACLRuleItemProtocolNumber157Const = "number_157" + NetworkACLRuleItemProtocolNumber158Const = "number_158" + NetworkACLRuleItemProtocolNumber159Const = "number_159" + NetworkACLRuleItemProtocolNumber16Const = "number_16" + NetworkACLRuleItemProtocolNumber160Const = "number_160" + NetworkACLRuleItemProtocolNumber161Const = "number_161" + NetworkACLRuleItemProtocolNumber162Const = "number_162" + NetworkACLRuleItemProtocolNumber163Const = "number_163" + NetworkACLRuleItemProtocolNumber164Const = "number_164" + NetworkACLRuleItemProtocolNumber165Const = "number_165" + NetworkACLRuleItemProtocolNumber166Const = "number_166" + NetworkACLRuleItemProtocolNumber167Const = "number_167" + NetworkACLRuleItemProtocolNumber168Const = "number_168" + NetworkACLRuleItemProtocolNumber169Const = "number_169" + NetworkACLRuleItemProtocolNumber170Const = "number_170" + NetworkACLRuleItemProtocolNumber171Const = "number_171" + NetworkACLRuleItemProtocolNumber172Const = "number_172" + NetworkACLRuleItemProtocolNumber173Const = "number_173" + NetworkACLRuleItemProtocolNumber174Const = "number_174" + NetworkACLRuleItemProtocolNumber175Const = "number_175" + NetworkACLRuleItemProtocolNumber176Const = "number_176" + NetworkACLRuleItemProtocolNumber177Const = "number_177" + NetworkACLRuleItemProtocolNumber178Const = "number_178" + NetworkACLRuleItemProtocolNumber179Const = "number_179" + NetworkACLRuleItemProtocolNumber18Const = "number_18" + NetworkACLRuleItemProtocolNumber180Const = "number_180" + NetworkACLRuleItemProtocolNumber181Const = "number_181" + NetworkACLRuleItemProtocolNumber182Const = "number_182" + NetworkACLRuleItemProtocolNumber183Const = "number_183" + NetworkACLRuleItemProtocolNumber184Const = "number_184" + NetworkACLRuleItemProtocolNumber185Const = "number_185" + NetworkACLRuleItemProtocolNumber186Const = "number_186" + NetworkACLRuleItemProtocolNumber187Const = "number_187" + NetworkACLRuleItemProtocolNumber188Const = "number_188" + NetworkACLRuleItemProtocolNumber189Const = "number_189" + NetworkACLRuleItemProtocolNumber19Const = "number_19" + NetworkACLRuleItemProtocolNumber190Const = "number_190" + NetworkACLRuleItemProtocolNumber191Const = "number_191" + NetworkACLRuleItemProtocolNumber192Const = "number_192" + NetworkACLRuleItemProtocolNumber193Const = "number_193" + NetworkACLRuleItemProtocolNumber194Const = "number_194" + NetworkACLRuleItemProtocolNumber195Const = "number_195" + NetworkACLRuleItemProtocolNumber196Const = "number_196" + NetworkACLRuleItemProtocolNumber197Const = "number_197" + NetworkACLRuleItemProtocolNumber198Const = "number_198" + NetworkACLRuleItemProtocolNumber199Const = "number_199" + NetworkACLRuleItemProtocolNumber2Const = "number_2" + NetworkACLRuleItemProtocolNumber20Const = "number_20" + NetworkACLRuleItemProtocolNumber200Const = "number_200" + NetworkACLRuleItemProtocolNumber201Const = "number_201" + NetworkACLRuleItemProtocolNumber202Const = "number_202" + NetworkACLRuleItemProtocolNumber203Const = "number_203" + NetworkACLRuleItemProtocolNumber204Const = "number_204" + NetworkACLRuleItemProtocolNumber205Const = "number_205" + NetworkACLRuleItemProtocolNumber206Const = "number_206" + NetworkACLRuleItemProtocolNumber207Const = "number_207" + NetworkACLRuleItemProtocolNumber208Const = "number_208" + NetworkACLRuleItemProtocolNumber209Const = "number_209" + NetworkACLRuleItemProtocolNumber21Const = "number_21" + NetworkACLRuleItemProtocolNumber210Const = "number_210" + NetworkACLRuleItemProtocolNumber211Const = "number_211" + NetworkACLRuleItemProtocolNumber212Const = "number_212" + NetworkACLRuleItemProtocolNumber213Const = "number_213" + NetworkACLRuleItemProtocolNumber214Const = "number_214" + NetworkACLRuleItemProtocolNumber215Const = "number_215" + NetworkACLRuleItemProtocolNumber216Const = "number_216" + NetworkACLRuleItemProtocolNumber217Const = "number_217" + NetworkACLRuleItemProtocolNumber218Const = "number_218" + NetworkACLRuleItemProtocolNumber219Const = "number_219" + NetworkACLRuleItemProtocolNumber22Const = "number_22" + NetworkACLRuleItemProtocolNumber220Const = "number_220" + NetworkACLRuleItemProtocolNumber221Const = "number_221" + NetworkACLRuleItemProtocolNumber222Const = "number_222" + NetworkACLRuleItemProtocolNumber223Const = "number_223" + NetworkACLRuleItemProtocolNumber224Const = "number_224" + NetworkACLRuleItemProtocolNumber225Const = "number_225" + NetworkACLRuleItemProtocolNumber226Const = "number_226" + NetworkACLRuleItemProtocolNumber227Const = "number_227" + NetworkACLRuleItemProtocolNumber228Const = "number_228" + NetworkACLRuleItemProtocolNumber229Const = "number_229" + NetworkACLRuleItemProtocolNumber23Const = "number_23" + NetworkACLRuleItemProtocolNumber230Const = "number_230" + NetworkACLRuleItemProtocolNumber231Const = "number_231" + NetworkACLRuleItemProtocolNumber232Const = "number_232" + NetworkACLRuleItemProtocolNumber233Const = "number_233" + NetworkACLRuleItemProtocolNumber234Const = "number_234" + NetworkACLRuleItemProtocolNumber235Const = "number_235" + NetworkACLRuleItemProtocolNumber236Const = "number_236" + NetworkACLRuleItemProtocolNumber237Const = "number_237" + NetworkACLRuleItemProtocolNumber238Const = "number_238" + NetworkACLRuleItemProtocolNumber239Const = "number_239" + NetworkACLRuleItemProtocolNumber24Const = "number_24" + NetworkACLRuleItemProtocolNumber240Const = "number_240" + NetworkACLRuleItemProtocolNumber241Const = "number_241" + NetworkACLRuleItemProtocolNumber242Const = "number_242" + NetworkACLRuleItemProtocolNumber243Const = "number_243" + NetworkACLRuleItemProtocolNumber244Const = "number_244" + NetworkACLRuleItemProtocolNumber245Const = "number_245" + NetworkACLRuleItemProtocolNumber246Const = "number_246" + NetworkACLRuleItemProtocolNumber247Const = "number_247" + NetworkACLRuleItemProtocolNumber248Const = "number_248" + NetworkACLRuleItemProtocolNumber249Const = "number_249" + NetworkACLRuleItemProtocolNumber25Const = "number_25" + NetworkACLRuleItemProtocolNumber250Const = "number_250" + NetworkACLRuleItemProtocolNumber251Const = "number_251" + NetworkACLRuleItemProtocolNumber252Const = "number_252" + NetworkACLRuleItemProtocolNumber253Const = "number_253" + NetworkACLRuleItemProtocolNumber254Const = "number_254" + NetworkACLRuleItemProtocolNumber255Const = "number_255" + NetworkACLRuleItemProtocolNumber26Const = "number_26" + NetworkACLRuleItemProtocolNumber27Const = "number_27" + NetworkACLRuleItemProtocolNumber28Const = "number_28" + NetworkACLRuleItemProtocolNumber29Const = "number_29" + NetworkACLRuleItemProtocolNumber3Const = "number_3" + NetworkACLRuleItemProtocolNumber30Const = "number_30" + NetworkACLRuleItemProtocolNumber31Const = "number_31" + NetworkACLRuleItemProtocolNumber32Const = "number_32" + NetworkACLRuleItemProtocolNumber33Const = "number_33" + NetworkACLRuleItemProtocolNumber34Const = "number_34" + NetworkACLRuleItemProtocolNumber35Const = "number_35" + NetworkACLRuleItemProtocolNumber36Const = "number_36" + NetworkACLRuleItemProtocolNumber37Const = "number_37" + NetworkACLRuleItemProtocolNumber38Const = "number_38" + NetworkACLRuleItemProtocolNumber39Const = "number_39" + NetworkACLRuleItemProtocolNumber40Const = "number_40" + NetworkACLRuleItemProtocolNumber41Const = "number_41" + NetworkACLRuleItemProtocolNumber42Const = "number_42" + NetworkACLRuleItemProtocolNumber43Const = "number_43" + NetworkACLRuleItemProtocolNumber44Const = "number_44" + NetworkACLRuleItemProtocolNumber45Const = "number_45" + NetworkACLRuleItemProtocolNumber48Const = "number_48" + NetworkACLRuleItemProtocolNumber49Const = "number_49" + NetworkACLRuleItemProtocolNumber5Const = "number_5" + NetworkACLRuleItemProtocolNumber52Const = "number_52" + NetworkACLRuleItemProtocolNumber53Const = "number_53" + NetworkACLRuleItemProtocolNumber54Const = "number_54" + NetworkACLRuleItemProtocolNumber55Const = "number_55" + NetworkACLRuleItemProtocolNumber56Const = "number_56" + NetworkACLRuleItemProtocolNumber57Const = "number_57" + NetworkACLRuleItemProtocolNumber58Const = "number_58" + NetworkACLRuleItemProtocolNumber59Const = "number_59" + NetworkACLRuleItemProtocolNumber60Const = "number_60" + NetworkACLRuleItemProtocolNumber61Const = "number_61" + NetworkACLRuleItemProtocolNumber62Const = "number_62" + NetworkACLRuleItemProtocolNumber63Const = "number_63" + NetworkACLRuleItemProtocolNumber64Const = "number_64" + NetworkACLRuleItemProtocolNumber65Const = "number_65" + NetworkACLRuleItemProtocolNumber66Const = "number_66" + NetworkACLRuleItemProtocolNumber67Const = "number_67" + NetworkACLRuleItemProtocolNumber68Const = "number_68" + NetworkACLRuleItemProtocolNumber69Const = "number_69" + NetworkACLRuleItemProtocolNumber7Const = "number_7" + NetworkACLRuleItemProtocolNumber70Const = "number_70" + NetworkACLRuleItemProtocolNumber71Const = "number_71" + NetworkACLRuleItemProtocolNumber72Const = "number_72" + NetworkACLRuleItemProtocolNumber73Const = "number_73" + NetworkACLRuleItemProtocolNumber74Const = "number_74" + NetworkACLRuleItemProtocolNumber75Const = "number_75" + NetworkACLRuleItemProtocolNumber76Const = "number_76" + NetworkACLRuleItemProtocolNumber77Const = "number_77" + NetworkACLRuleItemProtocolNumber78Const = "number_78" + NetworkACLRuleItemProtocolNumber79Const = "number_79" + NetworkACLRuleItemProtocolNumber8Const = "number_8" + NetworkACLRuleItemProtocolNumber80Const = "number_80" + NetworkACLRuleItemProtocolNumber81Const = "number_81" + NetworkACLRuleItemProtocolNumber82Const = "number_82" + NetworkACLRuleItemProtocolNumber83Const = "number_83" + NetworkACLRuleItemProtocolNumber84Const = "number_84" + NetworkACLRuleItemProtocolNumber85Const = "number_85" + NetworkACLRuleItemProtocolNumber86Const = "number_86" + NetworkACLRuleItemProtocolNumber87Const = "number_87" + NetworkACLRuleItemProtocolNumber88Const = "number_88" + NetworkACLRuleItemProtocolNumber89Const = "number_89" + NetworkACLRuleItemProtocolNumber9Const = "number_9" + NetworkACLRuleItemProtocolNumber90Const = "number_90" + NetworkACLRuleItemProtocolNumber91Const = "number_91" + NetworkACLRuleItemProtocolNumber92Const = "number_92" + NetworkACLRuleItemProtocolNumber93Const = "number_93" + NetworkACLRuleItemProtocolNumber94Const = "number_94" + NetworkACLRuleItemProtocolNumber95Const = "number_95" + NetworkACLRuleItemProtocolNumber96Const = "number_96" + NetworkACLRuleItemProtocolNumber97Const = "number_97" + NetworkACLRuleItemProtocolNumber98Const = "number_98" + NetworkACLRuleItemProtocolNumber99Const = "number_99" + NetworkACLRuleItemProtocolRsvpConst = "rsvp" + NetworkACLRuleItemProtocolSctpConst = "sctp" + NetworkACLRuleItemProtocolTCPConst = "tcp" + NetworkACLRuleItemProtocolUDPConst = "udp" + NetworkACLRuleItemProtocolVrrpConst = "vrrp" ) func (*NetworkACLRuleItem) isaNetworkACLRuleItem() bool { @@ -82807,16 +88991,1281 @@ func UnmarshalNetworkACLRuleItem(m map[string]json.RawMessage, result interface{ err = core.SDKErrorf(err, "required discriminator property 'protocol' not found in JSON object", "missing-discriminator", common.GetComponentInfo()) return } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll) + if discValue == "ah" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolAll-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "any" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAny) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolAny-error", common.GetComponentInfo()) + } + } else if discValue == "esp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "gre" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) } } else if discValue == "icmp" { err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp) if err != nil { err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIcmp-error", common.GetComponentInfo()) } + } else if discValue == "icmp_tcp_udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp-error", common.GetComponentInfo()) + } + } else if discValue == "ip_in_ip" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "l2tp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_0" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_10" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_100" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_101" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_102" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_103" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_104" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_105" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_106" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_107" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_108" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_109" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_11" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_110" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_111" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_113" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_114" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_116" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_117" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_118" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_119" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_12" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_120" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_121" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_122" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_123" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_124" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_125" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_126" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_127" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_128" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_129" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_13" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_130" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_131" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_133" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_134" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_135" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_136" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_137" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_138" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_139" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_14" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_140" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_141" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_142" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_143" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_144" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_145" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_146" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_147" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_148" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_149" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_15" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_150" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_151" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_152" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_153" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_154" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_155" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_156" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_157" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_158" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_159" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_16" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_160" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_161" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_162" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_163" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_164" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_165" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_166" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_167" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_168" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_169" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_170" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_171" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_172" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_173" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_174" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_175" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_176" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_177" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_178" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_179" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_18" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_180" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_181" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_182" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_183" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_184" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_185" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_186" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_187" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_188" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_189" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_19" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_190" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_191" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_192" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_193" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_194" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_195" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_196" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_197" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_198" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_199" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_2" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_20" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_200" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_201" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_202" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_203" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_204" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_205" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_206" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_207" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_208" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_209" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_21" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_210" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_211" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_212" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_213" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_214" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_215" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_216" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_217" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_218" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_219" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_22" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_220" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_221" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_222" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_223" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_224" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_225" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_226" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_227" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_228" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_229" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_23" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_230" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_231" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_232" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_233" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_234" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_235" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_236" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_237" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_238" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_239" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_24" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_240" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_241" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_242" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_243" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_244" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_245" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_246" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_247" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_248" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_249" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_25" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_250" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_251" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_252" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_253" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_254" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_255" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_26" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_27" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_28" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_29" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_3" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_30" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_31" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_32" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_33" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_34" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_35" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_36" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_37" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_38" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_39" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_40" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_41" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_42" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_43" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_44" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_45" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_48" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_49" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_5" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_52" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_53" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_54" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_55" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_56" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_57" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_58" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_59" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_60" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_61" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_62" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_63" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_64" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_65" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_66" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_67" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_68" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_69" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_7" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_70" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_71" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_72" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_73" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_74" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_75" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_76" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_77" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_78" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_79" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_8" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_80" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_81" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_82" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_83" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_84" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_85" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_86" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_87" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_88" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_89" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_9" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_90" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_91" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_92" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_93" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_94" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_95" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_96" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_97" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_98" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_99" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "rsvp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "sctp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } } else if discValue == "tcp" { err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp) if err != nil { @@ -82827,16 +90276,170 @@ func UnmarshalNetworkACLRuleItem(m map[string]json.RawMessage, result interface{ if err != nil { err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolTcpudp-error", common.GetComponentInfo()) } + } else if discValue == "vrrp" { + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemNetworkACLRuleProtocolIndividual-error", common.GetComponentInfo()) + } } else { - errMsg := fmt.Sprintf("unrecognized value for discriminator property 'protocol': %s", discValue) - err = core.SDKErrorf(err, errMsg, "invalid-discriminator", common.GetComponentInfo()) + // errMsg := fmt.Sprintf("unrecognized value for discriminator property 'protocol': %s", discValue) + // err = core.SDKErrorf(err, errMsg, "invalid-discriminator", common.GetComponentInfo()) + // Fallback to base NetworkACLRuleItem for unknown protocols + err = core.UnmarshalModel(m, "", result, UnmarshalNetworkACLRuleItemGeneric) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-NetworkACLRuleItemGeneric-error", common.GetComponentInfo()) + } + } + return +} + +// UnmarshalNetworkACLRuleItemGeneric unmarshals the base NetworkACLRuleItem fields for unknown protocol types +func UnmarshalNetworkACLRuleItemGeneric(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleItem) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) + if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + err = core.SDKErrorf(err, "", "destination-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + err = core.SDKErrorf(err, "", "source-error", common.GetComponentInfo()) + return } + + // Attempt to unmarshal optional protocol-specific fields - ignore errors as these may not be present + _ = core.UnmarshalPrimitive(m, "code", &obj.Code) + _ = core.UnmarshalPrimitive(m, "type", &obj.Type) + _ = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) + _ = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) + _ = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) + _ = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) + + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// UnmarshalNetworkACLRuleGeneric unmarshals the base NetworkACLRuleItem fields for unknown protocol types +func UnmarshalNetworkACLRuleGeneric(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRule) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) + if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + err = core.SDKErrorf(err, "", "destination-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + err = core.SDKErrorf(err, "", "source-error", common.GetComponentInfo()) + return + } + + // Attempt to unmarshal optional protocol-specific fields - ignore errors as these may not be present + _ = core.UnmarshalPrimitive(m, "code", &obj.Code) + _ = core.UnmarshalPrimitive(m, "type", &obj.Type) + _ = core.UnmarshalPrimitive(m, "destination_port_max", &obj.DestinationPortMax) + _ = core.UnmarshalPrimitive(m, "destination_port_min", &obj.DestinationPortMin) + _ = core.UnmarshalPrimitive(m, "source_port_max", &obj.SourcePortMax) + _ = core.UnmarshalPrimitive(m, "source_port_min", &obj.SourcePortMin) + + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } // NetworkACLRulePatch : NetworkACLRulePatch struct type NetworkACLRulePatch struct { // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. Action *string `json:"action,omitempty"` // The rule to move this rule immediately before. @@ -82849,7 +90452,7 @@ type NetworkACLRulePatch struct { // Specify `null` to remove an existing ICMP traffic code. Code *int64 `json:"code,omitempty"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. Destination *string `json:"destination,omitempty"` // The inclusive upper bound of the TCP or UDP destination port range. @@ -82868,7 +90471,7 @@ type NetworkACLRulePatch struct { // The name for this network ACL rule. The name must not be used by another rule for the network ACL. Name *string `json:"name,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. Source *string `json:"source,omitempty"` // The inclusive upper bound of the TCP or UDP source port range. @@ -82889,6 +90492,8 @@ type NetworkACLRulePatch struct { // Constants associated with the NetworkACLRulePatch.Action property. // The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. const ( NetworkACLRulePatchActionAllowConst = "allow" NetworkACLRulePatchActionDenyConst = "deny" @@ -83013,11 +90618,15 @@ func (networkACLRulePatch *NetworkACLRulePatch) AsPatch() (_patch map[string]int // NetworkACLRulePrototype : NetworkACLRulePrototype struct // Models which "extend" this model: -// - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype +// - NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype +// - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype // - NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype // - NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype +// - NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype type NetworkACLRulePrototype struct { // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. Action *string `json:"action" validate:"required"` // The rule to insert this rule immediately before. @@ -83025,13 +90634,13 @@ type NetworkACLRulePrototype struct { // If unspecified, this rule will be inserted after all existing rules. Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. Direction *string `json:"direction" validate:"required"` - // The IP version for this rule. + // The IP version to match. The format of `source` and `destination` must match this property. IPVersion *string `json:"ip_version,omitempty"` // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, @@ -83041,7 +90650,7 @@ type NetworkACLRulePrototype struct { // The network protocol. Protocol *string `json:"protocol" validate:"required"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. Source *string `json:"source" validate:"required"` // The ICMP traffic code to match. @@ -83081,6 +90690,8 @@ type NetworkACLRulePrototype struct { // Constants associated with the NetworkACLRulePrototype.Action property. // The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. const ( NetworkACLRulePrototypeActionAllowConst = "allow" NetworkACLRulePrototypeActionDenyConst = "deny" @@ -83094,7 +90705,7 @@ const ( ) // Constants associated with the NetworkACLRulePrototype.IPVersion property. -// The IP version for this rule. +// The IP version to match. The format of `source` and `destination` must match this property. const ( NetworkACLRulePrototypeIPVersionIpv4Const = "ipv4" ) @@ -83102,10 +90713,264 @@ const ( // Constants associated with the NetworkACLRulePrototype.Protocol property. // The network protocol. const ( - NetworkACLRulePrototypeProtocolAllConst = "all" - NetworkACLRulePrototypeProtocolIcmpConst = "icmp" - NetworkACLRulePrototypeProtocolTCPConst = "tcp" - NetworkACLRulePrototypeProtocolUDPConst = "udp" + NetworkACLRulePrototypeProtocolAhConst = "ah" + NetworkACLRulePrototypeProtocolAnyConst = "any" + NetworkACLRulePrototypeProtocolEspConst = "esp" + NetworkACLRulePrototypeProtocolGreConst = "gre" + NetworkACLRulePrototypeProtocolIPInIPConst = "ip_in_ip" + NetworkACLRulePrototypeProtocolIcmpConst = "icmp" + NetworkACLRulePrototypeProtocolIcmpTCPUDPConst = "icmp_tcp_udp" + NetworkACLRulePrototypeProtocolL2tpConst = "l2tp" + NetworkACLRulePrototypeProtocolNumber0Const = "number_0" + NetworkACLRulePrototypeProtocolNumber10Const = "number_10" + NetworkACLRulePrototypeProtocolNumber100Const = "number_100" + NetworkACLRulePrototypeProtocolNumber101Const = "number_101" + NetworkACLRulePrototypeProtocolNumber102Const = "number_102" + NetworkACLRulePrototypeProtocolNumber103Const = "number_103" + NetworkACLRulePrototypeProtocolNumber104Const = "number_104" + NetworkACLRulePrototypeProtocolNumber105Const = "number_105" + NetworkACLRulePrototypeProtocolNumber106Const = "number_106" + NetworkACLRulePrototypeProtocolNumber107Const = "number_107" + NetworkACLRulePrototypeProtocolNumber108Const = "number_108" + NetworkACLRulePrototypeProtocolNumber109Const = "number_109" + NetworkACLRulePrototypeProtocolNumber11Const = "number_11" + NetworkACLRulePrototypeProtocolNumber110Const = "number_110" + NetworkACLRulePrototypeProtocolNumber111Const = "number_111" + NetworkACLRulePrototypeProtocolNumber113Const = "number_113" + NetworkACLRulePrototypeProtocolNumber114Const = "number_114" + NetworkACLRulePrototypeProtocolNumber116Const = "number_116" + NetworkACLRulePrototypeProtocolNumber117Const = "number_117" + NetworkACLRulePrototypeProtocolNumber118Const = "number_118" + NetworkACLRulePrototypeProtocolNumber119Const = "number_119" + NetworkACLRulePrototypeProtocolNumber12Const = "number_12" + NetworkACLRulePrototypeProtocolNumber120Const = "number_120" + NetworkACLRulePrototypeProtocolNumber121Const = "number_121" + NetworkACLRulePrototypeProtocolNumber122Const = "number_122" + NetworkACLRulePrototypeProtocolNumber123Const = "number_123" + NetworkACLRulePrototypeProtocolNumber124Const = "number_124" + NetworkACLRulePrototypeProtocolNumber125Const = "number_125" + NetworkACLRulePrototypeProtocolNumber126Const = "number_126" + NetworkACLRulePrototypeProtocolNumber127Const = "number_127" + NetworkACLRulePrototypeProtocolNumber128Const = "number_128" + NetworkACLRulePrototypeProtocolNumber129Const = "number_129" + NetworkACLRulePrototypeProtocolNumber13Const = "number_13" + NetworkACLRulePrototypeProtocolNumber130Const = "number_130" + NetworkACLRulePrototypeProtocolNumber131Const = "number_131" + NetworkACLRulePrototypeProtocolNumber133Const = "number_133" + NetworkACLRulePrototypeProtocolNumber134Const = "number_134" + NetworkACLRulePrototypeProtocolNumber135Const = "number_135" + NetworkACLRulePrototypeProtocolNumber136Const = "number_136" + NetworkACLRulePrototypeProtocolNumber137Const = "number_137" + NetworkACLRulePrototypeProtocolNumber138Const = "number_138" + NetworkACLRulePrototypeProtocolNumber139Const = "number_139" + NetworkACLRulePrototypeProtocolNumber14Const = "number_14" + NetworkACLRulePrototypeProtocolNumber140Const = "number_140" + NetworkACLRulePrototypeProtocolNumber141Const = "number_141" + NetworkACLRulePrototypeProtocolNumber142Const = "number_142" + NetworkACLRulePrototypeProtocolNumber143Const = "number_143" + NetworkACLRulePrototypeProtocolNumber144Const = "number_144" + NetworkACLRulePrototypeProtocolNumber145Const = "number_145" + NetworkACLRulePrototypeProtocolNumber146Const = "number_146" + NetworkACLRulePrototypeProtocolNumber147Const = "number_147" + NetworkACLRulePrototypeProtocolNumber148Const = "number_148" + NetworkACLRulePrototypeProtocolNumber149Const = "number_149" + NetworkACLRulePrototypeProtocolNumber15Const = "number_15" + NetworkACLRulePrototypeProtocolNumber150Const = "number_150" + NetworkACLRulePrototypeProtocolNumber151Const = "number_151" + NetworkACLRulePrototypeProtocolNumber152Const = "number_152" + NetworkACLRulePrototypeProtocolNumber153Const = "number_153" + NetworkACLRulePrototypeProtocolNumber154Const = "number_154" + NetworkACLRulePrototypeProtocolNumber155Const = "number_155" + NetworkACLRulePrototypeProtocolNumber156Const = "number_156" + NetworkACLRulePrototypeProtocolNumber157Const = "number_157" + NetworkACLRulePrototypeProtocolNumber158Const = "number_158" + NetworkACLRulePrototypeProtocolNumber159Const = "number_159" + NetworkACLRulePrototypeProtocolNumber16Const = "number_16" + NetworkACLRulePrototypeProtocolNumber160Const = "number_160" + NetworkACLRulePrototypeProtocolNumber161Const = "number_161" + NetworkACLRulePrototypeProtocolNumber162Const = "number_162" + NetworkACLRulePrototypeProtocolNumber163Const = "number_163" + NetworkACLRulePrototypeProtocolNumber164Const = "number_164" + NetworkACLRulePrototypeProtocolNumber165Const = "number_165" + NetworkACLRulePrototypeProtocolNumber166Const = "number_166" + NetworkACLRulePrototypeProtocolNumber167Const = "number_167" + NetworkACLRulePrototypeProtocolNumber168Const = "number_168" + NetworkACLRulePrototypeProtocolNumber169Const = "number_169" + NetworkACLRulePrototypeProtocolNumber170Const = "number_170" + NetworkACLRulePrototypeProtocolNumber171Const = "number_171" + NetworkACLRulePrototypeProtocolNumber172Const = "number_172" + NetworkACLRulePrototypeProtocolNumber173Const = "number_173" + NetworkACLRulePrototypeProtocolNumber174Const = "number_174" + NetworkACLRulePrototypeProtocolNumber175Const = "number_175" + NetworkACLRulePrototypeProtocolNumber176Const = "number_176" + NetworkACLRulePrototypeProtocolNumber177Const = "number_177" + NetworkACLRulePrototypeProtocolNumber178Const = "number_178" + NetworkACLRulePrototypeProtocolNumber179Const = "number_179" + NetworkACLRulePrototypeProtocolNumber18Const = "number_18" + NetworkACLRulePrototypeProtocolNumber180Const = "number_180" + NetworkACLRulePrototypeProtocolNumber181Const = "number_181" + NetworkACLRulePrototypeProtocolNumber182Const = "number_182" + NetworkACLRulePrototypeProtocolNumber183Const = "number_183" + NetworkACLRulePrototypeProtocolNumber184Const = "number_184" + NetworkACLRulePrototypeProtocolNumber185Const = "number_185" + NetworkACLRulePrototypeProtocolNumber186Const = "number_186" + NetworkACLRulePrototypeProtocolNumber187Const = "number_187" + NetworkACLRulePrototypeProtocolNumber188Const = "number_188" + NetworkACLRulePrototypeProtocolNumber189Const = "number_189" + NetworkACLRulePrototypeProtocolNumber19Const = "number_19" + NetworkACLRulePrototypeProtocolNumber190Const = "number_190" + NetworkACLRulePrototypeProtocolNumber191Const = "number_191" + NetworkACLRulePrototypeProtocolNumber192Const = "number_192" + NetworkACLRulePrototypeProtocolNumber193Const = "number_193" + NetworkACLRulePrototypeProtocolNumber194Const = "number_194" + NetworkACLRulePrototypeProtocolNumber195Const = "number_195" + NetworkACLRulePrototypeProtocolNumber196Const = "number_196" + NetworkACLRulePrototypeProtocolNumber197Const = "number_197" + NetworkACLRulePrototypeProtocolNumber198Const = "number_198" + NetworkACLRulePrototypeProtocolNumber199Const = "number_199" + NetworkACLRulePrototypeProtocolNumber2Const = "number_2" + NetworkACLRulePrototypeProtocolNumber20Const = "number_20" + NetworkACLRulePrototypeProtocolNumber200Const = "number_200" + NetworkACLRulePrototypeProtocolNumber201Const = "number_201" + NetworkACLRulePrototypeProtocolNumber202Const = "number_202" + NetworkACLRulePrototypeProtocolNumber203Const = "number_203" + NetworkACLRulePrototypeProtocolNumber204Const = "number_204" + NetworkACLRulePrototypeProtocolNumber205Const = "number_205" + NetworkACLRulePrototypeProtocolNumber206Const = "number_206" + NetworkACLRulePrototypeProtocolNumber207Const = "number_207" + NetworkACLRulePrototypeProtocolNumber208Const = "number_208" + NetworkACLRulePrototypeProtocolNumber209Const = "number_209" + NetworkACLRulePrototypeProtocolNumber21Const = "number_21" + NetworkACLRulePrototypeProtocolNumber210Const = "number_210" + NetworkACLRulePrototypeProtocolNumber211Const = "number_211" + NetworkACLRulePrototypeProtocolNumber212Const = "number_212" + NetworkACLRulePrototypeProtocolNumber213Const = "number_213" + NetworkACLRulePrototypeProtocolNumber214Const = "number_214" + NetworkACLRulePrototypeProtocolNumber215Const = "number_215" + NetworkACLRulePrototypeProtocolNumber216Const = "number_216" + NetworkACLRulePrototypeProtocolNumber217Const = "number_217" + NetworkACLRulePrototypeProtocolNumber218Const = "number_218" + NetworkACLRulePrototypeProtocolNumber219Const = "number_219" + NetworkACLRulePrototypeProtocolNumber22Const = "number_22" + NetworkACLRulePrototypeProtocolNumber220Const = "number_220" + NetworkACLRulePrototypeProtocolNumber221Const = "number_221" + NetworkACLRulePrototypeProtocolNumber222Const = "number_222" + NetworkACLRulePrototypeProtocolNumber223Const = "number_223" + NetworkACLRulePrototypeProtocolNumber224Const = "number_224" + NetworkACLRulePrototypeProtocolNumber225Const = "number_225" + NetworkACLRulePrototypeProtocolNumber226Const = "number_226" + NetworkACLRulePrototypeProtocolNumber227Const = "number_227" + NetworkACLRulePrototypeProtocolNumber228Const = "number_228" + NetworkACLRulePrototypeProtocolNumber229Const = "number_229" + NetworkACLRulePrototypeProtocolNumber23Const = "number_23" + NetworkACLRulePrototypeProtocolNumber230Const = "number_230" + NetworkACLRulePrototypeProtocolNumber231Const = "number_231" + NetworkACLRulePrototypeProtocolNumber232Const = "number_232" + NetworkACLRulePrototypeProtocolNumber233Const = "number_233" + NetworkACLRulePrototypeProtocolNumber234Const = "number_234" + NetworkACLRulePrototypeProtocolNumber235Const = "number_235" + NetworkACLRulePrototypeProtocolNumber236Const = "number_236" + NetworkACLRulePrototypeProtocolNumber237Const = "number_237" + NetworkACLRulePrototypeProtocolNumber238Const = "number_238" + NetworkACLRulePrototypeProtocolNumber239Const = "number_239" + NetworkACLRulePrototypeProtocolNumber24Const = "number_24" + NetworkACLRulePrototypeProtocolNumber240Const = "number_240" + NetworkACLRulePrototypeProtocolNumber241Const = "number_241" + NetworkACLRulePrototypeProtocolNumber242Const = "number_242" + NetworkACLRulePrototypeProtocolNumber243Const = "number_243" + NetworkACLRulePrototypeProtocolNumber244Const = "number_244" + NetworkACLRulePrototypeProtocolNumber245Const = "number_245" + NetworkACLRulePrototypeProtocolNumber246Const = "number_246" + NetworkACLRulePrototypeProtocolNumber247Const = "number_247" + NetworkACLRulePrototypeProtocolNumber248Const = "number_248" + NetworkACLRulePrototypeProtocolNumber249Const = "number_249" + NetworkACLRulePrototypeProtocolNumber25Const = "number_25" + NetworkACLRulePrototypeProtocolNumber250Const = "number_250" + NetworkACLRulePrototypeProtocolNumber251Const = "number_251" + NetworkACLRulePrototypeProtocolNumber252Const = "number_252" + NetworkACLRulePrototypeProtocolNumber253Const = "number_253" + NetworkACLRulePrototypeProtocolNumber254Const = "number_254" + NetworkACLRulePrototypeProtocolNumber255Const = "number_255" + NetworkACLRulePrototypeProtocolNumber26Const = "number_26" + NetworkACLRulePrototypeProtocolNumber27Const = "number_27" + NetworkACLRulePrototypeProtocolNumber28Const = "number_28" + NetworkACLRulePrototypeProtocolNumber29Const = "number_29" + NetworkACLRulePrototypeProtocolNumber3Const = "number_3" + NetworkACLRulePrototypeProtocolNumber30Const = "number_30" + NetworkACLRulePrototypeProtocolNumber31Const = "number_31" + NetworkACLRulePrototypeProtocolNumber32Const = "number_32" + NetworkACLRulePrototypeProtocolNumber33Const = "number_33" + NetworkACLRulePrototypeProtocolNumber34Const = "number_34" + NetworkACLRulePrototypeProtocolNumber35Const = "number_35" + NetworkACLRulePrototypeProtocolNumber36Const = "number_36" + NetworkACLRulePrototypeProtocolNumber37Const = "number_37" + NetworkACLRulePrototypeProtocolNumber38Const = "number_38" + NetworkACLRulePrototypeProtocolNumber39Const = "number_39" + NetworkACLRulePrototypeProtocolNumber40Const = "number_40" + NetworkACLRulePrototypeProtocolNumber41Const = "number_41" + NetworkACLRulePrototypeProtocolNumber42Const = "number_42" + NetworkACLRulePrototypeProtocolNumber43Const = "number_43" + NetworkACLRulePrototypeProtocolNumber44Const = "number_44" + NetworkACLRulePrototypeProtocolNumber45Const = "number_45" + NetworkACLRulePrototypeProtocolNumber48Const = "number_48" + NetworkACLRulePrototypeProtocolNumber49Const = "number_49" + NetworkACLRulePrototypeProtocolNumber5Const = "number_5" + NetworkACLRulePrototypeProtocolNumber52Const = "number_52" + NetworkACLRulePrototypeProtocolNumber53Const = "number_53" + NetworkACLRulePrototypeProtocolNumber54Const = "number_54" + NetworkACLRulePrototypeProtocolNumber55Const = "number_55" + NetworkACLRulePrototypeProtocolNumber56Const = "number_56" + NetworkACLRulePrototypeProtocolNumber57Const = "number_57" + NetworkACLRulePrototypeProtocolNumber58Const = "number_58" + NetworkACLRulePrototypeProtocolNumber59Const = "number_59" + NetworkACLRulePrototypeProtocolNumber60Const = "number_60" + NetworkACLRulePrototypeProtocolNumber61Const = "number_61" + NetworkACLRulePrototypeProtocolNumber62Const = "number_62" + NetworkACLRulePrototypeProtocolNumber63Const = "number_63" + NetworkACLRulePrototypeProtocolNumber64Const = "number_64" + NetworkACLRulePrototypeProtocolNumber65Const = "number_65" + NetworkACLRulePrototypeProtocolNumber66Const = "number_66" + NetworkACLRulePrototypeProtocolNumber67Const = "number_67" + NetworkACLRulePrototypeProtocolNumber68Const = "number_68" + NetworkACLRulePrototypeProtocolNumber69Const = "number_69" + NetworkACLRulePrototypeProtocolNumber7Const = "number_7" + NetworkACLRulePrototypeProtocolNumber70Const = "number_70" + NetworkACLRulePrototypeProtocolNumber71Const = "number_71" + NetworkACLRulePrototypeProtocolNumber72Const = "number_72" + NetworkACLRulePrototypeProtocolNumber73Const = "number_73" + NetworkACLRulePrototypeProtocolNumber74Const = "number_74" + NetworkACLRulePrototypeProtocolNumber75Const = "number_75" + NetworkACLRulePrototypeProtocolNumber76Const = "number_76" + NetworkACLRulePrototypeProtocolNumber77Const = "number_77" + NetworkACLRulePrototypeProtocolNumber78Const = "number_78" + NetworkACLRulePrototypeProtocolNumber79Const = "number_79" + NetworkACLRulePrototypeProtocolNumber8Const = "number_8" + NetworkACLRulePrototypeProtocolNumber80Const = "number_80" + NetworkACLRulePrototypeProtocolNumber81Const = "number_81" + NetworkACLRulePrototypeProtocolNumber82Const = "number_82" + NetworkACLRulePrototypeProtocolNumber83Const = "number_83" + NetworkACLRulePrototypeProtocolNumber84Const = "number_84" + NetworkACLRulePrototypeProtocolNumber85Const = "number_85" + NetworkACLRulePrototypeProtocolNumber86Const = "number_86" + NetworkACLRulePrototypeProtocolNumber87Const = "number_87" + NetworkACLRulePrototypeProtocolNumber88Const = "number_88" + NetworkACLRulePrototypeProtocolNumber89Const = "number_89" + NetworkACLRulePrototypeProtocolNumber9Const = "number_9" + NetworkACLRulePrototypeProtocolNumber90Const = "number_90" + NetworkACLRulePrototypeProtocolNumber91Const = "number_91" + NetworkACLRulePrototypeProtocolNumber92Const = "number_92" + NetworkACLRulePrototypeProtocolNumber93Const = "number_93" + NetworkACLRulePrototypeProtocolNumber94Const = "number_94" + NetworkACLRulePrototypeProtocolNumber95Const = "number_95" + NetworkACLRulePrototypeProtocolNumber96Const = "number_96" + NetworkACLRulePrototypeProtocolNumber97Const = "number_97" + NetworkACLRulePrototypeProtocolNumber98Const = "number_98" + NetworkACLRulePrototypeProtocolNumber99Const = "number_99" + NetworkACLRulePrototypeProtocolRsvpConst = "rsvp" + NetworkACLRulePrototypeProtocolSctpConst = "sctp" + NetworkACLRulePrototypeProtocolTCPConst = "tcp" + NetworkACLRulePrototypeProtocolUDPConst = "udp" + NetworkACLRulePrototypeProtocolVrrpConst = "vrrp" ) func (*NetworkACLRulePrototype) isaNetworkACLRulePrototype() bool { @@ -83195,20 +91060,24 @@ func UnmarshalNetworkACLRulePrototype(m map[string]json.RawMessage, result inter // NetworkACLRulePrototypeNetworkACLContext : NetworkACLRulePrototypeNetworkACLContext struct // Models which "extend" this model: -// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype +// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype +// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype // - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype // - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype +// - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype type NetworkACLRulePrototypeNetworkACLContext struct { // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. Action *string `json:"action" validate:"required"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. Direction *string `json:"direction" validate:"required"` - // The IP version for this rule. + // The IP version to match. The format of `source` and `destination` must match this property. IPVersion *string `json:"ip_version,omitempty"` // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, @@ -83218,7 +91087,7 @@ type NetworkACLRulePrototypeNetworkACLContext struct { // The network protocol. Protocol *string `json:"protocol" validate:"required"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. Source *string `json:"source" validate:"required"` // The ICMP traffic code to match. @@ -83258,6 +91127,8 @@ type NetworkACLRulePrototypeNetworkACLContext struct { // Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Action property. // The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. const ( NetworkACLRulePrototypeNetworkACLContextActionAllowConst = "allow" NetworkACLRulePrototypeNetworkACLContextActionDenyConst = "deny" @@ -83271,7 +91142,7 @@ const ( ) // Constants associated with the NetworkACLRulePrototypeNetworkACLContext.IPVersion property. -// The IP version for this rule. +// The IP version to match. The format of `source` and `destination` must match this property. const ( NetworkACLRulePrototypeNetworkACLContextIPVersionIpv4Const = "ipv4" ) @@ -83279,10 +91150,264 @@ const ( // Constants associated with the NetworkACLRulePrototypeNetworkACLContext.Protocol property. // The network protocol. const ( - NetworkACLRulePrototypeNetworkACLContextProtocolAllConst = "all" - NetworkACLRulePrototypeNetworkACLContextProtocolIcmpConst = "icmp" - NetworkACLRulePrototypeNetworkACLContextProtocolTCPConst = "tcp" - NetworkACLRulePrototypeNetworkACLContextProtocolUDPConst = "udp" + NetworkACLRulePrototypeNetworkACLContextProtocolAhConst = "ah" + NetworkACLRulePrototypeNetworkACLContextProtocolAnyConst = "any" + NetworkACLRulePrototypeNetworkACLContextProtocolEspConst = "esp" + NetworkACLRulePrototypeNetworkACLContextProtocolGreConst = "gre" + NetworkACLRulePrototypeNetworkACLContextProtocolIPInIPConst = "ip_in_ip" + NetworkACLRulePrototypeNetworkACLContextProtocolIcmpConst = "icmp" + NetworkACLRulePrototypeNetworkACLContextProtocolIcmpTCPUDPConst = "icmp_tcp_udp" + NetworkACLRulePrototypeNetworkACLContextProtocolL2tpConst = "l2tp" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber0Const = "number_0" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber10Const = "number_10" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber100Const = "number_100" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber101Const = "number_101" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber102Const = "number_102" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber103Const = "number_103" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber104Const = "number_104" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber105Const = "number_105" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber106Const = "number_106" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber107Const = "number_107" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber108Const = "number_108" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber109Const = "number_109" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber11Const = "number_11" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber110Const = "number_110" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber111Const = "number_111" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber113Const = "number_113" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber114Const = "number_114" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber116Const = "number_116" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber117Const = "number_117" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber118Const = "number_118" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber119Const = "number_119" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber12Const = "number_12" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber120Const = "number_120" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber121Const = "number_121" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber122Const = "number_122" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber123Const = "number_123" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber124Const = "number_124" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber125Const = "number_125" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber126Const = "number_126" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber127Const = "number_127" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber128Const = "number_128" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber129Const = "number_129" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber13Const = "number_13" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber130Const = "number_130" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber131Const = "number_131" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber133Const = "number_133" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber134Const = "number_134" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber135Const = "number_135" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber136Const = "number_136" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber137Const = "number_137" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber138Const = "number_138" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber139Const = "number_139" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber14Const = "number_14" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber140Const = "number_140" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber141Const = "number_141" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber142Const = "number_142" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber143Const = "number_143" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber144Const = "number_144" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber145Const = "number_145" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber146Const = "number_146" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber147Const = "number_147" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber148Const = "number_148" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber149Const = "number_149" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber15Const = "number_15" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber150Const = "number_150" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber151Const = "number_151" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber152Const = "number_152" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber153Const = "number_153" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber154Const = "number_154" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber155Const = "number_155" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber156Const = "number_156" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber157Const = "number_157" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber158Const = "number_158" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber159Const = "number_159" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber16Const = "number_16" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber160Const = "number_160" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber161Const = "number_161" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber162Const = "number_162" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber163Const = "number_163" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber164Const = "number_164" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber165Const = "number_165" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber166Const = "number_166" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber167Const = "number_167" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber168Const = "number_168" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber169Const = "number_169" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber170Const = "number_170" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber171Const = "number_171" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber172Const = "number_172" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber173Const = "number_173" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber174Const = "number_174" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber175Const = "number_175" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber176Const = "number_176" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber177Const = "number_177" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber178Const = "number_178" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber179Const = "number_179" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber18Const = "number_18" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber180Const = "number_180" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber181Const = "number_181" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber182Const = "number_182" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber183Const = "number_183" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber184Const = "number_184" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber185Const = "number_185" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber186Const = "number_186" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber187Const = "number_187" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber188Const = "number_188" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber189Const = "number_189" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber19Const = "number_19" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber190Const = "number_190" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber191Const = "number_191" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber192Const = "number_192" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber193Const = "number_193" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber194Const = "number_194" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber195Const = "number_195" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber196Const = "number_196" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber197Const = "number_197" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber198Const = "number_198" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber199Const = "number_199" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber2Const = "number_2" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber20Const = "number_20" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber200Const = "number_200" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber201Const = "number_201" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber202Const = "number_202" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber203Const = "number_203" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber204Const = "number_204" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber205Const = "number_205" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber206Const = "number_206" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber207Const = "number_207" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber208Const = "number_208" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber209Const = "number_209" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber21Const = "number_21" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber210Const = "number_210" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber211Const = "number_211" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber212Const = "number_212" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber213Const = "number_213" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber214Const = "number_214" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber215Const = "number_215" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber216Const = "number_216" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber217Const = "number_217" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber218Const = "number_218" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber219Const = "number_219" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber22Const = "number_22" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber220Const = "number_220" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber221Const = "number_221" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber222Const = "number_222" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber223Const = "number_223" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber224Const = "number_224" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber225Const = "number_225" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber226Const = "number_226" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber227Const = "number_227" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber228Const = "number_228" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber229Const = "number_229" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber23Const = "number_23" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber230Const = "number_230" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber231Const = "number_231" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber232Const = "number_232" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber233Const = "number_233" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber234Const = "number_234" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber235Const = "number_235" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber236Const = "number_236" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber237Const = "number_237" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber238Const = "number_238" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber239Const = "number_239" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber24Const = "number_24" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber240Const = "number_240" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber241Const = "number_241" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber242Const = "number_242" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber243Const = "number_243" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber244Const = "number_244" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber245Const = "number_245" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber246Const = "number_246" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber247Const = "number_247" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber248Const = "number_248" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber249Const = "number_249" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber25Const = "number_25" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber250Const = "number_250" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber251Const = "number_251" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber252Const = "number_252" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber253Const = "number_253" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber254Const = "number_254" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber255Const = "number_255" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber26Const = "number_26" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber27Const = "number_27" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber28Const = "number_28" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber29Const = "number_29" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber3Const = "number_3" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber30Const = "number_30" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber31Const = "number_31" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber32Const = "number_32" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber33Const = "number_33" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber34Const = "number_34" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber35Const = "number_35" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber36Const = "number_36" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber37Const = "number_37" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber38Const = "number_38" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber39Const = "number_39" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber40Const = "number_40" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber41Const = "number_41" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber42Const = "number_42" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber43Const = "number_43" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber44Const = "number_44" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber45Const = "number_45" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber48Const = "number_48" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber49Const = "number_49" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber5Const = "number_5" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber52Const = "number_52" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber53Const = "number_53" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber54Const = "number_54" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber55Const = "number_55" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber56Const = "number_56" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber57Const = "number_57" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber58Const = "number_58" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber59Const = "number_59" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber60Const = "number_60" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber61Const = "number_61" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber62Const = "number_62" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber63Const = "number_63" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber64Const = "number_64" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber65Const = "number_65" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber66Const = "number_66" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber67Const = "number_67" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber68Const = "number_68" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber69Const = "number_69" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber7Const = "number_7" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber70Const = "number_70" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber71Const = "number_71" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber72Const = "number_72" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber73Const = "number_73" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber74Const = "number_74" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber75Const = "number_75" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber76Const = "number_76" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber77Const = "number_77" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber78Const = "number_78" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber79Const = "number_79" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber8Const = "number_8" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber80Const = "number_80" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber81Const = "number_81" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber82Const = "number_82" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber83Const = "number_83" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber84Const = "number_84" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber85Const = "number_85" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber86Const = "number_86" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber87Const = "number_87" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber88Const = "number_88" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber89Const = "number_89" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber9Const = "number_9" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber90Const = "number_90" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber91Const = "number_91" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber92Const = "number_92" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber93Const = "number_93" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber94Const = "number_94" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber95Const = "number_95" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber96Const = "number_96" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber97Const = "number_97" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber98Const = "number_98" + NetworkACLRulePrototypeNetworkACLContextProtocolNumber99Const = "number_99" + NetworkACLRulePrototypeNetworkACLContextProtocolRsvpConst = "rsvp" + NetworkACLRulePrototypeNetworkACLContextProtocolSctpConst = "sctp" + NetworkACLRulePrototypeNetworkACLContextProtocolTCPConst = "tcp" + NetworkACLRulePrototypeNetworkACLContextProtocolUDPConst = "udp" + NetworkACLRulePrototypeNetworkACLContextProtocolVrrpConst = "vrrp" ) func (*NetworkACLRulePrototypeNetworkACLContext) isaNetworkACLRulePrototypeNetworkACLContext() bool { @@ -83890,10 +92015,11 @@ type NetworkInterfacePrototype struct { Name *string `json:"name,omitempty"` // The primary IP address to bind to the instance network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. + // specified using an existing reserved IP, or a prototype object for a new reserved + // IP. // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the instance network interface's subnet. Otherwise, an + // If an existing reserved IP or a prototype object with an address is specified, it + // must be available on the instance network interface's subnet. Otherwise, an // available address on the subnet will be automatically selected and reserved. PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` @@ -85252,7 +93378,10 @@ func UnmarshalPrivatePathServiceGatewayRemote(m map[string]json.RawMessage, resu // PublicAddressRange : PublicAddressRange struct type PublicAddressRange struct { - // The public IPv4 range, expressed in CIDR format. + // The public IP address block for this public address range, expressed in CIDR format. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address + // blocks in the future. CIDR *string `json:"cidr" validate:"required"` // The date and time that the public address range was created. @@ -85441,6 +93570,7 @@ func (resp *PublicAddressRangeCollection) GetNextStart() (*string, error) { // PublicAddressRangePatch : PublicAddressRangePatch struct type PublicAddressRangePatch struct { // The name for this public address range. The name must not be used by another public address range in the region. + // Names starting with `ibm-` are reserved for provider-managed resources, and are not allowed. Name *string `json:"name,omitempty"` // The target to bind this public address range to. @@ -86499,6 +94629,44 @@ func (options *RemoveVirtualNetworkInterfaceIPOptions) SetHeaders(param map[stri return options } +// RemoveVPNGatewayAdvertisedCIDROptions : The RemoveVPNGatewayAdvertisedCIDR options. +type RemoveVPNGatewayAdvertisedCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The IP address range in CIDR block notation. + CIDR *string `json:"cidr" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewRemoveVPNGatewayAdvertisedCIDROptions : Instantiate RemoveVPNGatewayAdvertisedCIDROptions +func (*VpcV1) NewRemoveVPNGatewayAdvertisedCIDROptions(vpnGatewayID string, cidr string) *RemoveVPNGatewayAdvertisedCIDROptions { + return &RemoveVPNGatewayAdvertisedCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + CIDR: core.StringPtr(cidr), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *RemoveVPNGatewayAdvertisedCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayAdvertisedCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetCIDR : Allow user to set CIDR +func (_options *RemoveVPNGatewayAdvertisedCIDROptions) SetCIDR(cidr string) *RemoveVPNGatewayAdvertisedCIDROptions { + _options.CIDR = core.StringPtr(cidr) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *RemoveVPNGatewayAdvertisedCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayAdvertisedCIDROptions { + options.Headers = param + return options +} + // RemoveVPNGatewayConnectionsLocalCIDROptions : The RemoveVPNGatewayConnectionsLocalCIDR options. type RemoveVPNGatewayConnectionsLocalCIDROptions struct { // The VPN gateway identifier. @@ -88434,13 +96602,13 @@ func UnmarshalReservedIPTarget(m map[string]json.RawMessage, result interface{}) // - ReservedIPTargetPrototypeEndpointGatewayIdentity // - ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity type ReservedIPTargetPrototype struct { - // The unique identifier for this endpoint gateway. + // The unique identifier for this endpoint gateway or the unique identifier for this virtual network interface. ID *string `json:"id,omitempty"` - // The CRN for this endpoint gateway. + // The CRN for this endpoint gateway or the CRN for this virtual network interface. CRN *string `json:"crn,omitempty"` - // The URL for this endpoint gateway. + // The URL for this endpoint gateway or the URL for this virtual network interface. Href *string `json:"href,omitempty"` } @@ -89736,16 +97904,16 @@ func (resp *RoutingTableCollection) GetNextStart() (*string, error) { // RoutingTableIdentity : Identifies a routing table by a unique property. // Models which "extend" this model: -// - RoutingTableIdentityByCRN // - RoutingTableIdentityByID +// - RoutingTableIdentityByCRN // - RoutingTableIdentityByHref type RoutingTableIdentity struct { - // The CRN for this VPC routing table. - CRN *string `json:"crn,omitempty"` - // The unique identifier for this routing table. ID *string `json:"id,omitempty"` + // The CRN for this VPC routing table. + CRN *string `json:"crn,omitempty"` + // The URL for this routing table. Href *string `json:"href,omitempty"` } @@ -89762,14 +97930,14 @@ type RoutingTableIdentityIntf interface { // 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, "crn", &obj.CRN) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) @@ -89784,12 +97952,12 @@ func UnmarshalRoutingTableIdentity(m map[string]json.RawMessage, result interfac // asPatch returns a generic map representation of the RoutingTableIdentity func (routingTableIdentity *RoutingTableIdentity) asPatch() (_patch map[string]interface{}) { _patch = map[string]interface{}{} - if !core.IsNil(routingTableIdentity.CRN) { - _patch["crn"] = routingTableIdentity.CRN - } if !core.IsNil(routingTableIdentity.ID) { _patch["id"] = routingTableIdentity.ID } + if !core.IsNil(routingTableIdentity.CRN) { + _patch["crn"] = routingTableIdentity.CRN + } if !core.IsNil(routingTableIdentity.Href) { _patch["href"] = routingTableIdentity.Href } @@ -90292,9 +98460,11 @@ func UnmarshalSecurityGroupReference(m map[string]json.RawMessage, result interf // SecurityGroupRule : SecurityGroupRule struct // Models which "extend" this model: -// - SecurityGroupRuleSecurityGroupRuleProtocolAll +// - SecurityGroupRuleProtocolAny +// - SecurityGroupRuleProtocolIcmptcpudp // - SecurityGroupRuleSecurityGroupRuleProtocolIcmp // - SecurityGroupRuleSecurityGroupRuleProtocolTcpudp +// - SecurityGroupRuleProtocolIndividual type SecurityGroupRule struct { // The direction of traffic to allow. Direction *string `json:"direction" validate:"required"` @@ -90305,11 +98475,13 @@ type SecurityGroupRule struct { // The unique identifier for this security group rule. ID *string `json:"id" validate:"required"` - // The IP version to allow. The format of `local.address`, `remote.address`, - // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. + // The IP version to allow. // // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP // version. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. IPVersion *string `json:"ip_version" validate:"required"` // The local IP address or range of local IP addresses to which this rule will allow inbound @@ -90317,6 +98489,9 @@ type SecurityGroupRule struct { // to all local IP addresses (or from all local IP addresses, for outbound rules). Local SecurityGroupRuleLocalIntf `json:"local" validate:"required"` + // The name for this security group rule. The name is unique across all rules in the security group. + Name *string `json:"name" validate:"required"` + // The network protocol. // // The enumerated values for this property may @@ -90328,6 +98503,9 @@ type SecurityGroupRule struct { // (or to any destination, for outbound rules). Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + // The ICMP traffic code to allow. If absent, all codes are allowed. Code *int64 `json:"code,omitempty"` @@ -90349,11 +98527,13 @@ const ( ) // Constants associated with the SecurityGroupRule.IPVersion property. -// The IP version to allow. The format of `local.address`, `remote.address`, -// `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. +// The IP version to allow. // // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP // version. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. const ( SecurityGroupRuleIPVersionIpv4Const = "ipv4" ) @@ -90364,10 +98544,270 @@ const ( // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. const ( - SecurityGroupRuleProtocolAllConst = "all" - SecurityGroupRuleProtocolIcmpConst = "icmp" - SecurityGroupRuleProtocolTCPConst = "tcp" - SecurityGroupRuleProtocolUDPConst = "udp" + SecurityGroupRuleProtocolAhConst = "ah" + SecurityGroupRuleProtocolAnyConst = "any" + SecurityGroupRuleProtocolEspConst = "esp" + SecurityGroupRuleProtocolGreConst = "gre" + SecurityGroupRuleProtocolIPInIPConst = "ip_in_ip" + SecurityGroupRuleProtocolIcmpConst = "icmp" + SecurityGroupRuleProtocolIcmpTCPUDPConst = "icmp_tcp_udp" + SecurityGroupRuleProtocolL2tpConst = "l2tp" + SecurityGroupRuleProtocolNumber0Const = "number_0" + SecurityGroupRuleProtocolNumber10Const = "number_10" + SecurityGroupRuleProtocolNumber100Const = "number_100" + SecurityGroupRuleProtocolNumber101Const = "number_101" + SecurityGroupRuleProtocolNumber102Const = "number_102" + SecurityGroupRuleProtocolNumber103Const = "number_103" + SecurityGroupRuleProtocolNumber104Const = "number_104" + SecurityGroupRuleProtocolNumber105Const = "number_105" + SecurityGroupRuleProtocolNumber106Const = "number_106" + SecurityGroupRuleProtocolNumber107Const = "number_107" + SecurityGroupRuleProtocolNumber108Const = "number_108" + SecurityGroupRuleProtocolNumber109Const = "number_109" + SecurityGroupRuleProtocolNumber11Const = "number_11" + SecurityGroupRuleProtocolNumber110Const = "number_110" + SecurityGroupRuleProtocolNumber111Const = "number_111" + SecurityGroupRuleProtocolNumber113Const = "number_113" + SecurityGroupRuleProtocolNumber114Const = "number_114" + SecurityGroupRuleProtocolNumber116Const = "number_116" + SecurityGroupRuleProtocolNumber117Const = "number_117" + SecurityGroupRuleProtocolNumber118Const = "number_118" + SecurityGroupRuleProtocolNumber119Const = "number_119" + SecurityGroupRuleProtocolNumber12Const = "number_12" + SecurityGroupRuleProtocolNumber120Const = "number_120" + SecurityGroupRuleProtocolNumber121Const = "number_121" + SecurityGroupRuleProtocolNumber122Const = "number_122" + SecurityGroupRuleProtocolNumber123Const = "number_123" + SecurityGroupRuleProtocolNumber124Const = "number_124" + SecurityGroupRuleProtocolNumber125Const = "number_125" + SecurityGroupRuleProtocolNumber126Const = "number_126" + SecurityGroupRuleProtocolNumber127Const = "number_127" + SecurityGroupRuleProtocolNumber128Const = "number_128" + SecurityGroupRuleProtocolNumber129Const = "number_129" + SecurityGroupRuleProtocolNumber13Const = "number_13" + SecurityGroupRuleProtocolNumber130Const = "number_130" + SecurityGroupRuleProtocolNumber131Const = "number_131" + SecurityGroupRuleProtocolNumber133Const = "number_133" + SecurityGroupRuleProtocolNumber134Const = "number_134" + SecurityGroupRuleProtocolNumber135Const = "number_135" + SecurityGroupRuleProtocolNumber136Const = "number_136" + SecurityGroupRuleProtocolNumber137Const = "number_137" + SecurityGroupRuleProtocolNumber138Const = "number_138" + SecurityGroupRuleProtocolNumber139Const = "number_139" + SecurityGroupRuleProtocolNumber14Const = "number_14" + SecurityGroupRuleProtocolNumber140Const = "number_140" + SecurityGroupRuleProtocolNumber141Const = "number_141" + SecurityGroupRuleProtocolNumber142Const = "number_142" + SecurityGroupRuleProtocolNumber143Const = "number_143" + SecurityGroupRuleProtocolNumber144Const = "number_144" + SecurityGroupRuleProtocolNumber145Const = "number_145" + SecurityGroupRuleProtocolNumber146Const = "number_146" + SecurityGroupRuleProtocolNumber147Const = "number_147" + SecurityGroupRuleProtocolNumber148Const = "number_148" + SecurityGroupRuleProtocolNumber149Const = "number_149" + SecurityGroupRuleProtocolNumber15Const = "number_15" + SecurityGroupRuleProtocolNumber150Const = "number_150" + SecurityGroupRuleProtocolNumber151Const = "number_151" + SecurityGroupRuleProtocolNumber152Const = "number_152" + SecurityGroupRuleProtocolNumber153Const = "number_153" + SecurityGroupRuleProtocolNumber154Const = "number_154" + SecurityGroupRuleProtocolNumber155Const = "number_155" + SecurityGroupRuleProtocolNumber156Const = "number_156" + SecurityGroupRuleProtocolNumber157Const = "number_157" + SecurityGroupRuleProtocolNumber158Const = "number_158" + SecurityGroupRuleProtocolNumber159Const = "number_159" + SecurityGroupRuleProtocolNumber16Const = "number_16" + SecurityGroupRuleProtocolNumber160Const = "number_160" + SecurityGroupRuleProtocolNumber161Const = "number_161" + SecurityGroupRuleProtocolNumber162Const = "number_162" + SecurityGroupRuleProtocolNumber163Const = "number_163" + SecurityGroupRuleProtocolNumber164Const = "number_164" + SecurityGroupRuleProtocolNumber165Const = "number_165" + SecurityGroupRuleProtocolNumber166Const = "number_166" + SecurityGroupRuleProtocolNumber167Const = "number_167" + SecurityGroupRuleProtocolNumber168Const = "number_168" + SecurityGroupRuleProtocolNumber169Const = "number_169" + SecurityGroupRuleProtocolNumber170Const = "number_170" + SecurityGroupRuleProtocolNumber171Const = "number_171" + SecurityGroupRuleProtocolNumber172Const = "number_172" + SecurityGroupRuleProtocolNumber173Const = "number_173" + SecurityGroupRuleProtocolNumber174Const = "number_174" + SecurityGroupRuleProtocolNumber175Const = "number_175" + SecurityGroupRuleProtocolNumber176Const = "number_176" + SecurityGroupRuleProtocolNumber177Const = "number_177" + SecurityGroupRuleProtocolNumber178Const = "number_178" + SecurityGroupRuleProtocolNumber179Const = "number_179" + SecurityGroupRuleProtocolNumber18Const = "number_18" + SecurityGroupRuleProtocolNumber180Const = "number_180" + SecurityGroupRuleProtocolNumber181Const = "number_181" + SecurityGroupRuleProtocolNumber182Const = "number_182" + SecurityGroupRuleProtocolNumber183Const = "number_183" + SecurityGroupRuleProtocolNumber184Const = "number_184" + SecurityGroupRuleProtocolNumber185Const = "number_185" + SecurityGroupRuleProtocolNumber186Const = "number_186" + SecurityGroupRuleProtocolNumber187Const = "number_187" + SecurityGroupRuleProtocolNumber188Const = "number_188" + SecurityGroupRuleProtocolNumber189Const = "number_189" + SecurityGroupRuleProtocolNumber19Const = "number_19" + SecurityGroupRuleProtocolNumber190Const = "number_190" + SecurityGroupRuleProtocolNumber191Const = "number_191" + SecurityGroupRuleProtocolNumber192Const = "number_192" + SecurityGroupRuleProtocolNumber193Const = "number_193" + SecurityGroupRuleProtocolNumber194Const = "number_194" + SecurityGroupRuleProtocolNumber195Const = "number_195" + SecurityGroupRuleProtocolNumber196Const = "number_196" + SecurityGroupRuleProtocolNumber197Const = "number_197" + SecurityGroupRuleProtocolNumber198Const = "number_198" + SecurityGroupRuleProtocolNumber199Const = "number_199" + SecurityGroupRuleProtocolNumber2Const = "number_2" + SecurityGroupRuleProtocolNumber20Const = "number_20" + SecurityGroupRuleProtocolNumber200Const = "number_200" + SecurityGroupRuleProtocolNumber201Const = "number_201" + SecurityGroupRuleProtocolNumber202Const = "number_202" + SecurityGroupRuleProtocolNumber203Const = "number_203" + SecurityGroupRuleProtocolNumber204Const = "number_204" + SecurityGroupRuleProtocolNumber205Const = "number_205" + SecurityGroupRuleProtocolNumber206Const = "number_206" + SecurityGroupRuleProtocolNumber207Const = "number_207" + SecurityGroupRuleProtocolNumber208Const = "number_208" + SecurityGroupRuleProtocolNumber209Const = "number_209" + SecurityGroupRuleProtocolNumber21Const = "number_21" + SecurityGroupRuleProtocolNumber210Const = "number_210" + SecurityGroupRuleProtocolNumber211Const = "number_211" + SecurityGroupRuleProtocolNumber212Const = "number_212" + SecurityGroupRuleProtocolNumber213Const = "number_213" + SecurityGroupRuleProtocolNumber214Const = "number_214" + SecurityGroupRuleProtocolNumber215Const = "number_215" + SecurityGroupRuleProtocolNumber216Const = "number_216" + SecurityGroupRuleProtocolNumber217Const = "number_217" + SecurityGroupRuleProtocolNumber218Const = "number_218" + SecurityGroupRuleProtocolNumber219Const = "number_219" + SecurityGroupRuleProtocolNumber22Const = "number_22" + SecurityGroupRuleProtocolNumber220Const = "number_220" + SecurityGroupRuleProtocolNumber221Const = "number_221" + SecurityGroupRuleProtocolNumber222Const = "number_222" + SecurityGroupRuleProtocolNumber223Const = "number_223" + SecurityGroupRuleProtocolNumber224Const = "number_224" + SecurityGroupRuleProtocolNumber225Const = "number_225" + SecurityGroupRuleProtocolNumber226Const = "number_226" + SecurityGroupRuleProtocolNumber227Const = "number_227" + SecurityGroupRuleProtocolNumber228Const = "number_228" + SecurityGroupRuleProtocolNumber229Const = "number_229" + SecurityGroupRuleProtocolNumber23Const = "number_23" + SecurityGroupRuleProtocolNumber230Const = "number_230" + SecurityGroupRuleProtocolNumber231Const = "number_231" + SecurityGroupRuleProtocolNumber232Const = "number_232" + SecurityGroupRuleProtocolNumber233Const = "number_233" + SecurityGroupRuleProtocolNumber234Const = "number_234" + SecurityGroupRuleProtocolNumber235Const = "number_235" + SecurityGroupRuleProtocolNumber236Const = "number_236" + SecurityGroupRuleProtocolNumber237Const = "number_237" + SecurityGroupRuleProtocolNumber238Const = "number_238" + SecurityGroupRuleProtocolNumber239Const = "number_239" + SecurityGroupRuleProtocolNumber24Const = "number_24" + SecurityGroupRuleProtocolNumber240Const = "number_240" + SecurityGroupRuleProtocolNumber241Const = "number_241" + SecurityGroupRuleProtocolNumber242Const = "number_242" + SecurityGroupRuleProtocolNumber243Const = "number_243" + SecurityGroupRuleProtocolNumber244Const = "number_244" + SecurityGroupRuleProtocolNumber245Const = "number_245" + SecurityGroupRuleProtocolNumber246Const = "number_246" + SecurityGroupRuleProtocolNumber247Const = "number_247" + SecurityGroupRuleProtocolNumber248Const = "number_248" + SecurityGroupRuleProtocolNumber249Const = "number_249" + SecurityGroupRuleProtocolNumber25Const = "number_25" + SecurityGroupRuleProtocolNumber250Const = "number_250" + SecurityGroupRuleProtocolNumber251Const = "number_251" + SecurityGroupRuleProtocolNumber252Const = "number_252" + SecurityGroupRuleProtocolNumber253Const = "number_253" + SecurityGroupRuleProtocolNumber254Const = "number_254" + SecurityGroupRuleProtocolNumber255Const = "number_255" + SecurityGroupRuleProtocolNumber26Const = "number_26" + SecurityGroupRuleProtocolNumber27Const = "number_27" + SecurityGroupRuleProtocolNumber28Const = "number_28" + SecurityGroupRuleProtocolNumber29Const = "number_29" + SecurityGroupRuleProtocolNumber3Const = "number_3" + SecurityGroupRuleProtocolNumber30Const = "number_30" + SecurityGroupRuleProtocolNumber31Const = "number_31" + SecurityGroupRuleProtocolNumber32Const = "number_32" + SecurityGroupRuleProtocolNumber33Const = "number_33" + SecurityGroupRuleProtocolNumber34Const = "number_34" + SecurityGroupRuleProtocolNumber35Const = "number_35" + SecurityGroupRuleProtocolNumber36Const = "number_36" + SecurityGroupRuleProtocolNumber37Const = "number_37" + SecurityGroupRuleProtocolNumber38Const = "number_38" + SecurityGroupRuleProtocolNumber39Const = "number_39" + SecurityGroupRuleProtocolNumber40Const = "number_40" + SecurityGroupRuleProtocolNumber41Const = "number_41" + SecurityGroupRuleProtocolNumber42Const = "number_42" + SecurityGroupRuleProtocolNumber43Const = "number_43" + SecurityGroupRuleProtocolNumber44Const = "number_44" + SecurityGroupRuleProtocolNumber45Const = "number_45" + SecurityGroupRuleProtocolNumber48Const = "number_48" + SecurityGroupRuleProtocolNumber49Const = "number_49" + SecurityGroupRuleProtocolNumber5Const = "number_5" + SecurityGroupRuleProtocolNumber52Const = "number_52" + SecurityGroupRuleProtocolNumber53Const = "number_53" + SecurityGroupRuleProtocolNumber54Const = "number_54" + SecurityGroupRuleProtocolNumber55Const = "number_55" + SecurityGroupRuleProtocolNumber56Const = "number_56" + SecurityGroupRuleProtocolNumber57Const = "number_57" + SecurityGroupRuleProtocolNumber58Const = "number_58" + SecurityGroupRuleProtocolNumber59Const = "number_59" + SecurityGroupRuleProtocolNumber60Const = "number_60" + SecurityGroupRuleProtocolNumber61Const = "number_61" + SecurityGroupRuleProtocolNumber62Const = "number_62" + SecurityGroupRuleProtocolNumber63Const = "number_63" + SecurityGroupRuleProtocolNumber64Const = "number_64" + SecurityGroupRuleProtocolNumber65Const = "number_65" + SecurityGroupRuleProtocolNumber66Const = "number_66" + SecurityGroupRuleProtocolNumber67Const = "number_67" + SecurityGroupRuleProtocolNumber68Const = "number_68" + SecurityGroupRuleProtocolNumber69Const = "number_69" + SecurityGroupRuleProtocolNumber7Const = "number_7" + SecurityGroupRuleProtocolNumber70Const = "number_70" + SecurityGroupRuleProtocolNumber71Const = "number_71" + SecurityGroupRuleProtocolNumber72Const = "number_72" + SecurityGroupRuleProtocolNumber73Const = "number_73" + SecurityGroupRuleProtocolNumber74Const = "number_74" + SecurityGroupRuleProtocolNumber75Const = "number_75" + SecurityGroupRuleProtocolNumber76Const = "number_76" + SecurityGroupRuleProtocolNumber77Const = "number_77" + SecurityGroupRuleProtocolNumber78Const = "number_78" + SecurityGroupRuleProtocolNumber79Const = "number_79" + SecurityGroupRuleProtocolNumber8Const = "number_8" + SecurityGroupRuleProtocolNumber80Const = "number_80" + SecurityGroupRuleProtocolNumber81Const = "number_81" + SecurityGroupRuleProtocolNumber82Const = "number_82" + SecurityGroupRuleProtocolNumber83Const = "number_83" + SecurityGroupRuleProtocolNumber84Const = "number_84" + SecurityGroupRuleProtocolNumber85Const = "number_85" + SecurityGroupRuleProtocolNumber86Const = "number_86" + SecurityGroupRuleProtocolNumber87Const = "number_87" + SecurityGroupRuleProtocolNumber88Const = "number_88" + SecurityGroupRuleProtocolNumber89Const = "number_89" + SecurityGroupRuleProtocolNumber9Const = "number_9" + SecurityGroupRuleProtocolNumber90Const = "number_90" + SecurityGroupRuleProtocolNumber91Const = "number_91" + SecurityGroupRuleProtocolNumber92Const = "number_92" + SecurityGroupRuleProtocolNumber93Const = "number_93" + SecurityGroupRuleProtocolNumber94Const = "number_94" + SecurityGroupRuleProtocolNumber95Const = "number_95" + SecurityGroupRuleProtocolNumber96Const = "number_96" + SecurityGroupRuleProtocolNumber97Const = "number_97" + SecurityGroupRuleProtocolNumber98Const = "number_98" + SecurityGroupRuleProtocolNumber99Const = "number_99" + SecurityGroupRuleProtocolRsvpConst = "rsvp" + SecurityGroupRuleProtocolSctpConst = "sctp" + SecurityGroupRuleProtocolTCPConst = "tcp" + SecurityGroupRuleProtocolUDPConst = "udp" + SecurityGroupRuleProtocolVrrpConst = "vrrp" +) + +// Constants associated with the SecurityGroupRule.ResourceType property. +// The resource type. +const ( + SecurityGroupRuleResourceTypeSecurityGroupRuleConst = "security_group_rule" ) func (*SecurityGroupRule) isaSecurityGroupRule() bool { @@ -90392,16 +98832,1281 @@ func UnmarshalSecurityGroupRule(m map[string]json.RawMessage, result interface{} err = core.SDKErrorf(err, "required discriminator property 'protocol' not found in JSON object", "missing-discriminator", common.GetComponentInfo()) return } - if discValue == "all" { - err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll) + if discValue == "ah" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleSecurityGroupRuleProtocolAll-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "any" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolAny) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolAny-error", common.GetComponentInfo()) + } + } else if discValue == "esp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "gre" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) } } else if discValue == "icmp" { err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp) if err != nil { err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleSecurityGroupRuleProtocolIcmp-error", common.GetComponentInfo()) } + } else if discValue == "icmp_tcp_udp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIcmptcpudp) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIcmptcpudp-error", common.GetComponentInfo()) + } + } else if discValue == "ip_in_ip" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "l2tp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_0" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_10" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_100" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_101" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_102" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_103" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_104" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_105" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_106" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_107" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_108" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_109" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_11" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_110" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_111" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_113" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_114" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_116" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_117" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_118" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_119" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_12" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_120" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_121" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_122" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_123" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_124" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_125" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_126" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_127" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_128" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_129" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_13" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_130" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_131" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_133" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_134" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_135" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_136" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_137" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_138" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_139" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_14" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_140" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_141" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_142" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_143" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_144" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_145" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_146" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_147" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_148" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_149" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_15" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_150" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_151" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_152" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_153" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_154" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_155" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_156" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_157" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_158" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_159" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_16" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_160" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_161" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_162" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_163" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_164" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_165" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_166" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_167" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_168" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_169" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_170" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_171" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_172" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_173" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_174" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_175" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_176" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_177" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_178" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_179" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_18" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_180" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_181" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_182" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_183" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_184" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_185" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_186" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_187" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_188" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_189" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_19" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_190" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_191" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_192" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_193" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_194" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_195" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_196" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_197" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_198" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_199" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_2" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_20" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_200" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_201" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_202" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_203" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_204" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_205" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_206" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_207" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_208" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_209" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_21" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_210" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_211" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_212" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_213" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_214" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_215" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_216" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_217" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_218" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_219" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_22" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_220" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_221" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_222" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_223" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_224" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_225" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_226" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_227" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_228" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_229" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_23" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_230" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_231" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_232" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_233" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_234" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_235" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_236" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_237" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_238" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_239" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_24" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_240" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_241" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_242" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_243" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_244" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_245" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_246" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_247" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_248" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_249" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_25" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_250" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_251" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_252" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_253" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_254" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_255" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_26" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_27" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_28" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_29" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_3" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_30" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_31" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_32" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_33" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_34" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_35" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_36" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_37" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_38" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_39" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_40" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_41" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_42" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_43" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_44" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_45" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_48" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_49" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_5" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_52" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_53" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_54" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_55" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_56" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_57" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_58" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_59" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_60" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_61" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_62" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_63" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_64" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_65" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_66" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_67" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_68" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_69" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_7" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_70" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_71" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_72" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_73" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_74" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_75" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_76" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_77" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_78" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_79" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_8" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_80" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_81" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_82" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_83" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_84" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_85" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_86" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_87" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_88" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_89" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_9" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_90" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_91" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_92" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_93" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_94" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_95" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_96" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_97" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_98" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "number_99" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "rsvp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } + } else if discValue == "sctp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } } else if discValue == "tcp" { err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp) if err != nil { @@ -90412,10 +100117,79 @@ func UnmarshalSecurityGroupRule(m map[string]json.RawMessage, result interface{} if err != nil { err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleSecurityGroupRuleProtocolTcpudp-error", common.GetComponentInfo()) } + } else if discValue == "vrrp" { + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleProtocolIndividual) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleProtocolIndividual-error", common.GetComponentInfo()) + } } else { - errMsg := fmt.Sprintf("unrecognized value for discriminator property 'protocol': %s", discValue) - err = core.SDKErrorf(err, errMsg, "invalid-discriminator", common.GetComponentInfo()) + // errMsg := fmt.Sprintf("unrecognized value for discriminator property 'protocol': %s", discValue) + // err = core.SDKErrorf(err, errMsg, "invalid-discriminator", common.GetComponentInfo()) + // Fallback to base SecurityGroupRule for unknown protocols + err = core.UnmarshalModel(m, "", result, UnmarshalSecurityGroupRuleGeneric) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-SecurityGroupRuleGeneric-error", common.GetComponentInfo()) + } + } + return +} + +// UnmarshalSecurityGroupRuleGeneric unmarshals the base SecurityGroupRule fields for unknown protocol types +func UnmarshalSecurityGroupRuleGeneric(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRule) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalSecurityGroupRuleLocal) + if err != nil { + err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) + if err != nil { + err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) + return } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + + // Attempt to unmarshal optional fields - ignore errors as these may not be present + _ = core.UnmarshalPrimitive(m, "code", &obj.Code) + _ = core.UnmarshalPrimitive(m, "type", &obj.Type) + _ = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) + _ = core.UnmarshalPrimitive(m, "port_min", &obj.PortMin) + + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -90441,8 +100215,8 @@ func UnmarshalSecurityGroupRuleCollection(m map[string]json.RawMessage, result i // outbound traffic). A CIDR block of `0.0.0.0/0` allows traffic to all local IP addresses (or from all local IP // addresses, for outbound rules). // Models which "extend" this model: -// - SecurityGroupRuleLocalIP -// - SecurityGroupRuleLocalCIDR +// - SecurityGroupRuleLocalSecurityGroupRuleIP +// - SecurityGroupRuleLocalSecurityGroupRuleCIDR type SecurityGroupRuleLocal struct { // The IP address. // @@ -90452,8 +100226,8 @@ type SecurityGroupRuleLocal struct { // The CIDR block. // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. CIDRBlock *string `json:"cidr_block,omitempty"` } @@ -90488,19 +100262,13 @@ func UnmarshalSecurityGroupRuleLocal(m map[string]json.RawMessage, result interf // Specify a CIDR block of `0.0.0.0/0` to allow traffic to all local IP addresses (or from all local IP addresses, for // outbound rules). // Models which "extend" this model: -// - SecurityGroupRuleLocalPatchIP -// - SecurityGroupRuleLocalPatchCIDR +// - SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype +// - SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype type SecurityGroupRuleLocalPatch struct { // The IP address. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in - // the future. Address *string `json:"address,omitempty"` // The CIDR block. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. CIDRBlock *string `json:"cidr_block,omitempty"` } @@ -90549,19 +100317,13 @@ func (securityGroupRuleLocalPatch *SecurityGroupRuleLocalPatch) asPatch() (_patc // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic to all local IP addresses (or from all // local IP addresses, for outbound rules). // Models which "extend" this model: -// - SecurityGroupRuleLocalPrototypeIP -// - SecurityGroupRuleLocalPrototypeCIDR +// - SecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype +// - SecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype type SecurityGroupRuleLocalPrototype struct { // The IP address. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in - // the future. Address *string `json:"address,omitempty"` // The CIDR block. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. CIDRBlock *string `json:"cidr_block,omitempty"` } @@ -90603,8 +100365,8 @@ type SecurityGroupRulePatch struct { // The IP version to allow. The format of `local.address`, `remote.address`, // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. // - // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP - // version. + // If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this + // IP version. IPVersion *string `json:"ip_version,omitempty"` // The local IP address or range of local IP addresses to which this rule will allow inbound @@ -90615,6 +100377,9 @@ type SecurityGroupRulePatch struct { // local IP addresses, for outbound rules). Local SecurityGroupRuleLocalPatchIntf `json:"local,omitempty"` + // The name for this security group rule. The name must not be used by another rule in the security group. + Name *string `json:"name,omitempty"` + // The inclusive upper bound of the protocol destination port range. If set, `port_min` must also be set, and must not // be larger. // @@ -90629,8 +100394,10 @@ type SecurityGroupRulePatch struct { // The remote 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 destination, for outbound rules). + // security group. + // + // Specify a CIDR block of `0.0.0.0/0` to allow traffic from any source (or to any + // destination, for outbound rules). Remote SecurityGroupRuleRemotePatchIntf `json:"remote,omitempty"` // The ICMP traffic type to allow. @@ -90650,8 +100417,8 @@ const ( // The IP version to allow. The format of `local.address`, `remote.address`, // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. // -// If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP -// version. +// If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this +// IP version. const ( SecurityGroupRulePatchIPVersionIpv4Const = "ipv4" ) @@ -90679,6 +100446,11 @@ func UnmarshalSecurityGroupRulePatch(m map[string]json.RawMessage, result interf err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) if err != nil { err = core.SDKErrorf(err, "", "port_max-error", common.GetComponentInfo()) @@ -90718,6 +100490,9 @@ func (securityGroupRulePatch *SecurityGroupRulePatch) AsPatch() (_patch map[stri if !core.IsNil(securityGroupRulePatch.Local) { _patch["local"] = securityGroupRulePatch.Local.asPatch() } + if !core.IsNil(securityGroupRulePatch.Name) { + _patch["name"] = securityGroupRulePatch.Name + } if !core.IsNil(securityGroupRulePatch.PortMax) { _patch["port_max"] = securityGroupRulePatch.PortMax } @@ -90736,9 +100511,11 @@ func (securityGroupRulePatch *SecurityGroupRulePatch) AsPatch() (_patch map[stri // SecurityGroupRulePrototype : SecurityGroupRulePrototype struct // Models which "extend" this model: -// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll +// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype +// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype // - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp // - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp +// - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype type SecurityGroupRulePrototype struct { // The direction of traffic to allow. Direction *string `json:"direction" validate:"required"` @@ -90746,8 +100523,8 @@ type SecurityGroupRulePrototype struct { // The IP version to allow. The format of `local.address`, `remote.address`, // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. // - // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP - // version. + // If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this + // IP version. IPVersion *string `json:"ip_version,omitempty"` // The local IP address or range of local IP addresses to which this rule will allow inbound @@ -90757,6 +100534,10 @@ type SecurityGroupRulePrototype struct { // addresses (or from all local IP addresses, for outbound rules). Local SecurityGroupRuleLocalPrototypeIntf `json:"local,omitempty"` + // The name for this security group rule. The name must not be used by another rule in the security group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + // The network protocol. Protocol *string `json:"protocol" validate:"required"` @@ -90802,8 +100583,8 @@ const ( // The IP version to allow. The format of `local.address`, `remote.address`, // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. // -// If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP -// version. +// If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this +// IP version. const ( SecurityGroupRulePrototypeIPVersionIpv4Const = "ipv4" ) @@ -90811,10 +100592,264 @@ const ( // Constants associated with the SecurityGroupRulePrototype.Protocol property. // The network protocol. const ( - SecurityGroupRulePrototypeProtocolAllConst = "all" - SecurityGroupRulePrototypeProtocolIcmpConst = "icmp" - SecurityGroupRulePrototypeProtocolTCPConst = "tcp" - SecurityGroupRulePrototypeProtocolUDPConst = "udp" + SecurityGroupRulePrototypeProtocolAhConst = "ah" + SecurityGroupRulePrototypeProtocolAnyConst = "any" + SecurityGroupRulePrototypeProtocolEspConst = "esp" + SecurityGroupRulePrototypeProtocolGreConst = "gre" + SecurityGroupRulePrototypeProtocolIPInIPConst = "ip_in_ip" + SecurityGroupRulePrototypeProtocolIcmpConst = "icmp" + SecurityGroupRulePrototypeProtocolIcmpTCPUDPConst = "icmp_tcp_udp" + SecurityGroupRulePrototypeProtocolL2tpConst = "l2tp" + SecurityGroupRulePrototypeProtocolNumber0Const = "number_0" + SecurityGroupRulePrototypeProtocolNumber10Const = "number_10" + SecurityGroupRulePrototypeProtocolNumber100Const = "number_100" + SecurityGroupRulePrototypeProtocolNumber101Const = "number_101" + SecurityGroupRulePrototypeProtocolNumber102Const = "number_102" + SecurityGroupRulePrototypeProtocolNumber103Const = "number_103" + SecurityGroupRulePrototypeProtocolNumber104Const = "number_104" + SecurityGroupRulePrototypeProtocolNumber105Const = "number_105" + SecurityGroupRulePrototypeProtocolNumber106Const = "number_106" + SecurityGroupRulePrototypeProtocolNumber107Const = "number_107" + SecurityGroupRulePrototypeProtocolNumber108Const = "number_108" + SecurityGroupRulePrototypeProtocolNumber109Const = "number_109" + SecurityGroupRulePrototypeProtocolNumber11Const = "number_11" + SecurityGroupRulePrototypeProtocolNumber110Const = "number_110" + SecurityGroupRulePrototypeProtocolNumber111Const = "number_111" + SecurityGroupRulePrototypeProtocolNumber113Const = "number_113" + SecurityGroupRulePrototypeProtocolNumber114Const = "number_114" + SecurityGroupRulePrototypeProtocolNumber116Const = "number_116" + SecurityGroupRulePrototypeProtocolNumber117Const = "number_117" + SecurityGroupRulePrototypeProtocolNumber118Const = "number_118" + SecurityGroupRulePrototypeProtocolNumber119Const = "number_119" + SecurityGroupRulePrototypeProtocolNumber12Const = "number_12" + SecurityGroupRulePrototypeProtocolNumber120Const = "number_120" + SecurityGroupRulePrototypeProtocolNumber121Const = "number_121" + SecurityGroupRulePrototypeProtocolNumber122Const = "number_122" + SecurityGroupRulePrototypeProtocolNumber123Const = "number_123" + SecurityGroupRulePrototypeProtocolNumber124Const = "number_124" + SecurityGroupRulePrototypeProtocolNumber125Const = "number_125" + SecurityGroupRulePrototypeProtocolNumber126Const = "number_126" + SecurityGroupRulePrototypeProtocolNumber127Const = "number_127" + SecurityGroupRulePrototypeProtocolNumber128Const = "number_128" + SecurityGroupRulePrototypeProtocolNumber129Const = "number_129" + SecurityGroupRulePrototypeProtocolNumber13Const = "number_13" + SecurityGroupRulePrototypeProtocolNumber130Const = "number_130" + SecurityGroupRulePrototypeProtocolNumber131Const = "number_131" + SecurityGroupRulePrototypeProtocolNumber133Const = "number_133" + SecurityGroupRulePrototypeProtocolNumber134Const = "number_134" + SecurityGroupRulePrototypeProtocolNumber135Const = "number_135" + SecurityGroupRulePrototypeProtocolNumber136Const = "number_136" + SecurityGroupRulePrototypeProtocolNumber137Const = "number_137" + SecurityGroupRulePrototypeProtocolNumber138Const = "number_138" + SecurityGroupRulePrototypeProtocolNumber139Const = "number_139" + SecurityGroupRulePrototypeProtocolNumber14Const = "number_14" + SecurityGroupRulePrototypeProtocolNumber140Const = "number_140" + SecurityGroupRulePrototypeProtocolNumber141Const = "number_141" + SecurityGroupRulePrototypeProtocolNumber142Const = "number_142" + SecurityGroupRulePrototypeProtocolNumber143Const = "number_143" + SecurityGroupRulePrototypeProtocolNumber144Const = "number_144" + SecurityGroupRulePrototypeProtocolNumber145Const = "number_145" + SecurityGroupRulePrototypeProtocolNumber146Const = "number_146" + SecurityGroupRulePrototypeProtocolNumber147Const = "number_147" + SecurityGroupRulePrototypeProtocolNumber148Const = "number_148" + SecurityGroupRulePrototypeProtocolNumber149Const = "number_149" + SecurityGroupRulePrototypeProtocolNumber15Const = "number_15" + SecurityGroupRulePrototypeProtocolNumber150Const = "number_150" + SecurityGroupRulePrototypeProtocolNumber151Const = "number_151" + SecurityGroupRulePrototypeProtocolNumber152Const = "number_152" + SecurityGroupRulePrototypeProtocolNumber153Const = "number_153" + SecurityGroupRulePrototypeProtocolNumber154Const = "number_154" + SecurityGroupRulePrototypeProtocolNumber155Const = "number_155" + SecurityGroupRulePrototypeProtocolNumber156Const = "number_156" + SecurityGroupRulePrototypeProtocolNumber157Const = "number_157" + SecurityGroupRulePrototypeProtocolNumber158Const = "number_158" + SecurityGroupRulePrototypeProtocolNumber159Const = "number_159" + SecurityGroupRulePrototypeProtocolNumber16Const = "number_16" + SecurityGroupRulePrototypeProtocolNumber160Const = "number_160" + SecurityGroupRulePrototypeProtocolNumber161Const = "number_161" + SecurityGroupRulePrototypeProtocolNumber162Const = "number_162" + SecurityGroupRulePrototypeProtocolNumber163Const = "number_163" + SecurityGroupRulePrototypeProtocolNumber164Const = "number_164" + SecurityGroupRulePrototypeProtocolNumber165Const = "number_165" + SecurityGroupRulePrototypeProtocolNumber166Const = "number_166" + SecurityGroupRulePrototypeProtocolNumber167Const = "number_167" + SecurityGroupRulePrototypeProtocolNumber168Const = "number_168" + SecurityGroupRulePrototypeProtocolNumber169Const = "number_169" + SecurityGroupRulePrototypeProtocolNumber170Const = "number_170" + SecurityGroupRulePrototypeProtocolNumber171Const = "number_171" + SecurityGroupRulePrototypeProtocolNumber172Const = "number_172" + SecurityGroupRulePrototypeProtocolNumber173Const = "number_173" + SecurityGroupRulePrototypeProtocolNumber174Const = "number_174" + SecurityGroupRulePrototypeProtocolNumber175Const = "number_175" + SecurityGroupRulePrototypeProtocolNumber176Const = "number_176" + SecurityGroupRulePrototypeProtocolNumber177Const = "number_177" + SecurityGroupRulePrototypeProtocolNumber178Const = "number_178" + SecurityGroupRulePrototypeProtocolNumber179Const = "number_179" + SecurityGroupRulePrototypeProtocolNumber18Const = "number_18" + SecurityGroupRulePrototypeProtocolNumber180Const = "number_180" + SecurityGroupRulePrototypeProtocolNumber181Const = "number_181" + SecurityGroupRulePrototypeProtocolNumber182Const = "number_182" + SecurityGroupRulePrototypeProtocolNumber183Const = "number_183" + SecurityGroupRulePrototypeProtocolNumber184Const = "number_184" + SecurityGroupRulePrototypeProtocolNumber185Const = "number_185" + SecurityGroupRulePrototypeProtocolNumber186Const = "number_186" + SecurityGroupRulePrototypeProtocolNumber187Const = "number_187" + SecurityGroupRulePrototypeProtocolNumber188Const = "number_188" + SecurityGroupRulePrototypeProtocolNumber189Const = "number_189" + SecurityGroupRulePrototypeProtocolNumber19Const = "number_19" + SecurityGroupRulePrototypeProtocolNumber190Const = "number_190" + SecurityGroupRulePrototypeProtocolNumber191Const = "number_191" + SecurityGroupRulePrototypeProtocolNumber192Const = "number_192" + SecurityGroupRulePrototypeProtocolNumber193Const = "number_193" + SecurityGroupRulePrototypeProtocolNumber194Const = "number_194" + SecurityGroupRulePrototypeProtocolNumber195Const = "number_195" + SecurityGroupRulePrototypeProtocolNumber196Const = "number_196" + SecurityGroupRulePrototypeProtocolNumber197Const = "number_197" + SecurityGroupRulePrototypeProtocolNumber198Const = "number_198" + SecurityGroupRulePrototypeProtocolNumber199Const = "number_199" + SecurityGroupRulePrototypeProtocolNumber2Const = "number_2" + SecurityGroupRulePrototypeProtocolNumber20Const = "number_20" + SecurityGroupRulePrototypeProtocolNumber200Const = "number_200" + SecurityGroupRulePrototypeProtocolNumber201Const = "number_201" + SecurityGroupRulePrototypeProtocolNumber202Const = "number_202" + SecurityGroupRulePrototypeProtocolNumber203Const = "number_203" + SecurityGroupRulePrototypeProtocolNumber204Const = "number_204" + SecurityGroupRulePrototypeProtocolNumber205Const = "number_205" + SecurityGroupRulePrototypeProtocolNumber206Const = "number_206" + SecurityGroupRulePrototypeProtocolNumber207Const = "number_207" + SecurityGroupRulePrototypeProtocolNumber208Const = "number_208" + SecurityGroupRulePrototypeProtocolNumber209Const = "number_209" + SecurityGroupRulePrototypeProtocolNumber21Const = "number_21" + SecurityGroupRulePrototypeProtocolNumber210Const = "number_210" + SecurityGroupRulePrototypeProtocolNumber211Const = "number_211" + SecurityGroupRulePrototypeProtocolNumber212Const = "number_212" + SecurityGroupRulePrototypeProtocolNumber213Const = "number_213" + SecurityGroupRulePrototypeProtocolNumber214Const = "number_214" + SecurityGroupRulePrototypeProtocolNumber215Const = "number_215" + SecurityGroupRulePrototypeProtocolNumber216Const = "number_216" + SecurityGroupRulePrototypeProtocolNumber217Const = "number_217" + SecurityGroupRulePrototypeProtocolNumber218Const = "number_218" + SecurityGroupRulePrototypeProtocolNumber219Const = "number_219" + SecurityGroupRulePrototypeProtocolNumber22Const = "number_22" + SecurityGroupRulePrototypeProtocolNumber220Const = "number_220" + SecurityGroupRulePrototypeProtocolNumber221Const = "number_221" + SecurityGroupRulePrototypeProtocolNumber222Const = "number_222" + SecurityGroupRulePrototypeProtocolNumber223Const = "number_223" + SecurityGroupRulePrototypeProtocolNumber224Const = "number_224" + SecurityGroupRulePrototypeProtocolNumber225Const = "number_225" + SecurityGroupRulePrototypeProtocolNumber226Const = "number_226" + SecurityGroupRulePrototypeProtocolNumber227Const = "number_227" + SecurityGroupRulePrototypeProtocolNumber228Const = "number_228" + SecurityGroupRulePrototypeProtocolNumber229Const = "number_229" + SecurityGroupRulePrototypeProtocolNumber23Const = "number_23" + SecurityGroupRulePrototypeProtocolNumber230Const = "number_230" + SecurityGroupRulePrototypeProtocolNumber231Const = "number_231" + SecurityGroupRulePrototypeProtocolNumber232Const = "number_232" + SecurityGroupRulePrototypeProtocolNumber233Const = "number_233" + SecurityGroupRulePrototypeProtocolNumber234Const = "number_234" + SecurityGroupRulePrototypeProtocolNumber235Const = "number_235" + SecurityGroupRulePrototypeProtocolNumber236Const = "number_236" + SecurityGroupRulePrototypeProtocolNumber237Const = "number_237" + SecurityGroupRulePrototypeProtocolNumber238Const = "number_238" + SecurityGroupRulePrototypeProtocolNumber239Const = "number_239" + SecurityGroupRulePrototypeProtocolNumber24Const = "number_24" + SecurityGroupRulePrototypeProtocolNumber240Const = "number_240" + SecurityGroupRulePrototypeProtocolNumber241Const = "number_241" + SecurityGroupRulePrototypeProtocolNumber242Const = "number_242" + SecurityGroupRulePrototypeProtocolNumber243Const = "number_243" + SecurityGroupRulePrototypeProtocolNumber244Const = "number_244" + SecurityGroupRulePrototypeProtocolNumber245Const = "number_245" + SecurityGroupRulePrototypeProtocolNumber246Const = "number_246" + SecurityGroupRulePrototypeProtocolNumber247Const = "number_247" + SecurityGroupRulePrototypeProtocolNumber248Const = "number_248" + SecurityGroupRulePrototypeProtocolNumber249Const = "number_249" + SecurityGroupRulePrototypeProtocolNumber25Const = "number_25" + SecurityGroupRulePrototypeProtocolNumber250Const = "number_250" + SecurityGroupRulePrototypeProtocolNumber251Const = "number_251" + SecurityGroupRulePrototypeProtocolNumber252Const = "number_252" + SecurityGroupRulePrototypeProtocolNumber253Const = "number_253" + SecurityGroupRulePrototypeProtocolNumber254Const = "number_254" + SecurityGroupRulePrototypeProtocolNumber255Const = "number_255" + SecurityGroupRulePrototypeProtocolNumber26Const = "number_26" + SecurityGroupRulePrototypeProtocolNumber27Const = "number_27" + SecurityGroupRulePrototypeProtocolNumber28Const = "number_28" + SecurityGroupRulePrototypeProtocolNumber29Const = "number_29" + SecurityGroupRulePrototypeProtocolNumber3Const = "number_3" + SecurityGroupRulePrototypeProtocolNumber30Const = "number_30" + SecurityGroupRulePrototypeProtocolNumber31Const = "number_31" + SecurityGroupRulePrototypeProtocolNumber32Const = "number_32" + SecurityGroupRulePrototypeProtocolNumber33Const = "number_33" + SecurityGroupRulePrototypeProtocolNumber34Const = "number_34" + SecurityGroupRulePrototypeProtocolNumber35Const = "number_35" + SecurityGroupRulePrototypeProtocolNumber36Const = "number_36" + SecurityGroupRulePrototypeProtocolNumber37Const = "number_37" + SecurityGroupRulePrototypeProtocolNumber38Const = "number_38" + SecurityGroupRulePrototypeProtocolNumber39Const = "number_39" + SecurityGroupRulePrototypeProtocolNumber40Const = "number_40" + SecurityGroupRulePrototypeProtocolNumber41Const = "number_41" + SecurityGroupRulePrototypeProtocolNumber42Const = "number_42" + SecurityGroupRulePrototypeProtocolNumber43Const = "number_43" + SecurityGroupRulePrototypeProtocolNumber44Const = "number_44" + SecurityGroupRulePrototypeProtocolNumber45Const = "number_45" + SecurityGroupRulePrototypeProtocolNumber48Const = "number_48" + SecurityGroupRulePrototypeProtocolNumber49Const = "number_49" + SecurityGroupRulePrototypeProtocolNumber5Const = "number_5" + SecurityGroupRulePrototypeProtocolNumber52Const = "number_52" + SecurityGroupRulePrototypeProtocolNumber53Const = "number_53" + SecurityGroupRulePrototypeProtocolNumber54Const = "number_54" + SecurityGroupRulePrototypeProtocolNumber55Const = "number_55" + SecurityGroupRulePrototypeProtocolNumber56Const = "number_56" + SecurityGroupRulePrototypeProtocolNumber57Const = "number_57" + SecurityGroupRulePrototypeProtocolNumber58Const = "number_58" + SecurityGroupRulePrototypeProtocolNumber59Const = "number_59" + SecurityGroupRulePrototypeProtocolNumber60Const = "number_60" + SecurityGroupRulePrototypeProtocolNumber61Const = "number_61" + SecurityGroupRulePrototypeProtocolNumber62Const = "number_62" + SecurityGroupRulePrototypeProtocolNumber63Const = "number_63" + SecurityGroupRulePrototypeProtocolNumber64Const = "number_64" + SecurityGroupRulePrototypeProtocolNumber65Const = "number_65" + SecurityGroupRulePrototypeProtocolNumber66Const = "number_66" + SecurityGroupRulePrototypeProtocolNumber67Const = "number_67" + SecurityGroupRulePrototypeProtocolNumber68Const = "number_68" + SecurityGroupRulePrototypeProtocolNumber69Const = "number_69" + SecurityGroupRulePrototypeProtocolNumber7Const = "number_7" + SecurityGroupRulePrototypeProtocolNumber70Const = "number_70" + SecurityGroupRulePrototypeProtocolNumber71Const = "number_71" + SecurityGroupRulePrototypeProtocolNumber72Const = "number_72" + SecurityGroupRulePrototypeProtocolNumber73Const = "number_73" + SecurityGroupRulePrototypeProtocolNumber74Const = "number_74" + SecurityGroupRulePrototypeProtocolNumber75Const = "number_75" + SecurityGroupRulePrototypeProtocolNumber76Const = "number_76" + SecurityGroupRulePrototypeProtocolNumber77Const = "number_77" + SecurityGroupRulePrototypeProtocolNumber78Const = "number_78" + SecurityGroupRulePrototypeProtocolNumber79Const = "number_79" + SecurityGroupRulePrototypeProtocolNumber8Const = "number_8" + SecurityGroupRulePrototypeProtocolNumber80Const = "number_80" + SecurityGroupRulePrototypeProtocolNumber81Const = "number_81" + SecurityGroupRulePrototypeProtocolNumber82Const = "number_82" + SecurityGroupRulePrototypeProtocolNumber83Const = "number_83" + SecurityGroupRulePrototypeProtocolNumber84Const = "number_84" + SecurityGroupRulePrototypeProtocolNumber85Const = "number_85" + SecurityGroupRulePrototypeProtocolNumber86Const = "number_86" + SecurityGroupRulePrototypeProtocolNumber87Const = "number_87" + SecurityGroupRulePrototypeProtocolNumber88Const = "number_88" + SecurityGroupRulePrototypeProtocolNumber89Const = "number_89" + SecurityGroupRulePrototypeProtocolNumber9Const = "number_9" + SecurityGroupRulePrototypeProtocolNumber90Const = "number_90" + SecurityGroupRulePrototypeProtocolNumber91Const = "number_91" + SecurityGroupRulePrototypeProtocolNumber92Const = "number_92" + SecurityGroupRulePrototypeProtocolNumber93Const = "number_93" + SecurityGroupRulePrototypeProtocolNumber94Const = "number_94" + SecurityGroupRulePrototypeProtocolNumber95Const = "number_95" + SecurityGroupRulePrototypeProtocolNumber96Const = "number_96" + SecurityGroupRulePrototypeProtocolNumber97Const = "number_97" + SecurityGroupRulePrototypeProtocolNumber98Const = "number_98" + SecurityGroupRulePrototypeProtocolNumber99Const = "number_99" + SecurityGroupRulePrototypeProtocolRsvpConst = "rsvp" + SecurityGroupRulePrototypeProtocolSctpConst = "sctp" + SecurityGroupRulePrototypeProtocolTCPConst = "tcp" + SecurityGroupRulePrototypeProtocolUDPConst = "udp" + SecurityGroupRulePrototypeProtocolVrrpConst = "vrrp" ) func (*SecurityGroupRulePrototype) isaSecurityGroupRulePrototype() bool { @@ -90843,6 +100878,11 @@ func UnmarshalSecurityGroupRulePrototype(m map[string]json.RawMessage, result in err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) @@ -90881,8 +100921,8 @@ func UnmarshalSecurityGroupRulePrototype(m map[string]json.RawMessage, result in // CIDR block of `0.0.0.0/0` allows traffic from any source // (or to any destination, for outbound rules). // Models which "extend" this model: -// - SecurityGroupRuleRemoteIP -// - SecurityGroupRuleRemoteCIDR +// - SecurityGroupRuleRemoteSecurityGroupRuleIP +// - SecurityGroupRuleRemoteSecurityGroupRuleCIDR // - SecurityGroupRuleRemoteSecurityGroupReference type SecurityGroupRuleRemote struct { // The IP address. @@ -90893,8 +100933,8 @@ type SecurityGroupRuleRemote struct { // The CIDR block. // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. CIDRBlock *string `json:"cidr_block,omitempty"` // The CRN for this security group. @@ -90965,23 +101005,18 @@ func UnmarshalSecurityGroupRuleRemote(m map[string]json.RawMessage, result inter } // SecurityGroupRuleRemotePatch : The remote 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 destination, for outbound rules). +// Can be specified as an IP address, a CIDR block, or a security group. +// +// Specify a CIDR block of `0.0.0.0/0` to allow traffic from any source (or to any destination, for outbound rules). // Models which "extend" this model: -// - SecurityGroupRuleRemotePatchIP -// - SecurityGroupRuleRemotePatchCIDR +// - SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype +// - SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype // - SecurityGroupRuleRemotePatchSecurityGroupIdentity type SecurityGroupRuleRemotePatch struct { // The IP address. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in - // the future. Address *string `json:"address,omitempty"` // The CIDR block. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. CIDRBlock *string `json:"cidr_block,omitempty"` // The unique identifier for this security group. @@ -91063,20 +101098,14 @@ func (securityGroupRuleRemotePatch *SecurityGroupRuleRemotePatch) asPatch() (_pa // If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any source // (or to any destination, for outbound rules). // Models which "extend" this model: -// - SecurityGroupRuleRemotePrototypeIP -// - SecurityGroupRuleRemotePrototypeCIDR +// - SecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype +// - SecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype // - SecurityGroupRuleRemotePrototypeSecurityGroupIdentity type SecurityGroupRuleRemotePrototype struct { // The IP address. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in - // the future. Address *string `json:"address,omitempty"` // The CIDR block. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. CIDRBlock *string `json:"cidr_block,omitempty"` // The unique identifier for this security group. @@ -91365,14 +101394,37 @@ type Share struct { // with access to this file share's data and its snapshots. AccessorBindings []ShareAccessorBindingReference `json:"accessor_bindings" validate:"required"` + // The access protocols to allow for this share: + // - `nfs4`: NFSv4 is used to access this share via its associated share mount target. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + AllowedAccessProtocols []string `json:"allowed_access_protocols" validate:"required"` + // The transit encryption modes allowed for this share: // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. + // - `ipsec`: Encrypted in transit using an instance identity certificate. + // - `stunnel`: Encrypted in transit using a connection via the installed stunnel + // client. // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes" validate:"required"` + // The data availability mode of the share: + // - `zonal`: The share's data will be available provided the `zone` of the share is + // available. Additionally, disasters affecting the zone may lead to data loss. + // - `regional`: The share's data will be available provided at least one zone in the + // region is available. Additionally, disasters affecting the entire region may lead + // to data loss. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + AvailabilityMode *string `json:"availability_mode" validate:"required"` + + // The maximum bandwidth (in megabits per second) for the share. + Bandwidth *int64 `json:"bandwidth" validate:"required"` + // The date and time that the file share is created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` @@ -91396,10 +101448,9 @@ type Share struct { // The owner assigned to the file share at creation. InitialOwner *ShareInitialOwner `json:"initial_owner" validate:"required"` - // The maximum input/output operations per second (IOPS) for the file share. In addition, each client accessing the - // share will be restricted to 48,000 IOPS. + // The maximum input/output operations per second (IOPS) for the file share. // - // The maximum IOPS for a share may increase in the future. + // The maximum IOPS for a share as defined by the share's profile may increase in the future. Iops *int64 `json:"iops" validate:"required"` // The latest job associated with this file share. @@ -91499,11 +101550,22 @@ type Share struct { // future. SourceSnapshot ShareSourceSnapshotIntf `json:"source_snapshot,omitempty"` + // The [storage + // generation](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles&interface=api#using-api-iops-profiles): + // - `1`: The first storage generation + // - `2`: The second storage generation + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + StorageGeneration *int64 `json:"storage_generation" validate:"required"` + // The tags for this resource. UserTags []string `json:"user_tags" validate:"required"` // The zone this file share resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // + // This property will be absent for shares with an `availability_mode` of `regional`. + Zone *ZoneReference `json:"zone,omitempty"` } // Constants associated with the Share.AccessControlMode property. @@ -91533,10 +101595,31 @@ const ( ShareAccessorBindingRoleOriginConst = "origin" ) +// Constants associated with the Share.AllowedAccessProtocols property. +const ( + ShareAllowedAccessProtocolsNfs4Const = "nfs4" +) + // Constants associated with the Share.AllowedTransitEncryptionModes property. const ( - ShareAllowedTransitEncryptionModesNoneConst = "none" - ShareAllowedTransitEncryptionModesUserManagedConst = "user_managed" + ShareAllowedTransitEncryptionModesIpsecConst = "ipsec" + ShareAllowedTransitEncryptionModesNoneConst = "none" + ShareAllowedTransitEncryptionModesStunnelConst = "stunnel" +) + +// Constants associated with the Share.AvailabilityMode property. +// The data availability mode of the share: +// - `zonal`: The share's data will be available provided the `zone` of the share is +// available. Additionally, disasters affecting the zone may lead to data loss. +// - `regional`: The share's data will be available provided at least one zone in the +// region is available. Additionally, disasters affecting the entire region may lead +// to data loss. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + ShareAvailabilityModeRegionalConst = "regional" + ShareAvailabilityModeZonalConst = "zonal" ) // Constants associated with the Share.Encryption property. @@ -91618,11 +101701,26 @@ func UnmarshalShare(m map[string]json.RawMessage, result interface{}) (err error err = core.SDKErrorf(err, "", "accessor_bindings-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allowed_access_protocols", &obj.AllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "allowed_transit_encryption_modes", &obj.AllowedTransitEncryptionModes) if err != nil { err = core.SDKErrorf(err, "", "allowed_transit_encryption_modes-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "availability_mode", &obj.AvailabilityMode) + if err != nil { + err = core.SDKErrorf(err, "", "availability_mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) @@ -91763,6 +101861,11 @@ func UnmarshalShare(m map[string]json.RawMessage, result interface{}) (err error err = core.SDKErrorf(err, "", "source_snapshot-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "storage_generation", &obj.StorageGeneration) + if err != nil { + err = core.SDKErrorf(err, "", "storage_generation-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { err = core.SDKErrorf(err, "", "user_tags-error", common.GetComponentInfo()) @@ -92423,6 +102526,13 @@ type ShareMountTarget struct { // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. AccessControlMode *string `json:"access_control_mode" validate:"required"` + // The protocol used to access the share for this share mount target: + // - `nfs4`: NFSv4 will be used. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + AccessProtocol *string `json:"access_protocol" validate:"required"` + // The date and time that the share mount target was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` @@ -92466,8 +102576,10 @@ type ShareMountTarget struct { Subnet *SubnetReference `json:"subnet,omitempty"` // The transit encryption mode for this share mount target: - // - `none`: Not encrypted in transit - // - `user_managed`: Encrypted in transit using an instance identity certificate + // - `none`: Not encrypted in transit. + // - `ipsec`: Encrypted in transit using an instance identity certificate. + // - `stunnel`: Encrypted in transit using a connection via the installed stunnel + // client. // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. @@ -92501,6 +102613,16 @@ const ( ShareMountTargetAccessControlModeVPCConst = "vpc" ) +// Constants associated with the ShareMountTarget.AccessProtocol property. +// The protocol used to access the share for this share mount target: +// - `nfs4`: NFSv4 will be used. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + ShareMountTargetAccessProtocolNfs4Const = "nfs4" +) + // Constants associated with the ShareMountTarget.LifecycleState property. // The lifecycle state of the mount target. const ( @@ -92521,14 +102643,17 @@ const ( // Constants associated with the ShareMountTarget.TransitEncryption property. // The transit encryption mode for this share mount target: -// - `none`: Not encrypted in transit -// - `user_managed`: Encrypted in transit using an instance identity certificate +// - `none`: Not encrypted in transit. +// - `ipsec`: Encrypted in transit using an instance identity certificate. +// - `stunnel`: Encrypted in transit using a connection via the installed stunnel +// client. // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. const ( - ShareMountTargetTransitEncryptionNoneConst = "none" - ShareMountTargetTransitEncryptionUserManagedConst = "user_managed" + ShareMountTargetTransitEncryptionIpsecConst = "ipsec" + ShareMountTargetTransitEncryptionNoneConst = "none" + ShareMountTargetTransitEncryptionStunnelConst = "stunnel" ) // UnmarshalShareMountTarget unmarshals an instance of ShareMountTarget from the specified map of raw messages. @@ -92539,6 +102664,11 @@ func UnmarshalShareMountTarget(m map[string]json.RawMessage, result interface{}) err = core.SDKErrorf(err, "", "access_control_mode-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "access_protocol", &obj.AccessProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "access_protocol-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) @@ -92702,18 +102832,26 @@ func (shareMountTargetPatch *ShareMountTargetPatch) AsPatch() (_patch map[string // - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup // - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC type ShareMountTargetPrototype struct { + // The protocol to use to access the share for this share mount target: + // - `nfs4`: NFSv4 will be used. + // + // The specified value must be listed in the share's `allowed_access_protocols`. + AccessProtocol *string `json:"access_protocol" validate:"required"` + // The name for this share mount target. The name must not be used by another mount target for the file share. If // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. + // - `ipsec`: Encrypted in transit using an instance identity certificate. The + // `access_control_mode` for the share must be `security_group`. + // - `stunnel`: Encrypted in transit using an stunnel connection. The + // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. - TransitEncryption *string `json:"transit_encryption,omitempty"` + TransitEncryption *string `json:"transit_encryption" validate:"required"` VirtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf `json:"virtual_network_interface,omitempty"` @@ -92721,17 +102859,29 @@ type ShareMountTargetPrototype struct { VPC VPCIdentityIntf `json:"vpc,omitempty"` } +// Constants associated with the ShareMountTargetPrototype.AccessProtocol property. +// The protocol to use to access the share for this share mount target: +// - `nfs4`: NFSv4 will be used. +// +// The specified value must be listed in the share's `allowed_access_protocols`. +const ( + ShareMountTargetPrototypeAccessProtocolNfs4Const = "nfs4" +) + // Constants associated with the ShareMountTargetPrototype.TransitEncryption property. // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The +// - `ipsec`: Encrypted in transit using an instance identity certificate. The +// `access_control_mode` for the share must be `security_group`. +// - `stunnel`: Encrypted in transit using an stunnel connection. The // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. const ( - ShareMountTargetPrototypeTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeTransitEncryptionUserManagedConst = "user_managed" + ShareMountTargetPrototypeTransitEncryptionIpsecConst = "ipsec" + ShareMountTargetPrototypeTransitEncryptionNoneConst = "none" + ShareMountTargetPrototypeTransitEncryptionStunnelConst = "stunnel" ) func (*ShareMountTargetPrototype) isaShareMountTargetPrototype() bool { @@ -92745,6 +102895,11 @@ type ShareMountTargetPrototypeIntf interface { // UnmarshalShareMountTargetPrototype unmarshals an instance of ShareMountTargetPrototype from the specified map of raw messages. func UnmarshalShareMountTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(ShareMountTargetPrototype) + err = core.UnmarshalPrimitive(m, "access_protocol", &obj.AccessProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "access_protocol-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) @@ -93018,10 +103173,20 @@ type SharePatch struct { // mount target control access to the mount target. // - `vpc`: All clients in the VPC for a mount target have access to the mount target. // + // The `vpc` access control mode has been deprecated. Use `security_group` instead. + // // For this property to be changed, the share must have no mount targets, // `replication_role` must be `none` and `accessor_binding_role` must not be `accessor`. AccessControlMode *string `json:"access_control_mode,omitempty"` + // The access protocols to allow for this share (replacing any existing access protocols). + // + // If the share has existing mount targets, the set of allowed access protocols must contain all `access_protocol` + // modes specified by existing mount targets. + // + // For this property to be updated, the `accessor_binding_role` must be `none`. + AllowedAccessProtocols []string `json:"allowed_access_protocols,omitempty"` + // The transit encryption modes to allow for this share // (replacing the existing allowed transit encryption modes). The specified transit encryption modes must contain all // transit_encryption modes specified by existing mount targets. @@ -93029,6 +103194,13 @@ type SharePatch struct { // For this property to be updated, the `accessor_binding_role` must be `none`. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` + // The maximum bandwidth (in megabits per second) for the share. + // + // For this property to be changed, the share `accessor_binding_role` must not be + // `accessor`, the share profile must not have a `bandwidth.type` of `dependent` or + // `fixed`, and the specified value must be within the `bandwidth` range of the share's profile. + Bandwidth *int64 `json:"bandwidth,omitempty"` + // The maximum input/output operations per second (IOPS) for the file share. // // The maximum IOPS for a share may increase in the future. For this property to be changed, the share @@ -93072,6 +103244,8 @@ type SharePatch struct { // mount target control access to the mount target. // - `vpc`: All clients in the VPC for a mount target have access to the mount target. // +// The `vpc` access control mode has been deprecated. Use `security_group` instead. +// // For this property to be changed, the share must have no mount targets, // `replication_role` must be `none` and `accessor_binding_role` must not be `accessor`. const ( @@ -93079,10 +103253,16 @@ const ( SharePatchAccessControlModeVPCConst = "vpc" ) +// Constants associated with the SharePatch.AllowedAccessProtocols property. +const ( + SharePatchAllowedAccessProtocolsNfs4Const = "nfs4" +) + // Constants associated with the SharePatch.AllowedTransitEncryptionModes property. const ( - SharePatchAllowedTransitEncryptionModesNoneConst = "none" - SharePatchAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePatchAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePatchAllowedTransitEncryptionModesNoneConst = "none" + SharePatchAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // UnmarshalSharePatch unmarshals an instance of SharePatch from the specified map of raw messages. @@ -93093,11 +103273,21 @@ func UnmarshalSharePatch(m map[string]json.RawMessage, result interface{}) (err err = core.SDKErrorf(err, "", "access_control_mode-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allowed_access_protocols", &obj.AllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "allowed_transit_encryption_modes", &obj.AllowedTransitEncryptionModes) if err != nil { err = core.SDKErrorf(err, "", "allowed_transit_encryption_modes-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) if err != nil { err = core.SDKErrorf(err, "", "iops-error", common.GetComponentInfo()) @@ -93138,9 +103328,15 @@ func (sharePatch *SharePatch) AsPatch() (_patch map[string]interface{}, err erro if !core.IsNil(sharePatch.AccessControlMode) { _patch["access_control_mode"] = sharePatch.AccessControlMode } + if !core.IsNil(sharePatch.AllowedAccessProtocols) { + _patch["allowed_access_protocols"] = sharePatch.AllowedAccessProtocols + } if !core.IsNil(sharePatch.AllowedTransitEncryptionModes) { _patch["allowed_transit_encryption_modes"] = sharePatch.AllowedTransitEncryptionModes } + if !core.IsNil(sharePatch.Bandwidth) { + _patch["bandwidth"] = sharePatch.Bandwidth + } if !core.IsNil(sharePatch.Iops) { _patch["iops"] = sharePatch.Iops } @@ -93165,6 +103361,18 @@ func (sharePatch *SharePatch) AsPatch() (_patch map[string]interface{}, err erro // ShareProfile : ShareProfile struct type ShareProfile struct { + // The possible allowed access protocols for a share with this profile. + AllowedAccessProtocols ShareProfileAllowedAccessProtocolsIntf `json:"allowed_access_protocols" validate:"required"` + + // The possible allowed transit encryption modes for a share with this profile. + AllowedTransitEncryptionModes ShareProfileAllowedTransitEncryptionModesIntf `json:"allowed_transit_encryption_modes" validate:"required"` + + // The data availability mode of a share with this profile. + AvailabilityModes ShareProfileAvailabilityModesIntf `json:"availability_modes" validate:"required"` + + // The permitted bandwidth (in megabits per second) for a share with this profile. + Bandwidth ShareProfileBandwidthIntf `json:"bandwidth" validate:"required"` + // The permitted capacity range (in gigabytes) for a share with this profile. Capacity ShareProfileCapacityIntf `json:"capacity" validate:"required"` @@ -93185,6 +103393,9 @@ type ShareProfile struct { // The resource type. ResourceType *string `json:"resource_type" validate:"required"` + + // The storage generation for a share with this profile. + StorageGeneration ShareProfileStorageGenerationIntf `json:"storage_generation" validate:"required"` } // Constants associated with the ShareProfile.Family property. @@ -93205,6 +103416,26 @@ const ( // UnmarshalShareProfile unmarshals an instance of ShareProfile from the specified map of raw messages. func UnmarshalShareProfile(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(ShareProfile) + err = core.UnmarshalModel(m, "allowed_access_protocols", &obj.AllowedAccessProtocols, UnmarshalShareProfileAllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "allowed_transit_encryption_modes", &obj.AllowedTransitEncryptionModes, UnmarshalShareProfileAllowedTransitEncryptionModes) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_transit_encryption_modes-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "availability_modes", &obj.AvailabilityModes, UnmarshalShareProfileAvailabilityModes) + if err != nil { + err = core.SDKErrorf(err, "", "availability_modes-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalShareProfileBandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalShareProfileCapacity) if err != nil { err = core.SDKErrorf(err, "", "capacity-error", common.GetComponentInfo()) @@ -93235,6 +103466,318 @@ func UnmarshalShareProfile(m map[string]json.RawMessage, result interface{}) (er err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "storage_generation", &obj.StorageGeneration, UnmarshalShareProfileStorageGeneration) + if err != nil { + err = core.SDKErrorf(err, "", "storage_generation-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAllowedAccessProtocols : ShareProfileAllowedAccessProtocols struct +// Models which "extend" this model: +// - ShareProfileAllowedAccessProtocolsSubset +type ShareProfileAllowedAccessProtocols struct { + // The default allowed access protocol modes for shares with this profile. + Default []string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The possible allowed access protocols for shares with this profile: + // - `nfs4`: NFSv4 will be used. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values,omitempty"` +} + +// Constants associated with the ShareProfileAllowedAccessProtocols.Default property. +const ( + ShareProfileAllowedAccessProtocolsDefaultNfs4Const = "nfs4" +) + +// Constants associated with the ShareProfileAllowedAccessProtocols.Type property. +// The type for this profile field. +const ( + ShareProfileAllowedAccessProtocolsTypeSubsetConst = "subset" +) + +// Constants associated with the ShareProfileAllowedAccessProtocols.Values property. +const ( + ShareProfileAllowedAccessProtocolsValuesNfs4Const = "nfs4" +) + +func (*ShareProfileAllowedAccessProtocols) isaShareProfileAllowedAccessProtocols() bool { + return true +} + +type ShareProfileAllowedAccessProtocolsIntf interface { + isaShareProfileAllowedAccessProtocols() bool +} + +// UnmarshalShareProfileAllowedAccessProtocols unmarshals an instance of ShareProfileAllowedAccessProtocols from the specified map of raw messages. +func UnmarshalShareProfileAllowedAccessProtocols(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAllowedAccessProtocols) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAllowedTransitEncryptionModes : ShareProfileAllowedTransitEncryptionModes struct +// Models which "extend" this model: +// - ShareProfileAllowedTransitEncryptionModesSubset +type ShareProfileAllowedTransitEncryptionModes struct { + // The default allowed transit encryption modes for shares with this profile. + Default []string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The allowed [transit encryption + // modes](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-vpc-about&interface=ui#fs-eit) for a share with this + // profile: + // - `none`: Not encrypted in transit. + // - `ipsec`: Encrypted in transit using an instance identity certificate. + // - `stunnel`: Encrypted in transit using a connection via an stunnel connection. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values,omitempty"` +} + +// Constants associated with the ShareProfileAllowedTransitEncryptionModes.Default property. +const ( + ShareProfileAllowedTransitEncryptionModesDefaultIpsecConst = "ipsec" + ShareProfileAllowedTransitEncryptionModesDefaultNoneConst = "none" + ShareProfileAllowedTransitEncryptionModesDefaultStunnelConst = "stunnel" +) + +// Constants associated with the ShareProfileAllowedTransitEncryptionModes.Type property. +// The type for this profile field. +const ( + ShareProfileAllowedTransitEncryptionModesTypeSubsetConst = "subset" +) + +// Constants associated with the ShareProfileAllowedTransitEncryptionModes.Values property. +const ( + ShareProfileAllowedTransitEncryptionModesValuesIpsecConst = "ipsec" + ShareProfileAllowedTransitEncryptionModesValuesNoneConst = "none" + ShareProfileAllowedTransitEncryptionModesValuesStunnelConst = "stunnel" +) + +func (*ShareProfileAllowedTransitEncryptionModes) isaShareProfileAllowedTransitEncryptionModes() bool { + return true +} + +type ShareProfileAllowedTransitEncryptionModesIntf interface { + isaShareProfileAllowedTransitEncryptionModes() bool +} + +// UnmarshalShareProfileAllowedTransitEncryptionModes unmarshals an instance of ShareProfileAllowedTransitEncryptionModes from the specified map of raw messages. +func UnmarshalShareProfileAllowedTransitEncryptionModes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAllowedTransitEncryptionModes) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAvailabilityModes : ShareProfileAvailabilityModes struct +// Models which "extend" this model: +// - ShareProfileAvailabilityModesEnum +// - ShareProfileAvailabilityModesFixed +type ShareProfileAvailabilityModes struct { + // The default data availability mode for this profile. + Default *string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The data availability mode of the share: + // - `zonal`: The data availability of this share is limited only to a single zone of a + // given region as provided by the `zone` of the share. + // - `regional`: The data availability of this share covers all zones in the region where + // the share is created. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values,omitempty"` + + // The value for this profile field. + Value *string `json:"value,omitempty"` +} + +// Constants associated with the ShareProfileAvailabilityModes.Default property. +// The default data availability mode for this profile. +const ( + ShareProfileAvailabilityModesDefaultRegionalConst = "regional" + ShareProfileAvailabilityModesDefaultZonalConst = "zonal" +) + +// Constants associated with the ShareProfileAvailabilityModes.Type property. +// The type for this profile field. +const ( + ShareProfileAvailabilityModesTypeEnumConst = "enum" +) + +// Constants associated with the ShareProfileAvailabilityModes.Values property. +const ( + ShareProfileAvailabilityModesValuesRegionalConst = "regional" + ShareProfileAvailabilityModesValuesZonalConst = "zonal" +) + +// Constants associated with the ShareProfileAvailabilityModes.Value property. +// The value for this profile field. +const ( + ShareProfileAvailabilityModesValueRegionalConst = "regional" + ShareProfileAvailabilityModesValueZonalConst = "zonal" +) + +func (*ShareProfileAvailabilityModes) isaShareProfileAvailabilityModes() bool { + return true +} + +type ShareProfileAvailabilityModesIntf interface { + isaShareProfileAvailabilityModes() bool +} + +// UnmarshalShareProfileAvailabilityModes unmarshals an instance of ShareProfileAvailabilityModes from the specified map of raw messages. +func UnmarshalShareProfileAvailabilityModes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAvailabilityModes) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidth : ShareProfileBandwidth struct +// Models which "extend" this model: +// - ShareProfileBandwidthRange +// - ShareProfileBandwidthDependent +// - ShareProfileBandwidthFixed +// - ShareProfileBandwidthEnum +// - ShareProfileBandwidthDependentRange +type ShareProfileBandwidth struct { + // 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 type for this profile field. + Type *string `json:"type,omitempty"` + + Value *int64 `json:"value,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the ShareProfileBandwidth.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthTypeRangeConst = "range" +) + +func (*ShareProfileBandwidth) isaShareProfileBandwidth() bool { + return true +} + +type ShareProfileBandwidthIntf interface { + isaShareProfileBandwidth() bool +} + +// UnmarshalShareProfileBandwidth unmarshals an instance of ShareProfileBandwidth from the specified map of raw messages. +func UnmarshalShareProfileBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidth) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + err = core.SDKErrorf(err, "", "max-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + err = core.SDKErrorf(err, "", "min-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + err = core.SDKErrorf(err, "", "step-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -93567,6 +104110,48 @@ func UnmarshalShareProfileReference(m map[string]json.RawMessage, result interfa return } +// ShareProfileStorageGeneration : ShareProfileStorageGeneration struct +// Models which "extend" this model: +// - ShareProfileStorageGenerationFixed +type ShareProfileStorageGeneration struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` +} + +// Constants associated with the ShareProfileStorageGeneration.Type property. +// The type for this profile field. +const ( + ShareProfileStorageGenerationTypeFixedConst = "fixed" +) + +func (*ShareProfileStorageGeneration) isaShareProfileStorageGeneration() bool { + return true +} + +type ShareProfileStorageGenerationIntf interface { + isaShareProfileStorageGeneration() bool +} + +// UnmarshalShareProfileStorageGeneration unmarshals an instance of ShareProfileStorageGeneration from the specified map of raw messages. +func UnmarshalShareProfileStorageGeneration(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileStorageGeneration) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // SharePrototype : SharePrototype struct // Models which "extend" this model: // - SharePrototypeShareBySize @@ -93575,9 +104160,10 @@ func UnmarshalShareProfileReference(m map[string]json.RawMessage, result interfa // - SharePrototypeShareBySourceSnapshot type SharePrototype struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The mount targets for the file share. Each mount target must be in a unique VPC. @@ -93590,6 +104176,9 @@ type SharePrototype struct { // Configuration for a replica file share to create and associate with this file share. If // unspecified, a replica may be subsequently added by creating a new file share with a // `source_share` referencing this file share. + // + // Replica file shares can only be created for shares with an `availability_mode` of + // `zonal`. ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` // The tags for this resource. @@ -93602,8 +104191,26 @@ type SharePrototype struct { // require a virtual network interface. // - `vpc`: All clients in the VPC for a mount target have access to the mount target. // Mount targets for this share require a VPC. + // + // The `vpc` access control mode has been deprecated. Use `security_group` instead. AccessControlMode *string `json:"access_control_mode,omitempty"` + // The access protocols to allow for this share. If unspecified: + // - If share mount targets are specified, only the access protocols specified by those + // share mount target will be allowed. + // - Otherwise, the default access protocols from the profile will be used. + AllowedAccessProtocols []string `json:"allowed_access_protocols,omitempty"` + + // The maximum bandwidth (in megabits per second) for the file share. + // + // If the share profile has a `bandwidth.type` of `dependent` or `fixed`, this property is system-managed and must not + // be specified. Otherwise, the specified value must be within the `bandwidth` range of the share's profile. + // + // Provided the property is user-managed, if it is unspecified, its value will be set based on the specified [`size` + // and + // `iops`](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles&interface=api). + Bandwidth *int64 `json:"bandwidth,omitempty"` + // The root key to use to wrap the data encryption key for the share. // // If unspecified, the `encryption` type for the share will be `provider_managed`. @@ -93638,6 +104245,9 @@ type SharePrototype struct { // The zone this file share will reside in. For a replica share in the same region as // the source share, this must be a different zone from the source share. + // + // This property must be specified if the share profile `availability_mode` is `zonal`, + // and must not be specified otherwise. Zone ZoneIdentityIntf `json:"zone,omitempty"` // The cron specification for the file share replication schedule. @@ -93648,9 +104258,12 @@ type SharePrototype struct { // [increase](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. ReplicationCronSpec *string `json:"replication_cron_spec,omitempty"` - // The source file share for this replica file share. The specified file share must not - // already have a replica, and must not be a replica. If source file share is specified - // by CRN, it may be in an [associated partner + // The source file share for this replica file share. The specified file share must: + // - Not already have a replica. + // - Not be a replica. + // - Have a `storage_generation` of `1`. + // + // If source file share is specified by CRN, it may be in an [associated partner // region](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-replication). SourceShare ShareIdentityIntf `json:"source_share,omitempty"` @@ -93671,8 +104284,9 @@ type SharePrototype struct { // Constants associated with the SharePrototype.AllowedTransitEncryptionModes property. const ( - SharePrototypeAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // Constants associated with the SharePrototype.AccessControlMode property. @@ -93683,11 +104297,18 @@ const ( // require a virtual network interface. // - `vpc`: All clients in the VPC for a mount target have access to the mount target. // Mount targets for this share require a VPC. +// +// The `vpc` access control mode has been deprecated. Use `security_group` instead. const ( SharePrototypeAccessControlModeSecurityGroupConst = "security_group" SharePrototypeAccessControlModeVPCConst = "vpc" ) +// Constants associated with the SharePrototype.AllowedAccessProtocols property. +const ( + SharePrototypeAllowedAccessProtocolsNfs4Const = "nfs4" +) + func (*SharePrototype) isaSharePrototype() bool { return true } @@ -93729,6 +104350,16 @@ func UnmarshalSharePrototype(m map[string]json.RawMessage, result interface{}) ( err = core.SDKErrorf(err, "", "access_control_mode-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allowed_access_protocols", &obj.AllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { err = core.SDKErrorf(err, "", "encryption_key-error", common.GetComponentInfo()) @@ -93791,11 +104422,15 @@ func UnmarshalSharePrototype(m map[string]json.RawMessage, result interface{}) ( // SharePrototypeShareContext : Configuration for a replica file share to create and associate with this file share. If unspecified, a replica may be // subsequently added by creating a new file share with a // `source_share` referencing this file share. +// +// Replica file shares can only be created for shares with an `availability_mode` of +// `zonal`. type SharePrototypeShareContext struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The maximum input/output operations per second (IOPS) for the file share. @@ -93815,7 +104450,9 @@ type SharePrototypeShareContext struct { Name *string `json:"name,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use - // for this file share. The profile must support the share's specified IOPS and size. + // for this file share. The profile must: + // - support the share's specified IOPS and size, and + // - have the same `storage_generation` as the share. Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` // The cron specification for the file share replication schedule. @@ -93832,21 +104469,21 @@ type SharePrototypeShareContext struct { // The zone this replica file share will reside in. For a replica share in the same // region as the source share, this must be a different zone from the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + Zone ZoneIdentityIntf `json:"zone,omitempty"` } // Constants associated with the SharePrototypeShareContext.AllowedTransitEncryptionModes property. const ( - SharePrototypeShareContextAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeShareContextAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeShareContextAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeShareContextAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeShareContextAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // NewSharePrototypeShareContext : Instantiate SharePrototypeShareContext (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareContext(profile ShareProfileIdentityIntf, replicationCronSpec string, zone ZoneIdentityIntf) (_model *SharePrototypeShareContext, err error) { +func (*VpcV1) NewSharePrototypeShareContext(profile ShareProfileIdentityIntf, replicationCronSpec string) (_model *SharePrototypeShareContext, err error) { _model = &SharePrototypeShareContext{ Profile: profile, ReplicationCronSpec: core.StringPtr(replicationCronSpec), - Zone: zone, } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -94130,8 +104767,9 @@ type ShareSnapshot struct { // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this share snapshot. UserTags []string `json:"user_tags" validate:"required"` - // The zone this share snapshot resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // The zone this share snapshot resides in. For shares with `availability_mode` of + // `regional`, this property will be absent. + Zone *ZoneReference `json:"zone,omitempty"` } // Constants associated with the ShareSnapshot.LifecycleState property. @@ -94908,7 +105546,7 @@ type SnapshotAllowedUse struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variable is supported, corresponding // to the `BareMetalServer` property: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + // - `enable_secure_boot` (boolean): Whether secure boot is enabled. BareMetalServer *string `json:"bare_metal_server" validate:"required"` // The expression that must be satisfied by the properties of a virtual server instance provisioned using this @@ -94917,7 +105555,7 @@ type SnapshotAllowedUse struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variables are supported, // corresponding to `Instance` properties: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + // - `enable_secure_boot` (boolean): Whether secure boot is enabled // - `gpu.count` (integer): The number of GPUs // - `gpu.manufacturer` (string): The GPU manufacturer // - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) @@ -94960,7 +105598,7 @@ type SnapshotAllowedUsePatch struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variable is supported, corresponding // to the `BareMetalServer` property: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + // - `enable_secure_boot` (boolean): Whether secure boot is enabled. BareMetalServer *string `json:"bare_metal_server,omitempty"` // The expression that must be satisfied by the properties of a virtual server instance provisioned using this @@ -94969,7 +105607,7 @@ type SnapshotAllowedUsePatch struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variables are supported, // corresponding to `Instance` properties: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + // - `enable_secure_boot` (boolean): Whether secure boot is enabled // - `gpu.count` (integer): The number of GPUs // - `gpu.manufacturer` (string): The GPU manufacturer // - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) @@ -95031,7 +105669,7 @@ type SnapshotAllowedUsePrototype struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variable is supported, corresponding // to the `BareMetalServer` property: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + // - `enable_secure_boot` (boolean): Whether secure boot is enabled. BareMetalServer *string `json:"bare_metal_server,omitempty"` // The expression that must be satisfied by the properties of a virtual server instance provisioned using this @@ -95042,7 +105680,7 @@ type SnapshotAllowedUsePrototype struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variables are supported, // corresponding to `Instance` properties: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + // - `enable_secure_boot` (boolean): Whether secure boot is enabled // - `gpu.count` (integer): The number of GPUs // - `gpu.manufacturer` (string): The GPU manufacturer // - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) @@ -95253,6 +105891,11 @@ func (resp *SnapshotCollection) GetNextStart() (*string, error) { // SnapshotConsistencyGroup : SnapshotConsistencyGroup struct type SnapshotConsistencyGroup struct { + // If present, the backup policy job that created this snapshot consistency group. + // Snapshot consistency groups with the same backup policy job identifier represent + // snapshots of the same instance across different storage generations. + BackupPolicyJob *BackupPolicyJobReference `json:"backup_policy_job,omitempty"` + // If present, the backup policy plan which created this snapshot consistency group. BackupPolicyPlan *BackupPolicyPlanReference `json:"backup_policy_plan,omitempty"` @@ -95315,6 +105958,11 @@ const ( // UnmarshalSnapshotConsistencyGroup unmarshals an instance of SnapshotConsistencyGroup from the specified map of raw messages. func UnmarshalSnapshotConsistencyGroup(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(SnapshotConsistencyGroup) + err = core.UnmarshalModel(m, "backup_policy_job", &obj.BackupPolicyJob, UnmarshalBackupPolicyJobReference) + if err != nil { + err = core.SDKErrorf(err, "", "backup_policy_job-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "backup_policy_plan", &obj.BackupPolicyPlan, UnmarshalBackupPolicyPlanReference) if err != nil { err = core.SDKErrorf(err, "", "backup_policy_plan-error", common.GetComponentInfo()) @@ -95503,8 +106151,8 @@ type SnapshotConsistencyGroupPrototype struct { ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The data-consistent member snapshots to create. Each snapshot must specify a - // `source_volume` attached to the same virtual server instance, and all source volumes must have a - // `storage_generation` value of `1`. + // `source_volume` attached to the same virtual server instance, and all source volumes must have the same + // `storage_generation` value. Snapshots []SnapshotPrototypeSnapshotConsistencyGroupContext `json:"snapshots,omitempty"` } @@ -97679,6 +108327,54 @@ func (options *UpdateEndpointGatewayOptions) SetHeaders(param map[string]string) return options } +// UpdateEndpointGatewayResourceBindingOptions : The UpdateEndpointGatewayResourceBinding options. +type UpdateEndpointGatewayResourceBindingOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // The resource binding identifier. + ID *string `json:"id" validate:"required,ne="` + + // The endpoint gateway resource binding patch. + EndpointGatewayResourceBindingPatch map[string]interface{} `json:"EndpointGatewayResourceBinding_patch" validate:"required"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewUpdateEndpointGatewayResourceBindingOptions : Instantiate UpdateEndpointGatewayResourceBindingOptions +func (*VpcV1) NewUpdateEndpointGatewayResourceBindingOptions(endpointGatewayID string, id string, endpointGatewayResourceBindingPatch map[string]interface{}) *UpdateEndpointGatewayResourceBindingOptions { + return &UpdateEndpointGatewayResourceBindingOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), + EndpointGatewayResourceBindingPatch: endpointGatewayResourceBindingPatch, + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *UpdateEndpointGatewayResourceBindingOptions) SetEndpointGatewayID(endpointGatewayID string) *UpdateEndpointGatewayResourceBindingOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *UpdateEndpointGatewayResourceBindingOptions) SetID(id string) *UpdateEndpointGatewayResourceBindingOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetEndpointGatewayResourceBindingPatch : Allow user to set EndpointGatewayResourceBindingPatch +func (_options *UpdateEndpointGatewayResourceBindingOptions) SetEndpointGatewayResourceBindingPatch(endpointGatewayResourceBindingPatch map[string]interface{}) *UpdateEndpointGatewayResourceBindingOptions { + _options.EndpointGatewayResourceBindingPatch = endpointGatewayResourceBindingPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateEndpointGatewayResourceBindingOptions) SetHeaders(param map[string]string) *UpdateEndpointGatewayResourceBindingOptions { + options.Headers = param + return options +} + // UpdateFirmwareForBareMetalServerOptions : The UpdateFirmwareForBareMetalServer options. type UpdateFirmwareForBareMetalServerOptions struct { // The bare metal server identifier. @@ -99650,6 +110346,10 @@ type UpdateVirtualNetworkInterfaceOptions struct { // The virtual network interface patch. VirtualNetworkInterfacePatch map[string]interface{} `json:"VirtualNetworkInterface_patch" validate:"required"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -99674,12 +110374,66 @@ func (_options *UpdateVirtualNetworkInterfaceOptions) SetVirtualNetworkInterface return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateVirtualNetworkInterfaceOptions) SetIfMatch(ifMatch string) *UpdateVirtualNetworkInterfaceOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *UpdateVirtualNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateVirtualNetworkInterfaceOptions { options.Headers = param return options } +// UpdateVolumeJobOptions : The UpdateVolumeJob options. +type UpdateVolumeJobOptions struct { + // The volume identifier. + VolumeID *string `json:"volume_id" validate:"required,ne="` + + // The volume job identifier. + ID *string `json:"id" validate:"required,ne="` + + // The volume job patch. + VolumeJobPatch map[string]interface{} `json:"VolumeJob_patch" validate:"required"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewUpdateVolumeJobOptions : Instantiate UpdateVolumeJobOptions +func (*VpcV1) NewUpdateVolumeJobOptions(volumeID string, id string, volumeJobPatch map[string]interface{}) *UpdateVolumeJobOptions { + return &UpdateVolumeJobOptions{ + VolumeID: core.StringPtr(volumeID), + ID: core.StringPtr(id), + VolumeJobPatch: volumeJobPatch, + } +} + +// SetVolumeID : Allow user to set VolumeID +func (_options *UpdateVolumeJobOptions) SetVolumeID(volumeID string) *UpdateVolumeJobOptions { + _options.VolumeID = core.StringPtr(volumeID) + return _options +} + +// SetID : Allow user to set ID +func (_options *UpdateVolumeJobOptions) SetID(id string) *UpdateVolumeJobOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetVolumeJobPatch : Allow user to set VolumeJobPatch +func (_options *UpdateVolumeJobOptions) SetVolumeJobPatch(volumeJobPatch map[string]interface{}) *UpdateVolumeJobOptions { + _options.VolumeJobPatch = volumeJobPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateVolumeJobOptions) SetHeaders(param map[string]string) *UpdateVolumeJobOptions { + options.Headers = param + return options +} + // UpdateVolumeOptions : The UpdateVolume options. type UpdateVolumeOptions struct { // The volume identifier. @@ -100047,6 +110801,10 @@ type UpdateVPNGatewayConnectionOptions struct { // The VPN gateway connection patch. VPNGatewayConnectionPatch map[string]interface{} `json:"VPNGatewayConnection_patch" validate:"required"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -100078,6 +110836,12 @@ func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPatch( return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateVPNGatewayConnectionOptions) SetIfMatch(ifMatch string) *UpdateVPNGatewayConnectionOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *UpdateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayConnectionOptions { options.Headers = param @@ -100296,7 +111060,7 @@ type VPC struct { // // The maximum number of items for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - CseSourceIps []VpccseSourceIP `json:"cse_source_ips,omitempty"` + CseSourceIps []VpccseSourceIP `json:"cse_source_ips" validate:"required"` // The default network ACL to use for subnets created in this VPC. DefaultNetworkACL *NetworkACLReference `json:"default_network_acl" validate:"required"` @@ -100604,8 +111368,8 @@ func UnmarshalVpcdns(m map[string]json.RawMessage, result interface{}) (err erro type VpcdnsPatch struct { // Indicates whether this VPC is enabled as a DNS name resolution hub. // - // Updating the value to `true` requires `allow_dns_resolution_binding` to be `true` for all endpoint gateways residing - // in this VPC. + // Updating the value to `true` requires `dns_resolution_binding_mode` be set to `primary` for all endpoint gateways + // residing in this VPC. // // Changing the value requires `dns.resolution_binding_count` to be zero. EnableHub *bool `json:"enable_hub,omitempty"` @@ -100676,8 +111440,9 @@ type VpcdnsResolutionBinding struct { // The date and time that the DNS resolution binding was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - // The endpoint gateways that have `allow_dns_resolution_binding` set to `true` and reside in the VPC that has - // `dns.enable_hub` set to `false`. + // The endpoint gateways that have `dns_resolution_binding_mode` set to either `primary` or `per_resource_binding` and + // reside in the VPC that has `dns.enable_hub` set to + // `false`. // // The endpoint gateways may be remote and therefore may not be directly retrievable. EndpointGateways []EndpointGatewayReferenceRemote `json:"endpoint_gateways" validate:"required"` @@ -101763,6 +112528,13 @@ type VPNGateway struct { // The mode for this VPN gateway. Mode *string `json:"mode,omitempty"` + + // The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + // advertise routes with these CIDRs as route destinations. + AdvertisedCIDRs []string `json:"advertised_cidrs,omitempty"` + + // The local autonomous system number (ASN) for this VPN gateway and its connections. + LocalAsn *int64 `json:"local_asn,omitempty"` } // Constants associated with the VPNGateway.HealthState property. @@ -101895,6 +112667,35 @@ func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "advertised_cidrs", &obj.AdvertisedCIDRs) + if err != nil { + err = core.SDKErrorf(err, "", "advertised_cidrs-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "local_asn", &obj.LocalAsn) + if err != nil { + err = core.SDKErrorf(err, "", "local_asn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayAdvertisedCIDRCollection : VPNGatewayAdvertisedCIDRCollection struct +type VPNGatewayAdvertisedCIDRCollection struct { + // The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + // advertise routes with these CIDRs as route destinations. + AdvertisedCIDRs []string `json:"advertised_cidrs" validate:"required"` +} + +// UnmarshalVPNGatewayAdvertisedCIDRCollection unmarshals an instance of VPNGatewayAdvertisedCIDRCollection from the specified map of raw messages. +func UnmarshalVPNGatewayAdvertisedCIDRCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayAdvertisedCIDRCollection) + err = core.UnmarshalPrimitive(m, "advertised_cidrs", &obj.AdvertisedCIDRs) + if err != nil { + err = core.SDKErrorf(err, "", "advertised_cidrs-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -102364,6 +113165,269 @@ func UnmarshalVPNGatewayConnectionDpdPrototype(m map[string]json.RawMessage, res return } +// VPNGatewayConnectionDynamicRouteModeLocal : VPNGatewayConnectionDynamicRouteModeLocal struct +type VPNGatewayConnectionDynamicRouteModeLocal struct { + // The local IKE identities. + // + // A VPN gateway in dynamic route mode consists of two members in active-active mode. The first identity applies to the + // first member, and the second identity applies to the second member. + IkeIdentities []VPNGatewayConnectionIkeIdentityIntf `json:"ike_identities" validate:"required"` +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModeLocal unmarshals an instance of VPNGatewayConnectionDynamicRouteModeLocal from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModeLocal(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModeLocal) + err = core.UnmarshalModel(m, "ike_identities", &obj.IkeIdentities, UnmarshalVPNGatewayConnectionIkeIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identities-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModeLocalPrototype : VPNGatewayConnectionDynamicRouteModeLocalPrototype struct +type VPNGatewayConnectionDynamicRouteModeLocalPrototype struct { + // The local IKE identities to use. + // + // A VPN gateway in dynamic route mode consists of two members in active-active mode. The first specified identity will + // be applied to the first member, and the second specified identity will be applied to the second member. + // + // If unspecified, then `type` will be `ipv4_address` and `value` will be the public IP address of the member's VPN + // connection tunnel. + IkeIdentities []VPNGatewayConnectionIkeIdentityPrototypeIntf `json:"ike_identities,omitempty"` +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModeLocalPrototype unmarshals an instance of VPNGatewayConnectionDynamicRouteModeLocalPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModeLocalPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModeLocalPrototype) + err = core.UnmarshalModel(m, "ike_identities", &obj.IkeIdentities, UnmarshalVPNGatewayConnectionIkeIdentityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identities-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModePeer : VPNGatewayConnectionDynamicRouteModePeer struct +// Models which "extend" this model: +// - VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress +// - VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn +type VPNGatewayConnectionDynamicRouteModePeer struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity. + IkeIdentity VPNGatewayConnectionIkeIdentityIntf `json:"ike_identity" validate:"required"` + + // Indicates whether `peer.address` or `peer.fqdn` is used. + Type *string `json:"type" validate:"required"` + + // The IP address of the peer VPN gateway for this connection. + Address *string `json:"address,omitempty"` + + // The FQDN of the peer VPN gateway for this connection. + Fqdn *string `json:"fqdn,omitempty"` +} + +// Constants associated with the VPNGatewayConnectionDynamicRouteModePeer.Type property. +// Indicates whether `peer.address` or `peer.fqdn` is used. +const ( + VPNGatewayConnectionDynamicRouteModePeerTypeAddressConst = "address" + VPNGatewayConnectionDynamicRouteModePeerTypeFqdnConst = "fqdn" +) + +func (*VPNGatewayConnectionDynamicRouteModePeer) isaVPNGatewayConnectionDynamicRouteModePeer() bool { + return true +} + +type VPNGatewayConnectionDynamicRouteModePeerIntf interface { + isaVPNGatewayConnectionDynamicRouteModePeer() bool +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeer unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeer from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeer) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) + if err != nil { + err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModePeerPrototype : VPNGatewayConnectionDynamicRouteModePeerPrototype struct +// Models which "extend" this model: +// - VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress +// - VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn +type VPNGatewayConnectionDynamicRouteModePeerPrototype struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity to use. + // + // If unspecified: + // - If `peer.address` is specified, the `type` will be `ipv4_address`, and + // the `value` will be `peer.address`. + // - If `peer.fqdn` is specified, the `type` will be `fqdn`, and the `value` + // will be `peer.fqdn`. + IkeIdentity VPNGatewayConnectionIkeIdentityPrototypeIntf `json:"ike_identity,omitempty"` + + // The IP address of the peer VPN gateway for this connection. + Address *string `json:"address,omitempty"` + + // The FQDN of the peer VPN gateway for this connection. + Fqdn *string `json:"fqdn,omitempty"` +} + +func (*VPNGatewayConnectionDynamicRouteModePeerPrototype) isaVPNGatewayConnectionDynamicRouteModePeerPrototype() bool { + return true +} + +type VPNGatewayConnectionDynamicRouteModePeerPrototypeIntf interface { + isaVPNGatewayConnectionDynamicRouteModePeerPrototype() bool +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototype unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeerPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeerPrototype) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) + if err != nil { + err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModeTunnel : VPNGatewayConnectionDynamicRouteModeTunnel struct +type VPNGatewayConnectionDynamicRouteModeTunnel struct { + // The IP address of the neighbor on the virtual tunnel interface. + // This serves as the destination address for BGP peering sessions on the peer gateway + // within the tunnel. + NeighborIP *IP `json:"neighbor_ip" validate:"required"` + + // BGP routing protocol state as defined in + // [RFC 4721](https://www.rfc-editor.org/rfc/rfc4271#section-8.2.2). + ProtocolState *string `json:"protocol_state" validate:"required"` + + // The IP address of the VPN gateway member in which the tunnel resides. + PublicIP *IP `json:"public_ip" validate:"required"` + + // The status of the VPN Tunnel. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + StatusReasons []VPNGatewayConnectionTunnelStatusReason `json:"status_reasons" validate:"required"` + + // The IP address assigned to the VPN gateway's virtual tunnel interface. + // This serves as the source address for BGP peering sessions initiated from the VPN + // gateway towards the peer gateway within the tunnel. + TunnelInterfaceIP *IP `json:"tunnel_interface_ip" validate:"required"` +} + +// Constants associated with the VPNGatewayConnectionDynamicRouteModeTunnel.ProtocolState property. +// BGP routing protocol state as defined in +// [RFC 4721](https://www.rfc-editor.org/rfc/rfc4271#section-8.2.2). +const ( + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateActiveConst = "active" + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateConnectConst = "connect" + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateEstablishedConst = "established" + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateIdleConst = "idle" + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateOpenConfirmConst = "open_confirm" + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateOpenSentConst = "open_sent" +) + +// Constants associated with the VPNGatewayConnectionDynamicRouteModeTunnel.Status property. +// The status of the VPN Tunnel. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + VPNGatewayConnectionDynamicRouteModeTunnelStatusDownConst = "down" + VPNGatewayConnectionDynamicRouteModeTunnelStatusUpConst = "up" +) + +// UnmarshalVPNGatewayConnectionDynamicRouteModeTunnel unmarshals an instance of VPNGatewayConnectionDynamicRouteModeTunnel from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModeTunnel(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModeTunnel) + err = core.UnmarshalModel(m, "neighbor_ip", &obj.NeighborIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "neighbor_ip-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol_state", &obj.ProtocolState) + if err != nil { + err = core.SDKErrorf(err, "", "protocol_state-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "public_ip-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionTunnelStatusReason) + if err != nil { + err = core.SDKErrorf(err, "", "status_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnel_interface_ip", &obj.TunnelInterfaceIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "tunnel_interface_ip-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNGatewayConnectionIkeIdentity : VPNGatewayConnectionIkeIdentity struct // Models which "extend" this model: // - VPNGatewayConnectionIkeIdentityVPNGatewayConnectionIkeIdentityFqdn @@ -102687,6 +113751,16 @@ type VPNGatewayConnectionPatch struct { // The pre-shared key. Psk *string `json:"psk,omitempty"` + + // The routing protocol for this VPN gateway connection. For this property to be specified, `mode` must be `route`. + // + // - `none`: No routing protocol will be used. + // - `bgp`: The BGP routing protocol will be used. + RoutingProtocol *string `json:"routing_protocol,omitempty"` + + // The VPN tunnel configuration to use for this VPN gateway connection + // (in dynamic route mode). + Tunnels []VPNGatewayConnectionTunnel `json:"tunnels,omitempty"` } // Constants associated with the VPNGatewayConnectionPatch.EstablishMode property. @@ -102702,6 +113776,16 @@ const ( VPNGatewayConnectionPatchEstablishModePeerOnlyConst = "peer_only" ) +// Constants associated with the VPNGatewayConnectionPatch.RoutingProtocol property. +// The routing protocol for this VPN gateway connection. For this property to be specified, `mode` must be `route`. +// +// - `none`: No routing protocol will be used. +// - `bgp`: The BGP routing protocol will be used. +const ( + VPNGatewayConnectionPatchRoutingProtocolBgpConst = "bgp" + VPNGatewayConnectionPatchRoutingProtocolNoneConst = "none" +) + // 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) @@ -102750,6 +113834,16 @@ func UnmarshalVPNGatewayConnectionPatch(m map[string]json.RawMessage, result int err = core.SDKErrorf(err, "", "psk-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "routing_protocol-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionTunnel) + if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -102784,6 +113878,16 @@ func (vpnGatewayConnectionPatch *VPNGatewayConnectionPatch) AsPatch() (_patch ma if !core.IsNil(vpnGatewayConnectionPatch.Psk) { _patch["psk"] = vpnGatewayConnectionPatch.Psk } + if !core.IsNil(vpnGatewayConnectionPatch.RoutingProtocol) { + _patch["routing_protocol"] = vpnGatewayConnectionPatch.RoutingProtocol + } + if !core.IsNil(vpnGatewayConnectionPatch.Tunnels) { + var tunnelsPatches []map[string]interface{} + for _, tunnels := range vpnGatewayConnectionPatch.Tunnels { + tunnelsPatches = append(tunnelsPatches, tunnels.asPatch()) + } + _patch["tunnels"] = tunnelsPatches + } return } @@ -102791,13 +113895,20 @@ func (vpnGatewayConnectionPatch *VPNGatewayConnectionPatch) AsPatch() (_patch ma // VPNGatewayConnectionPeerPatch : VPNGatewayConnectionPeerPatch struct // Models which "extend" this model: // - VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch -// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch +// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch type VPNGatewayConnectionPeerPatch struct { - // The IP address of the peer VPN gateway for this connection. + // The IP address of the peer VPN gateway for this connection or the IP address of the peer VPN gateway for this + // connection. Address *string `json:"address,omitempty"` - // The FQDN of the peer VPN gateway for this connection. + // The FQDN of the peer VPN gateway for this connection or the FQDN of the peer VPN gateway for this connection. Fqdn *string `json:"fqdn,omitempty"` + + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn,omitempty"` } func (*VPNGatewayConnectionPeerPatch) isaVPNGatewayConnectionPeerPatch() bool { @@ -102822,6 +113933,11 @@ func UnmarshalVPNGatewayConnectionPeerPatch(m map[string]json.RawMessage, result err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -102835,6 +113951,9 @@ func (vpnGatewayConnectionPeerPatch *VPNGatewayConnectionPeerPatch) asPatch() (_ if !core.IsNil(vpnGatewayConnectionPeerPatch.Fqdn) { _patch["fqdn"] = vpnGatewayConnectionPeerPatch.Fqdn } + if !core.IsNil(vpnGatewayConnectionPeerPatch.Asn) { + _patch["asn"] = vpnGatewayConnectionPeerPatch.Asn + } return } @@ -103041,6 +114160,7 @@ func UnmarshalVPNGatewayConnectionPolicyModePeerPrototype(m map[string]json.RawM // VPNGatewayConnectionPrototype : VPNGatewayConnectionPrototype struct // Models which "extend" this model: // - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype +// - VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype // - VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype type VPNGatewayConnectionPrototype struct { // If set to false, the VPN gateway connection is shut down. @@ -103086,6 +114206,10 @@ type VPNGatewayConnectionPrototype struct { // The routing protocol for this VPN gateway connection. RoutingProtocol *string `json:"routing_protocol,omitempty"` + + // The VPN tunnel configuration to use for this VPN gateway connection + // (in dynamic route mode). + Tunnels []VPNGatewayConnectionTunnelPrototype `json:"tunnels,omitempty"` } // Constants associated with the VPNGatewayConnectionPrototype.EstablishMode property. @@ -103173,6 +114297,11 @@ func UnmarshalVPNGatewayConnectionPrototype(m map[string]json.RawMessage, result err = core.SDKErrorf(err, "", "routing_protocol-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionTunnelPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -103489,6 +114618,92 @@ func UnmarshalVPNGatewayConnectionStatusReason(m map[string]json.RawMessage, res return } +// VPNGatewayConnectionTunnel : VPNGatewayConnectionTunnel struct +type VPNGatewayConnectionTunnel struct { + // The IP address of the neighbor on the virtual tunnel interface. + // This serves as the destination address for BGP peering sessions on the peer gateway + // within the tunnel. + NeighborIP *IP `json:"neighbor_ip,omitempty"` + + // The IP address assigned to the VPN gateway's virtual tunnel interface. + // This serves as the source address for BGP peering sessions initiated from the VPN + // gateway towards the peer gateway within the tunnel. + TunnelInterfaceIP *IP `json:"tunnel_interface_ip,omitempty"` +} + +// UnmarshalVPNGatewayConnectionTunnel unmarshals an instance of VPNGatewayConnectionTunnel from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionTunnel(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionTunnel) + err = core.UnmarshalModel(m, "neighbor_ip", &obj.NeighborIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "neighbor_ip-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnel_interface_ip", &obj.TunnelInterfaceIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "tunnel_interface_ip-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the VPNGatewayConnectionTunnel +func (vpnGatewayConnectionTunnel *VPNGatewayConnectionTunnel) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(vpnGatewayConnectionTunnel.NeighborIP) { + _patch["neighbor_ip"] = vpnGatewayConnectionTunnel.NeighborIP.asPatch() + } + if !core.IsNil(vpnGatewayConnectionTunnel.TunnelInterfaceIP) { + _patch["tunnel_interface_ip"] = vpnGatewayConnectionTunnel.TunnelInterfaceIP.asPatch() + } + + return +} + +// VPNGatewayConnectionTunnelPrototype : VPNGatewayConnectionTunnelPrototype struct +type VPNGatewayConnectionTunnelPrototype struct { + // The IP address of the neighbor on the virtual tunnel interface. + // This serves as the destination address for BGP peering sessions on the peer gateway + // within the tunnel. + NeighborIP *IP `json:"neighbor_ip" validate:"required"` + + // The IP address assigned to the VPN gateway's virtual tunnel interface. + // This serves as the source address for BGP peering sessions initiated from the VPN + // gateway towards the peer gateway within the tunnel. + TunnelInterfaceIP *IP `json:"tunnel_interface_ip" validate:"required"` +} + +// NewVPNGatewayConnectionTunnelPrototype : Instantiate VPNGatewayConnectionTunnelPrototype (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionTunnelPrototype(neighborIP *IP, tunnelInterfaceIP *IP) (_model *VPNGatewayConnectionTunnelPrototype, err error) { + _model = &VPNGatewayConnectionTunnelPrototype{ + NeighborIP: neighborIP, + TunnelInterfaceIP: tunnelInterfaceIP, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalVPNGatewayConnectionTunnelPrototype unmarshals an instance of VPNGatewayConnectionTunnelPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionTunnelPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionTunnelPrototype) + err = core.UnmarshalModel(m, "neighbor_ip", &obj.NeighborIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "neighbor_ip-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnel_interface_ip", &obj.TunnelInterfaceIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "tunnel_interface_ip-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNGatewayConnectionTunnelStatusReason : VPNGatewayConnectionTunnelStatusReason struct type VPNGatewayConnectionTunnelStatusReason struct { // A reason code for this status: @@ -103900,6 +115115,12 @@ func UnmarshalVPNGatewayMemberLifecycleReason(m map[string]json.RawMessage, resu // VPNGatewayPatch : VPNGatewayPatch struct type VPNGatewayPatch struct { + // The local autonomous system number (ASN) for this VPN gateway and its connections. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + LocalAsn *int64 `json:"local_asn,omitempty"` + // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. Name *string `json:"name,omitempty"` } @@ -103907,6 +115128,11 @@ type VPNGatewayPatch struct { // 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, "local_asn", &obj.LocalAsn) + if err != nil { + err = core.SDKErrorf(err, "", "local_asn-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) @@ -103919,6 +115145,9 @@ func UnmarshalVPNGatewayPatch(m map[string]json.RawMessage, result interface{}) // AsPatch returns a generic map representation of the VPNGatewayPatch func (vpnGatewayPatch *VPNGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { _patch = map[string]interface{}{} + if !core.IsNil(vpnGatewayPatch.LocalAsn) { + _patch["local_asn"] = vpnGatewayPatch.LocalAsn + } if !core.IsNil(vpnGatewayPatch.Name) { _patch["name"] = vpnGatewayPatch.Name } @@ -103942,6 +115171,16 @@ type VPNGatewayPrototype struct { // Identifies a subnet by a unique property. Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + // The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + // advertise routes with these CIDRs as route destinations. + AdvertisedCIDRs []string `json:"advertised_cidrs,omitempty"` + + // The local autonomous system number (ASN) for this VPN gateway and its connections. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + LocalAsn *int64 `json:"local_asn,omitempty"` + // The mode for this VPN gateway. Mode *string `json:"mode,omitempty"` } @@ -103978,6 +115217,16 @@ func UnmarshalVPNGatewayPrototype(m map[string]json.RawMessage, result interface err = core.SDKErrorf(err, "", "subnet-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "advertised_cidrs", &obj.AdvertisedCIDRs) + if err != nil { + err = core.SDKErrorf(err, "", "advertised_cidrs-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "local_asn", &obj.LocalAsn) + if err != nil { + err = core.SDKErrorf(err, "", "local_asn-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) @@ -103987,6 +115236,311 @@ func UnmarshalVPNGatewayPrototype(m map[string]json.RawMessage, result interface return } +// VPNGatewayServiceConnection : VPNGatewayServiceConnection struct +type VPNGatewayServiceConnection struct { + // The date and time that this VPN gateway service connection was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + Creator VPNGatewayServiceConnectionCreatorIntf `json:"creator" validate:"required"` + + // The unique identifier for this VPN gateway service connection. + ID *string `json:"id" validate:"required"` + + // The reasons for the current `lifecycle_state` (if any). + LifecycleReasons []VPNGatewayServiceConnectionLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the VPN gateway service connection. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The status of this VPN gateway service connection: + // - `degraded`: operating with compromised performance. + // - `down`: not operational. + // - `up`: operating normally. + Status *string `json:"status" validate:"required"` + + // The reasons for the current VPN gateway service connection status (if any). + StatusReasons []VPNGatewayServiceConnectionStatusReason `json:"status_reasons" validate:"required"` +} + +// Constants associated with the VPNGatewayServiceConnection.LifecycleState property. +// The lifecycle state of the VPN gateway service connection. +const ( + VPNGatewayServiceConnectionLifecycleStateDeletingConst = "deleting" + VPNGatewayServiceConnectionLifecycleStateFailedConst = "failed" + VPNGatewayServiceConnectionLifecycleStatePendingConst = "pending" + VPNGatewayServiceConnectionLifecycleStateStableConst = "stable" + VPNGatewayServiceConnectionLifecycleStateSuspendedConst = "suspended" + VPNGatewayServiceConnectionLifecycleStateUpdatingConst = "updating" + VPNGatewayServiceConnectionLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the VPNGatewayServiceConnection.Status property. +// The status of this VPN gateway service connection: +// - `degraded`: operating with compromised performance. +// - `down`: not operational. +// - `up`: operating normally. +const ( + VPNGatewayServiceConnectionStatusDegradedConst = "degraded" + VPNGatewayServiceConnectionStatusDownConst = "down" + VPNGatewayServiceConnectionStatusUpConst = "up" +) + +// UnmarshalVPNGatewayServiceConnection unmarshals an instance of VPNGatewayServiceConnection from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnection) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalVPNGatewayServiceConnectionCreator) + if err != nil { + err = core.SDKErrorf(err, "", "creator-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayServiceConnectionLifecycleReason) + if err != nil { + err = core.SDKErrorf(err, "", "lifecycle_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + err = core.SDKErrorf(err, "", "lifecycle_state-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayServiceConnectionStatusReason) + if err != nil { + err = core.SDKErrorf(err, "", "status_reasons-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayServiceConnectionCollection : VPNGatewayServiceConnectionCollection struct +type VPNGatewayServiceConnectionCollection struct { + // A link to the first page of resources. + First *PageLink `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 *PageLink `json:"next,omitempty"` + + // A page of service connections for the VPN gateway. + ServiceConnections []VPNGatewayServiceConnection `json:"service_connections" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalVPNGatewayServiceConnectionCollection unmarshals an instance of VPNGatewayServiceConnectionCollection from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnectionCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnectionCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "service_connections", &obj.ServiceConnections, UnmarshalVPNGatewayServiceConnection) + if err != nil { + err = core.SDKErrorf(err, "", "service_connections-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) + 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 *VPNGatewayServiceConnectionCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil { + err = core.SDKErrorf(err, "", "read-query-param-error", common.GetComponentInfo()) + return nil, err + } else if start == nil { + return nil, nil + } + return start, nil +} + +// VPNGatewayServiceConnectionCreator : VPNGatewayServiceConnectionCreator struct +// Models which "extend" this model: +// - VPNGatewayServiceConnectionCreatorTransitGatewayReference +type VPNGatewayServiceConnectionCreator struct { + // The CRN for this transit gateway. + CRN *string `json:"crn,omitempty"` + + // The unique identifier for this transit gateway. + ID *string `json:"id,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` +} + +// Constants associated with the VPNGatewayServiceConnectionCreator.ResourceType property. +// The resource type. +const ( + VPNGatewayServiceConnectionCreatorResourceTypeTransitGatewayConst = "transit_gateway" +) + +func (*VPNGatewayServiceConnectionCreator) isaVPNGatewayServiceConnectionCreator() bool { + return true +} + +type VPNGatewayServiceConnectionCreatorIntf interface { + isaVPNGatewayServiceConnectionCreator() bool +} + +// UnmarshalVPNGatewayServiceConnectionCreator unmarshals an instance of VPNGatewayServiceConnectionCreator from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnectionCreator(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnectionCreator) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayServiceConnectionLifecycleReason : VPNGatewayServiceConnectionLifecycleReason struct +type VPNGatewayServiceConnectionLifecycleReason struct { + // A reason code for this lifecycle state: + // - `internal_error`: internal error (contact IBM support) + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // A link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayServiceConnectionLifecycleReason.Code property. +// A reason code for this lifecycle state: +// - `internal_error`: internal error (contact IBM support) +// - `resource_suspended_by_provider`: The resource has been suspended (contact IBM +// support) +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + VPNGatewayServiceConnectionLifecycleReasonCodeInternalErrorConst = "internal_error" + VPNGatewayServiceConnectionLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalVPNGatewayServiceConnectionLifecycleReason unmarshals an instance of VPNGatewayServiceConnectionLifecycleReason from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnectionLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnectionLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + err = core.SDKErrorf(err, "", "more_info-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayServiceConnectionStatusReason : VPNGatewayServiceConnectionStatusReason struct +type VPNGatewayServiceConnectionStatusReason struct { + // The reasons for the current VPN gateway service connection status (if any). + // - `internal_error` + // - `peer_not_responding`. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this VPN gateway service connection's status. + Message *string `json:"message" validate:"required"` + + // A link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayServiceConnectionStatusReason.Code property. +// The reasons for the current VPN gateway service connection status (if any). +// - `internal_error` +// - `peer_not_responding`. +const ( + VPNGatewayServiceConnectionStatusReasonCodeInternalErrorConst = "internal_error" + VPNGatewayServiceConnectionStatusReasonCodePeerNotRespondingConst = "peer_not_responding" +) + +// UnmarshalVPNGatewayServiceConnectionStatusReason unmarshals an instance of VPNGatewayServiceConnectionStatusReason from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnectionStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnectionStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + err = core.SDKErrorf(err, "", "more_info-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNServer : VPNServer struct type VPNServer struct { // The certificate instance for this VPN server. @@ -106423,7 +117977,7 @@ type VolumeAllowedUse struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variable is supported, corresponding // to the `BareMetalServer` property: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + // - `enable_secure_boot` (boolean): Whether secure boot is enabled. BareMetalServer *string `json:"bare_metal_server" validate:"required"` // The expression that must be satisfied by the properties of a virtual server instance provisioned using this volume. @@ -106431,7 +117985,7 @@ type VolumeAllowedUse struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variables are supported, // corresponding to `Instance` properties: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + // - `enable_secure_boot` (boolean): Whether secure boot is enabled // - `gpu.count` (integer): The number of GPUs // - `gpu.manufacturer` (string): The GPU manufacturer // - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) @@ -106474,7 +118028,7 @@ type VolumeAllowedUsePatch struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variable is supported, corresponding // to the `BareMetalServer` property: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + // - `enable_secure_boot` (boolean): Whether secure boot is enabled. BareMetalServer *string `json:"bare_metal_server,omitempty"` // The expression that must be satisfied by the properties of a virtual server instance provisioned using this volume @@ -106482,7 +118036,7 @@ type VolumeAllowedUsePatch struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variables are supported, // corresponding to `Instance` properties: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + // - `enable_secure_boot` (boolean): Whether secure boot is enabled // - `gpu.count` (integer): The number of GPUs // - `gpu.manufacturer` (string): The GPU manufacturer // - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) @@ -106544,7 +118098,7 @@ type VolumeAllowedUsePrototype struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variable is supported, corresponding // to the `BareMetalServer` property: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + // - `enable_secure_boot` (boolean): Whether secure boot is enabled. BareMetalServer *string `json:"bare_metal_server,omitempty"` // The expression that must be satisfied by the properties of a virtual server instance provisioned using this volume. @@ -106554,7 +118108,7 @@ type VolumeAllowedUsePrototype struct { // The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), // but does not support built-in functions and macros. In addition, the following variables are supported, // corresponding to `Instance` properties: - // - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + // - `enable_secure_boot` (boolean): Whether secure boot is enabled // - `gpu.count` (integer): The number of GPUs // - `gpu.manufacturer` (string): The GPU manufacturer // - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) @@ -107020,11 +118574,17 @@ type VolumeAttachmentPrototypeVolume struct { UserTags []string `json:"user_tags,omitempty"` // The capacity to use for the volume (in gigabytes). The specified value must be within the `capacity` range of the - // volume's profile. + // volume's profile or the capacity to use for the volume (in gigabytes). The specified value must be at least the + // snapshot's `minimum_capacity`, and must be within the `capacity` range of the volume's profile. + // + // 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 `encryption` type for the volume will be `provider_managed` or 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"` @@ -107512,7 +119072,260 @@ func UnmarshalVolumeInstanceProfileCollection(m map[string]json.RawMessage, resu } // Retrieve the value to be passed to a request to access the next page of results -func (resp *VolumeInstanceProfileCollection) GetNextStart() (*string, error) { +func (resp *VolumeInstanceProfileCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil { + err = core.SDKErrorf(err, "", "read-query-param-error", common.GetComponentInfo()) + return nil, err + } else if start == nil { + return nil, nil + } + return start, nil +} + +// VolumeJob : VolumeJob struct +// Models which "extend" this model: +// - VolumeJobTypeMigrate +type VolumeJob struct { + // Indicates whether this volume job will be automatically deleted after it completes. At present, this is always + // `false`, but may be modifiable in the future. + AutoDelete *bool `json:"auto_delete" validate:"required"` + + // The date and time that the volume job was completed. + // + // If absent, the volume job has not yet completed. + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // The date and time that the volume job was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The date and time that the volume job is estimated to complete. + // + // If absent, the volume job is still queued and has not yet started. + EstimatedCompletionAt *strfmt.DateTime `json:"estimated_completion_at,omitempty"` + + // The URL for this volume job. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this volume job. + ID *string `json:"id" validate:"required"` + + // The type of volume job. + // + // - `migrate`: Migrates a volume to a new `storage_generation` profile. + // During the migration process, the volume will be `busy`. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + JobType *string `json:"job_type" validate:"required"` + + // The name for this volume job. The name must not be used by another job for this volume. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The date and time that the volume job was started. + // + // If absent, the volume job has not yet started. + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // The status of this volume job: + // - `canceled`: the job is canceled + // - `canceling`: the job is being canceled + // - `deleting`: the job is being deleted + // - `failed`: the job could not be completed successfully + // - `queued`: the job is queued + // - `running`: the job is in progress + // - `succeeded`: the job completed successfully + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + StatusReasons []VolumeJobStatusReason `json:"status_reasons" validate:"required"` + + // The parameters to use after the volume is migrated. + Parameters *VolumeJobTypeMigrateParameters `json:"parameters,omitempty"` +} + +// Constants associated with the VolumeJob.JobType property. +// The type of volume job. +// +// - `migrate`: Migrates a volume to a new `storage_generation` profile. +// During the migration process, the volume will be `busy`. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + VolumeJobJobTypeMigrateConst = "migrate" +) + +// Constants associated with the VolumeJob.ResourceType property. +// The resource type. +const ( + VolumeJobResourceTypeVolumeJobConst = "volume_job" +) + +// Constants associated with the VolumeJob.Status property. +// The status of this volume job: +// - `canceled`: the job is canceled +// - `canceling`: the job is being canceled +// - `deleting`: the job is being deleted +// - `failed`: the job could not be completed successfully +// - `queued`: the job is queued +// - `running`: the job is in progress +// - `succeeded`: the job completed successfully +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + VolumeJobStatusCanceledConst = "canceled" + VolumeJobStatusCancelingConst = "canceling" + VolumeJobStatusDeletingConst = "deleting" + VolumeJobStatusFailedConst = "failed" + VolumeJobStatusQueuedConst = "queued" + VolumeJobStatusRunningConst = "running" + VolumeJobStatusSucceededConst = "succeeded" +) + +func (*VolumeJob) isaVolumeJob() bool { + return true +} + +type VolumeJobIntf interface { + isaVolumeJob() bool +} + +// UnmarshalVolumeJob unmarshals an instance of VolumeJob from the specified map of raw messages. +func UnmarshalVolumeJob(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeJob) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + err = core.SDKErrorf(err, "", "auto_delete-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) + if err != nil { + err = core.SDKErrorf(err, "", "completed_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "estimated_completion_at", &obj.EstimatedCompletionAt) + if err != nil { + err = core.SDKErrorf(err, "", "estimated_completion_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "job_type", &obj.JobType) + if err != nil { + err = core.SDKErrorf(err, "", "job_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) + if err != nil { + err = core.SDKErrorf(err, "", "started_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVolumeJobStatusReason) + if err != nil { + err = core.SDKErrorf(err, "", "status_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "parameters", &obj.Parameters, UnmarshalVolumeJobTypeMigrateParameters) + if err != nil { + err = core.SDKErrorf(err, "", "parameters-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VolumeJobCollection : VolumeJobCollection struct +type VolumeJobCollection struct { + // A link to the first page of resources. + First *PageLink `json:"first" validate:"required"` + + // The jobs for this volume. + Jobs []VolumeJobIntf `json:"jobs" 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 *PageLink `json:"next,omitempty"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalVolumeJobCollection unmarshals an instance of VolumeJobCollection from the specified map of raw messages. +func UnmarshalVolumeJobCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeJobCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "jobs", &obj.Jobs, UnmarshalVolumeJob) + if err != nil { + err = core.SDKErrorf(err, "", "jobs-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) + 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 *VolumeJobCollection) GetNextStart() (*string, error) { if core.IsNil(resp.Next) { return nil, nil } @@ -107526,6 +119339,193 @@ func (resp *VolumeInstanceProfileCollection) GetNextStart() (*string, error) { return start, nil } +// VolumeJobPatch : VolumeJobPatch struct +type VolumeJobPatch struct { + // The name for this volume job. The name must not be used by another job for this volume. + Name *string `json:"name,omitempty"` +} + +// UnmarshalVolumeJobPatch unmarshals an instance of VolumeJobPatch from the specified map of raw messages. +func UnmarshalVolumeJobPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeJobPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the VolumeJobPatch +func (volumeJobPatch *VolumeJobPatch) AsPatch() (_patch map[string]interface{}, err error) { + _patch = map[string]interface{}{} + if !core.IsNil(volumeJobPatch.Name) { + _patch["name"] = volumeJobPatch.Name + } + + return +} + +// VolumeJobPrototype : VolumeJobPrototype struct +// Models which "extend" this model: +// - VolumeJobPrototypeVolumeJobTypeMigratePrototype +type VolumeJobPrototype struct { + // The type of job this volume job will perform. + // + // - `migrate`: Migrates a volume to a new `storage_generation` profile. + // During the migration process, the volume will be `busy`. + JobType *string `json:"job_type" validate:"required"` + + // The name for this volume job. The name must not be used by another job for this volume. If unspecified, the name + // will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The parameters to use after the volume is migrated. + Parameters *VolumeJobTypeMigrateParameters `json:"parameters" validate:"required"` +} + +// Constants associated with the VolumeJobPrototype.JobType property. +// The type of job this volume job will perform. +// +// - `migrate`: Migrates a volume to a new `storage_generation` profile. +// During the migration process, the volume will be `busy`. +const ( + VolumeJobPrototypeJobTypeMigrateConst = "migrate" +) + +func (*VolumeJobPrototype) isaVolumeJobPrototype() bool { + return true +} + +type VolumeJobPrototypeIntf interface { + isaVolumeJobPrototype() bool +} + +// UnmarshalVolumeJobPrototype unmarshals an instance of VolumeJobPrototype from the specified map of raw messages. +func UnmarshalVolumeJobPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeJobPrototype) + err = core.UnmarshalPrimitive(m, "job_type", &obj.JobType) + if err != nil { + err = core.SDKErrorf(err, "", "job_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "parameters", &obj.Parameters, UnmarshalVolumeJobTypeMigrateParameters) + if err != nil { + err = core.SDKErrorf(err, "", "parameters-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VolumeJobStatusReason : VolumeJobStatusReason struct +type VolumeJobStatusReason struct { + // A reason code for the status: + // - `instance_powered_off`: The instance the volume is attached to has been powered off + // - `internal_error`: Internal error (contact IBM support) + // - `volume_detached_from_instance`: The volume is not attached to a running instance. + Code *string `json:"code" validate:"required"` + + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` + + // A link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VolumeJobStatusReason.Code property. +// A reason code for the status: +// - `instance_powered_off`: The instance the volume is attached to has been powered off +// - `internal_error`: Internal error (contact IBM support) +// - `volume_detached_from_instance`: The volume is not attached to a running instance. +const ( + VolumeJobStatusReasonCodeInstancePoweredOffConst = "instance_powered_off" + VolumeJobStatusReasonCodeInternalErrorConst = "internal_error" + VolumeJobStatusReasonCodeVolumeDetachedFromInstanceConst = "volume_detached_from_instance" +) + +// UnmarshalVolumeJobStatusReason unmarshals an instance of VolumeJobStatusReason from the specified map of raw messages. +func UnmarshalVolumeJobStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeJobStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + err = core.SDKErrorf(err, "", "more_info-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VolumeJobTypeMigrateParameters : The parameters to use after the volume is migrated. +type VolumeJobTypeMigrateParameters struct { + // The value to use for the volume's `bandwidth` after migration. + // + // If specified, the volume profile after migration must not have a `bandwidth.type` of + // `dependent`. + Bandwidth *int64 `json:"bandwidth,omitempty"` + + // The value to use for the volume's `iops` after migration. + // + // If specified, the volume profile after migration must not have an `iops.type` of + // `dependent`. + Iops *int64 `json:"iops,omitempty"` + + // The profile with a `storage_generation` value of `2` to migrate the volume to. + // + // The volume's current profile must have a `storage_generation` value of `1`. + Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` +} + +// NewVolumeJobTypeMigrateParameters : Instantiate VolumeJobTypeMigrateParameters (Generic Model Constructor) +func (*VpcV1) NewVolumeJobTypeMigrateParameters(profile VolumeProfileIdentityIntf) (_model *VolumeJobTypeMigrateParameters, err error) { + _model = &VolumeJobTypeMigrateParameters{ + Profile: profile, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalVolumeJobTypeMigrateParameters unmarshals an instance of VolumeJobTypeMigrateParameters from the specified map of raw messages. +func UnmarshalVolumeJobTypeMigrateParameters(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeJobTypeMigrateParameters) + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + err = core.SDKErrorf(err, "", "iops-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "profile-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VolumePatch : VolumePatch struct type VolumePatch struct { // The usage constraints to be matched against the requested instance or bare metal server @@ -108385,11 +120385,17 @@ type VolumePrototype struct { Zone ZoneIdentityIntf `json:"zone" validate:"required"` // The capacity to use for the volume (in gigabytes). The specified value must be within the `capacity` range of the - // volume's profile. + // volume's profile or the capacity to use for the volume (in gigabytes). The specified value must be at least the + // snapshot's `minimum_capacity`, and must be within the `capacity` range of the volume's profile. + // + // 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 `encryption` type for the volume will be `provider_managed` or 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"` @@ -108499,10 +120505,14 @@ type VolumePrototypeInstanceByImageContext struct { Bandwidth *int64 `json:"bandwidth,omitempty"` // The capacity to use for the volume (in gigabytes). The specified value must be at least the image's - // `minimum_provisioned_size`, at most 250 gigabytes, and within the - // `boot_capacity` range of the volume's profile. - // - // If unspecified, the capacity will be the image's `minimum_provisioned_size`. + // `minimum_provisioned_size`, at most 250 gigabytes for + // `storage_generation: 1` or at most 32,000 gigabytes for `storage_generation: 2`, and within the `boot_capacity` + // range of the volume's profile. + // + // If unspecified, the capacity will depend on the image: + // - When using a system-provided image, 100 gigabytes or the `minimum_provisioned_size` + // of the image, whichever is larger. + // - When using a custom image, the `minimum_provisioned_size` of the image. Capacity *int64 `json:"capacity,omitempty"` // The root key to use to wrap the data encryption key for the volume. @@ -108618,7 +120628,9 @@ type VolumePrototypeInstanceBySourceSnapshotContext struct { Bandwidth *int64 `json:"bandwidth,omitempty"` // The capacity to use for the volume (in gigabytes). The specified value must be at least the snapshot's - // `minimum_capacity`, at most 250 gigabytes, and within the `boot_capacity` range of the volume's profile. + // `minimum_capacity`, at most 250 gigabytes for + // `storage_generation: 1` or at most 32,000 gigabytes for `storage_generation: 2`, and within the `boot_capacity` + // range of the volume's profile. Capacity *int64 `json:"capacity,omitempty"` // The root key to use to wrap the data encryption key for the volume. @@ -109981,8 +121993,8 @@ type BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype struct // The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag // will be subject to the backup policy. // - // A backup policy of type `instance` will create a backup of all volumes with a - // `storage_generation` value of `1` attached to the instance. + // If the targeted instance contains volumes with different `storage_generation` values, a backup policy of type + // `instance` will create separate backups for each `storage_generation` present. MatchResourceType *string `json:"match_resource_type" validate:"required"` } @@ -109997,8 +122009,8 @@ const ( // The resource type this backup policy will apply to. Resources that have both a matching type and a matching user tag // will be subject to the backup policy. // -// A backup policy of type `instance` will create a backup of all volumes with a -// `storage_generation` value of `1` attached to the instance. +// If the targeted instance contains volumes with different `storage_generation` values, a backup policy of type +// `instance` will create separate backups for each `storage_generation` present. const ( BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototypeMatchResourceTypeInstanceConst = "instance" ) @@ -115680,8 +127692,9 @@ func UnmarshalDedicatedHostPrototypeDedicatedHostByZone(m map[string]json.RawMes // This model "extends" EncryptionKeyIdentity type EncryptionKeyIdentityByCRN 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 - // Services Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. + // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) for this resource. + // + // The use of Hyper Protect Crypto Services for encryption keys has been deprecated. CRN *string `json:"crn" validate:"required"` } @@ -115830,6 +127843,62 @@ func UnmarshalEndpointGatewayReservedIPReservedIPPrototypeTargetContext(m map[st return } +// EndpointGatewayResourceBindingTargetCRN : The CRN for the resource targeted by this resource binding. +// This model "extends" EndpointGatewayResourceBindingTarget +type EndpointGatewayResourceBindingTargetCRN struct { + CRN *string `json:"crn" validate:"required"` +} + +func (*EndpointGatewayResourceBindingTargetCRN) isaEndpointGatewayResourceBindingTarget() bool { + return true +} + +// UnmarshalEndpointGatewayResourceBindingTargetCRN unmarshals an instance of EndpointGatewayResourceBindingTargetCRN from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingTargetCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingTargetCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN : The resource to bind to the endpoint gateway. +// This model "extends" EndpointGatewayResourceBindingTargetPrototype +type EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN struct { + CRN *string `json:"crn" validate:"required"` +} + +// NewEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN : Instantiate EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN (Generic Model Constructor) +func (*VpcV1) NewEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN(crn string) (_model *EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN, err error) { + _model = &EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN) isaEndpointGatewayResourceBindingTargetPrototype() bool { + return true +} + +// UnmarshalEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN unmarshals an instance of EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype : EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype struct // This model "extends" EndpointGatewayTargetPrototype type EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype struct { @@ -117216,9 +129285,9 @@ func UnmarshalFlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity(m m return } -// FlowLogCollectorTargetInstanceNetworkAttachmentReference : FlowLogCollectorTargetInstanceNetworkAttachmentReference struct +// FlowLogCollectorTargetInstanceNetworkAttachmentReferenceFlowLogCollectorContext : FlowLogCollectorTargetInstanceNetworkAttachmentReferenceFlowLogCollectorContext struct // This model "extends" FlowLogCollectorTarget -type FlowLogCollectorTargetInstanceNetworkAttachmentReference struct { +type FlowLogCollectorTargetInstanceNetworkAttachmentReferenceFlowLogCollectorContext struct { // If present, this property indicates the referenced resource has been deleted, and provides // some supplementary information. Deleted *Deleted `json:"deleted,omitempty"` @@ -117232,33 +129301,23 @@ type FlowLogCollectorTargetInstanceNetworkAttachmentReference struct { // The name for this instance network attachment. The name is unique across all network attachments for the instance. Name *string `json:"name" validate:"required"` - // The primary IP address of the virtual network interface for the instance network - // attachment. - PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` - // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - - // The subnet of the virtual network interface for the instance network attachment. - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The virtual network interface for this instance network attachment. - VirtualNetworkInterface *VirtualNetworkInterfaceReferenceAttachmentContext `json:"virtual_network_interface" validate:"required"` } -// Constants associated with the FlowLogCollectorTargetInstanceNetworkAttachmentReference.ResourceType property. +// Constants associated with the FlowLogCollectorTargetInstanceNetworkAttachmentReferenceFlowLogCollectorContext.ResourceType property. // The resource type. const ( - FlowLogCollectorTargetInstanceNetworkAttachmentReferenceResourceTypeInstanceNetworkAttachmentConst = "instance_network_attachment" + FlowLogCollectorTargetInstanceNetworkAttachmentReferenceFlowLogCollectorContextResourceTypeInstanceNetworkAttachmentConst = "instance_network_attachment" ) -func (*FlowLogCollectorTargetInstanceNetworkAttachmentReference) isaFlowLogCollectorTarget() bool { +func (*FlowLogCollectorTargetInstanceNetworkAttachmentReferenceFlowLogCollectorContext) isaFlowLogCollectorTarget() bool { return true } -// UnmarshalFlowLogCollectorTargetInstanceNetworkAttachmentReference unmarshals an instance of FlowLogCollectorTargetInstanceNetworkAttachmentReference from the specified map of raw messages. -func UnmarshalFlowLogCollectorTargetInstanceNetworkAttachmentReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(FlowLogCollectorTargetInstanceNetworkAttachmentReference) +// UnmarshalFlowLogCollectorTargetInstanceNetworkAttachmentReferenceFlowLogCollectorContext unmarshals an instance of FlowLogCollectorTargetInstanceNetworkAttachmentReferenceFlowLogCollectorContext from the specified map of raw messages. +func UnmarshalFlowLogCollectorTargetInstanceNetworkAttachmentReferenceFlowLogCollectorContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(FlowLogCollectorTargetInstanceNetworkAttachmentReferenceFlowLogCollectorContext) err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDeleted) if err != nil { err = core.SDKErrorf(err, "", "deleted-error", common.GetComponentInfo()) @@ -117279,26 +129338,11 @@ func UnmarshalFlowLogCollectorTargetInstanceNetworkAttachmentReference(m map[str err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "primary_ip", &obj.PrimaryIP, UnmarshalReservedIPReference) - if err != nil { - err = core.SDKErrorf(err, "", "primary_ip-error", common.GetComponentInfo()) - return - } err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - err = core.SDKErrorf(err, "", "subnet-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "virtual_network_interface", &obj.VirtualNetworkInterface, UnmarshalVirtualNetworkInterfaceReferenceAttachmentContext) - if err != nil { - err = core.SDKErrorf(err, "", "virtual_network_interface-error", common.GetComponentInfo()) - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -117776,10 +129820,11 @@ type ImagePrototypeImageByFile struct { // 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 Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). + // specified), using [Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys). // // If unspecified, the imported image is treated as unencrypted. + // + // The use of Hyper Protect Crypto Services for image encryption keys has been deprecated. EncryptedDataKey *string `json:"encrypted_data_key,omitempty"` // The root key that was used to wrap the data key (which is ultimately represented as @@ -118243,24 +130288,26 @@ func UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceIn // InstanceGroupManagerActionPrototypeScheduledActionPrototype : InstanceGroupManagerActionPrototypeScheduledActionPrototype struct // Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager // This model "extends" InstanceGroupManagerActionPrototype type InstanceGroupManagerActionPrototypeScheduledActionPrototype struct { // The name for this instance group manager action. The name must not be used by another action for the instance group // 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. - RunAt *strfmt.DateTime `json:"run_at,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"` Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` 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"` + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at,omitempty"` } func (*InstanceGroupManagerActionPrototypeScheduledActionPrototype) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { @@ -118284,9 +130331,9 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype(m map[ err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) if err != nil { - err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) @@ -118299,9 +130346,9 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype(m map[ err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) if err != nil { - err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -119955,6 +132002,133 @@ func UnmarshalInstancePlacementTargetPlacementGroupReference(m map[string]json.R return } +// InstanceProfileAvailabilityClassEnum : The permitted availability class values for an instance with this profile. +// This model "extends" InstanceProfileAvailabilityClass +type InstanceProfileAvailabilityClassEnum struct { + // The default availability class for an instance with this profile. + Default *string `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The permitted values for this profile field. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the InstanceProfileAvailabilityClassEnum.Default property. +// The default availability class for an instance with this profile. +const ( + InstanceProfileAvailabilityClassEnumDefaultSpotConst = "spot" + InstanceProfileAvailabilityClassEnumDefaultStandardConst = "standard" +) + +// Constants associated with the InstanceProfileAvailabilityClassEnum.Type property. +// The type for this profile field. +const ( + InstanceProfileAvailabilityClassEnumTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileAvailabilityClassEnum.Values property. +// The availability class for the virtual server instance: +// - `spot`: The virtual server instance may be preempted. +// - `standard`: The virtual server instance will not be preempted. +// +// See [virtual server instance availability +// class](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers) for details. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileAvailabilityClassEnumValuesSpotConst = "spot" + InstanceProfileAvailabilityClassEnumValuesStandardConst = "standard" +) + +func (*InstanceProfileAvailabilityClassEnum) isaInstanceProfileAvailabilityClass() bool { + return true +} + +// UnmarshalInstanceProfileAvailabilityClassEnum unmarshals an instance of InstanceProfileAvailabilityClassEnum from the specified map of raw messages. +func UnmarshalInstanceProfileAvailabilityClassEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileAvailabilityClassEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileAvailabilityClassFixed : The availability class values for an instance with this profile. +// This model "extends" InstanceProfileAvailabilityClass +type InstanceProfileAvailabilityClassFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The availability class for the virtual server instance: + // - `spot`: The virtual server instance may be preempted. + // - `standard`: The virtual server instance will not be preempted. + // + // See [virtual server instance availability + // class](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers) for details. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Value *string `json:"value" validate:"required"` +} + +// Constants associated with the InstanceProfileAvailabilityClassFixed.Type property. +// The type for this profile field. +const ( + InstanceProfileAvailabilityClassFixedTypeFixedConst = "fixed" +) + +// Constants associated with the InstanceProfileAvailabilityClassFixed.Value property. +// The availability class for the virtual server instance: +// - `spot`: The virtual server instance may be preempted. +// - `standard`: The virtual server instance will not be preempted. +// +// See [virtual server instance availability +// class](https://cloud.ibm.com/docs/vpc?topic=vpc-spot-instances-virtual-servers) for details. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileAvailabilityClassFixedValueSpotConst = "spot" + InstanceProfileAvailabilityClassFixedValueStandardConst = "standard" +) + +func (*InstanceProfileAvailabilityClassFixed) isaInstanceProfileAvailabilityClass() bool { + return true +} + +// UnmarshalInstanceProfileAvailabilityClassFixed unmarshals an instance of InstanceProfileAvailabilityClassFixed from the specified map of raw messages. +func UnmarshalInstanceProfileAvailabilityClassFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileAvailabilityClassFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceProfileBandwidthDependent : The total bandwidth shared across the network attachments or network interfaces and storage volumes of an instance // with this profile depends on its configuration. // This model "extends" InstanceProfileBandwidth @@ -121329,6 +133503,133 @@ func UnmarshalInstanceProfileNetworkAttachmentCountRange(m map[string]json.RawMe return } +// InstanceProfileNetworkBandwidthModeEnum : The permitted network bandwidth modes for an instance with this profile. +// This model "extends" InstanceProfileNetworkBandwidthMode +type InstanceProfileNetworkBandwidthModeEnum struct { + // The default network bandwidth mode for this profile. + Default *string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The supported network bandwidth modes for an instance with this profile. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the InstanceProfileNetworkBandwidthModeEnum.Default property. +// The default network bandwidth mode for this profile. +const ( + InstanceProfileNetworkBandwidthModeEnumDefaultDividedConst = "divided" + InstanceProfileNetworkBandwidthModeEnumDefaultPooledConst = "pooled" +) + +// Constants associated with the InstanceProfileNetworkBandwidthModeEnum.Type property. +// The type for this profile field. +const ( + InstanceProfileNetworkBandwidthModeEnumTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileNetworkBandwidthModeEnum.Values property. +// A network bandwidth mode: +// +// - `divided`: network bandwidth divided equally across the instance's network attachments +// (or the instance's network interfaces). +// - `pooled`: network bandwidth pooled among instance network attachments +// (or the instance's network interfaces). +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileNetworkBandwidthModeEnumValuesDividedConst = "divided" + InstanceProfileNetworkBandwidthModeEnumValuesPooledConst = "pooled" +) + +func (*InstanceProfileNetworkBandwidthModeEnum) isaInstanceProfileNetworkBandwidthMode() bool { + return true +} + +// UnmarshalInstanceProfileNetworkBandwidthModeEnum unmarshals an instance of InstanceProfileNetworkBandwidthModeEnum from the specified map of raw messages. +func UnmarshalInstanceProfileNetworkBandwidthModeEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNetworkBandwidthModeEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileNetworkBandwidthModeFixed : The network bandwidth mode for an instance with this profile. +// This model "extends" InstanceProfileNetworkBandwidthMode +type InstanceProfileNetworkBandwidthModeFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // A network bandwidth mode: + // + // - `divided`: network bandwidth divided equally across the instance's network attachments + // (or the instance's network interfaces). + // - `pooled`: network bandwidth pooled among instance network attachments + // (or the instance's network interfaces). + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Value *string `json:"value" validate:"required"` +} + +// Constants associated with the InstanceProfileNetworkBandwidthModeFixed.Type property. +// The type for this profile field. +const ( + InstanceProfileNetworkBandwidthModeFixedTypeFixedConst = "fixed" +) + +// Constants associated with the InstanceProfileNetworkBandwidthModeFixed.Value property. +// A network bandwidth mode: +// +// - `divided`: network bandwidth divided equally across the instance's network attachments +// (or the instance's network interfaces). +// - `pooled`: network bandwidth pooled among instance network attachments +// (or the instance's network interfaces). +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileNetworkBandwidthModeFixedValueDividedConst = "divided" + InstanceProfileNetworkBandwidthModeFixedValuePooledConst = "pooled" +) + +func (*InstanceProfileNetworkBandwidthModeFixed) isaInstanceProfileNetworkBandwidthMode() bool { + return true +} + +// UnmarshalInstanceProfileNetworkBandwidthModeFixed unmarshals an instance of InstanceProfileNetworkBandwidthModeFixed from the specified map of raw messages. +func UnmarshalInstanceProfileNetworkBandwidthModeFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileNetworkBandwidthModeFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceProfileNetworkInterfaceCountDependent : The number of network interfaces supported on an instance with this profile is dependent on its configuration. // This model "extends" InstanceProfileNetworkInterfaceCount type InstanceProfileNetworkInterfaceCountDependent struct { @@ -121469,6 +133770,43 @@ func UnmarshalInstanceProfilePortSpeedFixed(m map[string]json.RawMessage, result return } +// InstanceProfileVcpuBurstLimitFixed : The permitted value for VCPU burst limit percentage for an instance with this profile. +// This model "extends" InstanceProfileVcpuBurstLimit +type InstanceProfileVcpuBurstLimitFixed 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 InstanceProfileVcpuBurstLimitFixed.Type property. +// The type for this profile field. +const ( + InstanceProfileVcpuBurstLimitFixedTypeFixedConst = "fixed" +) + +func (*InstanceProfileVcpuBurstLimitFixed) isaInstanceProfileVcpuBurstLimit() bool { + return true +} + +// UnmarshalInstanceProfileVcpuBurstLimitFixed unmarshals an instance of InstanceProfileVcpuBurstLimitFixed from the specified map of raw messages. +func UnmarshalInstanceProfileVcpuBurstLimitFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVcpuBurstLimitFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceProfileVcpuDependent : The VCPU count for an instance with this profile depends on its configuration. // This model "extends" InstanceProfileVcpu type InstanceProfileVcpuDependent struct { @@ -121828,6 +134166,99 @@ func UnmarshalInstanceProfileVolumeBandwidthFixed(m map[string]json.RawMessage, return } +// InstanceProfileVolumeBandwidthQoSModesDependent : The volume bandwidth QoS modes for an instance with this profile depends on its configuration. +// This model "extends" InstanceProfileVolumeBandwidthQoSModes +type InstanceProfileVolumeBandwidthQoSModesDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModesDependent.Type property. +// The type for this profile field. +const ( + InstanceProfileVolumeBandwidthQoSModesDependentTypeDependentConst = "dependent" +) + +func (*InstanceProfileVolumeBandwidthQoSModesDependent) isaInstanceProfileVolumeBandwidthQoSModes() bool { + return true +} + +// UnmarshalInstanceProfileVolumeBandwidthQoSModesDependent unmarshals an instance of InstanceProfileVolumeBandwidthQoSModesDependent from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidthQoSModesDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidthQoSModesDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileVolumeBandwidthQoSModesEnum : InstanceProfileVolumeBandwidthQoSModesEnum struct +// This model "extends" InstanceProfileVolumeBandwidthQoSModes +type InstanceProfileVolumeBandwidthQoSModesEnum struct { + // The default volume bandwidth QoS mode for this profile. + Default *string `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The permitted volume bandwidth QoS modes for an instance using this profile. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModesEnum.Default property. +// The default volume bandwidth QoS mode for this profile. +const ( + InstanceProfileVolumeBandwidthQoSModesEnumDefaultPooledConst = "pooled" + InstanceProfileVolumeBandwidthQoSModesEnumDefaultWeightedConst = "weighted" +) + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModesEnum.Type property. +// The type for this profile field. +const ( + InstanceProfileVolumeBandwidthQoSModesEnumTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModesEnum.Values property. +// A volume bandwidth QoS mode: +// - `pooled`: All volumes attached to an instance will pool and share bandwidth. +// - `weighted`: Each volume attached to an instance will have its own bandwidth, weighted according to its IOPS. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileVolumeBandwidthQoSModesEnumValuesPooledConst = "pooled" + InstanceProfileVolumeBandwidthQoSModesEnumValuesWeightedConst = "weighted" +) + +func (*InstanceProfileVolumeBandwidthQoSModesEnum) isaInstanceProfileVolumeBandwidthQoSModes() bool { + return true +} + +// UnmarshalInstanceProfileVolumeBandwidthQoSModesEnum unmarshals an instance of InstanceProfileVolumeBandwidthQoSModesEnum from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidthQoSModesEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidthQoSModesEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceProfileVolumeBandwidthRange : The permitted storage bandwidth range (in megabits per second) shared across the storage volumes of an instance with // this profile. // This model "extends" InstanceProfileVolumeBandwidth @@ -121896,6 +134327,8 @@ func UnmarshalInstanceProfileVolumeBandwidthRange(m map[string]json.RawMessage, // - InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface // This model "extends" InstancePrototype type InstancePrototypeInstanceByCatalogOffering struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -121946,7 +134379,8 @@ type InstancePrototypeInstanceByCatalogOffering struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -121962,9 +134396,17 @@ type InstancePrototypeInstanceByCatalogOffering struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -122009,6 +134451,16 @@ const ( InstancePrototypeInstanceByCatalogOfferingConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByCatalogOffering.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByCatalogOfferingVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByCatalogOfferingVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstancePrototypeInstanceByCatalogOffering) isaInstancePrototypeInstanceByCatalogOffering() bool { return true } @@ -122025,6 +134477,11 @@ func (*InstancePrototypeInstanceByCatalogOffering) isaInstancePrototype() bool { // UnmarshalInstancePrototypeInstanceByCatalogOffering unmarshals an instance of InstancePrototypeInstanceByCatalogOffering from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceByCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceByCatalogOffering) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -122095,11 +134552,21 @@ func UnmarshalInstancePrototypeInstanceByCatalogOffering(m map[string]json.RawMe err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -122152,6 +134619,8 @@ func UnmarshalInstancePrototypeInstanceByCatalogOffering(m map[string]json.RawMe // - InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface // This model "extends" InstancePrototype type InstancePrototypeInstanceByImage struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -122202,7 +134671,8 @@ type InstancePrototypeInstanceByImage struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -122218,9 +134688,17 @@ type InstancePrototypeInstanceByImage struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -122259,6 +134737,16 @@ const ( InstancePrototypeInstanceByImageConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByImage.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByImageVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByImageVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstancePrototypeInstanceByImage) isaInstancePrototypeInstanceByImage() bool { return true } @@ -122275,6 +134763,11 @@ 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", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -122345,11 +134838,21 @@ func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, res err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -122400,6 +134903,8 @@ func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, res // - InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface // This model "extends" InstancePrototype type InstancePrototypeInstanceBySourceSnapshot struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -122450,7 +134955,8 @@ type InstancePrototypeInstanceBySourceSnapshot struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -122466,9 +134972,17 @@ type InstancePrototypeInstanceBySourceSnapshot struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -122504,6 +135018,16 @@ const ( InstancePrototypeInstanceBySourceSnapshotConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceBySourceSnapshot.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceBySourceSnapshotVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceBySourceSnapshotVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstancePrototypeInstanceBySourceSnapshot) isaInstancePrototypeInstanceBySourceSnapshot() bool { return true } @@ -122520,6 +135044,11 @@ func (*InstancePrototypeInstanceBySourceSnapshot) isaInstancePrototype() bool { // UnmarshalInstancePrototypeInstanceBySourceSnapshot unmarshals an instance of InstancePrototypeInstanceBySourceSnapshot from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceBySourceSnapshot) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -122590,11 +135119,21 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshot(m map[string]json.RawMes err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -122643,6 +135182,8 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshot(m map[string]json.RawMes // `primary_network_interface` is specified in the source template. // This model "extends" InstancePrototype type InstancePrototypeInstanceBySourceTemplate struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -122693,7 +135234,8 @@ type InstancePrototypeInstanceBySourceTemplate struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -122709,9 +135251,17 @@ type InstancePrototypeInstanceBySourceTemplate struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -122764,6 +135314,16 @@ const ( InstancePrototypeInstanceBySourceTemplateConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceBySourceTemplate.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceBySourceTemplateVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceBySourceTemplateVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceBySourceTemplate : Instantiate InstancePrototypeInstanceBySourceTemplate (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstancePrototypeInstanceBySourceTemplate, err error) { _model = &InstancePrototypeInstanceBySourceTemplate{ @@ -122783,6 +135343,11 @@ 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", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -122853,11 +135418,21 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -122918,6 +135493,8 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes // - InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface // This model "extends" InstancePrototype type InstancePrototypeInstanceByVolume struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -122968,7 +135545,8 @@ type InstancePrototypeInstanceByVolume struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -122984,9 +135562,17 @@ type InstancePrototypeInstanceByVolume struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -123022,6 +135608,16 @@ const ( InstancePrototypeInstanceByVolumeConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByVolume.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByVolumeVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByVolumeVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstancePrototypeInstanceByVolume) isaInstancePrototypeInstanceByVolume() bool { return true } @@ -123038,6 +135634,11 @@ 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", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -123108,11 +135709,21 @@ func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, re err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -123293,6 +135904,8 @@ func (instanceTemplateIdentityByID *InstanceTemplateIdentityByID) asPatch() (_pa // - InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface // This model "extends" InstanceTemplatePrototype type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -123341,7 +135954,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -123357,9 +135971,17 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -123404,6 +136026,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) isaInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() bool { return true } @@ -123420,6 +136052,11 @@ func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) isaInstanceTe // UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOffering from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -123490,11 +136127,21 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[s err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -123547,6 +136194,8 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[s // - InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface // This model "extends" InstanceTemplatePrototype type InstanceTemplatePrototypeInstanceTemplateByImage struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -123595,7 +136244,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -123611,9 +136261,17 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -123652,6 +136310,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByImageConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByImage.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByImageVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByImageVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplatePrototypeInstanceTemplateByImage) isaInstanceTemplatePrototypeInstanceTemplateByImage() bool { return true } @@ -123668,6 +136336,11 @@ func (*InstanceTemplatePrototypeInstanceTemplateByImage) isaInstanceTemplateProt // UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImage from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceTemplateByImage) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -123738,11 +136411,21 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -123793,6 +136476,8 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json // - InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface // This model "extends" InstanceTemplatePrototype type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -123841,7 +136526,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -123857,9 +136543,17 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -123895,6 +136589,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) isaInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() bool { return true } @@ -123911,6 +136615,11 @@ func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) isaInstanceTem // UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -123981,11 +136690,21 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[st err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -124034,6 +136753,8 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[st // `primary_network_interface` is specified in the source template. // This model "extends" InstanceTemplatePrototype type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -124082,7 +136803,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -124098,9 +136820,17 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -124153,6 +136883,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateBySourceTemplateConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateBySourceTemplateVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateBySourceTemplateVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceTemplate (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceTemplate, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateBySourceTemplate{ @@ -124172,6 +136912,11 @@ func (*InstanceTemplatePrototypeInstanceTemplateBySourceTemplate) isaInstanceTem // UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceTemplate from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceTemplate) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -124242,11 +136987,21 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(m map[st err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -124307,6 +137062,8 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(m map[st // - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface // This model "extends" InstanceTemplate type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -124366,7 +137123,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -124383,9 +137141,17 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -124430,6 +137196,16 @@ const ( InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { return true } @@ -124446,6 +137222,11 @@ func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) isaInst // UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext from the specified map of raw messages. func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -124536,11 +137317,21 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(m err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -124591,6 +137382,8 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(m // - InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface // This model "extends" InstanceTemplate type InstanceTemplateInstanceByImageInstanceTemplateContext struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -124650,7 +137443,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContext struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -124667,9 +137461,17 @@ type InstanceTemplateInstanceByImageInstanceTemplateContext struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -124708,6 +137510,16 @@ const ( InstanceTemplateInstanceByImageInstanceTemplateContextConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByImageInstanceTemplateContext.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByImageInstanceTemplateContextVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByImageInstanceTemplateContextVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByImageInstanceTemplateContext) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { return true } @@ -124724,6 +137536,11 @@ func (*InstanceTemplateInstanceByImageInstanceTemplateContext) isaInstanceTempla // UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceByImageInstanceTemplateContext from the specified map of raw messages. func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplateInstanceByImageInstanceTemplateContext) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -124814,11 +137631,21 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext(m map[strin err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -124869,6 +137696,8 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext(m map[strin // - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface // This model "extends" InstanceTemplate type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -124928,7 +137757,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -124945,9 +137775,17 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -124983,6 +137821,16 @@ const ( InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { return true } @@ -124999,6 +137847,11 @@ func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) isaInsta // UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext unmarshals an instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext from the specified map of raw messages. func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -125089,11 +137942,21 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(m err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -126339,6 +139202,8 @@ type LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeHttp Timeout *int64 `json:"timeout" validate:"required"` // The protocol type to use for health checks. + // + // Load balancers in the `network` family do not support the `https` protocol. Type *string `json:"type" validate:"required"` // The health check URL path to use. @@ -126349,6 +139214,8 @@ type LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeHttp // Constants associated with the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeHttphttpsPrototype.Type property. // The protocol type to use for health checks. +// +// Load balancers in the `network` family do not support the `https` protocol. const ( LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeHttphttpsPrototypeTypeHTTPConst = "http" LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeHttphttpsPrototypeTypeHTTPSConst = "https" @@ -126714,6 +139581,81 @@ func (loadBalancerPoolIdentityLoadBalancerPoolIdentityByID *LoadBalancerPoolIden return } +// LoadBalancerPoolMemberTargetByReservedIP : LoadBalancerPoolMemberTargetByReservedIP struct +// This model "extends" LoadBalancerPoolMemberTarget +type LoadBalancerPoolMemberTargetByReservedIP struct { + // The IP address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in + // the future. + Address *string `json:"address" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *Deleted `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"` + + // The name for this reserved IP. The name is unique across all reserved IPs in a subnet. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the LoadBalancerPoolMemberTargetByReservedIP.ResourceType property. +// The resource type. +const ( + LoadBalancerPoolMemberTargetByReservedIPResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" +) + +func (*LoadBalancerPoolMemberTargetByReservedIP) isaLoadBalancerPoolMemberTarget() bool { + return true +} + +// UnmarshalLoadBalancerPoolMemberTargetByReservedIP unmarshals an instance of LoadBalancerPoolMemberTargetByReservedIP from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetByReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetByReservedIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDeleted) + if err != nil { + err = core.SDKErrorf(err, "", "deleted-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // LoadBalancerPoolMemberTargetPrototypeIP : LoadBalancerPoolMemberTargetPrototypeIP struct // This model "extends" LoadBalancerPoolMemberTargetPrototype type LoadBalancerPoolMemberTargetPrototypeIP struct { @@ -126898,9 +139840,65 @@ func (loadBalancerPoolMemberTargetPrototypeLoadBalancerIdentity *LoadBalancerPoo return } -// LoadBalancerPoolMemberTargetIP : LoadBalancerPoolMemberTargetIP struct +// LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity : Identifies a reserved IP by a unique property. +// Models which "extend" this model: +// - LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID +// - LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref +// This model "extends" LoadBalancerPoolMemberTargetPrototype +type LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity struct { + // The unique identifier for this reserved IP. + ID *string `json:"id,omitempty"` + + // The URL for this reserved IP. + Href *string `json:"href,omitempty"` +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity) isaLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity() bool { + return true +} + +type LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityIntf interface { + LoadBalancerPoolMemberTargetPrototypeIntf + isaLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity() bool +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity) isaLoadBalancerPoolMemberTargetPrototype() bool { + return true +} + +// UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity +func (loadBalancerPoolMemberTargetPrototypeReservedIPIdentity *LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(loadBalancerPoolMemberTargetPrototypeReservedIPIdentity.ID) { + _patch["id"] = loadBalancerPoolMemberTargetPrototypeReservedIPIdentity.ID + } + if !core.IsNil(loadBalancerPoolMemberTargetPrototypeReservedIPIdentity.Href) { + _patch["href"] = loadBalancerPoolMemberTargetPrototypeReservedIPIdentity.Href + } + + return +} + +// LoadBalancerPoolMemberTargetIPNotReservedIP : LoadBalancerPoolMemberTargetIPNotReservedIP struct // This model "extends" LoadBalancerPoolMemberTarget -type LoadBalancerPoolMemberTargetIP struct { +type LoadBalancerPoolMemberTargetIPNotReservedIP struct { // The IP address. // // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in @@ -126908,13 +139906,13 @@ type LoadBalancerPoolMemberTargetIP struct { Address *string `json:"address" validate:"required"` } -func (*LoadBalancerPoolMemberTargetIP) isaLoadBalancerPoolMemberTarget() bool { +func (*LoadBalancerPoolMemberTargetIPNotReservedIP) isaLoadBalancerPoolMemberTarget() bool { return true } -// UnmarshalLoadBalancerPoolMemberTargetIP unmarshals an instance of LoadBalancerPoolMemberTargetIP from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetIP) +// UnmarshalLoadBalancerPoolMemberTargetIPNotReservedIP unmarshals an instance of LoadBalancerPoolMemberTargetIPNotReservedIP from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetIPNotReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetIPNotReservedIP) err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) @@ -128051,9 +141049,9 @@ func UnmarshalNetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByID(m map[stri return } -// NetworkACLRuleItemNetworkACLRuleProtocolAll : A rule for ICMP, TCP and UDP traffic. +// NetworkACLRuleItemNetworkACLRuleProtocolAny : NetworkACLRuleItemNetworkACLRuleProtocolAny struct // This model "extends" NetworkACLRuleItem -type NetworkACLRuleItemNetworkACLRuleProtocolAll struct { +type NetworkACLRuleItemNetworkACLRuleProtocolAny struct { // The action to perform for a packet matching the rule. Action *string `json:"action" validate:"required"` @@ -128065,6 +141063,9 @@ type NetworkACLRuleItemNetworkACLRuleProtocolAll struct { CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. @@ -128077,51 +141078,60 @@ type NetworkACLRuleItemNetworkACLRuleProtocolAll struct { ID *string `json:"id" validate:"required"` // The IP version for this rule. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. IPVersion *string `json:"ip_version" validate:"required"` // The name for this network ACL rule. The name is unique across all rules for the network ACL. Name *string `json:"name" validate:"required"` // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. Source *string `json:"source" validate:"required"` // The network protocol. Protocol *string `json:"protocol" validate:"required"` } -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Action property. +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAny.Action property. // The action to perform for a packet matching the rule. const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllActionAllowConst = "allow" - NetworkACLRuleItemNetworkACLRuleProtocolAllActionDenyConst = "deny" + NetworkACLRuleItemNetworkACLRuleProtocolAnyActionAllowConst = "allow" + NetworkACLRuleItemNetworkACLRuleProtocolAnyActionDenyConst = "deny" ) -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Direction property. +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAny.Direction property. // The direction of traffic to match. const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllDirectionInboundConst = "inbound" - NetworkACLRuleItemNetworkACLRuleProtocolAllDirectionOutboundConst = "outbound" + NetworkACLRuleItemNetworkACLRuleProtocolAnyDirectionInboundConst = "inbound" + NetworkACLRuleItemNetworkACLRuleProtocolAnyDirectionOutboundConst = "outbound" ) -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.IPVersion property. +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAny.IPVersion property. // The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllIPVersionIpv4Const = "ipv4" + NetworkACLRuleItemNetworkACLRuleProtocolAnyIPVersionIpv4Const = "ipv4" ) -// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAll.Protocol property. +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolAny.Protocol property. // The network protocol. const ( - NetworkACLRuleItemNetworkACLRuleProtocolAllProtocolAllConst = "all" + NetworkACLRuleItemNetworkACLRuleProtocolAnyProtocolAnyConst = "any" ) -func (*NetworkACLRuleItemNetworkACLRuleProtocolAll) isaNetworkACLRuleItem() bool { +func (*NetworkACLRuleItemNetworkACLRuleProtocolAny) isaNetworkACLRuleItem() bool { return true } -// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolAll from the specified map of raw messages. -func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleItemNetworkACLRuleProtocolAll) +// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAny unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolAny from the specified map of raw messages. +func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolAny(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleItemNetworkACLRuleProtocolAny) err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) @@ -128195,6 +141205,9 @@ type NetworkACLRuleItemNetworkACLRuleProtocolIcmp struct { CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. @@ -128207,12 +141220,18 @@ type NetworkACLRuleItemNetworkACLRuleProtocolIcmp struct { ID *string `json:"id" validate:"required"` // The IP version for this rule. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. IPVersion *string `json:"ip_version" validate:"required"` // The name for this network ACL rule. The name is unique across all rules for the network ACL. Name *string `json:"name" validate:"required"` // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. Source *string `json:"source" validate:"required"` // The ICMP traffic code to match. @@ -128245,6 +141264,9 @@ const ( // Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmp.IPVersion property. // The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. const ( NetworkACLRuleItemNetworkACLRuleProtocolIcmpIPVersionIpv4Const = "ipv4" ) @@ -128331,6 +141353,568 @@ func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmp(m map[string]json.Raw return } +// NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp : NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp struct +// This model "extends" NetworkACLRuleItem +type NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp struct { + // The action to perform for a packet matching the rule. + 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 IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. + Destination *string `json:"destination" validate:"required"` + + // The direction of traffic to match. + 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. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. + IPVersion *string `json:"ip_version" validate:"required"` + + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. + Source *string `json:"source" validate:"required"` + + // The network protocol. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudpActionAllowConst = "allow" + NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudpActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudpDirectionInboundConst = "inbound" + NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudpDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp.IPVersion property. +// The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudpIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp.Protocol property. +// The network protocol. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudpProtocolIcmpTCPUDPConst = "icmp_tcp_udp" +) + +func (*NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp) isaNetworkACLRuleItem() bool { + return true +} + +// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp from the specified map of raw messages. +func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleItemNetworkACLRuleProtocolIcmptcpudp) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) + if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + err = core.SDKErrorf(err, "", "destination-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + err = core.SDKErrorf(err, "", "source-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkACLRuleItemNetworkACLRuleProtocolIndividual : NetworkACLRuleItemNetworkACLRuleProtocolIndividual struct +// This model "extends" NetworkACLRuleItem +type NetworkACLRuleItemNetworkACLRuleProtocolIndividual struct { + // The action to perform for a packet matching the rule. + 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 IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. + Destination *string `json:"destination" validate:"required"` + + // The direction of traffic to match. + 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. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. + IPVersion *string `json:"ip_version" validate:"required"` + + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. + Source *string `json:"source" validate:"required"` + + // The network protocol. + // + // The value must be the name of an individual protocol, excluding `icmp`, `tcp` and + // `udp`. Names for well known protocols are: + // - `ah`: AH (authentication header, protocol number `51`) + // - `esp`: ESP (encapsulating security payload, protocol number `50`) + // - `gre`: GRE (generic routing encapsulation, protocol number `47`) + // - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + // - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + // - `rsvp`: RSVP (reservation protocol, protocol number `46`) + // - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + // - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + // + // For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIndividual.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolIndividualActionAllowConst = "allow" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIndividual.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolIndividualDirectionInboundConst = "inbound" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIndividual.IPVersion property. +// The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolIndividualIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolIndividual.Protocol property. +// The network protocol. +// +// The value must be the name of an individual protocol, excluding `icmp`, `tcp` and +// `udp`. Names for well known protocols are: +// - `ah`: AH (authentication header, protocol number `51`) +// - `esp`: ESP (encapsulating security payload, protocol number `50`) +// - `gre`: GRE (generic routing encapsulation, protocol number `47`) +// - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) +// - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) +// - `rsvp`: RSVP (reservation protocol, protocol number `46`) +// - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) +// - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) +// +// For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. +const ( + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolAhConst = "ah" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolEspConst = "esp" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolGreConst = "gre" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolIPInIPConst = "ip_in_ip" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolL2tpConst = "l2tp" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber0Const = "number_0" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber10Const = "number_10" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber100Const = "number_100" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber101Const = "number_101" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber102Const = "number_102" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber103Const = "number_103" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber104Const = "number_104" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber105Const = "number_105" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber106Const = "number_106" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber107Const = "number_107" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber108Const = "number_108" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber109Const = "number_109" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber11Const = "number_11" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber110Const = "number_110" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber111Const = "number_111" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber113Const = "number_113" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber114Const = "number_114" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber116Const = "number_116" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber117Const = "number_117" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber118Const = "number_118" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber119Const = "number_119" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber12Const = "number_12" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber120Const = "number_120" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber121Const = "number_121" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber122Const = "number_122" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber123Const = "number_123" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber124Const = "number_124" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber125Const = "number_125" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber126Const = "number_126" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber127Const = "number_127" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber128Const = "number_128" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber129Const = "number_129" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber13Const = "number_13" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber130Const = "number_130" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber131Const = "number_131" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber133Const = "number_133" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber134Const = "number_134" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber135Const = "number_135" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber136Const = "number_136" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber137Const = "number_137" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber138Const = "number_138" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber139Const = "number_139" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber14Const = "number_14" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber140Const = "number_140" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber141Const = "number_141" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber142Const = "number_142" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber143Const = "number_143" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber144Const = "number_144" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber145Const = "number_145" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber146Const = "number_146" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber147Const = "number_147" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber148Const = "number_148" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber149Const = "number_149" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber15Const = "number_15" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber150Const = "number_150" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber151Const = "number_151" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber152Const = "number_152" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber153Const = "number_153" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber154Const = "number_154" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber155Const = "number_155" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber156Const = "number_156" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber157Const = "number_157" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber158Const = "number_158" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber159Const = "number_159" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber16Const = "number_16" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber160Const = "number_160" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber161Const = "number_161" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber162Const = "number_162" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber163Const = "number_163" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber164Const = "number_164" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber165Const = "number_165" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber166Const = "number_166" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber167Const = "number_167" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber168Const = "number_168" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber169Const = "number_169" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber170Const = "number_170" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber171Const = "number_171" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber172Const = "number_172" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber173Const = "number_173" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber174Const = "number_174" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber175Const = "number_175" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber176Const = "number_176" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber177Const = "number_177" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber178Const = "number_178" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber179Const = "number_179" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber18Const = "number_18" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber180Const = "number_180" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber181Const = "number_181" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber182Const = "number_182" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber183Const = "number_183" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber184Const = "number_184" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber185Const = "number_185" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber186Const = "number_186" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber187Const = "number_187" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber188Const = "number_188" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber189Const = "number_189" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber19Const = "number_19" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber190Const = "number_190" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber191Const = "number_191" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber192Const = "number_192" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber193Const = "number_193" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber194Const = "number_194" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber195Const = "number_195" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber196Const = "number_196" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber197Const = "number_197" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber198Const = "number_198" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber199Const = "number_199" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber2Const = "number_2" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber20Const = "number_20" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber200Const = "number_200" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber201Const = "number_201" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber202Const = "number_202" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber203Const = "number_203" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber204Const = "number_204" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber205Const = "number_205" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber206Const = "number_206" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber207Const = "number_207" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber208Const = "number_208" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber209Const = "number_209" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber21Const = "number_21" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber210Const = "number_210" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber211Const = "number_211" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber212Const = "number_212" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber213Const = "number_213" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber214Const = "number_214" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber215Const = "number_215" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber216Const = "number_216" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber217Const = "number_217" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber218Const = "number_218" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber219Const = "number_219" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber22Const = "number_22" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber220Const = "number_220" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber221Const = "number_221" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber222Const = "number_222" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber223Const = "number_223" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber224Const = "number_224" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber225Const = "number_225" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber226Const = "number_226" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber227Const = "number_227" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber228Const = "number_228" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber229Const = "number_229" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber23Const = "number_23" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber230Const = "number_230" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber231Const = "number_231" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber232Const = "number_232" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber233Const = "number_233" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber234Const = "number_234" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber235Const = "number_235" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber236Const = "number_236" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber237Const = "number_237" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber238Const = "number_238" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber239Const = "number_239" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber24Const = "number_24" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber240Const = "number_240" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber241Const = "number_241" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber242Const = "number_242" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber243Const = "number_243" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber244Const = "number_244" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber245Const = "number_245" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber246Const = "number_246" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber247Const = "number_247" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber248Const = "number_248" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber249Const = "number_249" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber25Const = "number_25" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber250Const = "number_250" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber251Const = "number_251" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber252Const = "number_252" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber253Const = "number_253" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber254Const = "number_254" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber255Const = "number_255" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber26Const = "number_26" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber27Const = "number_27" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber28Const = "number_28" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber29Const = "number_29" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber3Const = "number_3" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber30Const = "number_30" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber31Const = "number_31" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber32Const = "number_32" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber33Const = "number_33" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber34Const = "number_34" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber35Const = "number_35" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber36Const = "number_36" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber37Const = "number_37" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber38Const = "number_38" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber39Const = "number_39" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber40Const = "number_40" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber41Const = "number_41" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber42Const = "number_42" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber43Const = "number_43" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber44Const = "number_44" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber45Const = "number_45" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber48Const = "number_48" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber49Const = "number_49" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber5Const = "number_5" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber52Const = "number_52" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber53Const = "number_53" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber54Const = "number_54" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber55Const = "number_55" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber56Const = "number_56" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber57Const = "number_57" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber58Const = "number_58" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber59Const = "number_59" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber60Const = "number_60" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber61Const = "number_61" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber62Const = "number_62" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber63Const = "number_63" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber64Const = "number_64" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber65Const = "number_65" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber66Const = "number_66" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber67Const = "number_67" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber68Const = "number_68" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber69Const = "number_69" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber7Const = "number_7" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber70Const = "number_70" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber71Const = "number_71" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber72Const = "number_72" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber73Const = "number_73" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber74Const = "number_74" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber75Const = "number_75" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber76Const = "number_76" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber77Const = "number_77" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber78Const = "number_78" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber79Const = "number_79" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber8Const = "number_8" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber80Const = "number_80" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber81Const = "number_81" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber82Const = "number_82" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber83Const = "number_83" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber84Const = "number_84" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber85Const = "number_85" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber86Const = "number_86" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber87Const = "number_87" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber88Const = "number_88" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber89Const = "number_89" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber9Const = "number_9" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber90Const = "number_90" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber91Const = "number_91" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber92Const = "number_92" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber93Const = "number_93" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber94Const = "number_94" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber95Const = "number_95" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber96Const = "number_96" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber97Const = "number_97" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber98Const = "number_98" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolNumber99Const = "number_99" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolRsvpConst = "rsvp" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolSctpConst = "sctp" + NetworkACLRuleItemNetworkACLRuleProtocolIndividualProtocolVrrpConst = "vrrp" +) + +func (*NetworkACLRuleItemNetworkACLRuleProtocolIndividual) isaNetworkACLRuleItem() bool { + return true +} + +// UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual unmarshals an instance of NetworkACLRuleItemNetworkACLRuleProtocolIndividual from the specified map of raw messages. +func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolIndividual(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleItemNetworkACLRuleProtocolIndividual) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) + if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + err = core.SDKErrorf(err, "", "destination-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + err = core.SDKErrorf(err, "", "source-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // NetworkACLRuleItemNetworkACLRuleProtocolTcpudp : A rule for TCP or UDP traffic. // This model "extends" NetworkACLRuleItem type NetworkACLRuleItemNetworkACLRuleProtocolTcpudp struct { @@ -128345,6 +141929,9 @@ type NetworkACLRuleItemNetworkACLRuleProtocolTcpudp struct { CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. @@ -128357,12 +141944,18 @@ type NetworkACLRuleItemNetworkACLRuleProtocolTcpudp struct { ID *string `json:"id" validate:"required"` // The IP version for this rule. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. IPVersion *string `json:"ip_version" validate:"required"` // The name for this network ACL rule. The name is unique across all rules for the network ACL. Name *string `json:"name" validate:"required"` // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. Source *string `json:"source" validate:"required"` // The inclusive upper bound of the TCP or UDP destination port range. @@ -128397,6 +141990,9 @@ const ( // Constants associated with the NetworkACLRuleItemNetworkACLRuleProtocolTcpudp.IPVersion property. // The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. const ( NetworkACLRuleItemNetworkACLRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" ) @@ -128494,61 +142090,65 @@ func UnmarshalNetworkACLRuleItemNetworkACLRuleProtocolTcpudp(m map[string]json.R return } -// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype : A rule for ICMP, TCP and UDP traffic. +// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype struct // This model "extends" NetworkACLRulePrototypeNetworkACLContext -type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype struct { +type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype struct { // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. Action *string `json:"action" validate:"required"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. Direction *string `json:"direction" validate:"required"` - // The IP version for this rule. + // The IP version to match. The format of `source` and `destination` must match this property. IPVersion *string `json:"ip_version,omitempty"` // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, // the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. Source *string `json:"source" validate:"required"` // The network protocol. Protocol *string `json:"protocol" validate:"required"` } -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Action property. +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.Action property. // The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeActionDenyConst = "deny" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototypeActionDenyConst = "deny" ) -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Direction property. +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.Direction property. // The direction of traffic to match. const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeDirectionOutboundConst = "outbound" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototypeDirectionOutboundConst = "outbound" ) -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.IPVersion property. -// The IP version for this rule. +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.IPVersion property. +// The IP version to match. The format of `source` and `destination` must match this property. const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeIPVersionIpv4Const = "ipv4" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototypeIPVersionIpv4Const = "ipv4" ) -// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Protocol property. +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.Protocol property. // The network protocol. const ( - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeProtocolAllConst = "all" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototypeProtocolAnyConst = "any" ) -// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype{ +// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype{ Action: core.StringPtr(action), Destination: core.StringPtr(destination), Direction: core.StringPtr(direction), @@ -128562,13 +142162,13 @@ func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolA return } -func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { +func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { return true } -// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype) +// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype) err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) @@ -128612,22 +142212,24 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllP // This model "extends" NetworkACLRulePrototypeNetworkACLContext type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype struct { // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. Action *string `json:"action" validate:"required"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. Direction *string `json:"direction" validate:"required"` - // The IP version for this rule. + // The IP version to match. The format of `source` and `destination` must match this property. IPVersion *string `json:"ip_version,omitempty"` // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, // the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. Source *string `json:"source" validate:"required"` // The ICMP traffic code to match. @@ -128646,6 +142248,8 @@ type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype // Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.Action property. // The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. const ( NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeActionAllowConst = "allow" NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeActionDenyConst = "deny" @@ -128659,7 +142263,7 @@ const ( ) // Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototype.IPVersion property. -// The IP version for this rule. +// The IP version to match. The format of `source` and `destination` must match this property. const ( NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmpPrototypeIPVersionIpv4Const = "ipv4" ) @@ -128742,26 +142346,542 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmp return } +// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype struct +// This model "extends" NetworkACLRulePrototypeNetworkACLContext +type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype struct { + // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. + Action *string `json:"action" validate:"required"` + + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. + Destination *string `json:"destination" validate:"required"` + + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` + + // The IP version to match. The format of `source` and `destination` must match this property. + IPVersion *string `json:"ip_version,omitempty"` + + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. + Source *string `json:"source" validate:"required"` + + // The network protocol. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype.Action property. +// The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototypeActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototypeDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype.IPVersion property. +// The IP version to match. The format of `source` and `destination` must match this property. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototypeIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype.Protocol property. +// The network protocol. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototypeProtocolIcmpTCPUDPConst = "icmp_tcp_udp" +) + +// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype{ + Action: core.StringPtr(action), + Destination: core.StringPtr(destination), + Direction: core.StringPtr(direction), + Source: core.StringPtr(source), + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { + return true +} + +// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIcmptcpudpPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + err = core.SDKErrorf(err, "", "destination-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + err = core.SDKErrorf(err, "", "source-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype : NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype struct +// This model "extends" NetworkACLRulePrototypeNetworkACLContext +type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype struct { + // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. + Action *string `json:"action" validate:"required"` + + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. + Destination *string `json:"destination" validate:"required"` + + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` + + // The IP version to match. The format of `source` and `destination` must match this property. + IPVersion *string `json:"ip_version,omitempty"` + + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. + Source *string `json:"source" validate:"required"` + + // The network protocol. + // + // The value must be the name of an individual protocol, excluding `icmp`, `tcp` and + // `udp`. Names for well known protocols are: + // - `ah`: AH (authentication header, protocol number `51`) + // - `esp`: ESP (encapsulating security payload, protocol number `50`) + // - `gre`: GRE (generic routing encapsulation, protocol number `47`) + // - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + // - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + // - `rsvp`: RSVP (reservation protocol, protocol number `46`) + // - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + // - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + // + // For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype.Action property. +// The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype.IPVersion property. +// The IP version to match. The format of `source` and `destination` must match this property. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype.Protocol property. +// The network protocol. +// +// The value must be the name of an individual protocol, excluding `icmp`, `tcp` and +// `udp`. Names for well known protocols are: +// - `ah`: AH (authentication header, protocol number `51`) +// - `esp`: ESP (encapsulating security payload, protocol number `50`) +// - `gre`: GRE (generic routing encapsulation, protocol number `47`) +// - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) +// - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) +// - `rsvp`: RSVP (reservation protocol, protocol number `46`) +// - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) +// - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) +// +// For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. +const ( + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolAhConst = "ah" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolEspConst = "esp" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolGreConst = "gre" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolIPInIPConst = "ip_in_ip" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolL2tpConst = "l2tp" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber0Const = "number_0" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber10Const = "number_10" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber100Const = "number_100" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber101Const = "number_101" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber102Const = "number_102" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber103Const = "number_103" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber104Const = "number_104" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber105Const = "number_105" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber106Const = "number_106" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber107Const = "number_107" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber108Const = "number_108" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber109Const = "number_109" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber11Const = "number_11" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber110Const = "number_110" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber111Const = "number_111" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber113Const = "number_113" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber114Const = "number_114" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber116Const = "number_116" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber117Const = "number_117" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber118Const = "number_118" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber119Const = "number_119" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber12Const = "number_12" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber120Const = "number_120" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber121Const = "number_121" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber122Const = "number_122" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber123Const = "number_123" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber124Const = "number_124" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber125Const = "number_125" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber126Const = "number_126" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber127Const = "number_127" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber128Const = "number_128" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber129Const = "number_129" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber13Const = "number_13" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber130Const = "number_130" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber131Const = "number_131" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber133Const = "number_133" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber134Const = "number_134" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber135Const = "number_135" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber136Const = "number_136" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber137Const = "number_137" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber138Const = "number_138" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber139Const = "number_139" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber14Const = "number_14" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber140Const = "number_140" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber141Const = "number_141" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber142Const = "number_142" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber143Const = "number_143" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber144Const = "number_144" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber145Const = "number_145" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber146Const = "number_146" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber147Const = "number_147" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber148Const = "number_148" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber149Const = "number_149" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber15Const = "number_15" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber150Const = "number_150" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber151Const = "number_151" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber152Const = "number_152" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber153Const = "number_153" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber154Const = "number_154" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber155Const = "number_155" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber156Const = "number_156" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber157Const = "number_157" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber158Const = "number_158" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber159Const = "number_159" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber16Const = "number_16" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber160Const = "number_160" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber161Const = "number_161" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber162Const = "number_162" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber163Const = "number_163" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber164Const = "number_164" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber165Const = "number_165" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber166Const = "number_166" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber167Const = "number_167" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber168Const = "number_168" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber169Const = "number_169" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber170Const = "number_170" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber171Const = "number_171" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber172Const = "number_172" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber173Const = "number_173" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber174Const = "number_174" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber175Const = "number_175" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber176Const = "number_176" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber177Const = "number_177" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber178Const = "number_178" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber179Const = "number_179" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber18Const = "number_18" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber180Const = "number_180" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber181Const = "number_181" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber182Const = "number_182" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber183Const = "number_183" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber184Const = "number_184" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber185Const = "number_185" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber186Const = "number_186" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber187Const = "number_187" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber188Const = "number_188" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber189Const = "number_189" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber19Const = "number_19" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber190Const = "number_190" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber191Const = "number_191" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber192Const = "number_192" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber193Const = "number_193" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber194Const = "number_194" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber195Const = "number_195" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber196Const = "number_196" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber197Const = "number_197" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber198Const = "number_198" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber199Const = "number_199" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber2Const = "number_2" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber20Const = "number_20" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber200Const = "number_200" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber201Const = "number_201" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber202Const = "number_202" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber203Const = "number_203" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber204Const = "number_204" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber205Const = "number_205" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber206Const = "number_206" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber207Const = "number_207" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber208Const = "number_208" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber209Const = "number_209" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber21Const = "number_21" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber210Const = "number_210" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber211Const = "number_211" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber212Const = "number_212" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber213Const = "number_213" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber214Const = "number_214" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber215Const = "number_215" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber216Const = "number_216" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber217Const = "number_217" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber218Const = "number_218" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber219Const = "number_219" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber22Const = "number_22" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber220Const = "number_220" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber221Const = "number_221" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber222Const = "number_222" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber223Const = "number_223" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber224Const = "number_224" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber225Const = "number_225" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber226Const = "number_226" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber227Const = "number_227" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber228Const = "number_228" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber229Const = "number_229" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber23Const = "number_23" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber230Const = "number_230" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber231Const = "number_231" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber232Const = "number_232" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber233Const = "number_233" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber234Const = "number_234" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber235Const = "number_235" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber236Const = "number_236" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber237Const = "number_237" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber238Const = "number_238" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber239Const = "number_239" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber24Const = "number_24" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber240Const = "number_240" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber241Const = "number_241" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber242Const = "number_242" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber243Const = "number_243" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber244Const = "number_244" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber245Const = "number_245" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber246Const = "number_246" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber247Const = "number_247" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber248Const = "number_248" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber249Const = "number_249" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber25Const = "number_25" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber250Const = "number_250" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber251Const = "number_251" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber252Const = "number_252" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber253Const = "number_253" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber254Const = "number_254" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber255Const = "number_255" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber26Const = "number_26" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber27Const = "number_27" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber28Const = "number_28" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber29Const = "number_29" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber3Const = "number_3" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber30Const = "number_30" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber31Const = "number_31" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber32Const = "number_32" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber33Const = "number_33" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber34Const = "number_34" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber35Const = "number_35" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber36Const = "number_36" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber37Const = "number_37" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber38Const = "number_38" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber39Const = "number_39" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber40Const = "number_40" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber41Const = "number_41" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber42Const = "number_42" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber43Const = "number_43" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber44Const = "number_44" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber45Const = "number_45" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber48Const = "number_48" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber49Const = "number_49" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber5Const = "number_5" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber52Const = "number_52" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber53Const = "number_53" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber54Const = "number_54" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber55Const = "number_55" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber56Const = "number_56" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber57Const = "number_57" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber58Const = "number_58" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber59Const = "number_59" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber60Const = "number_60" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber61Const = "number_61" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber62Const = "number_62" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber63Const = "number_63" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber64Const = "number_64" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber65Const = "number_65" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber66Const = "number_66" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber67Const = "number_67" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber68Const = "number_68" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber69Const = "number_69" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber7Const = "number_7" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber70Const = "number_70" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber71Const = "number_71" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber72Const = "number_72" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber73Const = "number_73" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber74Const = "number_74" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber75Const = "number_75" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber76Const = "number_76" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber77Const = "number_77" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber78Const = "number_78" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber79Const = "number_79" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber8Const = "number_8" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber80Const = "number_80" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber81Const = "number_81" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber82Const = "number_82" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber83Const = "number_83" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber84Const = "number_84" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber85Const = "number_85" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber86Const = "number_86" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber87Const = "number_87" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber88Const = "number_88" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber89Const = "number_89" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber9Const = "number_9" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber90Const = "number_90" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber91Const = "number_91" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber92Const = "number_92" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber93Const = "number_93" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber94Const = "number_94" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber95Const = "number_95" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber96Const = "number_96" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber97Const = "number_97" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber98Const = "number_98" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolNumber99Const = "number_99" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolRsvpConst = "rsvp" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolSctpConst = "sctp" + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeProtocolVrrpConst = "vrrp" +) + +// NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype : Instantiate NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype{ + Action: core.StringPtr(action), + Destination: core.StringPtr(destination), + Direction: core.StringPtr(direction), + Source: core.StringPtr(source), + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype) isaNetworkACLRulePrototypeNetworkACLContext() bool { + return true +} + +// UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + err = core.SDKErrorf(err, "", "destination-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + err = core.SDKErrorf(err, "", "source-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype : A rule for TCP or UDP traffic. // This model "extends" NetworkACLRulePrototypeNetworkACLContext type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype struct { // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. Action *string `json:"action" validate:"required"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. Direction *string `json:"direction" validate:"required"` - // The IP version for this rule. + // The IP version to match. The format of `source` and `destination` must match this property. IPVersion *string `json:"ip_version,omitempty"` // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, // the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. Source *string `json:"source" validate:"required"` // The inclusive upper bound of the TCP or UDP destination port range. @@ -128794,6 +142914,8 @@ type NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototy // Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.Action property. // The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. const ( NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeActionAllowConst = "allow" NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeActionDenyConst = "deny" @@ -128807,7 +142929,7 @@ const ( ) // Constants associated with the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototype.IPVersion property. -// The IP version for this rule. +// The IP version to match. The format of `source` and `destination` must match this property. const ( NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpudpPrototypeIPVersionIpv4Const = "ipv4" ) @@ -128901,63 +143023,67 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTcpu return } -// NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype : A rule for ICMP, TCP and UDP traffic. +// NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype struct // This model "extends" NetworkACLRulePrototype -type NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype struct { +type NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype struct { // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. Action *string `json:"action" validate:"required"` Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. Direction *string `json:"direction" validate:"required"` - // The IP version for this rule. + // The IP version to match. The format of `source` and `destination` must match this property. IPVersion *string `json:"ip_version,omitempty"` // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, // the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. Source *string `json:"source" validate:"required"` // The network protocol. Protocol *string `json:"protocol" validate:"required"` } -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Action property. +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.Action property. // The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeActionAllowConst = "allow" - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeActionDenyConst = "deny" + NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototypeActionDenyConst = "deny" ) -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Direction property. +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.Direction property. // The direction of traffic to match. const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeDirectionInboundConst = "inbound" - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeDirectionOutboundConst = "outbound" + NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototypeDirectionOutboundConst = "outbound" ) -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.IPVersion property. -// The IP version for this rule. +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.IPVersion property. +// The IP version to match. The format of `source` and `destination` must match this property. const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeIPVersionIpv4Const = "ipv4" + NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototypeIPVersionIpv4Const = "ipv4" ) -// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Protocol property. +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.Protocol property. // The network protocol. const ( - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeProtocolAllConst = "all" + NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototypeProtocolAnyConst = "any" ) -// NewNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype (Generic Model Constructor) -func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype, err error) { - _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype{ +// NewNetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype{ Action: core.StringPtr(action), Destination: core.StringPtr(destination), Direction: core.StringPtr(direction), @@ -128971,13 +143097,13 @@ func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(actio return } -func (*NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype) isaNetworkACLRulePrototype() bool { +func (*NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype) isaNetworkACLRulePrototype() bool { return true } -// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype from the specified map of raw messages. -func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype) +// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype) err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) @@ -129026,24 +143152,26 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(m map[st // This model "extends" NetworkACLRulePrototype type NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype struct { // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. Action *string `json:"action" validate:"required"` Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. Direction *string `json:"direction" validate:"required"` - // The IP version for this rule. + // The IP version to match. The format of `source` and `destination` must match this property. IPVersion *string `json:"ip_version,omitempty"` // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, // the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. Source *string `json:"source" validate:"required"` // The ICMP traffic code to match. @@ -129062,6 +143190,8 @@ type NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype struct { // Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.Action property. // The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. const ( NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeActionAllowConst = "allow" NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeActionDenyConst = "deny" @@ -129075,7 +143205,7 @@ const ( ) // Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype.IPVersion property. -// The IP version for this rule. +// The IP version to match. The format of `source` and `destination` must match this property. const ( NetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototypeIPVersionIpv4Const = "ipv4" ) @@ -129144,21 +143274,549 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype(m map[s err = core.SDKErrorf(err, "", "source-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) - if err != nil { - err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) - return - } + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype struct +// This model "extends" NetworkACLRulePrototype +type NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype struct { + // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. + Action *string `json:"action" validate:"required"` + + Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` + + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. + Destination *string `json:"destination" validate:"required"` + + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` + + // The IP version to match. The format of `source` and `destination` must match this property. + IPVersion *string `json:"ip_version,omitempty"` + + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. + Source *string `json:"source" validate:"required"` + + // The network protocol. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype.Action property. +// The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototypeActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototypeDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype.IPVersion property. +// The IP version to match. The format of `source` and `destination` must match this property. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototypeIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype.Protocol property. +// The network protocol. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototypeProtocolIcmpTCPUDPConst = "icmp_tcp_udp" +) + +// NewNetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype{ + Action: core.StringPtr(action), + Destination: core.StringPtr(destination), + Direction: core.StringPtr(direction), + Source: core.StringPtr(source), + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype) isaNetworkACLRulePrototype() bool { + return true +} + +// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolIcmptcpudpPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + err = core.SDKErrorf(err, "", "destination-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + err = core.SDKErrorf(err, "", "source-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype : NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype struct +// This model "extends" NetworkACLRulePrototype +type NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype struct { + // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. + Action *string `json:"action" validate:"required"` + + Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` + + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. + Destination *string `json:"destination" validate:"required"` + + // The direction of traffic to match. + Direction *string `json:"direction" validate:"required"` + + // The IP version to match. The format of `source` and `destination` must match this property. + IPVersion *string `json:"ip_version,omitempty"` + + // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, + // the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. + Source *string `json:"source" validate:"required"` + + // The network protocol. + // + // The value must be the name of an individual protocol, excluding `icmp`, `tcp` and + // `udp`. Names for well known protocols are: + // - `ah`: AH (authentication header, protocol number `51`) + // - `esp`: ESP (encapsulating security payload, protocol number `50`) + // - `gre`: GRE (generic routing encapsulation, protocol number `47`) + // - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + // - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + // - `rsvp`: RSVP (reservation protocol, protocol number `46`) + // - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + // - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + // + // For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype.Action property. +// The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeActionAllowConst = "allow" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeDirectionInboundConst = "inbound" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype.IPVersion property. +// The IP version to match. The format of `source` and `destination` must match this property. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype.Protocol property. +// The network protocol. +// +// The value must be the name of an individual protocol, excluding `icmp`, `tcp` and +// `udp`. Names for well known protocols are: +// - `ah`: AH (authentication header, protocol number `51`) +// - `esp`: ESP (encapsulating security payload, protocol number `50`) +// - `gre`: GRE (generic routing encapsulation, protocol number `47`) +// - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) +// - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) +// - `rsvp`: RSVP (reservation protocol, protocol number `46`) +// - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) +// - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) +// +// For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. +const ( + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolAhConst = "ah" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolEspConst = "esp" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolGreConst = "gre" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolIPInIPConst = "ip_in_ip" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolL2tpConst = "l2tp" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber0Const = "number_0" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber10Const = "number_10" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber100Const = "number_100" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber101Const = "number_101" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber102Const = "number_102" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber103Const = "number_103" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber104Const = "number_104" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber105Const = "number_105" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber106Const = "number_106" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber107Const = "number_107" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber108Const = "number_108" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber109Const = "number_109" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber11Const = "number_11" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber110Const = "number_110" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber111Const = "number_111" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber113Const = "number_113" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber114Const = "number_114" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber116Const = "number_116" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber117Const = "number_117" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber118Const = "number_118" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber119Const = "number_119" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber12Const = "number_12" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber120Const = "number_120" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber121Const = "number_121" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber122Const = "number_122" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber123Const = "number_123" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber124Const = "number_124" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber125Const = "number_125" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber126Const = "number_126" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber127Const = "number_127" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber128Const = "number_128" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber129Const = "number_129" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber13Const = "number_13" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber130Const = "number_130" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber131Const = "number_131" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber133Const = "number_133" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber134Const = "number_134" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber135Const = "number_135" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber136Const = "number_136" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber137Const = "number_137" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber138Const = "number_138" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber139Const = "number_139" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber14Const = "number_14" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber140Const = "number_140" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber141Const = "number_141" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber142Const = "number_142" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber143Const = "number_143" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber144Const = "number_144" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber145Const = "number_145" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber146Const = "number_146" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber147Const = "number_147" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber148Const = "number_148" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber149Const = "number_149" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber15Const = "number_15" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber150Const = "number_150" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber151Const = "number_151" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber152Const = "number_152" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber153Const = "number_153" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber154Const = "number_154" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber155Const = "number_155" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber156Const = "number_156" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber157Const = "number_157" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber158Const = "number_158" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber159Const = "number_159" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber16Const = "number_16" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber160Const = "number_160" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber161Const = "number_161" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber162Const = "number_162" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber163Const = "number_163" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber164Const = "number_164" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber165Const = "number_165" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber166Const = "number_166" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber167Const = "number_167" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber168Const = "number_168" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber169Const = "number_169" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber170Const = "number_170" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber171Const = "number_171" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber172Const = "number_172" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber173Const = "number_173" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber174Const = "number_174" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber175Const = "number_175" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber176Const = "number_176" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber177Const = "number_177" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber178Const = "number_178" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber179Const = "number_179" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber18Const = "number_18" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber180Const = "number_180" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber181Const = "number_181" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber182Const = "number_182" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber183Const = "number_183" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber184Const = "number_184" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber185Const = "number_185" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber186Const = "number_186" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber187Const = "number_187" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber188Const = "number_188" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber189Const = "number_189" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber19Const = "number_19" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber190Const = "number_190" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber191Const = "number_191" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber192Const = "number_192" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber193Const = "number_193" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber194Const = "number_194" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber195Const = "number_195" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber196Const = "number_196" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber197Const = "number_197" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber198Const = "number_198" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber199Const = "number_199" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber2Const = "number_2" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber20Const = "number_20" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber200Const = "number_200" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber201Const = "number_201" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber202Const = "number_202" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber203Const = "number_203" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber204Const = "number_204" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber205Const = "number_205" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber206Const = "number_206" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber207Const = "number_207" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber208Const = "number_208" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber209Const = "number_209" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber21Const = "number_21" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber210Const = "number_210" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber211Const = "number_211" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber212Const = "number_212" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber213Const = "number_213" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber214Const = "number_214" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber215Const = "number_215" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber216Const = "number_216" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber217Const = "number_217" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber218Const = "number_218" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber219Const = "number_219" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber22Const = "number_22" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber220Const = "number_220" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber221Const = "number_221" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber222Const = "number_222" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber223Const = "number_223" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber224Const = "number_224" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber225Const = "number_225" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber226Const = "number_226" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber227Const = "number_227" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber228Const = "number_228" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber229Const = "number_229" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber23Const = "number_23" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber230Const = "number_230" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber231Const = "number_231" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber232Const = "number_232" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber233Const = "number_233" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber234Const = "number_234" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber235Const = "number_235" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber236Const = "number_236" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber237Const = "number_237" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber238Const = "number_238" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber239Const = "number_239" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber24Const = "number_24" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber240Const = "number_240" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber241Const = "number_241" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber242Const = "number_242" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber243Const = "number_243" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber244Const = "number_244" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber245Const = "number_245" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber246Const = "number_246" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber247Const = "number_247" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber248Const = "number_248" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber249Const = "number_249" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber25Const = "number_25" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber250Const = "number_250" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber251Const = "number_251" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber252Const = "number_252" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber253Const = "number_253" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber254Const = "number_254" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber255Const = "number_255" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber26Const = "number_26" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber27Const = "number_27" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber28Const = "number_28" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber29Const = "number_29" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber3Const = "number_3" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber30Const = "number_30" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber31Const = "number_31" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber32Const = "number_32" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber33Const = "number_33" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber34Const = "number_34" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber35Const = "number_35" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber36Const = "number_36" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber37Const = "number_37" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber38Const = "number_38" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber39Const = "number_39" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber40Const = "number_40" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber41Const = "number_41" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber42Const = "number_42" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber43Const = "number_43" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber44Const = "number_44" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber45Const = "number_45" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber48Const = "number_48" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber49Const = "number_49" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber5Const = "number_5" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber52Const = "number_52" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber53Const = "number_53" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber54Const = "number_54" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber55Const = "number_55" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber56Const = "number_56" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber57Const = "number_57" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber58Const = "number_58" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber59Const = "number_59" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber60Const = "number_60" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber61Const = "number_61" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber62Const = "number_62" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber63Const = "number_63" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber64Const = "number_64" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber65Const = "number_65" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber66Const = "number_66" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber67Const = "number_67" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber68Const = "number_68" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber69Const = "number_69" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber7Const = "number_7" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber70Const = "number_70" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber71Const = "number_71" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber72Const = "number_72" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber73Const = "number_73" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber74Const = "number_74" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber75Const = "number_75" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber76Const = "number_76" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber77Const = "number_77" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber78Const = "number_78" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber79Const = "number_79" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber8Const = "number_8" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber80Const = "number_80" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber81Const = "number_81" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber82Const = "number_82" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber83Const = "number_83" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber84Const = "number_84" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber85Const = "number_85" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber86Const = "number_86" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber87Const = "number_87" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber88Const = "number_88" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber89Const = "number_89" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber9Const = "number_9" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber90Const = "number_90" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber91Const = "number_91" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber92Const = "number_92" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber93Const = "number_93" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber94Const = "number_94" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber95Const = "number_95" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber96Const = "number_96" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber97Const = "number_97" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber98Const = "number_98" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolNumber99Const = "number_99" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolRsvpConst = "rsvp" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolSctpConst = "sctp" + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeProtocolVrrpConst = "vrrp" +) + +// NewNetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype : Instantiate NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype (Generic Model Constructor) +func (*VpcV1) NewNetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype(action string, destination string, direction string, source string, protocol string) (_model *NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype, err error) { + _model = &NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype{ + Action: core.StringPtr(action), + Destination: core.StringPtr(destination), + Direction: core.StringPtr(direction), + Source: core.StringPtr(source), + Protocol: core.StringPtr(protocol), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype) isaNetworkACLRulePrototype() bool { + return true +} + +// UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype unmarshals an instance of NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype from the specified map of raw messages. +func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleBeforePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + err = core.SDKErrorf(err, "", "destination-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + err = core.SDKErrorf(err, "", "source-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -129167,24 +143825,26 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolIcmpPrototype(m map[s // This model "extends" NetworkACLRulePrototype type NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype struct { // The action to perform for a packet matching the rule. + // + // Must not be `deny` if `protocol` is `icmp_tcp_udp`. Action *string `json:"action" validate:"required"` Before NetworkACLRuleBeforePrototypeIntf `json:"before,omitempty"` - // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all destination addresses. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. Direction *string `json:"direction" validate:"required"` - // The IP version for this rule. + // The IP version to match. The format of `source` and `destination` must match this property. IPVersion *string `json:"ip_version,omitempty"` // The name for this network ACL rule. The name must not be used by another rule for the network ACL. If unspecified, // the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` will match all source addresses. Source *string `json:"source" validate:"required"` // The inclusive upper bound of the TCP or UDP destination port range. @@ -129217,6 +143877,8 @@ type NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype struct { // Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.Action property. // The action to perform for a packet matching the rule. +// +// Must not be `deny` if `protocol` is `icmp_tcp_udp`. const ( NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeActionAllowConst = "allow" NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeActionDenyConst = "deny" @@ -129230,7 +143892,7 @@ const ( ) // Constants associated with the NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype.IPVersion property. -// The IP version for this rule. +// The IP version to match. The format of `source` and `destination` must match this property. const ( NetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototypeIPVersionIpv4Const = "ipv4" ) @@ -129329,9 +143991,9 @@ func UnmarshalNetworkACLRulePrototypeNetworkACLRuleProtocolTcpudpPrototype(m map return } -// NetworkACLRuleNetworkACLRuleProtocolAll : A rule for ICMP, TCP and UDP traffic. +// NetworkACLRuleNetworkACLRuleProtocolAny : NetworkACLRuleNetworkACLRuleProtocolAny struct // This model "extends" NetworkACLRule -type NetworkACLRuleNetworkACLRuleProtocolAll struct { +type NetworkACLRuleNetworkACLRuleProtocolAny struct { // The action to perform for a packet matching the rule. Action *string `json:"action" validate:"required"` @@ -129342,6 +144004,9 @@ type NetworkACLRuleNetworkACLRuleProtocolAll struct { CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. @@ -129354,51 +144019,60 @@ type NetworkACLRuleNetworkACLRuleProtocolAll struct { ID *string `json:"id" validate:"required"` // The IP version for this rule. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. IPVersion *string `json:"ip_version" validate:"required"` // The name for this network ACL rule. The name is unique across all rules for the network ACL. Name *string `json:"name" validate:"required"` // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. Source *string `json:"source" validate:"required"` // The network protocol. Protocol *string `json:"protocol" validate:"required"` } -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Action property. +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAny.Action property. // The action to perform for a packet matching the rule. const ( - NetworkACLRuleNetworkACLRuleProtocolAllActionAllowConst = "allow" - NetworkACLRuleNetworkACLRuleProtocolAllActionDenyConst = "deny" + NetworkACLRuleNetworkACLRuleProtocolAnyActionAllowConst = "allow" + NetworkACLRuleNetworkACLRuleProtocolAnyActionDenyConst = "deny" ) -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Direction property. +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAny.Direction property. // The direction of traffic to match. const ( - NetworkACLRuleNetworkACLRuleProtocolAllDirectionInboundConst = "inbound" - NetworkACLRuleNetworkACLRuleProtocolAllDirectionOutboundConst = "outbound" + NetworkACLRuleNetworkACLRuleProtocolAnyDirectionInboundConst = "inbound" + NetworkACLRuleNetworkACLRuleProtocolAnyDirectionOutboundConst = "outbound" ) -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.IPVersion property. +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAny.IPVersion property. // The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. const ( - NetworkACLRuleNetworkACLRuleProtocolAllIPVersionIpv4Const = "ipv4" + NetworkACLRuleNetworkACLRuleProtocolAnyIPVersionIpv4Const = "ipv4" ) -// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAll.Protocol property. +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolAny.Protocol property. // The network protocol. const ( - NetworkACLRuleNetworkACLRuleProtocolAllProtocolAllConst = "all" + NetworkACLRuleNetworkACLRuleProtocolAnyProtocolAnyConst = "any" ) -func (*NetworkACLRuleNetworkACLRuleProtocolAll) isaNetworkACLRule() bool { +func (*NetworkACLRuleNetworkACLRuleProtocolAny) isaNetworkACLRule() bool { return true } -// UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolAll from the specified map of raw messages. -func UnmarshalNetworkACLRuleNetworkACLRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(NetworkACLRuleNetworkACLRuleProtocolAll) +// UnmarshalNetworkACLRuleNetworkACLRuleProtocolAny unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolAny from the specified map of raw messages. +func UnmarshalNetworkACLRuleNetworkACLRuleProtocolAny(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleNetworkACLRuleProtocolAny) err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) @@ -129471,6 +144145,9 @@ type NetworkACLRuleNetworkACLRuleProtocolIcmp struct { CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. @@ -129483,12 +144160,18 @@ type NetworkACLRuleNetworkACLRuleProtocolIcmp struct { ID *string `json:"id" validate:"required"` // The IP version for this rule. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. IPVersion *string `json:"ip_version" validate:"required"` // The name for this network ACL rule. The name is unique across all rules for the network ACL. Name *string `json:"name" validate:"required"` // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. Source *string `json:"source" validate:"required"` // The ICMP traffic code to match. @@ -129521,6 +144204,9 @@ const ( // Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmp.IPVersion property. // The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. const ( NetworkACLRuleNetworkACLRuleProtocolIcmpIPVersionIpv4Const = "ipv4" ) @@ -129607,6 +144293,566 @@ func UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmp(m map[string]json.RawMess return } +// NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp : NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp struct +// This model "extends" NetworkACLRule +type NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp struct { + // The action to perform for a packet matching the rule. + 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 IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. + Destination *string `json:"destination" validate:"required"` + + // The direction of traffic to match. + 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. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. + IPVersion *string `json:"ip_version" validate:"required"` + + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. + Source *string `json:"source" validate:"required"` + + // The network protocol. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRuleNetworkACLRuleProtocolIcmptcpudpActionAllowConst = "allow" + NetworkACLRuleNetworkACLRuleProtocolIcmptcpudpActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleNetworkACLRuleProtocolIcmptcpudpDirectionInboundConst = "inbound" + NetworkACLRuleNetworkACLRuleProtocolIcmptcpudpDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp.IPVersion property. +// The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. +const ( + NetworkACLRuleNetworkACLRuleProtocolIcmptcpudpIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp.Protocol property. +// The network protocol. +const ( + NetworkACLRuleNetworkACLRuleProtocolIcmptcpudpProtocolIcmpTCPUDPConst = "icmp_tcp_udp" +) + +func (*NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp) isaNetworkACLRule() bool { + return true +} + +// UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmptcpudp unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp from the specified map of raw messages. +func UnmarshalNetworkACLRuleNetworkACLRuleProtocolIcmptcpudp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleNetworkACLRuleProtocolIcmptcpudp) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) + if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + err = core.SDKErrorf(err, "", "destination-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + err = core.SDKErrorf(err, "", "source-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// NetworkACLRuleNetworkACLRuleProtocolIndividual : NetworkACLRuleNetworkACLRuleProtocolIndividual struct +// This model "extends" NetworkACLRule +type NetworkACLRuleNetworkACLRuleProtocolIndividual struct { + // The action to perform for a packet matching the rule. + 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 IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. + Destination *string `json:"destination" validate:"required"` + + // The direction of traffic to match. + 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. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. + IPVersion *string `json:"ip_version" validate:"required"` + + // The name for this network ACL rule. The name is unique across all rules for the network ACL. + Name *string `json:"name" validate:"required"` + + // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. + Source *string `json:"source" validate:"required"` + + // The network protocol. + // + // The value must be the name of an individual protocol, excluding `icmp`, `tcp` and + // `udp`. Names for well known protocols are: + // - `ah`: AH (authentication header, protocol number `51`) + // - `esp`: ESP (encapsulating security payload, protocol number `50`) + // - `gre`: GRE (generic routing encapsulation, protocol number `47`) + // - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + // - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + // - `rsvp`: RSVP (reservation protocol, protocol number `46`) + // - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + // - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + // + // For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIndividual.Action property. +// The action to perform for a packet matching the rule. +const ( + NetworkACLRuleNetworkACLRuleProtocolIndividualActionAllowConst = "allow" + NetworkACLRuleNetworkACLRuleProtocolIndividualActionDenyConst = "deny" +) + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIndividual.Direction property. +// The direction of traffic to match. +const ( + NetworkACLRuleNetworkACLRuleProtocolIndividualDirectionInboundConst = "inbound" + NetworkACLRuleNetworkACLRuleProtocolIndividualDirectionOutboundConst = "outbound" +) + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIndividual.IPVersion property. +// The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. +const ( + NetworkACLRuleNetworkACLRuleProtocolIndividualIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the NetworkACLRuleNetworkACLRuleProtocolIndividual.Protocol property. +// The network protocol. +// +// The value must be the name of an individual protocol, excluding `icmp`, `tcp` and +// `udp`. Names for well known protocols are: +// - `ah`: AH (authentication header, protocol number `51`) +// - `esp`: ESP (encapsulating security payload, protocol number `50`) +// - `gre`: GRE (generic routing encapsulation, protocol number `47`) +// - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) +// - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) +// - `rsvp`: RSVP (reservation protocol, protocol number `46`) +// - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) +// - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) +// +// For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. +const ( + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolAhConst = "ah" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolEspConst = "esp" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolGreConst = "gre" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolIPInIPConst = "ip_in_ip" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolL2tpConst = "l2tp" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber0Const = "number_0" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber10Const = "number_10" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber100Const = "number_100" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber101Const = "number_101" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber102Const = "number_102" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber103Const = "number_103" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber104Const = "number_104" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber105Const = "number_105" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber106Const = "number_106" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber107Const = "number_107" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber108Const = "number_108" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber109Const = "number_109" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber11Const = "number_11" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber110Const = "number_110" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber111Const = "number_111" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber113Const = "number_113" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber114Const = "number_114" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber116Const = "number_116" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber117Const = "number_117" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber118Const = "number_118" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber119Const = "number_119" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber12Const = "number_12" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber120Const = "number_120" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber121Const = "number_121" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber122Const = "number_122" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber123Const = "number_123" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber124Const = "number_124" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber125Const = "number_125" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber126Const = "number_126" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber127Const = "number_127" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber128Const = "number_128" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber129Const = "number_129" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber13Const = "number_13" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber130Const = "number_130" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber131Const = "number_131" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber133Const = "number_133" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber134Const = "number_134" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber135Const = "number_135" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber136Const = "number_136" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber137Const = "number_137" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber138Const = "number_138" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber139Const = "number_139" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber14Const = "number_14" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber140Const = "number_140" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber141Const = "number_141" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber142Const = "number_142" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber143Const = "number_143" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber144Const = "number_144" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber145Const = "number_145" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber146Const = "number_146" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber147Const = "number_147" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber148Const = "number_148" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber149Const = "number_149" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber15Const = "number_15" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber150Const = "number_150" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber151Const = "number_151" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber152Const = "number_152" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber153Const = "number_153" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber154Const = "number_154" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber155Const = "number_155" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber156Const = "number_156" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber157Const = "number_157" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber158Const = "number_158" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber159Const = "number_159" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber16Const = "number_16" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber160Const = "number_160" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber161Const = "number_161" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber162Const = "number_162" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber163Const = "number_163" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber164Const = "number_164" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber165Const = "number_165" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber166Const = "number_166" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber167Const = "number_167" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber168Const = "number_168" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber169Const = "number_169" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber170Const = "number_170" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber171Const = "number_171" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber172Const = "number_172" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber173Const = "number_173" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber174Const = "number_174" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber175Const = "number_175" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber176Const = "number_176" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber177Const = "number_177" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber178Const = "number_178" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber179Const = "number_179" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber18Const = "number_18" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber180Const = "number_180" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber181Const = "number_181" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber182Const = "number_182" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber183Const = "number_183" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber184Const = "number_184" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber185Const = "number_185" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber186Const = "number_186" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber187Const = "number_187" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber188Const = "number_188" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber189Const = "number_189" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber19Const = "number_19" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber190Const = "number_190" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber191Const = "number_191" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber192Const = "number_192" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber193Const = "number_193" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber194Const = "number_194" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber195Const = "number_195" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber196Const = "number_196" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber197Const = "number_197" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber198Const = "number_198" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber199Const = "number_199" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber2Const = "number_2" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber20Const = "number_20" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber200Const = "number_200" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber201Const = "number_201" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber202Const = "number_202" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber203Const = "number_203" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber204Const = "number_204" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber205Const = "number_205" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber206Const = "number_206" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber207Const = "number_207" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber208Const = "number_208" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber209Const = "number_209" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber21Const = "number_21" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber210Const = "number_210" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber211Const = "number_211" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber212Const = "number_212" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber213Const = "number_213" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber214Const = "number_214" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber215Const = "number_215" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber216Const = "number_216" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber217Const = "number_217" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber218Const = "number_218" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber219Const = "number_219" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber22Const = "number_22" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber220Const = "number_220" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber221Const = "number_221" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber222Const = "number_222" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber223Const = "number_223" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber224Const = "number_224" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber225Const = "number_225" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber226Const = "number_226" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber227Const = "number_227" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber228Const = "number_228" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber229Const = "number_229" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber23Const = "number_23" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber230Const = "number_230" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber231Const = "number_231" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber232Const = "number_232" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber233Const = "number_233" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber234Const = "number_234" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber235Const = "number_235" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber236Const = "number_236" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber237Const = "number_237" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber238Const = "number_238" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber239Const = "number_239" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber24Const = "number_24" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber240Const = "number_240" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber241Const = "number_241" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber242Const = "number_242" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber243Const = "number_243" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber244Const = "number_244" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber245Const = "number_245" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber246Const = "number_246" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber247Const = "number_247" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber248Const = "number_248" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber249Const = "number_249" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber25Const = "number_25" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber250Const = "number_250" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber251Const = "number_251" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber252Const = "number_252" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber253Const = "number_253" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber254Const = "number_254" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber255Const = "number_255" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber26Const = "number_26" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber27Const = "number_27" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber28Const = "number_28" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber29Const = "number_29" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber3Const = "number_3" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber30Const = "number_30" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber31Const = "number_31" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber32Const = "number_32" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber33Const = "number_33" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber34Const = "number_34" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber35Const = "number_35" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber36Const = "number_36" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber37Const = "number_37" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber38Const = "number_38" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber39Const = "number_39" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber40Const = "number_40" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber41Const = "number_41" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber42Const = "number_42" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber43Const = "number_43" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber44Const = "number_44" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber45Const = "number_45" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber48Const = "number_48" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber49Const = "number_49" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber5Const = "number_5" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber52Const = "number_52" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber53Const = "number_53" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber54Const = "number_54" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber55Const = "number_55" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber56Const = "number_56" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber57Const = "number_57" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber58Const = "number_58" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber59Const = "number_59" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber60Const = "number_60" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber61Const = "number_61" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber62Const = "number_62" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber63Const = "number_63" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber64Const = "number_64" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber65Const = "number_65" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber66Const = "number_66" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber67Const = "number_67" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber68Const = "number_68" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber69Const = "number_69" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber7Const = "number_7" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber70Const = "number_70" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber71Const = "number_71" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber72Const = "number_72" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber73Const = "number_73" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber74Const = "number_74" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber75Const = "number_75" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber76Const = "number_76" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber77Const = "number_77" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber78Const = "number_78" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber79Const = "number_79" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber8Const = "number_8" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber80Const = "number_80" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber81Const = "number_81" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber82Const = "number_82" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber83Const = "number_83" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber84Const = "number_84" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber85Const = "number_85" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber86Const = "number_86" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber87Const = "number_87" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber88Const = "number_88" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber89Const = "number_89" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber9Const = "number_9" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber90Const = "number_90" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber91Const = "number_91" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber92Const = "number_92" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber93Const = "number_93" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber94Const = "number_94" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber95Const = "number_95" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber96Const = "number_96" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber97Const = "number_97" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber98Const = "number_98" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolNumber99Const = "number_99" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolRsvpConst = "rsvp" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolSctpConst = "sctp" + NetworkACLRuleNetworkACLRuleProtocolIndividualProtocolVrrpConst = "vrrp" +) + +func (*NetworkACLRuleNetworkACLRuleProtocolIndividual) isaNetworkACLRule() bool { + return true +} + +// UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual unmarshals an instance of NetworkACLRuleNetworkACLRuleProtocolIndividual from the specified map of raw messages. +func UnmarshalNetworkACLRuleNetworkACLRuleProtocolIndividual(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(NetworkACLRuleNetworkACLRuleProtocolIndividual) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "before", &obj.Before, UnmarshalNetworkACLRuleReference) + if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + err = core.SDKErrorf(err, "", "destination-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "source", &obj.Source) + if err != nil { + err = core.SDKErrorf(err, "", "source-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // NetworkACLRuleNetworkACLRuleProtocolTcpudp : A rule for TCP or UDP traffic. // This model "extends" NetworkACLRule type NetworkACLRuleNetworkACLRuleProtocolTcpudp struct { @@ -129620,6 +144866,9 @@ type NetworkACLRuleNetworkACLRuleProtocolTcpudp struct { CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // The destination IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses or + // CIDR blocks in the future. Destination *string `json:"destination" validate:"required"` // The direction of traffic to match. @@ -129632,12 +144881,18 @@ type NetworkACLRuleNetworkACLRuleProtocolTcpudp struct { ID *string `json:"id" validate:"required"` // The IP version for this rule. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. IPVersion *string `json:"ip_version" validate:"required"` // The name for this network ACL rule. The name is unique across all rules for the network ACL. Name *string `json:"name" validate:"required"` // The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. Source *string `json:"source" validate:"required"` // The inclusive upper bound of the TCP or UDP destination port range. @@ -129672,6 +144927,9 @@ const ( // Constants associated with the NetworkACLRuleNetworkACLRuleProtocolTcpudp.IPVersion property. // The IP version for this rule. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. const ( NetworkACLRuleNetworkACLRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" ) @@ -131761,19 +147019,16 @@ func UnmarshalSecurityGroupIdentityByID(m map[string]json.RawMessage, result int return } -// SecurityGroupRuleLocalPatchCIDR : SecurityGroupRuleLocalPatchCIDR struct +// SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype : SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype struct // This model "extends" SecurityGroupRuleLocalPatch -type SecurityGroupRuleLocalPatchCIDR struct { +type SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype struct { // The CIDR block. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. CIDRBlock *string `json:"cidr_block" validate:"required"` } -// NewSecurityGroupRuleLocalPatchCIDR : Instantiate SecurityGroupRuleLocalPatchCIDR (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleLocalPatchCIDR(cidrBlock string) (_model *SecurityGroupRuleLocalPatchCIDR, err error) { - _model = &SecurityGroupRuleLocalPatchCIDR{ +// NewSecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype : Instantiate SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype(cidrBlock string) (_model *SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype, err error) { + _model = &SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype{ CIDRBlock: core.StringPtr(cidrBlock), } err = core.ValidateStruct(_model, "required parameters") @@ -131783,13 +147038,13 @@ func (*VpcV1) NewSecurityGroupRuleLocalPatchCIDR(cidrBlock string) (_model *Secu return } -func (*SecurityGroupRuleLocalPatchCIDR) isaSecurityGroupRuleLocalPatch() bool { +func (*SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype) isaSecurityGroupRuleLocalPatch() bool { return true } -// UnmarshalSecurityGroupRuleLocalPatchCIDR unmarshals an instance of SecurityGroupRuleLocalPatchCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleLocalPatchCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleLocalPatchCIDR) +// UnmarshalSecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype unmarshals an instance of SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype) err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { err = core.SDKErrorf(err, "", "cidr_block-error", common.GetComponentInfo()) @@ -131799,29 +147054,26 @@ func UnmarshalSecurityGroupRuleLocalPatchCIDR(m map[string]json.RawMessage, resu return } -// asPatch returns a generic map representation of the SecurityGroupRuleLocalPatchCIDR -func (securityGroupRuleLocalPatchCIDR *SecurityGroupRuleLocalPatchCIDR) asPatch() (_patch map[string]interface{}) { +// asPatch returns a generic map representation of the SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype +func (securityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype *SecurityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype) asPatch() (_patch map[string]interface{}) { _patch = map[string]interface{}{} - if !core.IsNil(securityGroupRuleLocalPatchCIDR.CIDRBlock) { - _patch["cidr_block"] = securityGroupRuleLocalPatchCIDR.CIDRBlock + if !core.IsNil(securityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype.CIDRBlock) { + _patch["cidr_block"] = securityGroupRuleLocalPatchSecurityGroupRuleCIDRPrototype.CIDRBlock } return } -// SecurityGroupRuleLocalPatchIP : SecurityGroupRuleLocalPatchIP struct +// SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype : SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype struct // This model "extends" SecurityGroupRuleLocalPatch -type SecurityGroupRuleLocalPatchIP struct { +type SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype struct { // The IP address. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in - // the future. Address *string `json:"address" validate:"required"` } -// NewSecurityGroupRuleLocalPatchIP : Instantiate SecurityGroupRuleLocalPatchIP (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleLocalPatchIP(address string) (_model *SecurityGroupRuleLocalPatchIP, err error) { - _model = &SecurityGroupRuleLocalPatchIP{ +// NewSecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype : Instantiate SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype(address string) (_model *SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype, err error) { + _model = &SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype{ Address: core.StringPtr(address), } err = core.ValidateStruct(_model, "required parameters") @@ -131831,13 +147083,13 @@ func (*VpcV1) NewSecurityGroupRuleLocalPatchIP(address string) (_model *Security return } -func (*SecurityGroupRuleLocalPatchIP) isaSecurityGroupRuleLocalPatch() bool { +func (*SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype) isaSecurityGroupRuleLocalPatch() bool { return true } -// UnmarshalSecurityGroupRuleLocalPatchIP unmarshals an instance of SecurityGroupRuleLocalPatchIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleLocalPatchIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleLocalPatchIP) +// UnmarshalSecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype unmarshals an instance of SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype) err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) @@ -131847,29 +147099,26 @@ func UnmarshalSecurityGroupRuleLocalPatchIP(m map[string]json.RawMessage, result return } -// asPatch returns a generic map representation of the SecurityGroupRuleLocalPatchIP -func (securityGroupRuleLocalPatchIP *SecurityGroupRuleLocalPatchIP) asPatch() (_patch map[string]interface{}) { +// asPatch returns a generic map representation of the SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype +func (securityGroupRuleLocalPatchSecurityGroupRuleIPPrototype *SecurityGroupRuleLocalPatchSecurityGroupRuleIPPrototype) asPatch() (_patch map[string]interface{}) { _patch = map[string]interface{}{} - if !core.IsNil(securityGroupRuleLocalPatchIP.Address) { - _patch["address"] = securityGroupRuleLocalPatchIP.Address + if !core.IsNil(securityGroupRuleLocalPatchSecurityGroupRuleIPPrototype.Address) { + _patch["address"] = securityGroupRuleLocalPatchSecurityGroupRuleIPPrototype.Address } return } -// SecurityGroupRuleLocalPrototypeCIDR : SecurityGroupRuleLocalPrototypeCIDR struct +// SecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype : SecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype struct // This model "extends" SecurityGroupRuleLocalPrototype -type SecurityGroupRuleLocalPrototypeCIDR struct { +type SecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype struct { // The CIDR block. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. CIDRBlock *string `json:"cidr_block" validate:"required"` } -// NewSecurityGroupRuleLocalPrototypeCIDR : Instantiate SecurityGroupRuleLocalPrototypeCIDR (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleLocalPrototypeCIDR(cidrBlock string) (_model *SecurityGroupRuleLocalPrototypeCIDR, err error) { - _model = &SecurityGroupRuleLocalPrototypeCIDR{ +// NewSecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype : Instantiate SecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype(cidrBlock string) (_model *SecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype, err error) { + _model = &SecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype{ CIDRBlock: core.StringPtr(cidrBlock), } err = core.ValidateStruct(_model, "required parameters") @@ -131879,13 +147128,13 @@ func (*VpcV1) NewSecurityGroupRuleLocalPrototypeCIDR(cidrBlock string) (_model * return } -func (*SecurityGroupRuleLocalPrototypeCIDR) isaSecurityGroupRuleLocalPrototype() bool { +func (*SecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype) isaSecurityGroupRuleLocalPrototype() bool { return true } -// UnmarshalSecurityGroupRuleLocalPrototypeCIDR unmarshals an instance of SecurityGroupRuleLocalPrototypeCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleLocalPrototypeCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleLocalPrototypeCIDR) +// UnmarshalSecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype unmarshals an instance of SecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleLocalPrototypeSecurityGroupRuleCIDRPrototype) err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { err = core.SDKErrorf(err, "", "cidr_block-error", common.GetComponentInfo()) @@ -131895,19 +147144,16 @@ func UnmarshalSecurityGroupRuleLocalPrototypeCIDR(m map[string]json.RawMessage, return } -// SecurityGroupRuleLocalPrototypeIP : SecurityGroupRuleLocalPrototypeIP struct +// SecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype : SecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype struct // This model "extends" SecurityGroupRuleLocalPrototype -type SecurityGroupRuleLocalPrototypeIP struct { +type SecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype struct { // The IP address. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in - // the future. Address *string `json:"address" validate:"required"` } -// NewSecurityGroupRuleLocalPrototypeIP : Instantiate SecurityGroupRuleLocalPrototypeIP (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleLocalPrototypeIP(address string) (_model *SecurityGroupRuleLocalPrototypeIP, err error) { - _model = &SecurityGroupRuleLocalPrototypeIP{ +// NewSecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype : Instantiate SecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype(address string) (_model *SecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype, err error) { + _model = &SecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype{ Address: core.StringPtr(address), } err = core.ValidateStruct(_model, "required parameters") @@ -131917,13 +147163,13 @@ func (*VpcV1) NewSecurityGroupRuleLocalPrototypeIP(address string) (_model *Secu return } -func (*SecurityGroupRuleLocalPrototypeIP) isaSecurityGroupRuleLocalPrototype() bool { +func (*SecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype) isaSecurityGroupRuleLocalPrototype() bool { return true } -// UnmarshalSecurityGroupRuleLocalPrototypeIP unmarshals an instance of SecurityGroupRuleLocalPrototypeIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleLocalPrototypeIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleLocalPrototypeIP) +// UnmarshalSecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype unmarshals an instance of SecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleLocalPrototypeSecurityGroupRuleIPPrototype) err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) @@ -131933,23 +147179,23 @@ func UnmarshalSecurityGroupRuleLocalPrototypeIP(m map[string]json.RawMessage, re return } -// SecurityGroupRuleLocalCIDR : SecurityGroupRuleLocalCIDR struct +// SecurityGroupRuleLocalSecurityGroupRuleCIDR : SecurityGroupRuleLocalSecurityGroupRuleCIDR struct // This model "extends" SecurityGroupRuleLocal -type SecurityGroupRuleLocalCIDR struct { +type SecurityGroupRuleLocalSecurityGroupRuleCIDR struct { // The CIDR block. // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. CIDRBlock *string `json:"cidr_block" validate:"required"` } -func (*SecurityGroupRuleLocalCIDR) isaSecurityGroupRuleLocal() bool { +func (*SecurityGroupRuleLocalSecurityGroupRuleCIDR) isaSecurityGroupRuleLocal() bool { return true } -// UnmarshalSecurityGroupRuleLocalCIDR unmarshals an instance of SecurityGroupRuleLocalCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleLocalCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleLocalCIDR) +// UnmarshalSecurityGroupRuleLocalSecurityGroupRuleCIDR unmarshals an instance of SecurityGroupRuleLocalSecurityGroupRuleCIDR from the specified map of raw messages. +func UnmarshalSecurityGroupRuleLocalSecurityGroupRuleCIDR(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleLocalSecurityGroupRuleCIDR) err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { err = core.SDKErrorf(err, "", "cidr_block-error", common.GetComponentInfo()) @@ -131959,9 +147205,9 @@ func UnmarshalSecurityGroupRuleLocalCIDR(m map[string]json.RawMessage, result in return } -// SecurityGroupRuleLocalIP : SecurityGroupRuleLocalIP struct +// SecurityGroupRuleLocalSecurityGroupRuleIP : SecurityGroupRuleLocalSecurityGroupRuleIP struct // This model "extends" SecurityGroupRuleLocal -type SecurityGroupRuleLocalIP struct { +type SecurityGroupRuleLocalSecurityGroupRuleIP struct { // The IP address. // // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in @@ -131969,13 +147215,13 @@ type SecurityGroupRuleLocalIP struct { Address *string `json:"address" validate:"required"` } -func (*SecurityGroupRuleLocalIP) isaSecurityGroupRuleLocal() bool { +func (*SecurityGroupRuleLocalSecurityGroupRuleIP) isaSecurityGroupRuleLocal() bool { return true } -// UnmarshalSecurityGroupRuleLocalIP unmarshals an instance of SecurityGroupRuleLocalIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleLocalIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleLocalIP) +// UnmarshalSecurityGroupRuleLocalSecurityGroupRuleIP unmarshals an instance of SecurityGroupRuleLocalSecurityGroupRuleIP from the specified map of raw messages. +func UnmarshalSecurityGroupRuleLocalSecurityGroupRuleIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleLocalSecurityGroupRuleIP) err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) @@ -131985,90 +147231,641 @@ func UnmarshalSecurityGroupRuleLocalIP(m map[string]json.RawMessage, result inte return } -// SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll : A rule allowing ICMP, TCP and UDP traffic. -// This model "extends" SecurityGroupRulePrototype -type SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll struct { +// SecurityGroupRuleProtocolAny : A rule allowing traffic for any protocol. +// This model "extends" SecurityGroupRule +type SecurityGroupRuleProtocolAny struct { // The direction of traffic to allow. Direction *string `json:"direction" validate:"required"` - // The IP version to allow. The format of `local.address`, `remote.address`, - // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. + // The URL for this security group rule. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this security group rule. + ID *string `json:"id" validate:"required"` + + // The IP version to allow. // // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP // version. - IPVersion *string `json:"ip_version,omitempty"` + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. + IPVersion *string `json:"ip_version" validate:"required"` - Local SecurityGroupRuleLocalPrototypeIntf `json:"local,omitempty"` + Local SecurityGroupRuleLocalIntf `json:"local" validate:"required"` - Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` + // The name for this security group rule. The name is unique across all rules in the security group. + Name *string `json:"name" validate:"required"` + + Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` // The network protocol. Protocol *string `json:"protocol" validate:"required"` } -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Direction property. +// Constants associated with the SecurityGroupRuleProtocolAny.Direction property. // The direction of traffic to allow. const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllDirectionInboundConst = "inbound" - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllDirectionOutboundConst = "outbound" + SecurityGroupRuleProtocolAnyDirectionInboundConst = "inbound" + SecurityGroupRuleProtocolAnyDirectionOutboundConst = "outbound" ) -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.IPVersion property. -// The IP version to allow. The format of `local.address`, `remote.address`, -// `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. +// Constants associated with the SecurityGroupRuleProtocolAny.IPVersion property. +// The IP version to allow. // // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP // version. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. +const ( + SecurityGroupRuleProtocolAnyIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the SecurityGroupRuleProtocolAny.ResourceType property. +// The resource type. const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllIPVersionIpv4Const = "ipv4" + SecurityGroupRuleProtocolAnyResourceTypeSecurityGroupRuleConst = "security_group_rule" ) -// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Protocol property. +// Constants associated with the SecurityGroupRuleProtocolAny.Protocol property. // The network protocol. const ( - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllProtocolAllConst = "all" + SecurityGroupRuleProtocolAnyProtocolAnyConst = "any" ) -// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll, err error) { - _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll{ - Direction: core.StringPtr(direction), - Protocol: core.StringPtr(protocol), +func (*SecurityGroupRuleProtocolAny) isaSecurityGroupRule() bool { + return true +} + +// UnmarshalSecurityGroupRuleProtocolAny unmarshals an instance of SecurityGroupRuleProtocolAny from the specified map of raw messages. +func UnmarshalSecurityGroupRuleProtocolAny(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleProtocolAny) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return } - err = core.ValidateStruct(_model, "required parameters") + err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalSecurityGroupRuleLocal) + if err != nil { + err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) + if err != nil { + err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) isaSecurityGroupRulePrototype() bool { +// SecurityGroupRuleProtocolIcmptcpudp : A rule allowing ICMP, TCP and UDP traffic. +// This model "extends" SecurityGroupRule +type SecurityGroupRuleProtocolIcmptcpudp struct { + // The direction of traffic to allow. + Direction *string `json:"direction" validate:"required"` + + // The URL for this security group rule. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this security group rule. + ID *string `json:"id" validate:"required"` + + // The IP version to allow. + // + // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP + // version. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. + IPVersion *string `json:"ip_version" validate:"required"` + + Local SecurityGroupRuleLocalIntf `json:"local" validate:"required"` + + // The name for this security group rule. The name is unique across all rules in the security group. + Name *string `json:"name" validate:"required"` + + Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The network protocol. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the SecurityGroupRuleProtocolIcmptcpudp.Direction property. +// The direction of traffic to allow. +const ( + SecurityGroupRuleProtocolIcmptcpudpDirectionInboundConst = "inbound" + SecurityGroupRuleProtocolIcmptcpudpDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRuleProtocolIcmptcpudp.IPVersion property. +// The IP version to allow. +// +// If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP +// version. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. +const ( + SecurityGroupRuleProtocolIcmptcpudpIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the SecurityGroupRuleProtocolIcmptcpudp.ResourceType property. +// The resource type. +const ( + SecurityGroupRuleProtocolIcmptcpudpResourceTypeSecurityGroupRuleConst = "security_group_rule" +) + +// Constants associated with the SecurityGroupRuleProtocolIcmptcpudp.Protocol property. +// The network protocol. +const ( + SecurityGroupRuleProtocolIcmptcpudpProtocolIcmpTCPUDPConst = "icmp_tcp_udp" +) + +func (*SecurityGroupRuleProtocolIcmptcpudp) isaSecurityGroupRule() bool { return true } -// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll from the specified map of raw messages. -func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll) +// UnmarshalSecurityGroupRuleProtocolIcmptcpudp unmarshals an instance of SecurityGroupRuleProtocolIcmptcpudp from the specified map of raw messages. +func UnmarshalSecurityGroupRuleProtocolIcmptcpudp(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleProtocolIcmptcpudp) err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) if err != nil { err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalSecurityGroupRuleLocalPrototype) + err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalSecurityGroupRuleLocal) if err != nil { err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) + if err != nil { + err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupRuleProtocolIndividual : A rule allowing traffic for one protocol (other than ICMP, TCP or UDP). +// This model "extends" SecurityGroupRule +type SecurityGroupRuleProtocolIndividual struct { + // The direction of traffic to allow. + Direction *string `json:"direction" validate:"required"` + + // The URL for this security group rule. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this security group rule. + ID *string `json:"id" validate:"required"` + + // The IP version to allow. + // + // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP + // version. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. + IPVersion *string `json:"ip_version" validate:"required"` + + Local SecurityGroupRuleLocalIntf `json:"local" validate:"required"` + + // The name for this security group rule. The name is unique across all rules in the security group. + Name *string `json:"name" validate:"required"` + + Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The network protocol to allow. + // + // The value must be the name of an individual protocol, excluding `icmp`, `tcp` and + // `udp`. Names for well known protocols are: + // - `ah`: AH (authentication header, protocol number `51`) + // - `esp`: ESP (encapsulating security payload, protocol number `50`) + // - `gre`: GRE (generic routing encapsulation, protocol number `47`) + // - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + // - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + // - `rsvp`: RSVP (reservation protocol, protocol number `46`) + // - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + // - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + // + // For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the SecurityGroupRuleProtocolIndividual.Direction property. +// The direction of traffic to allow. +const ( + SecurityGroupRuleProtocolIndividualDirectionInboundConst = "inbound" + SecurityGroupRuleProtocolIndividualDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRuleProtocolIndividual.IPVersion property. +// The IP version to allow. +// +// If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP +// version. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. +const ( + SecurityGroupRuleProtocolIndividualIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the SecurityGroupRuleProtocolIndividual.ResourceType property. +// The resource type. +const ( + SecurityGroupRuleProtocolIndividualResourceTypeSecurityGroupRuleConst = "security_group_rule" +) + +// Constants associated with the SecurityGroupRuleProtocolIndividual.Protocol property. +// The network protocol to allow. +// +// The value must be the name of an individual protocol, excluding `icmp`, `tcp` and +// `udp`. Names for well known protocols are: +// - `ah`: AH (authentication header, protocol number `51`) +// - `esp`: ESP (encapsulating security payload, protocol number `50`) +// - `gre`: GRE (generic routing encapsulation, protocol number `47`) +// - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) +// - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) +// - `rsvp`: RSVP (reservation protocol, protocol number `46`) +// - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) +// - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) +// +// For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. +const ( + SecurityGroupRuleProtocolIndividualProtocolAhConst = "ah" + SecurityGroupRuleProtocolIndividualProtocolEspConst = "esp" + SecurityGroupRuleProtocolIndividualProtocolGreConst = "gre" + SecurityGroupRuleProtocolIndividualProtocolIPInIPConst = "ip_in_ip" + SecurityGroupRuleProtocolIndividualProtocolL2tpConst = "l2tp" + SecurityGroupRuleProtocolIndividualProtocolNumber0Const = "number_0" + SecurityGroupRuleProtocolIndividualProtocolNumber10Const = "number_10" + SecurityGroupRuleProtocolIndividualProtocolNumber100Const = "number_100" + SecurityGroupRuleProtocolIndividualProtocolNumber101Const = "number_101" + SecurityGroupRuleProtocolIndividualProtocolNumber102Const = "number_102" + SecurityGroupRuleProtocolIndividualProtocolNumber103Const = "number_103" + SecurityGroupRuleProtocolIndividualProtocolNumber104Const = "number_104" + SecurityGroupRuleProtocolIndividualProtocolNumber105Const = "number_105" + SecurityGroupRuleProtocolIndividualProtocolNumber106Const = "number_106" + SecurityGroupRuleProtocolIndividualProtocolNumber107Const = "number_107" + SecurityGroupRuleProtocolIndividualProtocolNumber108Const = "number_108" + SecurityGroupRuleProtocolIndividualProtocolNumber109Const = "number_109" + SecurityGroupRuleProtocolIndividualProtocolNumber11Const = "number_11" + SecurityGroupRuleProtocolIndividualProtocolNumber110Const = "number_110" + SecurityGroupRuleProtocolIndividualProtocolNumber111Const = "number_111" + SecurityGroupRuleProtocolIndividualProtocolNumber113Const = "number_113" + SecurityGroupRuleProtocolIndividualProtocolNumber114Const = "number_114" + SecurityGroupRuleProtocolIndividualProtocolNumber116Const = "number_116" + SecurityGroupRuleProtocolIndividualProtocolNumber117Const = "number_117" + SecurityGroupRuleProtocolIndividualProtocolNumber118Const = "number_118" + SecurityGroupRuleProtocolIndividualProtocolNumber119Const = "number_119" + SecurityGroupRuleProtocolIndividualProtocolNumber12Const = "number_12" + SecurityGroupRuleProtocolIndividualProtocolNumber120Const = "number_120" + SecurityGroupRuleProtocolIndividualProtocolNumber121Const = "number_121" + SecurityGroupRuleProtocolIndividualProtocolNumber122Const = "number_122" + SecurityGroupRuleProtocolIndividualProtocolNumber123Const = "number_123" + SecurityGroupRuleProtocolIndividualProtocolNumber124Const = "number_124" + SecurityGroupRuleProtocolIndividualProtocolNumber125Const = "number_125" + SecurityGroupRuleProtocolIndividualProtocolNumber126Const = "number_126" + SecurityGroupRuleProtocolIndividualProtocolNumber127Const = "number_127" + SecurityGroupRuleProtocolIndividualProtocolNumber128Const = "number_128" + SecurityGroupRuleProtocolIndividualProtocolNumber129Const = "number_129" + SecurityGroupRuleProtocolIndividualProtocolNumber13Const = "number_13" + SecurityGroupRuleProtocolIndividualProtocolNumber130Const = "number_130" + SecurityGroupRuleProtocolIndividualProtocolNumber131Const = "number_131" + SecurityGroupRuleProtocolIndividualProtocolNumber133Const = "number_133" + SecurityGroupRuleProtocolIndividualProtocolNumber134Const = "number_134" + SecurityGroupRuleProtocolIndividualProtocolNumber135Const = "number_135" + SecurityGroupRuleProtocolIndividualProtocolNumber136Const = "number_136" + SecurityGroupRuleProtocolIndividualProtocolNumber137Const = "number_137" + SecurityGroupRuleProtocolIndividualProtocolNumber138Const = "number_138" + SecurityGroupRuleProtocolIndividualProtocolNumber139Const = "number_139" + SecurityGroupRuleProtocolIndividualProtocolNumber14Const = "number_14" + SecurityGroupRuleProtocolIndividualProtocolNumber140Const = "number_140" + SecurityGroupRuleProtocolIndividualProtocolNumber141Const = "number_141" + SecurityGroupRuleProtocolIndividualProtocolNumber142Const = "number_142" + SecurityGroupRuleProtocolIndividualProtocolNumber143Const = "number_143" + SecurityGroupRuleProtocolIndividualProtocolNumber144Const = "number_144" + SecurityGroupRuleProtocolIndividualProtocolNumber145Const = "number_145" + SecurityGroupRuleProtocolIndividualProtocolNumber146Const = "number_146" + SecurityGroupRuleProtocolIndividualProtocolNumber147Const = "number_147" + SecurityGroupRuleProtocolIndividualProtocolNumber148Const = "number_148" + SecurityGroupRuleProtocolIndividualProtocolNumber149Const = "number_149" + SecurityGroupRuleProtocolIndividualProtocolNumber15Const = "number_15" + SecurityGroupRuleProtocolIndividualProtocolNumber150Const = "number_150" + SecurityGroupRuleProtocolIndividualProtocolNumber151Const = "number_151" + SecurityGroupRuleProtocolIndividualProtocolNumber152Const = "number_152" + SecurityGroupRuleProtocolIndividualProtocolNumber153Const = "number_153" + SecurityGroupRuleProtocolIndividualProtocolNumber154Const = "number_154" + SecurityGroupRuleProtocolIndividualProtocolNumber155Const = "number_155" + SecurityGroupRuleProtocolIndividualProtocolNumber156Const = "number_156" + SecurityGroupRuleProtocolIndividualProtocolNumber157Const = "number_157" + SecurityGroupRuleProtocolIndividualProtocolNumber158Const = "number_158" + SecurityGroupRuleProtocolIndividualProtocolNumber159Const = "number_159" + SecurityGroupRuleProtocolIndividualProtocolNumber16Const = "number_16" + SecurityGroupRuleProtocolIndividualProtocolNumber160Const = "number_160" + SecurityGroupRuleProtocolIndividualProtocolNumber161Const = "number_161" + SecurityGroupRuleProtocolIndividualProtocolNumber162Const = "number_162" + SecurityGroupRuleProtocolIndividualProtocolNumber163Const = "number_163" + SecurityGroupRuleProtocolIndividualProtocolNumber164Const = "number_164" + SecurityGroupRuleProtocolIndividualProtocolNumber165Const = "number_165" + SecurityGroupRuleProtocolIndividualProtocolNumber166Const = "number_166" + SecurityGroupRuleProtocolIndividualProtocolNumber167Const = "number_167" + SecurityGroupRuleProtocolIndividualProtocolNumber168Const = "number_168" + SecurityGroupRuleProtocolIndividualProtocolNumber169Const = "number_169" + SecurityGroupRuleProtocolIndividualProtocolNumber170Const = "number_170" + SecurityGroupRuleProtocolIndividualProtocolNumber171Const = "number_171" + SecurityGroupRuleProtocolIndividualProtocolNumber172Const = "number_172" + SecurityGroupRuleProtocolIndividualProtocolNumber173Const = "number_173" + SecurityGroupRuleProtocolIndividualProtocolNumber174Const = "number_174" + SecurityGroupRuleProtocolIndividualProtocolNumber175Const = "number_175" + SecurityGroupRuleProtocolIndividualProtocolNumber176Const = "number_176" + SecurityGroupRuleProtocolIndividualProtocolNumber177Const = "number_177" + SecurityGroupRuleProtocolIndividualProtocolNumber178Const = "number_178" + SecurityGroupRuleProtocolIndividualProtocolNumber179Const = "number_179" + SecurityGroupRuleProtocolIndividualProtocolNumber18Const = "number_18" + SecurityGroupRuleProtocolIndividualProtocolNumber180Const = "number_180" + SecurityGroupRuleProtocolIndividualProtocolNumber181Const = "number_181" + SecurityGroupRuleProtocolIndividualProtocolNumber182Const = "number_182" + SecurityGroupRuleProtocolIndividualProtocolNumber183Const = "number_183" + SecurityGroupRuleProtocolIndividualProtocolNumber184Const = "number_184" + SecurityGroupRuleProtocolIndividualProtocolNumber185Const = "number_185" + SecurityGroupRuleProtocolIndividualProtocolNumber186Const = "number_186" + SecurityGroupRuleProtocolIndividualProtocolNumber187Const = "number_187" + SecurityGroupRuleProtocolIndividualProtocolNumber188Const = "number_188" + SecurityGroupRuleProtocolIndividualProtocolNumber189Const = "number_189" + SecurityGroupRuleProtocolIndividualProtocolNumber19Const = "number_19" + SecurityGroupRuleProtocolIndividualProtocolNumber190Const = "number_190" + SecurityGroupRuleProtocolIndividualProtocolNumber191Const = "number_191" + SecurityGroupRuleProtocolIndividualProtocolNumber192Const = "number_192" + SecurityGroupRuleProtocolIndividualProtocolNumber193Const = "number_193" + SecurityGroupRuleProtocolIndividualProtocolNumber194Const = "number_194" + SecurityGroupRuleProtocolIndividualProtocolNumber195Const = "number_195" + SecurityGroupRuleProtocolIndividualProtocolNumber196Const = "number_196" + SecurityGroupRuleProtocolIndividualProtocolNumber197Const = "number_197" + SecurityGroupRuleProtocolIndividualProtocolNumber198Const = "number_198" + SecurityGroupRuleProtocolIndividualProtocolNumber199Const = "number_199" + SecurityGroupRuleProtocolIndividualProtocolNumber2Const = "number_2" + SecurityGroupRuleProtocolIndividualProtocolNumber20Const = "number_20" + SecurityGroupRuleProtocolIndividualProtocolNumber200Const = "number_200" + SecurityGroupRuleProtocolIndividualProtocolNumber201Const = "number_201" + SecurityGroupRuleProtocolIndividualProtocolNumber202Const = "number_202" + SecurityGroupRuleProtocolIndividualProtocolNumber203Const = "number_203" + SecurityGroupRuleProtocolIndividualProtocolNumber204Const = "number_204" + SecurityGroupRuleProtocolIndividualProtocolNumber205Const = "number_205" + SecurityGroupRuleProtocolIndividualProtocolNumber206Const = "number_206" + SecurityGroupRuleProtocolIndividualProtocolNumber207Const = "number_207" + SecurityGroupRuleProtocolIndividualProtocolNumber208Const = "number_208" + SecurityGroupRuleProtocolIndividualProtocolNumber209Const = "number_209" + SecurityGroupRuleProtocolIndividualProtocolNumber21Const = "number_21" + SecurityGroupRuleProtocolIndividualProtocolNumber210Const = "number_210" + SecurityGroupRuleProtocolIndividualProtocolNumber211Const = "number_211" + SecurityGroupRuleProtocolIndividualProtocolNumber212Const = "number_212" + SecurityGroupRuleProtocolIndividualProtocolNumber213Const = "number_213" + SecurityGroupRuleProtocolIndividualProtocolNumber214Const = "number_214" + SecurityGroupRuleProtocolIndividualProtocolNumber215Const = "number_215" + SecurityGroupRuleProtocolIndividualProtocolNumber216Const = "number_216" + SecurityGroupRuleProtocolIndividualProtocolNumber217Const = "number_217" + SecurityGroupRuleProtocolIndividualProtocolNumber218Const = "number_218" + SecurityGroupRuleProtocolIndividualProtocolNumber219Const = "number_219" + SecurityGroupRuleProtocolIndividualProtocolNumber22Const = "number_22" + SecurityGroupRuleProtocolIndividualProtocolNumber220Const = "number_220" + SecurityGroupRuleProtocolIndividualProtocolNumber221Const = "number_221" + SecurityGroupRuleProtocolIndividualProtocolNumber222Const = "number_222" + SecurityGroupRuleProtocolIndividualProtocolNumber223Const = "number_223" + SecurityGroupRuleProtocolIndividualProtocolNumber224Const = "number_224" + SecurityGroupRuleProtocolIndividualProtocolNumber225Const = "number_225" + SecurityGroupRuleProtocolIndividualProtocolNumber226Const = "number_226" + SecurityGroupRuleProtocolIndividualProtocolNumber227Const = "number_227" + SecurityGroupRuleProtocolIndividualProtocolNumber228Const = "number_228" + SecurityGroupRuleProtocolIndividualProtocolNumber229Const = "number_229" + SecurityGroupRuleProtocolIndividualProtocolNumber23Const = "number_23" + SecurityGroupRuleProtocolIndividualProtocolNumber230Const = "number_230" + SecurityGroupRuleProtocolIndividualProtocolNumber231Const = "number_231" + SecurityGroupRuleProtocolIndividualProtocolNumber232Const = "number_232" + SecurityGroupRuleProtocolIndividualProtocolNumber233Const = "number_233" + SecurityGroupRuleProtocolIndividualProtocolNumber234Const = "number_234" + SecurityGroupRuleProtocolIndividualProtocolNumber235Const = "number_235" + SecurityGroupRuleProtocolIndividualProtocolNumber236Const = "number_236" + SecurityGroupRuleProtocolIndividualProtocolNumber237Const = "number_237" + SecurityGroupRuleProtocolIndividualProtocolNumber238Const = "number_238" + SecurityGroupRuleProtocolIndividualProtocolNumber239Const = "number_239" + SecurityGroupRuleProtocolIndividualProtocolNumber24Const = "number_24" + SecurityGroupRuleProtocolIndividualProtocolNumber240Const = "number_240" + SecurityGroupRuleProtocolIndividualProtocolNumber241Const = "number_241" + SecurityGroupRuleProtocolIndividualProtocolNumber242Const = "number_242" + SecurityGroupRuleProtocolIndividualProtocolNumber243Const = "number_243" + SecurityGroupRuleProtocolIndividualProtocolNumber244Const = "number_244" + SecurityGroupRuleProtocolIndividualProtocolNumber245Const = "number_245" + SecurityGroupRuleProtocolIndividualProtocolNumber246Const = "number_246" + SecurityGroupRuleProtocolIndividualProtocolNumber247Const = "number_247" + SecurityGroupRuleProtocolIndividualProtocolNumber248Const = "number_248" + SecurityGroupRuleProtocolIndividualProtocolNumber249Const = "number_249" + SecurityGroupRuleProtocolIndividualProtocolNumber25Const = "number_25" + SecurityGroupRuleProtocolIndividualProtocolNumber250Const = "number_250" + SecurityGroupRuleProtocolIndividualProtocolNumber251Const = "number_251" + SecurityGroupRuleProtocolIndividualProtocolNumber252Const = "number_252" + SecurityGroupRuleProtocolIndividualProtocolNumber253Const = "number_253" + SecurityGroupRuleProtocolIndividualProtocolNumber254Const = "number_254" + SecurityGroupRuleProtocolIndividualProtocolNumber255Const = "number_255" + SecurityGroupRuleProtocolIndividualProtocolNumber26Const = "number_26" + SecurityGroupRuleProtocolIndividualProtocolNumber27Const = "number_27" + SecurityGroupRuleProtocolIndividualProtocolNumber28Const = "number_28" + SecurityGroupRuleProtocolIndividualProtocolNumber29Const = "number_29" + SecurityGroupRuleProtocolIndividualProtocolNumber3Const = "number_3" + SecurityGroupRuleProtocolIndividualProtocolNumber30Const = "number_30" + SecurityGroupRuleProtocolIndividualProtocolNumber31Const = "number_31" + SecurityGroupRuleProtocolIndividualProtocolNumber32Const = "number_32" + SecurityGroupRuleProtocolIndividualProtocolNumber33Const = "number_33" + SecurityGroupRuleProtocolIndividualProtocolNumber34Const = "number_34" + SecurityGroupRuleProtocolIndividualProtocolNumber35Const = "number_35" + SecurityGroupRuleProtocolIndividualProtocolNumber36Const = "number_36" + SecurityGroupRuleProtocolIndividualProtocolNumber37Const = "number_37" + SecurityGroupRuleProtocolIndividualProtocolNumber38Const = "number_38" + SecurityGroupRuleProtocolIndividualProtocolNumber39Const = "number_39" + SecurityGroupRuleProtocolIndividualProtocolNumber40Const = "number_40" + SecurityGroupRuleProtocolIndividualProtocolNumber41Const = "number_41" + SecurityGroupRuleProtocolIndividualProtocolNumber42Const = "number_42" + SecurityGroupRuleProtocolIndividualProtocolNumber43Const = "number_43" + SecurityGroupRuleProtocolIndividualProtocolNumber44Const = "number_44" + SecurityGroupRuleProtocolIndividualProtocolNumber45Const = "number_45" + SecurityGroupRuleProtocolIndividualProtocolNumber48Const = "number_48" + SecurityGroupRuleProtocolIndividualProtocolNumber49Const = "number_49" + SecurityGroupRuleProtocolIndividualProtocolNumber5Const = "number_5" + SecurityGroupRuleProtocolIndividualProtocolNumber52Const = "number_52" + SecurityGroupRuleProtocolIndividualProtocolNumber53Const = "number_53" + SecurityGroupRuleProtocolIndividualProtocolNumber54Const = "number_54" + SecurityGroupRuleProtocolIndividualProtocolNumber55Const = "number_55" + SecurityGroupRuleProtocolIndividualProtocolNumber56Const = "number_56" + SecurityGroupRuleProtocolIndividualProtocolNumber57Const = "number_57" + SecurityGroupRuleProtocolIndividualProtocolNumber58Const = "number_58" + SecurityGroupRuleProtocolIndividualProtocolNumber59Const = "number_59" + SecurityGroupRuleProtocolIndividualProtocolNumber60Const = "number_60" + SecurityGroupRuleProtocolIndividualProtocolNumber61Const = "number_61" + SecurityGroupRuleProtocolIndividualProtocolNumber62Const = "number_62" + SecurityGroupRuleProtocolIndividualProtocolNumber63Const = "number_63" + SecurityGroupRuleProtocolIndividualProtocolNumber64Const = "number_64" + SecurityGroupRuleProtocolIndividualProtocolNumber65Const = "number_65" + SecurityGroupRuleProtocolIndividualProtocolNumber66Const = "number_66" + SecurityGroupRuleProtocolIndividualProtocolNumber67Const = "number_67" + SecurityGroupRuleProtocolIndividualProtocolNumber68Const = "number_68" + SecurityGroupRuleProtocolIndividualProtocolNumber69Const = "number_69" + SecurityGroupRuleProtocolIndividualProtocolNumber7Const = "number_7" + SecurityGroupRuleProtocolIndividualProtocolNumber70Const = "number_70" + SecurityGroupRuleProtocolIndividualProtocolNumber71Const = "number_71" + SecurityGroupRuleProtocolIndividualProtocolNumber72Const = "number_72" + SecurityGroupRuleProtocolIndividualProtocolNumber73Const = "number_73" + SecurityGroupRuleProtocolIndividualProtocolNumber74Const = "number_74" + SecurityGroupRuleProtocolIndividualProtocolNumber75Const = "number_75" + SecurityGroupRuleProtocolIndividualProtocolNumber76Const = "number_76" + SecurityGroupRuleProtocolIndividualProtocolNumber77Const = "number_77" + SecurityGroupRuleProtocolIndividualProtocolNumber78Const = "number_78" + SecurityGroupRuleProtocolIndividualProtocolNumber79Const = "number_79" + SecurityGroupRuleProtocolIndividualProtocolNumber8Const = "number_8" + SecurityGroupRuleProtocolIndividualProtocolNumber80Const = "number_80" + SecurityGroupRuleProtocolIndividualProtocolNumber81Const = "number_81" + SecurityGroupRuleProtocolIndividualProtocolNumber82Const = "number_82" + SecurityGroupRuleProtocolIndividualProtocolNumber83Const = "number_83" + SecurityGroupRuleProtocolIndividualProtocolNumber84Const = "number_84" + SecurityGroupRuleProtocolIndividualProtocolNumber85Const = "number_85" + SecurityGroupRuleProtocolIndividualProtocolNumber86Const = "number_86" + SecurityGroupRuleProtocolIndividualProtocolNumber87Const = "number_87" + SecurityGroupRuleProtocolIndividualProtocolNumber88Const = "number_88" + SecurityGroupRuleProtocolIndividualProtocolNumber89Const = "number_89" + SecurityGroupRuleProtocolIndividualProtocolNumber9Const = "number_9" + SecurityGroupRuleProtocolIndividualProtocolNumber90Const = "number_90" + SecurityGroupRuleProtocolIndividualProtocolNumber91Const = "number_91" + SecurityGroupRuleProtocolIndividualProtocolNumber92Const = "number_92" + SecurityGroupRuleProtocolIndividualProtocolNumber93Const = "number_93" + SecurityGroupRuleProtocolIndividualProtocolNumber94Const = "number_94" + SecurityGroupRuleProtocolIndividualProtocolNumber95Const = "number_95" + SecurityGroupRuleProtocolIndividualProtocolNumber96Const = "number_96" + SecurityGroupRuleProtocolIndividualProtocolNumber97Const = "number_97" + SecurityGroupRuleProtocolIndividualProtocolNumber98Const = "number_98" + SecurityGroupRuleProtocolIndividualProtocolNumber99Const = "number_99" + SecurityGroupRuleProtocolIndividualProtocolRsvpConst = "rsvp" + SecurityGroupRuleProtocolIndividualProtocolSctpConst = "sctp" + SecurityGroupRuleProtocolIndividualProtocolVrrpConst = "vrrp" +) + +func (*SecurityGroupRuleProtocolIndividual) isaSecurityGroupRule() bool { + return true +} + +// UnmarshalSecurityGroupRuleProtocolIndividual unmarshals an instance of SecurityGroupRuleProtocolIndividual from the specified map of raw messages. +func UnmarshalSecurityGroupRuleProtocolIndividual(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleProtocolIndividual) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalSecurityGroupRuleLocal) + if err != nil { + err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) if err != nil { err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) if err != nil { err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) @@ -132087,12 +147884,16 @@ type SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp struct { // The IP version to allow. The format of `local.address`, `remote.address`, // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. // - // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP - // version. + // If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this + // IP version. IPVersion *string `json:"ip_version,omitempty"` Local SecurityGroupRuleLocalPrototypeIntf `json:"local,omitempty"` + // The name for this security group rule. The name must not be used by another rule in the security group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` // The ICMP traffic code to allow. @@ -132120,8 +147921,8 @@ const ( // The IP version to allow. The format of `local.address`, `remote.address`, // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. // -// If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP -// version. +// If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this +// IP version. const ( SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmpIPVersionIpv4Const = "ipv4" ) @@ -132167,6 +147968,11 @@ func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmp(m map[stri err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) if err != nil { err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) @@ -132200,12 +148006,16 @@ type SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp struct { // The IP version to allow. The format of `local.address`, `remote.address`, // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. // - // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP - // version. + // If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this + // IP version. IPVersion *string `json:"ip_version,omitempty"` Local SecurityGroupRuleLocalPrototypeIntf `json:"local,omitempty"` + // The name for this security group rule. The name must not be used by another rule in the security group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` // The inclusive upper bound of the TCP or UDP destination port range. @@ -132235,8 +148045,8 @@ const ( // The IP version to allow. The format of `local.address`, `remote.address`, // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. // -// If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP -// version. +// If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this +// IP version. const ( SecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" ) @@ -132283,6 +148093,11 @@ func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp(m map[st err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) if err != nil { err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) @@ -132307,20 +148122,59 @@ func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp(m map[st return } -// SecurityGroupRuleRemotePatchCIDR : SecurityGroupRuleRemotePatchCIDR struct -// This model "extends" SecurityGroupRuleRemotePatch -type SecurityGroupRuleRemotePatchCIDR struct { - // The CIDR block. +// SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype : A rule allowing traffic for any protocol. +// This model "extends" SecurityGroupRulePrototype +type SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype struct { + // The direction of traffic to allow. + Direction *string `json:"direction" validate:"required"` + + // The IP version to allow. The format of `local.address`, `remote.address`, + // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. - CIDRBlock *string `json:"cidr_block" validate:"required"` + // If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this + // IP version. + IPVersion *string `json:"ip_version,omitempty"` + + Local SecurityGroupRuleLocalPrototypeIntf `json:"local,omitempty"` + + // The name for this security group rule. The name must not be used by another rule in the security group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` + + // The network protocol. + Protocol *string `json:"protocol" validate:"required"` } -// NewSecurityGroupRuleRemotePatchCIDR : Instantiate SecurityGroupRuleRemotePatchCIDR (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePatchCIDR(cidrBlock string) (_model *SecurityGroupRuleRemotePatchCIDR, err error) { - _model = &SecurityGroupRuleRemotePatchCIDR{ - CIDRBlock: core.StringPtr(cidrBlock), +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.Direction property. +// The direction of traffic to allow. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeDirectionInboundConst = "inbound" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.IPVersion property. +// The IP version to allow. The format of `local.address`, `remote.address`, +// `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. +// +// If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this +// IP version. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.Protocol property. +// The network protocol. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeProtocolAnyConst = "any" +) + +// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype, err error) { + _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype{ + Direction: core.StringPtr(direction), + Protocol: core.StringPtr(protocol), } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -132329,46 +148183,100 @@ func (*VpcV1) NewSecurityGroupRuleRemotePatchCIDR(cidrBlock string) (_model *Sec return } -func (*SecurityGroupRuleRemotePatchCIDR) isaSecurityGroupRuleRemotePatch() bool { +func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype) isaSecurityGroupRulePrototype() bool { return true } -// UnmarshalSecurityGroupRuleRemotePatchCIDR unmarshals an instance of SecurityGroupRuleRemotePatchCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatchCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatchCIDR) - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) +// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { - err = core.SDKErrorf(err, "", "cidr_block-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalSecurityGroupRuleLocalPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// asPatch returns a generic map representation of the SecurityGroupRuleRemotePatchCIDR -func (securityGroupRuleRemotePatchCIDR *SecurityGroupRuleRemotePatchCIDR) asPatch() (_patch map[string]interface{}) { - _patch = map[string]interface{}{} - if !core.IsNil(securityGroupRuleRemotePatchCIDR.CIDRBlock) { - _patch["cidr_block"] = securityGroupRuleRemotePatchCIDR.CIDRBlock - } - - return -} +// SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype : A rule allowing ICMP, TCP and UDP traffic. +// This model "extends" SecurityGroupRulePrototype +type SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype struct { + // The direction of traffic to allow. + Direction *string `json:"direction" validate:"required"` -// SecurityGroupRuleRemotePatchIP : SecurityGroupRuleRemotePatchIP struct -// This model "extends" SecurityGroupRuleRemotePatch -type SecurityGroupRuleRemotePatchIP struct { - // The IP address. + // The IP version to allow. The format of `local.address`, `remote.address`, + // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in - // the future. - Address *string `json:"address" validate:"required"` + // If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this + // IP version. + IPVersion *string `json:"ip_version,omitempty"` + + Local SecurityGroupRuleLocalPrototypeIntf `json:"local,omitempty"` + + // The name for this security group rule. The name must not be used by another rule in the security group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` + + // The network protocol. + Protocol *string `json:"protocol" validate:"required"` } -// NewSecurityGroupRuleRemotePatchIP : Instantiate SecurityGroupRuleRemotePatchIP (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePatchIP(address string) (_model *SecurityGroupRuleRemotePatchIP, err error) { - _model = &SecurityGroupRuleRemotePatchIP{ - Address: core.StringPtr(address), +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype.Direction property. +// The direction of traffic to allow. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeDirectionInboundConst = "inbound" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype.IPVersion property. +// The IP version to allow. The format of `local.address`, `remote.address`, +// `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. +// +// If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this +// IP version. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype.Protocol property. +// The network protocol. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeProtocolIcmpTCPUDPConst = "icmp_tcp_udp" +) + +// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype, err error) { + _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype{ + Direction: core.StringPtr(direction), + Protocol: core.StringPtr(protocol), } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -132377,29 +148285,424 @@ func (*VpcV1) NewSecurityGroupRuleRemotePatchIP(address string) (_model *Securit return } -func (*SecurityGroupRuleRemotePatchIP) isaSecurityGroupRuleRemotePatch() bool { +func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype) isaSecurityGroupRulePrototype() bool { return true } -// UnmarshalSecurityGroupRuleRemotePatchIP unmarshals an instance of SecurityGroupRuleRemotePatchIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePatchIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePatchIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) +// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) if err != nil { - err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalSecurityGroupRuleLocalPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// asPatch returns a generic map representation of the SecurityGroupRuleRemotePatchIP -func (securityGroupRuleRemotePatchIP *SecurityGroupRuleRemotePatchIP) asPatch() (_patch map[string]interface{}) { - _patch = map[string]interface{}{} - if !core.IsNil(securityGroupRuleRemotePatchIP.Address) { - _patch["address"] = securityGroupRuleRemotePatchIP.Address +// SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype : SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype struct +// This model "extends" SecurityGroupRulePrototype +type SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype struct { + // The direction of traffic to allow. + Direction *string `json:"direction" validate:"required"` + + // The IP version to allow. The format of `local.address`, `remote.address`, + // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. + // + // If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this + // IP version. + IPVersion *string `json:"ip_version,omitempty"` + + Local SecurityGroupRuleLocalPrototypeIntf `json:"local,omitempty"` + + // The name for this security group rule. The name must not be used by another rule in the security group. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + Remote SecurityGroupRuleRemotePrototypeIntf `json:"remote,omitempty"` + + // The network protocol to allow. + // + // The value must be the name of an individual protocol, excluding `icmp`, `tcp` and + // `udp`. Names for well known protocols are: + // - `ah`: AH (authentication header, protocol number `51`) + // - `esp`: ESP (encapsulating security payload, protocol number `50`) + // - `gre`: GRE (generic routing encapsulation, protocol number `47`) + // - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + // - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + // - `rsvp`: RSVP (reservation protocol, protocol number `46`) + // - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + // - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + // + // For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + Protocol *string `json:"protocol" validate:"required"` +} + +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.Direction property. +// The direction of traffic to allow. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeDirectionInboundConst = "inbound" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeDirectionOutboundConst = "outbound" +) + +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.IPVersion property. +// The IP version to allow. The format of `local.address`, `remote.address`, +// `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. +// +// If `remote` references a security group, then this rule will only apply to IP addresses in that group matching this +// IP version. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeIPVersionIpv4Const = "ipv4" +) + +// Constants associated with the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.Protocol property. +// The network protocol to allow. +// +// The value must be the name of an individual protocol, excluding `icmp`, `tcp` and +// `udp`. Names for well known protocols are: +// - `ah`: AH (authentication header, protocol number `51`) +// - `esp`: ESP (encapsulating security payload, protocol number `50`) +// - `gre`: GRE (generic routing encapsulation, protocol number `47`) +// - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) +// - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) +// - `rsvp`: RSVP (reservation protocol, protocol number `46`) +// - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) +// - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) +// +// For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. +const ( + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolAhConst = "ah" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolEspConst = "esp" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolGreConst = "gre" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolIPInIPConst = "ip_in_ip" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolL2tpConst = "l2tp" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber0Const = "number_0" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber10Const = "number_10" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber100Const = "number_100" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber101Const = "number_101" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber102Const = "number_102" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber103Const = "number_103" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber104Const = "number_104" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber105Const = "number_105" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber106Const = "number_106" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber107Const = "number_107" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber108Const = "number_108" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber109Const = "number_109" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber11Const = "number_11" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber110Const = "number_110" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber111Const = "number_111" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber113Const = "number_113" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber114Const = "number_114" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber116Const = "number_116" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber117Const = "number_117" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber118Const = "number_118" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber119Const = "number_119" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber12Const = "number_12" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber120Const = "number_120" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber121Const = "number_121" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber122Const = "number_122" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber123Const = "number_123" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber124Const = "number_124" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber125Const = "number_125" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber126Const = "number_126" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber127Const = "number_127" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber128Const = "number_128" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber129Const = "number_129" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber13Const = "number_13" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber130Const = "number_130" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber131Const = "number_131" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber133Const = "number_133" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber134Const = "number_134" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber135Const = "number_135" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber136Const = "number_136" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber137Const = "number_137" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber138Const = "number_138" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber139Const = "number_139" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber14Const = "number_14" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber140Const = "number_140" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber141Const = "number_141" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber142Const = "number_142" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber143Const = "number_143" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber144Const = "number_144" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber145Const = "number_145" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber146Const = "number_146" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber147Const = "number_147" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber148Const = "number_148" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber149Const = "number_149" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber15Const = "number_15" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber150Const = "number_150" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber151Const = "number_151" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber152Const = "number_152" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber153Const = "number_153" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber154Const = "number_154" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber155Const = "number_155" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber156Const = "number_156" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber157Const = "number_157" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber158Const = "number_158" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber159Const = "number_159" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber16Const = "number_16" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber160Const = "number_160" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber161Const = "number_161" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber162Const = "number_162" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber163Const = "number_163" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber164Const = "number_164" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber165Const = "number_165" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber166Const = "number_166" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber167Const = "number_167" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber168Const = "number_168" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber169Const = "number_169" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber170Const = "number_170" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber171Const = "number_171" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber172Const = "number_172" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber173Const = "number_173" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber174Const = "number_174" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber175Const = "number_175" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber176Const = "number_176" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber177Const = "number_177" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber178Const = "number_178" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber179Const = "number_179" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber18Const = "number_18" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber180Const = "number_180" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber181Const = "number_181" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber182Const = "number_182" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber183Const = "number_183" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber184Const = "number_184" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber185Const = "number_185" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber186Const = "number_186" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber187Const = "number_187" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber188Const = "number_188" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber189Const = "number_189" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber19Const = "number_19" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber190Const = "number_190" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber191Const = "number_191" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber192Const = "number_192" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber193Const = "number_193" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber194Const = "number_194" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber195Const = "number_195" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber196Const = "number_196" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber197Const = "number_197" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber198Const = "number_198" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber199Const = "number_199" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber2Const = "number_2" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber20Const = "number_20" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber200Const = "number_200" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber201Const = "number_201" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber202Const = "number_202" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber203Const = "number_203" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber204Const = "number_204" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber205Const = "number_205" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber206Const = "number_206" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber207Const = "number_207" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber208Const = "number_208" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber209Const = "number_209" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber21Const = "number_21" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber210Const = "number_210" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber211Const = "number_211" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber212Const = "number_212" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber213Const = "number_213" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber214Const = "number_214" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber215Const = "number_215" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber216Const = "number_216" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber217Const = "number_217" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber218Const = "number_218" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber219Const = "number_219" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber22Const = "number_22" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber220Const = "number_220" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber221Const = "number_221" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber222Const = "number_222" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber223Const = "number_223" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber224Const = "number_224" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber225Const = "number_225" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber226Const = "number_226" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber227Const = "number_227" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber228Const = "number_228" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber229Const = "number_229" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber23Const = "number_23" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber230Const = "number_230" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber231Const = "number_231" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber232Const = "number_232" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber233Const = "number_233" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber234Const = "number_234" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber235Const = "number_235" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber236Const = "number_236" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber237Const = "number_237" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber238Const = "number_238" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber239Const = "number_239" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber24Const = "number_24" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber240Const = "number_240" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber241Const = "number_241" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber242Const = "number_242" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber243Const = "number_243" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber244Const = "number_244" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber245Const = "number_245" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber246Const = "number_246" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber247Const = "number_247" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber248Const = "number_248" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber249Const = "number_249" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber25Const = "number_25" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber250Const = "number_250" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber251Const = "number_251" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber252Const = "number_252" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber253Const = "number_253" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber254Const = "number_254" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber255Const = "number_255" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber26Const = "number_26" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber27Const = "number_27" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber28Const = "number_28" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber29Const = "number_29" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber3Const = "number_3" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber30Const = "number_30" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber31Const = "number_31" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber32Const = "number_32" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber33Const = "number_33" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber34Const = "number_34" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber35Const = "number_35" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber36Const = "number_36" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber37Const = "number_37" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber38Const = "number_38" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber39Const = "number_39" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber40Const = "number_40" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber41Const = "number_41" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber42Const = "number_42" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber43Const = "number_43" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber44Const = "number_44" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber45Const = "number_45" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber48Const = "number_48" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber49Const = "number_49" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber5Const = "number_5" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber52Const = "number_52" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber53Const = "number_53" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber54Const = "number_54" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber55Const = "number_55" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber56Const = "number_56" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber57Const = "number_57" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber58Const = "number_58" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber59Const = "number_59" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber60Const = "number_60" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber61Const = "number_61" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber62Const = "number_62" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber63Const = "number_63" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber64Const = "number_64" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber65Const = "number_65" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber66Const = "number_66" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber67Const = "number_67" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber68Const = "number_68" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber69Const = "number_69" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber7Const = "number_7" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber70Const = "number_70" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber71Const = "number_71" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber72Const = "number_72" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber73Const = "number_73" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber74Const = "number_74" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber75Const = "number_75" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber76Const = "number_76" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber77Const = "number_77" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber78Const = "number_78" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber79Const = "number_79" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber8Const = "number_8" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber80Const = "number_80" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber81Const = "number_81" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber82Const = "number_82" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber83Const = "number_83" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber84Const = "number_84" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber85Const = "number_85" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber86Const = "number_86" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber87Const = "number_87" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber88Const = "number_88" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber89Const = "number_89" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber9Const = "number_9" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber90Const = "number_90" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber91Const = "number_91" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber92Const = "number_92" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber93Const = "number_93" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber94Const = "number_94" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber95Const = "number_95" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber96Const = "number_96" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber97Const = "number_97" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber98Const = "number_98" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolNumber99Const = "number_99" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolRsvpConst = "rsvp" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolSctpConst = "sctp" + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeProtocolVrrpConst = "vrrp" +) + +// NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype : Instantiate SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype(direction string, protocol string) (_model *SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype, err error) { + _model = &SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype{ + Direction: core.StringPtr(direction), + Protocol: core.StringPtr(protocol), } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} +func (*SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype) isaSecurityGroupRulePrototype() bool { + return true +} + +// UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype unmarshals an instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype) + err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) + if err != nil { + err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) + if err != nil { + err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalSecurityGroupRuleLocalPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemotePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + if err != nil { + err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -132471,19 +148774,158 @@ func (securityGroupRuleRemotePatchSecurityGroupIdentity *SecurityGroupRuleRemote return } -// SecurityGroupRuleRemotePrototypeCIDR : SecurityGroupRuleRemotePrototypeCIDR struct +// SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype : SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype struct +// This model "extends" SecurityGroupRuleRemotePatch +type SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype struct { + // The CIDR block. + CIDRBlock *string `json:"cidr_block" validate:"required"` +} + +// NewSecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype : Instantiate SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype(cidrBlock string) (_model *SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype, err error) { + _model = &SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype{ + CIDRBlock: core.StringPtr(cidrBlock), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype) isaSecurityGroupRuleRemotePatch() bool { + return true +} + +// UnmarshalSecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype unmarshals an instance of SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype) + err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) + if err != nil { + err = core.SDKErrorf(err, "", "cidr_block-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype +func (securityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype *SecurityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(securityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype.CIDRBlock) { + _patch["cidr_block"] = securityGroupRuleRemotePatchSecurityGroupRuleCIDRPrototype.CIDRBlock + } + + return +} + +// SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype : SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype struct +// This model "extends" SecurityGroupRuleRemotePatch +type SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype struct { + // The IP address. + Address *string `json:"address" validate:"required"` +} + +// NewSecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype : Instantiate SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype(address string) (_model *SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype, err error) { + _model = &SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype{ + Address: core.StringPtr(address), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype) isaSecurityGroupRuleRemotePatch() bool { + return true +} + +// UnmarshalSecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype unmarshals an instance of SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype +func (securityGroupRuleRemotePatchSecurityGroupRuleIPPrototype *SecurityGroupRuleRemotePatchSecurityGroupRuleIPPrototype) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(securityGroupRuleRemotePatchSecurityGroupRuleIPPrototype.Address) { + _patch["address"] = securityGroupRuleRemotePatchSecurityGroupRuleIPPrototype.Address + } + + return +} + +// SecurityGroupRuleRemotePrototypeSecurityGroupIdentity : Identifies a security group by a unique property. +// Models which "extend" this model: +// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID +// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN +// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref // This model "extends" SecurityGroupRuleRemotePrototype -type SecurityGroupRuleRemotePrototypeCIDR struct { +type SecurityGroupRuleRemotePrototypeSecurityGroupIdentity struct { + // The unique identifier for this security group. + ID *string `json:"id,omitempty"` + + // The CRN for this security group. + CRN *string `json:"crn,omitempty"` + + // The URL for this security group. + Href *string `json:"href,omitempty"` +} + +func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool { + return true +} + +type SecurityGroupRuleRemotePrototypeSecurityGroupIdentityIntf interface { + SecurityGroupRuleRemotePrototypeIntf + isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool +} + +func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) isaSecurityGroupRuleRemotePrototype() bool { + return true +} + +// UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity unmarshals an instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentity from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype : SecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype struct +// This model "extends" SecurityGroupRuleRemotePrototype +type SecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype struct { // The CIDR block. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. CIDRBlock *string `json:"cidr_block" validate:"required"` } -// NewSecurityGroupRuleRemotePrototypeCIDR : Instantiate SecurityGroupRuleRemotePrototypeCIDR (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePrototypeCIDR(cidrBlock string) (_model *SecurityGroupRuleRemotePrototypeCIDR, err error) { - _model = &SecurityGroupRuleRemotePrototypeCIDR{ +// NewSecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype : Instantiate SecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype(cidrBlock string) (_model *SecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype, err error) { + _model = &SecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype{ CIDRBlock: core.StringPtr(cidrBlock), } err = core.ValidateStruct(_model, "required parameters") @@ -132493,13 +148935,13 @@ func (*VpcV1) NewSecurityGroupRuleRemotePrototypeCIDR(cidrBlock string) (_model return } -func (*SecurityGroupRuleRemotePrototypeCIDR) isaSecurityGroupRuleRemotePrototype() bool { +func (*SecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype) isaSecurityGroupRuleRemotePrototype() bool { return true } -// UnmarshalSecurityGroupRuleRemotePrototypeCIDR unmarshals an instance of SecurityGroupRuleRemotePrototypeCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeCIDR) +// UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype unmarshals an instance of SecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePrototypeSecurityGroupRuleCIDRPrototype) err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { err = core.SDKErrorf(err, "", "cidr_block-error", common.GetComponentInfo()) @@ -132509,19 +148951,16 @@ func UnmarshalSecurityGroupRuleRemotePrototypeCIDR(m map[string]json.RawMessage, return } -// SecurityGroupRuleRemotePrototypeIP : SecurityGroupRuleRemotePrototypeIP struct +// SecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype : SecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype struct // This model "extends" SecurityGroupRuleRemotePrototype -type SecurityGroupRuleRemotePrototypeIP struct { +type SecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype struct { // The IP address. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in - // the future. Address *string `json:"address" validate:"required"` } -// NewSecurityGroupRuleRemotePrototypeIP : Instantiate SecurityGroupRuleRemotePrototypeIP (Generic Model Constructor) -func (*VpcV1) NewSecurityGroupRuleRemotePrototypeIP(address string) (_model *SecurityGroupRuleRemotePrototypeIP, err error) { - _model = &SecurityGroupRuleRemotePrototypeIP{ +// NewSecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype : Instantiate SecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype (Generic Model Constructor) +func (*VpcV1) NewSecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype(address string) (_model *SecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype, err error) { + _model = &SecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype{ Address: core.StringPtr(address), } err = core.ValidateStruct(_model, "required parameters") @@ -132531,117 +148970,13 @@ func (*VpcV1) NewSecurityGroupRuleRemotePrototypeIP(address string) (_model *Sec return } -func (*SecurityGroupRuleRemotePrototypeIP) isaSecurityGroupRuleRemotePrototype() bool { +func (*SecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype) isaSecurityGroupRuleRemotePrototype() bool { return true } -// UnmarshalSecurityGroupRuleRemotePrototypeIP unmarshals an instance of SecurityGroupRuleRemotePrototypeIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeIP) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemotePrototypeSecurityGroupIdentity : Identifies a security group by a unique property. -// Models which "extend" this model: -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByID -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN -// - SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref -// This model "extends" SecurityGroupRuleRemotePrototype -type SecurityGroupRuleRemotePrototypeSecurityGroupIdentity struct { - // The unique identifier for this security group. - ID *string `json:"id,omitempty"` - - // The CRN for this security group. - CRN *string `json:"crn,omitempty"` - - // The URL for this security group. - Href *string `json:"href,omitempty"` -} - -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool { - return true -} - -type SecurityGroupRuleRemotePrototypeSecurityGroupIdentityIntf interface { - SecurityGroupRuleRemotePrototypeIntf - isaSecurityGroupRuleRemotePrototypeSecurityGroupIdentity() bool -} - -func (*SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) isaSecurityGroupRuleRemotePrototype() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity unmarshals an instance of SecurityGroupRuleRemotePrototypeSecurityGroupIdentity from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemotePrototypeSecurityGroupIdentity) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemoteCIDR : SecurityGroupRuleRemoteCIDR struct -// This model "extends" SecurityGroupRuleRemote -type SecurityGroupRuleRemoteCIDR struct { - // The CIDR block. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 address - // blocks in the future. - CIDRBlock *string `json:"cidr_block" validate:"required"` -} - -func (*SecurityGroupRuleRemoteCIDR) isaSecurityGroupRuleRemote() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemoteCIDR unmarshals an instance of SecurityGroupRuleRemoteCIDR from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemoteCIDR(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemoteCIDR) - err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) - if err != nil { - err = core.SDKErrorf(err, "", "cidr_block-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// SecurityGroupRuleRemoteIP : SecurityGroupRuleRemoteIP struct -// This model "extends" SecurityGroupRuleRemote -type SecurityGroupRuleRemoteIP struct { - // The IP address. - // - // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in - // the future. - Address *string `json:"address" validate:"required"` -} - -func (*SecurityGroupRuleRemoteIP) isaSecurityGroupRuleRemote() bool { - return true -} - -// UnmarshalSecurityGroupRuleRemoteIP unmarshals an instance of SecurityGroupRuleRemoteIP from the specified map of raw messages. -func UnmarshalSecurityGroupRuleRemoteIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleRemoteIP) +// UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype unmarshals an instance of SecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemotePrototypeSecurityGroupRuleIPPrototype) err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) @@ -132707,96 +149042,52 @@ func UnmarshalSecurityGroupRuleRemoteSecurityGroupReference(m map[string]json.Ra return } -// SecurityGroupRuleSecurityGroupRuleProtocolAll : A rule allowing ICMP, TCP and UDP traffic. -// This model "extends" SecurityGroupRule -type SecurityGroupRuleSecurityGroupRuleProtocolAll struct { - // The direction of traffic to allow. - Direction *string `json:"direction" validate:"required"` - - // The URL for this security group rule. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this security group rule. - ID *string `json:"id" validate:"required"` - - // The IP version to allow. The format of `local.address`, `remote.address`, - // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. +// SecurityGroupRuleRemoteSecurityGroupRuleCIDR : SecurityGroupRuleRemoteSecurityGroupRuleCIDR struct +// This model "extends" SecurityGroupRuleRemote +type SecurityGroupRuleRemoteSecurityGroupRuleCIDR struct { + // The CIDR block. // - // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP - // version. - IPVersion *string `json:"ip_version" validate:"required"` - - Local SecurityGroupRuleLocalIntf `json:"local" validate:"required"` - - Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` - - // The network protocol. - Protocol *string `json:"protocol" validate:"required"` + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 CIDR blocks + // in the future. + CIDRBlock *string `json:"cidr_block" validate:"required"` } -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.Direction property. -// The direction of traffic to allow. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolAllDirectionInboundConst = "inbound" - SecurityGroupRuleSecurityGroupRuleProtocolAllDirectionOutboundConst = "outbound" -) - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.IPVersion property. -// The IP version to allow. The format of `local.address`, `remote.address`, -// `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. -// -// If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP -// version. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolAllIPVersionIpv4Const = "ipv4" -) - -// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolAll.Protocol property. -// The network protocol. -const ( - SecurityGroupRuleSecurityGroupRuleProtocolAllProtocolAllConst = "all" -) - -func (*SecurityGroupRuleSecurityGroupRuleProtocolAll) isaSecurityGroupRule() bool { +func (*SecurityGroupRuleRemoteSecurityGroupRuleCIDR) isaSecurityGroupRuleRemote() bool { return true } -// UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll unmarshals an instance of SecurityGroupRuleSecurityGroupRuleProtocolAll from the specified map of raw messages. -func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolAll(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(SecurityGroupRuleSecurityGroupRuleProtocolAll) - err = core.UnmarshalPrimitive(m, "direction", &obj.Direction) - if err != nil { - err = core.SDKErrorf(err, "", "direction-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "ip_version", &obj.IPVersion) - if err != nil { - err = core.SDKErrorf(err, "", "ip_version-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalSecurityGroupRuleLocal) - if err != nil { - err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) +// UnmarshalSecurityGroupRuleRemoteSecurityGroupRuleCIDR unmarshals an instance of SecurityGroupRuleRemoteSecurityGroupRuleCIDR from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemoteSecurityGroupRuleCIDR(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemoteSecurityGroupRuleCIDR) + err = core.UnmarshalPrimitive(m, "cidr_block", &obj.CIDRBlock) if err != nil { - err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "cidr_block-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "protocol", &obj.Protocol) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// SecurityGroupRuleRemoteSecurityGroupRuleIP : SecurityGroupRuleRemoteSecurityGroupRuleIP struct +// This model "extends" SecurityGroupRuleRemote +type SecurityGroupRuleRemoteSecurityGroupRuleIP struct { + // The IP address. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in + // the future. + Address *string `json:"address" validate:"required"` +} + +func (*SecurityGroupRuleRemoteSecurityGroupRuleIP) isaSecurityGroupRuleRemote() bool { + return true +} + +// UnmarshalSecurityGroupRuleRemoteSecurityGroupRuleIP unmarshals an instance of SecurityGroupRuleRemoteSecurityGroupRuleIP from the specified map of raw messages. +func UnmarshalSecurityGroupRuleRemoteSecurityGroupRuleIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(SecurityGroupRuleRemoteSecurityGroupRuleIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { - err = core.SDKErrorf(err, "", "protocol-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -132815,17 +149106,25 @@ type SecurityGroupRuleSecurityGroupRuleProtocolIcmp struct { // The unique identifier for this security group rule. ID *string `json:"id" validate:"required"` - // The IP version to allow. The format of `local.address`, `remote.address`, - // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. + // The IP version to allow. // // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP // version. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. IPVersion *string `json:"ip_version" validate:"required"` Local SecurityGroupRuleLocalIntf `json:"local" validate:"required"` + // The name for this security group rule. The name is unique across all rules in the security group. + Name *string `json:"name" validate:"required"` + Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + // The ICMP traffic code to allow. If absent, all codes are allowed. Code *int64 `json:"code,omitempty"` @@ -132844,15 +149143,23 @@ const ( ) // Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.IPVersion property. -// The IP version to allow. The format of `local.address`, `remote.address`, -// `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. +// The IP version to allow. // // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP // version. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. const ( SecurityGroupRuleSecurityGroupRuleProtocolIcmpIPVersionIpv4Const = "ipv4" ) +// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.ResourceType property. +// The resource type. +const ( + SecurityGroupRuleSecurityGroupRuleProtocolIcmpResourceTypeSecurityGroupRuleConst = "security_group_rule" +) + // Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolIcmp.Protocol property. // The network protocol. const ( @@ -132891,11 +149198,21 @@ func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolIcmp(m map[string]json.R err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) if err != nil { err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) @@ -132930,17 +149247,25 @@ type SecurityGroupRuleSecurityGroupRuleProtocolTcpudp struct { // The unique identifier for this security group rule. ID *string `json:"id" validate:"required"` - // The IP version to allow. The format of `local.address`, `remote.address`, - // `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. + // The IP version to allow. // // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP // version. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. IPVersion *string `json:"ip_version" validate:"required"` Local SecurityGroupRuleLocalIntf `json:"local" validate:"required"` + // The name for this security group rule. The name is unique across all rules in the security group. + Name *string `json:"name" validate:"required"` + Remote SecurityGroupRuleRemoteIntf `json:"remote" validate:"required"` + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + // The inclusive upper bound of the TCP or UDP destination port range. PortMax *int64 `json:"port_max,omitempty"` @@ -132959,15 +149284,23 @@ const ( ) // Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.IPVersion property. -// The IP version to allow. The format of `local.address`, `remote.address`, -// `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. +// The IP version to allow. // // If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP // version. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support `ipv6` in the future. const ( SecurityGroupRuleSecurityGroupRuleProtocolTcpudpIPVersionIpv4Const = "ipv4" ) +// Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.ResourceType property. +// The resource type. +const ( + SecurityGroupRuleSecurityGroupRuleProtocolTcpudpResourceTypeSecurityGroupRuleConst = "security_group_rule" +) + // Constants associated with the SecurityGroupRuleSecurityGroupRuleProtocolTcpudp.Protocol property. // The network protocol. const ( @@ -133007,11 +149340,21 @@ func UnmarshalSecurityGroupRuleSecurityGroupRuleProtocolTcpudp(m map[string]json err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "remote", &obj.Remote, UnmarshalSecurityGroupRuleRemote) if err != nil { err = core.SDKErrorf(err, "", "remote-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "port_max", &obj.PortMax) if err != nil { err = core.SDKErrorf(err, "", "port_max-error", common.GetComponentInfo()) @@ -133690,8 +150033,9 @@ func UnmarshalShareIdentityByID(m map[string]json.RawMessage, result interface{} return } -// ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup : The virtual network interface for this share mount target. The virtual network interface must: +// ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup : The virtual network interface for this share mount target. // +// The virtual network interface must: // - have `allow_ip_spoofing` set to `false` // - have `enable_infrastructure_nat` set to `true` // - have `protocol_state_filtering_mode` set to `auto` or `enabled` @@ -133704,38 +150048,60 @@ func UnmarshalShareIdentityByID(m map[string]json.RawMessage, result interface{} // Required if the share's `access_control_mode` is `security_group`. // This model "extends" ShareMountTargetPrototype type ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup struct { + // The protocol to use to access the share for this share mount target: + // - `nfs4`: NFSv4 will be used. + // + // The specified value must be listed in the share's `allowed_access_protocols`. + AccessProtocol *string `json:"access_protocol" validate:"required"` + // The name for this share mount target. The name must not be used by another mount target for the file share. If // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. + // - `ipsec`: Encrypted in transit using an instance identity certificate. The + // `access_control_mode` for the share must be `security_group`. + // - `stunnel`: Encrypted in transit using an stunnel connection. The + // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. - TransitEncryption *string `json:"transit_encryption,omitempty"` + TransitEncryption *string `json:"transit_encryption" validate:"required"` VirtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf `json:"virtual_network_interface" validate:"required"` } +// Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.AccessProtocol property. +// The protocol to use to access the share for this share mount target: +// - `nfs4`: NFSv4 will be used. +// +// The specified value must be listed in the share's `allowed_access_protocols`. +const ( + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupAccessProtocolNfs4Const = "nfs4" +) + // Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.TransitEncryption property. // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The +// - `ipsec`: Encrypted in transit using an instance identity certificate. The +// `access_control_mode` for the share must be `security_group`. +// - `stunnel`: Encrypted in transit using an stunnel connection. The // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. const ( - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionUserManagedConst = "user_managed" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionIpsecConst = "ipsec" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionNoneConst = "none" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionStunnelConst = "stunnel" ) // NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup : Instantiate ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup (Generic Model Constructor) -func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(virtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup, err error) { +func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(accessProtocol string, transitEncryption string, virtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup, err error) { _model = &ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup{ + AccessProtocol: core.StringPtr(accessProtocol), + TransitEncryption: core.StringPtr(transitEncryption), VirtualNetworkInterface: virtualNetworkInterface, } err = core.ValidateStruct(_model, "required parameters") @@ -133752,6 +150118,11 @@ func (*ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup // UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup unmarshals an instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup from the specified map of raw messages. func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup) + err = core.UnmarshalPrimitive(m, "access_protocol", &obj.AccessProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "access_protocol-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) @@ -133777,40 +150148,62 @@ func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecuri // Required if the share's `access_control_mode` is `vpc`. // This model "extends" ShareMountTargetPrototype type ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC struct { + // The protocol to use to access the share for this share mount target: + // - `nfs4`: NFSv4 will be used. + // + // The specified value must be listed in the share's `allowed_access_protocols`. + AccessProtocol *string `json:"access_protocol" validate:"required"` + // The name for this share mount target. The name must not be used by another mount target for the file share. If // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. + // - `ipsec`: Encrypted in transit using an instance identity certificate. The + // `access_control_mode` for the share must be `security_group`. + // - `stunnel`: Encrypted in transit using an stunnel connection. The + // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. - TransitEncryption *string `json:"transit_encryption,omitempty"` + TransitEncryption *string `json:"transit_encryption" validate:"required"` // Identifies a VPC by a unique property. VPC VPCIdentityIntf `json:"vpc" validate:"required"` } +// Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.AccessProtocol property. +// The protocol to use to access the share for this share mount target: +// - `nfs4`: NFSv4 will be used. +// +// The specified value must be listed in the share's `allowed_access_protocols`. +const ( + ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCAccessProtocolNfs4Const = "nfs4" +) + // Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.TransitEncryption property. // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The +// - `ipsec`: Encrypted in transit using an instance identity certificate. The +// `access_control_mode` for the share must be `security_group`. +// - `stunnel`: Encrypted in transit using an stunnel connection. The // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. const ( - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionUserManagedConst = "user_managed" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionIpsecConst = "ipsec" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionNoneConst = "none" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionStunnelConst = "stunnel" ) // NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC : Instantiate ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC (Generic Model Constructor) -func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(vpc VPCIdentityIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC, err error) { +func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(accessProtocol string, transitEncryption string, vpc VPCIdentityIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC, err error) { _model = &ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC{ - VPC: vpc, + AccessProtocol: core.StringPtr(accessProtocol), + TransitEncryption: core.StringPtr(transitEncryption), + VPC: vpc, } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -133826,6 +150219,11 @@ func (*ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC) isaShare // UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC unmarshals an instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC from the specified map of raw messages. func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC) + err = core.UnmarshalPrimitive(m, "access_protocol", &obj.AccessProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "access_protocol-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) @@ -134051,6 +150449,473 @@ func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInte return } +// ShareProfileAllowedAccessProtocolsSubset : ShareProfileAllowedAccessProtocolsSubset struct +// This model "extends" ShareProfileAllowedAccessProtocols +type ShareProfileAllowedAccessProtocolsSubset struct { + // The default allowed access protocol modes for shares with this profile. + Default []string `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The possible allowed access protocols for shares with this profile: + // - `nfs4`: NFSv4 will be used. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the ShareProfileAllowedAccessProtocolsSubset.Default property. +const ( + ShareProfileAllowedAccessProtocolsSubsetDefaultNfs4Const = "nfs4" +) + +// Constants associated with the ShareProfileAllowedAccessProtocolsSubset.Type property. +// The type for this profile field. +const ( + ShareProfileAllowedAccessProtocolsSubsetTypeSubsetConst = "subset" +) + +// Constants associated with the ShareProfileAllowedAccessProtocolsSubset.Values property. +const ( + ShareProfileAllowedAccessProtocolsSubsetValuesNfs4Const = "nfs4" +) + +func (*ShareProfileAllowedAccessProtocolsSubset) isaShareProfileAllowedAccessProtocols() bool { + return true +} + +// UnmarshalShareProfileAllowedAccessProtocolsSubset unmarshals an instance of ShareProfileAllowedAccessProtocolsSubset from the specified map of raw messages. +func UnmarshalShareProfileAllowedAccessProtocolsSubset(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAllowedAccessProtocolsSubset) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAllowedTransitEncryptionModesSubset : ShareProfileAllowedTransitEncryptionModesSubset struct +// This model "extends" ShareProfileAllowedTransitEncryptionModes +type ShareProfileAllowedTransitEncryptionModesSubset struct { + // The default allowed transit encryption modes for shares with this profile. + Default []string `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The allowed [transit encryption + // modes](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-vpc-about&interface=ui#fs-eit) for a share with this + // profile: + // - `none`: Not encrypted in transit. + // - `ipsec`: Encrypted in transit using an instance identity certificate. + // - `stunnel`: Encrypted in transit using a connection via an stunnel connection. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the ShareProfileAllowedTransitEncryptionModesSubset.Default property. +const ( + ShareProfileAllowedTransitEncryptionModesSubsetDefaultIpsecConst = "ipsec" + ShareProfileAllowedTransitEncryptionModesSubsetDefaultNoneConst = "none" + ShareProfileAllowedTransitEncryptionModesSubsetDefaultStunnelConst = "stunnel" +) + +// Constants associated with the ShareProfileAllowedTransitEncryptionModesSubset.Type property. +// The type for this profile field. +const ( + ShareProfileAllowedTransitEncryptionModesSubsetTypeSubsetConst = "subset" +) + +// Constants associated with the ShareProfileAllowedTransitEncryptionModesSubset.Values property. +const ( + ShareProfileAllowedTransitEncryptionModesSubsetValuesIpsecConst = "ipsec" + ShareProfileAllowedTransitEncryptionModesSubsetValuesNoneConst = "none" + ShareProfileAllowedTransitEncryptionModesSubsetValuesStunnelConst = "stunnel" +) + +func (*ShareProfileAllowedTransitEncryptionModesSubset) isaShareProfileAllowedTransitEncryptionModes() bool { + return true +} + +// UnmarshalShareProfileAllowedTransitEncryptionModesSubset unmarshals an instance of ShareProfileAllowedTransitEncryptionModesSubset from the specified map of raw messages. +func UnmarshalShareProfileAllowedTransitEncryptionModesSubset(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAllowedTransitEncryptionModesSubset) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAvailabilityModesEnum : The permitted data availability modes for a share with this profile. +// This model "extends" ShareProfileAvailabilityModes +type ShareProfileAvailabilityModesEnum struct { + // The default data availability mode for this profile. + Default *string `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The data availability mode of the share: + // - `zonal`: The data availability of this share is limited only to a single zone of a + // given region as provided by the `zone` of the share. + // - `regional`: The data availability of this share covers all zones in the region where + // the share is created. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the ShareProfileAvailabilityModesEnum.Default property. +// The default data availability mode for this profile. +const ( + ShareProfileAvailabilityModesEnumDefaultRegionalConst = "regional" + ShareProfileAvailabilityModesEnumDefaultZonalConst = "zonal" +) + +// Constants associated with the ShareProfileAvailabilityModesEnum.Type property. +// The type for this profile field. +const ( + ShareProfileAvailabilityModesEnumTypeEnumConst = "enum" +) + +// Constants associated with the ShareProfileAvailabilityModesEnum.Values property. +const ( + ShareProfileAvailabilityModesEnumValuesRegionalConst = "regional" + ShareProfileAvailabilityModesEnumValuesZonalConst = "zonal" +) + +func (*ShareProfileAvailabilityModesEnum) isaShareProfileAvailabilityModes() bool { + return true +} + +// UnmarshalShareProfileAvailabilityModesEnum unmarshals an instance of ShareProfileAvailabilityModesEnum from the specified map of raw messages. +func UnmarshalShareProfileAvailabilityModesEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAvailabilityModesEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAvailabilityModesFixed : The data availability mode for a share with this profile is fixed. +// This model "extends" ShareProfileAvailabilityModes +type ShareProfileAvailabilityModesFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *string `json:"value" validate:"required"` +} + +// Constants associated with the ShareProfileAvailabilityModesFixed.Type property. +// The type for this profile field. +const ( + ShareProfileAvailabilityModesFixedTypeFixedConst = "fixed" +) + +// Constants associated with the ShareProfileAvailabilityModesFixed.Value property. +// The value for this profile field. +const ( + ShareProfileAvailabilityModesFixedValueRegionalConst = "regional" + ShareProfileAvailabilityModesFixedValueZonalConst = "zonal" +) + +func (*ShareProfileAvailabilityModesFixed) isaShareProfileAvailabilityModes() bool { + return true +} + +// UnmarshalShareProfileAvailabilityModesFixed unmarshals an instance of ShareProfileAvailabilityModesFixed from the specified map of raw messages. +func UnmarshalShareProfileAvailabilityModesFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAvailabilityModesFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidthDependent : The permitted bandwidth for a share with this profile depends on its configuration. +// This model "extends" ShareProfileBandwidth +type ShareProfileBandwidthDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the ShareProfileBandwidthDependent.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthDependentTypeDependentConst = "dependent" +) + +func (*ShareProfileBandwidthDependent) isaShareProfileBandwidth() bool { + return true +} + +// UnmarshalShareProfileBandwidthDependent unmarshals an instance of ShareProfileBandwidthDependent from the specified map of raw messages. +func UnmarshalShareProfileBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidthDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidthDependentRange : The permitted bandwidth range of a share with this profile depends on its configuration. +// This model "extends" ShareProfileBandwidth +type ShareProfileBandwidthDependentRange struct { + // 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 ShareProfileBandwidthDependentRange.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthDependentRangeTypeDependentRangeConst = "dependent_range" +) + +func (*ShareProfileBandwidthDependentRange) isaShareProfileBandwidth() bool { + return true +} + +// UnmarshalShareProfileBandwidthDependentRange unmarshals an instance of ShareProfileBandwidthDependentRange from the specified map of raw messages. +func UnmarshalShareProfileBandwidthDependentRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidthDependentRange) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + err = core.SDKErrorf(err, "", "max-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + err = core.SDKErrorf(err, "", "min-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + err = core.SDKErrorf(err, "", "step-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidthEnum : The permitted bandwidth values of a share with this profile. +// This model "extends" ShareProfileBandwidth +type ShareProfileBandwidthEnum 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"` +} + +// Constants associated with the ShareProfileBandwidthEnum.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthEnumTypeEnumConst = "enum" +) + +func (*ShareProfileBandwidthEnum) isaShareProfileBandwidth() bool { + return true +} + +// UnmarshalShareProfileBandwidthEnum unmarshals an instance of ShareProfileBandwidthEnum from the specified map of raw messages. +func UnmarshalShareProfileBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidthEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidthFixed : The permitted bandwidth of a share with this profile is fixed. +// This model "extends" ShareProfileBandwidth +type ShareProfileBandwidthFixed 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 ShareProfileBandwidthFixed.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthFixedTypeFixedConst = "fixed" +) + +func (*ShareProfileBandwidthFixed) isaShareProfileBandwidth() bool { + return true +} + +// UnmarshalShareProfileBandwidthFixed unmarshals an instance of ShareProfileBandwidthFixed from the specified map of raw messages. +func UnmarshalShareProfileBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidthFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidthRange : The permitted bandwidth range (in megabits per second) of a share with this profile. +// This model "extends" ShareProfileBandwidth +type ShareProfileBandwidthRange 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"` + + Value *int64 `json:"value,omitempty"` +} + +// Constants associated with the ShareProfileBandwidthRange.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthRangeTypeRangeConst = "range" +) + +func (*ShareProfileBandwidthRange) isaShareProfileBandwidth() bool { + return true +} + +// UnmarshalShareProfileBandwidthRange unmarshals an instance of ShareProfileBandwidthRange from the specified map of raw messages. +func UnmarshalShareProfileBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidthRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + err = core.SDKErrorf(err, "", "max-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + err = core.SDKErrorf(err, "", "min-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + err = core.SDKErrorf(err, "", "step-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // ShareProfileCapacityDependentRange : The permitted total capacity (in gigabytes) of a share with this profile depends on its configuration. // This model "extends" ShareProfileCapacity type ShareProfileCapacityDependentRange struct { @@ -134554,15 +151419,56 @@ func (shareProfileIdentityByName *ShareProfileIdentityByName) asPatch() (_patch return } +// ShareProfileStorageGenerationFixed : The storage generation value of a share with this profile is fixed. +// This model "extends" ShareProfileStorageGeneration +type ShareProfileStorageGenerationFixed 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 ShareProfileStorageGenerationFixed.Type property. +// The type for this profile field. +const ( + ShareProfileStorageGenerationFixedTypeFixedConst = "fixed" +) + +func (*ShareProfileStorageGenerationFixed) isaShareProfileStorageGeneration() bool { + return true +} + +// UnmarshalShareProfileStorageGenerationFixed unmarshals an instance of ShareProfileStorageGenerationFixed from the specified map of raw messages. +func UnmarshalShareProfileStorageGenerationFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileStorageGenerationFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // SharePrototypeShareByOriginShare : Create an accessor file share for an existing file share. The values for -// `access_control_mode`, `encryption_key`, `initial_owner`, `iops`, `profile`, `size`, and -// `zone` will be inherited from `origin_share`. +// `access_control_mode`, `allowed_access_protocols`, `bandwidth`, `encryption_key`, +// `initial_owner`, `iops`, `profile`, `size`, and `zone` will be inherited from +// `origin_share`. +// +// Accessor file shares can only be created for shares with a `storage_generation` of `1`. // This model "extends" SharePrototype type SharePrototypeShareByOriginShare struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The mount targets for the file share. Each mount target must be in a unique VPC. @@ -134591,8 +151497,9 @@ type SharePrototypeShareByOriginShare struct { // Constants associated with the SharePrototypeShareByOriginShare.AllowedTransitEncryptionModes property. const ( - SharePrototypeShareByOriginShareAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeShareByOriginShareAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeShareByOriginShareAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeShareByOriginShareAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeShareByOriginShareAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // NewSharePrototypeShareByOriginShare : Instantiate SharePrototypeShareByOriginShare (Generic Model Constructor) @@ -134657,9 +151564,10 @@ func UnmarshalSharePrototypeShareByOriginShare(m map[string]json.RawMessage, res // This model "extends" SharePrototype type SharePrototypeShareBySize struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The mount targets for the file share. Each mount target must be in a unique VPC. @@ -134681,8 +151589,26 @@ type SharePrototypeShareBySize struct { // require a virtual network interface. // - `vpc`: All clients in the VPC for a mount target have access to the mount target. // Mount targets for this share require a VPC. + // + // The `vpc` access control mode has been deprecated. Use `security_group` instead. AccessControlMode *string `json:"access_control_mode,omitempty"` + // The access protocols to allow for this share. If unspecified: + // - If share mount targets are specified, only the access protocols specified by those + // share mount target will be allowed. + // - Otherwise, the default access protocols from the profile will be used. + AllowedAccessProtocols []string `json:"allowed_access_protocols,omitempty"` + + // The maximum bandwidth (in megabits per second) for the file share. + // + // If the share profile has a `bandwidth.type` of `dependent` or `fixed`, this property is system-managed and must not + // be specified. Otherwise, the specified value must be within the `bandwidth` range of the share's profile. + // + // Provided the property is user-managed, if it is unspecified, its value will be set based on the specified [`size` + // and + // `iops`](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles&interface=api). + Bandwidth *int64 `json:"bandwidth,omitempty"` + // The root key to use to wrap the data encryption key for the share. // // If unspecified, the `encryption` type for the share will be `provider_managed`. @@ -134717,13 +151643,17 @@ type SharePrototypeShareBySize struct { // The zone this file share will reside in. For a replica share in the same region as // the source share, this must be a different zone from the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // + // This property must be specified if the share profile `availability_mode` is `zonal`, + // and must not be specified otherwise. + Zone ZoneIdentityIntf `json:"zone,omitempty"` } // Constants associated with the SharePrototypeShareBySize.AllowedTransitEncryptionModes property. const ( - SharePrototypeShareBySizeAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeShareBySizeAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeShareBySizeAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeShareBySizeAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeShareBySizeAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // Constants associated with the SharePrototypeShareBySize.AccessControlMode property. @@ -134734,17 +151664,23 @@ const ( // require a virtual network interface. // - `vpc`: All clients in the VPC for a mount target have access to the mount target. // Mount targets for this share require a VPC. +// +// The `vpc` access control mode has been deprecated. Use `security_group` instead. const ( SharePrototypeShareBySizeAccessControlModeSecurityGroupConst = "security_group" SharePrototypeShareBySizeAccessControlModeVPCConst = "vpc" ) +// Constants associated with the SharePrototypeShareBySize.AllowedAccessProtocols property. +const ( + SharePrototypeShareBySizeAllowedAccessProtocolsNfs4Const = "nfs4" +) + // NewSharePrototypeShareBySize : Instantiate SharePrototypeShareBySize (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareBySize(profile ShareProfileIdentityIntf, size int64, zone ZoneIdentityIntf) (_model *SharePrototypeShareBySize, err error) { +func (*VpcV1) NewSharePrototypeShareBySize(profile ShareProfileIdentityIntf, size int64) (_model *SharePrototypeShareBySize, err error) { _model = &SharePrototypeShareBySize{ Profile: profile, Size: core.Int64Ptr(size), - Zone: zone, } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -134790,6 +151726,16 @@ func UnmarshalSharePrototypeShareBySize(m map[string]json.RawMessage, result int err = core.SDKErrorf(err, "", "access_control_mode-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allowed_access_protocols", &obj.AllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { err = core.SDKErrorf(err, "", "encryption_key-error", common.GetComponentInfo()) @@ -134830,13 +151776,18 @@ func UnmarshalSharePrototypeShareBySize(m map[string]json.RawMessage, result int } // SharePrototypeShareBySourceShare : Create a replica file share for an existing file share. The values for -// `access_control_mode`, `encryption_key`, `initial_owner`, and `size` will be inherited from `source_share`. +// `access_control_mode`, `allowed_access_protocols`, `bandwidth`, `encryption_key`, +// `initial_owner`, and `size` will be inherited from the `source_share`. +// +// Replica file shares can only be created if the source share has a `storage_generation` of +// `1`. // This model "extends" SharePrototype type SharePrototypeShareBySourceShare struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The mount targets for the file share. Each mount target must be in a unique VPC. @@ -134866,7 +151817,9 @@ type SharePrototypeShareBySourceShare struct { Iops *int64 `json:"iops,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use - // for this file share. The profile must support the share's specified IOPS and size. + // for this file share. The profile must: + // - support the share's specified IOPS and size, and + // - have the same `storage_generation` as the source share. Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` // The cron specification for the file share replication schedule. @@ -134881,30 +151834,36 @@ type SharePrototypeShareBySourceShare struct { // the source share will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The source file share for this replica file share. The specified file share must not - // already have a replica, and must not be a replica. If source file share is specified - // by CRN, it may be in an [associated partner + // The source file share for this replica file share. The specified file share must: + // - Not already have a replica. + // - Not be a replica. + // - Have a `storage_generation` of `1`. + // + // If source file share is specified by CRN, it may be in an [associated partner // region](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-replication). SourceShare ShareIdentityIntf `json:"source_share" validate:"required"` // The zone this file share will reside in. For a replica share in the same region as // the source share, this must be a different zone from the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // + // This property must be specified if the share profile `availability_mode` is `zonal`, + // and must not be specified otherwise. + Zone ZoneIdentityIntf `json:"zone,omitempty"` } // Constants associated with the SharePrototypeShareBySourceShare.AllowedTransitEncryptionModes property. const ( - SharePrototypeShareBySourceShareAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeShareBySourceShareAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeShareBySourceShareAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeShareBySourceShareAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeShareBySourceShareAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // NewSharePrototypeShareBySourceShare : Instantiate SharePrototypeShareBySourceShare (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareBySourceShare(profile ShareProfileIdentityIntf, replicationCronSpec string, sourceShare ShareIdentityIntf, zone ZoneIdentityIntf) (_model *SharePrototypeShareBySourceShare, err error) { +func (*VpcV1) NewSharePrototypeShareBySourceShare(profile ShareProfileIdentityIntf, replicationCronSpec string, sourceShare ShareIdentityIntf) (_model *SharePrototypeShareBySourceShare, err error) { _model = &SharePrototypeShareBySourceShare{ Profile: profile, ReplicationCronSpec: core.StringPtr(replicationCronSpec), SourceShare: sourceShare, - Zone: zone, } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -134984,14 +151943,15 @@ func UnmarshalSharePrototypeShareBySourceShare(m map[string]json.RawMessage, res return } -// SharePrototypeShareBySourceSnapshot : Create a file share from a source snapshot. The initial value for `access_control_mode`, and the zone the file share -// resides in will be inherited from `source_snapshot`. +// SharePrototypeShareBySourceSnapshot : Create a file share from a source snapshot. The initial value for `access_control_mode`, +// `initial_owner` and `zone` will be inherited from `source_snapshot`. // This model "extends" SharePrototype type SharePrototypeShareBySourceSnapshot struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The mount targets for the file share. Each mount target must be in a unique VPC. @@ -135006,15 +151966,37 @@ type SharePrototypeShareBySourceSnapshot struct { // The tags for this resource. UserTags []string `json:"user_tags,omitempty"` + // The access protocols to allow for this share. If unspecified: + // - If share mount targets are specified, only the access protocols specified by those + // share mount target will be allowed. + // - Otherwise, the default access protocols from the profile will be used. + AllowedAccessProtocols []string `json:"allowed_access_protocols,omitempty"` + + // The maximum bandwidth (in megabits per second) for the file share. + // + // If the share profile has a `bandwidth.type` of `dependent` or `fixed`, this property is system-managed and must not + // be specified. Otherwise, the specified value must be within the `bandwidth` range of the share's profile. + // + // Provided the property is user-managed, if it is unspecified, its value will be set based on the specified [`size` + // and + // `iops`](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles&interface=api). + Bandwidth *int64 `json:"bandwidth,omitempty"` + // The root key to use to wrap the data encryption key for the share. // // The specified key may be in a different account, subject to IAM policies. // - // If unspecified, the source snapshot's `encryption_key` will be used. + // If unspecified, the source share's `encryption_key` will be used. + // + // For snapshots of shares with `storage_generation` of `2`, an encryption key may only + // be specified if the source share's `encryption` is `user_managed`. EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` // The owner assigned to the file share at creation. Subsequent changes to the owner // must be performed by a client that has mounted the file share. + // + // `initial_owner` for a share created from a source snapshot can only be specified for + // snapshots of shares with `storage_generation` of `1`. InitialOwner *ShareInitialOwner `json:"initial_owner,omitempty"` // The maximum input/output operations per second (IOPS) for the file share. @@ -135025,7 +152007,9 @@ type SharePrototypeShareBySourceSnapshot struct { Iops *int64 `json:"iops,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use - // for this file share. The profile must support the share's specified IOPS and size. + // for this file share. The profile must: + // - support the share's specified IOPS and size, and + // - have the same `storage_generation` as the source snapshot. Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` // The resource group to use. If unspecified, the account's [default resource @@ -135048,8 +152032,14 @@ type SharePrototypeShareBySourceSnapshot struct { // Constants associated with the SharePrototypeShareBySourceSnapshot.AllowedTransitEncryptionModes property. const ( - SharePrototypeShareBySourceSnapshotAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeShareBySourceSnapshotAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeShareBySourceSnapshotAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeShareBySourceSnapshotAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeShareBySourceSnapshotAllowedTransitEncryptionModesStunnelConst = "stunnel" +) + +// Constants associated with the SharePrototypeShareBySourceSnapshot.AllowedAccessProtocols property. +const ( + SharePrototypeShareBySourceSnapshotAllowedAccessProtocolsNfs4Const = "nfs4" ) // NewSharePrototypeShareBySourceSnapshot : Instantiate SharePrototypeShareBySourceSnapshot (Generic Model Constructor) @@ -135097,6 +152087,16 @@ func UnmarshalSharePrototypeShareBySourceSnapshot(m map[string]json.RawMessage, err = core.SDKErrorf(err, "", "user_tags-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allowed_access_protocols", &obj.AllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { err = core.SDKErrorf(err, "", "encryption_key-error", common.GetComponentInfo()) @@ -135273,8 +152273,8 @@ type SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots struct ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The data-consistent member snapshots to create. Each snapshot must specify a - // `source_volume` attached to the same virtual server instance, and all source volumes must have a - // `storage_generation` value of `1`. + // `source_volume` attached to the same virtual server instance, and all source volumes must have the same + // `storage_generation` value. Snapshots []SnapshotPrototypeSnapshotConsistencyGroupContext `json:"snapshots" validate:"required"` } @@ -136737,6 +153737,232 @@ func (vpcIdentityByID *VPCIdentityByID) asPatch() (_patch map[string]interface{} return } +// VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress : VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress struct +// This model "extends" VPNGatewayConnectionDynamicRouteModePeerPrototype +type VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity to use. + // + // If unspecified: + // - If `peer.address` is specified, the `type` will be `ipv4_address`, and the `value` will be `peer.address`. + // - If `peer.fqdn` is specified, the `type` will be `fqdn`, and the `value` will be `peer.fqdn`. + IkeIdentity VPNGatewayConnectionIkeIdentityPrototypeIntf `json:"ike_identity,omitempty"` + + // The IP address of the peer VPN gateway for this connection. + Address *string `json:"address" validate:"required"` +} + +// NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress : Instantiate VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress(asn int64, address string) (_model *VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress, err error) { + _model = &VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress{ + Asn: core.Int64Ptr(asn), + Address: core.StringPtr(address), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress) isaVPNGatewayConnectionDynamicRouteModePeerPrototype() bool { + return true +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn : VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn struct +// This model "extends" VPNGatewayConnectionDynamicRouteModePeerPrototype +type VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity to use. + // + // If unspecified: + // - If `peer.address` is specified, the `type` will be `ipv4_address`, and the `value` will be `peer.address`. + // - If `peer.fqdn` is specified, the `type` will be `fqdn`, and the `value` will be `peer.fqdn`. + IkeIdentity VPNGatewayConnectionIkeIdentityPrototypeIntf `json:"ike_identity,omitempty"` + + // The FQDN of the peer VPN gateway for this connection. + Fqdn *string `json:"fqdn" validate:"required"` +} + +// NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn : Instantiate VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn(asn int64, fqdn string) (_model *VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn, err error) { + _model = &VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn{ + Asn: core.Int64Ptr(asn), + Fqdn: core.StringPtr(fqdn), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn) isaVPNGatewayConnectionDynamicRouteModePeerPrototype() bool { + return true +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) + if err != nil { + err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress : VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress struct +// This model "extends" VPNGatewayConnectionDynamicRouteModePeer +type VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity. + IkeIdentity VPNGatewayConnectionIkeIdentityIntf `json:"ike_identity" validate:"required"` + + // Indicates whether `peer.address` or `peer.fqdn` is used. + Type *string `json:"type" validate:"required"` + + // The IP address of the peer VPN gateway for this connection. + Address *string `json:"address" validate:"required"` +} + +// Constants associated with the VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress.Type property. +// Indicates whether `peer.address` or `peer.fqdn` is used. +const ( + VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddressTypeAddressConst = "address" + VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddressTypeFqdnConst = "fqdn" +) + +func (*VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress) isaVPNGatewayConnectionDynamicRouteModePeer() bool { + return true +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn : VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn struct +// This model "extends" VPNGatewayConnectionDynamicRouteModePeer +type VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity. + IkeIdentity VPNGatewayConnectionIkeIdentityIntf `json:"ike_identity" validate:"required"` + + // Indicates whether `peer.address` or `peer.fqdn` is used. + Type *string `json:"type" validate:"required"` + + // The FQDN of the peer VPN gateway for this connection. + Fqdn *string `json:"fqdn" validate:"required"` +} + +// Constants associated with the VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn.Type property. +// Indicates whether `peer.address` or `peer.fqdn` is used. +const ( + VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdnTypeAddressConst = "address" + VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdnTypeFqdnConst = "fqdn" +) + +func (*VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn) isaVPNGatewayConnectionDynamicRouteModePeer() bool { + return true +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) + if err != nil { + err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn : VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn struct // This model "extends" VPNGatewayConnectionIkeIdentityPrototype type VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn struct { @@ -137453,13 +154679,19 @@ func UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(m return } -// VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch : The peer VPN gateway for this connection. If `peer.type` is `ipv4_address`, only `peer.address` may be specified. If +// VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch : The peer VPN gateway for this connection. If `peer.type` is `ipv4_address`, only `peer.address` may be specified. If // `peer.type` is fqdn, only `peer.fqdn` may be specified. // Models which "extend" this model: -// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch -// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch +// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch +// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch // This model "extends" VPNGatewayConnectionPeerPatch -type VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch struct { +type VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn,omitempty"` + // The IP address of the peer VPN gateway for this connection. Address *string `json:"address,omitempty"` @@ -137467,22 +154699,27 @@ type VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch struct Fqdn *string `json:"fqdn,omitempty"` } -func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch() bool { +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch() bool { return true } -type VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchIntf interface { +type VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchIntf interface { VPNGatewayConnectionPeerPatchIntf - isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch() bool + isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch() bool } -func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch) isaVPNGatewayConnectionPeerPatch() bool { +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch) isaVPNGatewayConnectionPeerPatch() bool { return true } -// UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch unmarshals an instance of VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch) +// UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch unmarshals an instance of VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) @@ -137497,26 +154734,29 @@ func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPat return } -// asPatch returns a generic map representation of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch -func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch *VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch) asPatch() (_patch map[string]interface{}) { +// asPatch returns a generic map representation of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch +func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch *VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch) asPatch() (_patch map[string]interface{}) { _patch = map[string]interface{}{} - if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch.Address) { - _patch["address"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch.Address + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Asn) { + _patch["asn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Asn } - if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch.Fqdn) { - _patch["fqdn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch.Fqdn + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Address) { + _patch["address"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Address + } + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Fqdn) { + _patch["fqdn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Fqdn } return } -// VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch : The peer VPN gateway for this connection. If `peer.type` is `ipv4_address`, only `peer.address` may be specified. If +// VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch : The peer VPN gateway for this connection. If `peer.type` is `ipv4_address`, only `peer.address` may be specified. If // `peer.type` is fqdn, only `peer.fqdn` may be specified. // Models which "extend" this model: -// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch -// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch +// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch +// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch // This model "extends" VPNGatewayConnectionPeerPatch -type VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch struct { +type VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch struct { // The IP address of the peer VPN gateway for this connection. Address *string `json:"address,omitempty"` @@ -137524,22 +154764,22 @@ type VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch s Fqdn *string `json:"fqdn,omitempty"` } -func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch() bool { +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch() bool { return true } -type VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchIntf interface { +type VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchIntf interface { VPNGatewayConnectionPeerPatchIntf - isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch() bool + isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch() bool } -func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch) isaVPNGatewayConnectionPeerPatch() bool { +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch) isaVPNGatewayConnectionPeerPatch() bool { return true } -// UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch unmarshals an instance of VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch) +// UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch unmarshals an instance of VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch) err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) @@ -137554,14 +154794,14 @@ func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePe return } -// asPatch returns a generic map representation of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch -func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch *VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch) asPatch() (_patch map[string]interface{}) { +// asPatch returns a generic map representation of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch +func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch *VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch) asPatch() (_patch map[string]interface{}) { _patch = map[string]interface{}{} - if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch.Address) { - _patch["address"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch.Address + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch.Address) { + _patch["address"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch.Address } - if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch.Fqdn) { - _patch["fqdn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch.Fqdn + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch.Fqdn) { + _patch["fqdn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch.Fqdn } return @@ -137994,6 +155234,158 @@ func UnmarshalVPNGatewayConnectionPolicyModePeerVPNGatewayConnectionPeerByFqdn(m return } +// VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype : VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype struct +// This model "extends" VPNGatewayConnectionPrototype +type VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up,omitempty"` + + DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` + + // The establish mode of the VPN gateway connection: + // - `bidirectional`: Either side of the VPN gateway can initiate IKE protocol + // negotiations or rekeying processes. + // - `peer_only`: Only the peer can initiate IKE protocol negotiations for this VPN gateway + // connection. Additionally, the peer is responsible for initiating the rekeying process + // after the connection is established. If rekeying does not occur, the VPN gateway + // connection will be brought down after its lifetime expires. + EstablishMode *string `json:"establish_mode,omitempty"` + + IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` + + IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` + + // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The pre-shared key. + Psk *string `json:"psk" validate:"required"` + + // Indicates whether the traffic is distributed between the `up` tunnels of the VPN gateway connection when the VPC + // route's next hop is a VPN connection. If `false`, the traffic is only routed through the `up` tunnel with the lower + // `public_ip` address. Before enabling it on VPN connections to on-prem private networks, review + // [distributing traffic + // restrictions](https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-limitations#distributing-traffic-restrictions). + DistributeTraffic *bool `json:"distribute_traffic,omitempty"` + + Local *VPNGatewayConnectionDynamicRouteModeLocalPrototype `json:"local,omitempty"` + + Peer VPNGatewayConnectionDynamicRouteModePeerPrototypeIntf `json:"peer" validate:"required"` + + // The routing protocol for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol" validate:"required"` + + // The VPN tunnel configuration to use for this VPN gateway connection + // (in dynamic route mode). + Tunnels []VPNGatewayConnectionTunnelPrototype `json:"tunnels" validate:"required"` +} + +// Constants associated with the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype.EstablishMode property. +// The establish mode of the VPN gateway connection: +// - `bidirectional`: Either side of the VPN gateway can initiate IKE protocol +// negotiations or rekeying processes. +// - `peer_only`: Only the peer can initiate IKE protocol negotiations for this VPN gateway +// connection. Additionally, the peer is responsible for initiating the rekeying process +// after the connection is established. If rekeying does not occur, the VPN gateway +// connection will be brought down after its lifetime expires. +const ( + VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototypeEstablishModeBidirectionalConst = "bidirectional" + VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototypeEstablishModePeerOnlyConst = "peer_only" +) + +// Constants associated with the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype.RoutingProtocol property. +// The routing protocol for this VPN gateway connection. +const ( + VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototypeRoutingProtocolBgpConst = "bgp" +) + +// NewVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype : Instantiate VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype(psk string, peer VPNGatewayConnectionDynamicRouteModePeerPrototypeIntf, routingProtocol string, tunnels []VPNGatewayConnectionTunnelPrototype) (_model *VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype, err error) { + _model = &VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype{ + Psk: core.StringPtr(psk), + Peer: peer, + RoutingProtocol: core.StringPtr(routingProtocol), + Tunnels: tunnels, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype) isaVPNGatewayConnectionPrototype() bool { + return true +} + +// UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype unmarshals an instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) + if err != nil { + err = core.SDKErrorf(err, "", "admin_state_up-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "dead_peer_detection-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "establish_mode", &obj.EstablishMode) + if err != nil { + err = core.SDKErrorf(err, "", "establish_mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ike_policy-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ipsec_policy-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + if err != nil { + err = core.SDKErrorf(err, "", "psk-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "distribute_traffic", &obj.DistributeTraffic) + if err != nil { + err = core.SDKErrorf(err, "", "distribute_traffic-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalVPNGatewayConnectionDynamicRouteModeLocalPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "peer", &obj.Peer, UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "peer-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "routing_protocol-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionTunnelPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype : VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype struct // This model "extends" VPNGatewayConnectionPrototype type VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype struct { @@ -138254,6 +155646,7 @@ func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePr // VPNGatewayConnectionRouteMode : VPNGatewayConnectionRouteMode struct // Models which "extend" this model: // - VPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode +// - VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode // This model "extends" VPNGatewayConnection type VPNGatewayConnectionRouteMode struct { // If set to false, the VPN gateway connection is shut down. @@ -138408,7 +155801,12 @@ func UnmarshalVPNGatewayConnectionRouteMode(m map[string]json.RawMessage, result err = core.SDKErrorf(err, "required discriminator property 'routing_protocol' not found in JSON object", "missing-discriminator", common.GetComponentInfo()) return } - if discValue == "none" { + if discValue == "bgp" { + err = core.UnmarshalModel(m, "", result, UnmarshalVPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode-error", common.GetComponentInfo()) + } + } else if discValue == "none" { err = core.UnmarshalModel(m, "", result, UnmarshalVPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode) if err != nil { err = core.SDKErrorf(err, "", "unmarshal-VPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode-error", common.GetComponentInfo()) @@ -138784,133 +156182,357 @@ func UnmarshalVPNGatewayPolicyMode(m map[string]json.RawMessage, result interfac err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayPrototypeVPNGatewayPolicyModePrototype : VPNGatewayPrototypeVPNGatewayPolicyModePrototype struct -// This model "extends" VPNGatewayPrototype -type VPNGatewayPrototypeVPNGatewayPolicyModePrototype struct { - // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // The mode for this VPN gateway. - Mode *string `json:"mode" validate:"required"` -} - -// Constants associated with the VPNGatewayPrototypeVPNGatewayPolicyModePrototype.Mode property. -// The mode for this VPN gateway. -const ( - VPNGatewayPrototypeVPNGatewayPolicyModePrototypeModePolicyConst = "policy" -) - -// NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype : Instantiate VPNGatewayPrototypeVPNGatewayPolicyModePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype(subnet SubnetIdentityIntf, mode string) (_model *VPNGatewayPrototypeVPNGatewayPolicyModePrototype, err error) { - _model = &VPNGatewayPrototypeVPNGatewayPolicyModePrototype{ - Subnet: subnet, - Mode: core.StringPtr(mode), - } - err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } - return -} - -func (*VPNGatewayPrototypeVPNGatewayPolicyModePrototype) isaVPNGatewayPrototype() bool { - return true -} - -// UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype unmarshals an instance of VPNGatewayPrototypeVPNGatewayPolicyModePrototype from the specified map of raw messages. -func UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPrototypeVPNGatewayPolicyModePrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "subnet-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// VPNGatewayPrototypeVPNGatewayRouteModePrototype : VPNGatewayPrototypeVPNGatewayRouteModePrototype struct -// This model "extends" VPNGatewayPrototype -type VPNGatewayPrototypeVPNGatewayRouteModePrototype struct { - // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name - // will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` - - // The mode for this VPN gateway. - Mode *string `json:"mode,omitempty"` -} - -// Constants associated with the VPNGatewayPrototypeVPNGatewayRouteModePrototype.Mode property. -// The mode for this VPN gateway. -const ( - VPNGatewayPrototypeVPNGatewayRouteModePrototypeModeRouteConst = "route" -) - -// NewVPNGatewayPrototypeVPNGatewayRouteModePrototype : Instantiate VPNGatewayPrototypeVPNGatewayRouteModePrototype (Generic Model Constructor) -func (*VpcV1) NewVPNGatewayPrototypeVPNGatewayRouteModePrototype(subnet SubnetIdentityIntf) (_model *VPNGatewayPrototypeVPNGatewayRouteModePrototype, err error) { - _model = &VPNGatewayPrototypeVPNGatewayRouteModePrototype{ - Subnet: subnet, - } - err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } - return -} - -func (*VPNGatewayPrototypeVPNGatewayRouteModePrototype) isaVPNGatewayPrototype() bool { - return true -} - -// UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype unmarshals an instance of VPNGatewayPrototypeVPNGatewayRouteModePrototype from the specified map of raw messages. -func UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayPrototypeVPNGatewayRouteModePrototype) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + if err != nil { + err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayPrototypeVPNGatewayPolicyModePrototype : VPNGatewayPrototypeVPNGatewayPolicyModePrototype struct +// This model "extends" VPNGatewayPrototype +type VPNGatewayPrototypeVPNGatewayPolicyModePrototype struct { + // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name + // will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + + // The mode for this VPN gateway. + Mode *string `json:"mode" validate:"required"` +} + +// Constants associated with the VPNGatewayPrototypeVPNGatewayPolicyModePrototype.Mode property. +// The mode for this VPN gateway. +const ( + VPNGatewayPrototypeVPNGatewayPolicyModePrototypeModePolicyConst = "policy" +) + +// NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype : Instantiate VPNGatewayPrototypeVPNGatewayPolicyModePrototype (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayPrototypeVPNGatewayPolicyModePrototype(subnet SubnetIdentityIntf, mode string) (_model *VPNGatewayPrototypeVPNGatewayPolicyModePrototype, err error) { + _model = &VPNGatewayPrototypeVPNGatewayPolicyModePrototype{ + Subnet: subnet, + Mode: core.StringPtr(mode), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*VPNGatewayPrototypeVPNGatewayPolicyModePrototype) isaVPNGatewayPrototype() bool { + return true +} + +// UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype unmarshals an instance of VPNGatewayPrototypeVPNGatewayPolicyModePrototype from the specified map of raw messages. +func UnmarshalVPNGatewayPrototypeVPNGatewayPolicyModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayPrototypeVPNGatewayPolicyModePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "subnet-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + if err != nil { + err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayPrototypeVPNGatewayRouteModePrototype : VPNGatewayPrototypeVPNGatewayRouteModePrototype struct +// This model "extends" VPNGatewayPrototype +type VPNGatewayPrototypeVPNGatewayRouteModePrototype struct { + // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. If unspecified, the name + // will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + + // The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + // advertise routes with these CIDRs as route destinations. + AdvertisedCIDRs []string `json:"advertised_cidrs,omitempty"` + + // The local autonomous system number (ASN) for this VPN gateway and its connections. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + LocalAsn *int64 `json:"local_asn,omitempty"` + + // The mode for this VPN gateway. + Mode *string `json:"mode,omitempty"` +} + +// Constants associated with the VPNGatewayPrototypeVPNGatewayRouteModePrototype.Mode property. +// The mode for this VPN gateway. +const ( + VPNGatewayPrototypeVPNGatewayRouteModePrototypeModeRouteConst = "route" +) + +// NewVPNGatewayPrototypeVPNGatewayRouteModePrototype : Instantiate VPNGatewayPrototypeVPNGatewayRouteModePrototype (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayPrototypeVPNGatewayRouteModePrototype(subnet SubnetIdentityIntf) (_model *VPNGatewayPrototypeVPNGatewayRouteModePrototype, err error) { + _model = &VPNGatewayPrototypeVPNGatewayRouteModePrototype{ + Subnet: subnet, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*VPNGatewayPrototypeVPNGatewayRouteModePrototype) isaVPNGatewayPrototype() bool { + return true +} + +// UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype unmarshals an instance of VPNGatewayPrototypeVPNGatewayRouteModePrototype from the specified map of raw messages. +func UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayPrototypeVPNGatewayRouteModePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "subnet-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "advertised_cidrs", &obj.AdvertisedCIDRs) + if err != nil { + err = core.SDKErrorf(err, "", "advertised_cidrs-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "local_asn", &obj.LocalAsn) + if err != nil { + err = core.SDKErrorf(err, "", "local_asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + if err != nil { + err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayRouteMode : VPNGatewayRouteMode struct +// This model "extends" VPNGateway +type VPNGatewayRouteMode struct { + // The 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 CRN for this VPN gateway. + CRN *string `json:"crn" validate:"required"` + + // The reasons for the current `health_state` (if any). + HealthReasons []VPNGatewayHealthReason `json:"health_reasons" 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 URL for this VPN gateway. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this VPN gateway. + ID *string `json:"id" validate:"required"` + + // The reasons for the current `lifecycle_state` (if any). + LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the VPN gateway. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The members for the VPN gateway. + Members []VPNGatewayMember `json:"members" validate:"required"` + + // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. + Name *string `json:"name" validate:"required"` + + // The resource group for this VPN gateway. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + Subnet *SubnetReference `json:"subnet" validate:"required"` + + // The VPC this VPN gateway resides in. + VPC *VPCReference `json:"vpc" validate:"required"` + + // The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + // advertise routes with these CIDRs as route destinations. + AdvertisedCIDRs []string `json:"advertised_cidrs" validate:"required"` + + // The local autonomous system number (ASN) for this VPN gateway and its connections. + LocalAsn *int64 `json:"local_asn" validate:"required"` + + // The mode for this VPN gateway. + Mode *string `json:"mode" validate:"required"` +} + +// Constants associated with the VPNGatewayRouteMode.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 ( + VPNGatewayRouteModeHealthStateDegradedConst = "degraded" + VPNGatewayRouteModeHealthStateFaultedConst = "faulted" + VPNGatewayRouteModeHealthStateInapplicableConst = "inapplicable" + VPNGatewayRouteModeHealthStateOkConst = "ok" +) + +// Constants associated with the VPNGatewayRouteMode.LifecycleState property. +// The lifecycle state of the VPN gateway. +const ( + VPNGatewayRouteModeLifecycleStateDeletingConst = "deleting" + VPNGatewayRouteModeLifecycleStateFailedConst = "failed" + VPNGatewayRouteModeLifecycleStatePendingConst = "pending" + VPNGatewayRouteModeLifecycleStateStableConst = "stable" + VPNGatewayRouteModeLifecycleStateSuspendedConst = "suspended" + VPNGatewayRouteModeLifecycleStateUpdatingConst = "updating" + VPNGatewayRouteModeLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the VPNGatewayRouteMode.ResourceType property. +// The resource type. +const ( + VPNGatewayRouteModeResourceTypeVPNGatewayConst = "vpn_gateway" +) + +// Constants associated with the VPNGatewayRouteMode.Mode property. +// The mode for this VPN gateway. +const ( + VPNGatewayRouteModeModeRouteConst = "route" +) + +func (*VPNGatewayRouteMode) isaVPNGateway() bool { + return true +} + +// UnmarshalVPNGatewayRouteMode unmarshals an instance of VPNGatewayRouteMode from the specified map of raw messages. +func UnmarshalVPNGatewayRouteMode(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayRouteMode) + err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) + if err != nil { + err = core.SDKErrorf(err, "", "connections-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) + if err != nil { + err = core.SDKErrorf(err, "", "health_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + err = core.SDKErrorf(err, "", "health_state-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) + if err != nil { + err = core.SDKErrorf(err, "", "lifecycle_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + err = core.SDKErrorf(err, "", "lifecycle_state-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) + if err != nil { + err = core.SDKErrorf(err, "", "members-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) + if err != nil { + err = core.SDKErrorf(err, "", "subnet-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) + if err != nil { + err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "advertised_cidrs", &obj.AdvertisedCIDRs) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "advertised_cidrs-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) + err = core.UnmarshalPrimitive(m, "local_asn", &obj.LocalAsn) if err != nil { - err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "subnet-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "local_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) @@ -138922,189 +156544,47 @@ func UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype(m map[string]json. return } -// VPNGatewayRouteMode : VPNGatewayRouteMode struct -// This model "extends" VPNGateway -type VPNGatewayRouteMode struct { - // The 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 CRN for this VPN gateway. +// VPNGatewayServiceConnectionCreatorTransitGatewayReference : VPNGatewayServiceConnectionCreatorTransitGatewayReference struct +// This model "extends" VPNGatewayServiceConnectionCreator +type VPNGatewayServiceConnectionCreatorTransitGatewayReference struct { + // The CRN for this transit gateway. CRN *string `json:"crn" validate:"required"` - // The reasons for the current `health_state` (if any). - HealthReasons []VPNGatewayHealthReason `json:"health_reasons" 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 URL for this VPN gateway. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this VPN gateway. + // The unique identifier for this transit gateway. ID *string `json:"id" validate:"required"` - // The reasons for the current `lifecycle_state` (if any). - LifecycleReasons []VPNGatewayLifecycleReason `json:"lifecycle_reasons" validate:"required"` - - // The lifecycle state of the VPN gateway. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The members for the VPN gateway. - Members []VPNGatewayMember `json:"members" validate:"required"` - - // The name for this VPN gateway. The name is unique across all VPN gateways in the VPC. - Name *string `json:"name" validate:"required"` - - // The resource group for this VPN gateway. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - // The resource type. ResourceType *string `json:"resource_type" validate:"required"` - - Subnet *SubnetReference `json:"subnet" validate:"required"` - - // The VPC this VPN gateway resides in. - VPC *VPCReference `json:"vpc" validate:"required"` - - // The mode for this VPN gateway. - Mode *string `json:"mode" validate:"required"` } -// Constants associated with the VPNGatewayRouteMode.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 ( - VPNGatewayRouteModeHealthStateDegradedConst = "degraded" - VPNGatewayRouteModeHealthStateFaultedConst = "faulted" - VPNGatewayRouteModeHealthStateInapplicableConst = "inapplicable" - VPNGatewayRouteModeHealthStateOkConst = "ok" -) - -// Constants associated with the VPNGatewayRouteMode.LifecycleState property. -// The lifecycle state of the VPN gateway. -const ( - VPNGatewayRouteModeLifecycleStateDeletingConst = "deleting" - VPNGatewayRouteModeLifecycleStateFailedConst = "failed" - VPNGatewayRouteModeLifecycleStatePendingConst = "pending" - VPNGatewayRouteModeLifecycleStateStableConst = "stable" - VPNGatewayRouteModeLifecycleStateSuspendedConst = "suspended" - VPNGatewayRouteModeLifecycleStateUpdatingConst = "updating" - VPNGatewayRouteModeLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the VPNGatewayRouteMode.ResourceType property. +// Constants associated with the VPNGatewayServiceConnectionCreatorTransitGatewayReference.ResourceType property. // The resource type. const ( - VPNGatewayRouteModeResourceTypeVPNGatewayConst = "vpn_gateway" + VPNGatewayServiceConnectionCreatorTransitGatewayReferenceResourceTypeTransitGatewayConst = "transit_gateway" ) -// Constants associated with the VPNGatewayRouteMode.Mode property. -// The mode for this VPN gateway. -const ( - VPNGatewayRouteModeModeRouteConst = "route" -) - -func (*VPNGatewayRouteMode) isaVPNGateway() bool { +func (*VPNGatewayServiceConnectionCreatorTransitGatewayReference) isaVPNGatewayServiceConnectionCreator() bool { return true } -// UnmarshalVPNGatewayRouteMode unmarshals an instance of VPNGatewayRouteMode from the specified map of raw messages. -func UnmarshalVPNGatewayRouteMode(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayRouteMode) - err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalVPNGatewayConnectionReference) - if err != nil { - err = core.SDKErrorf(err, "", "connections-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return - } +// UnmarshalVPNGatewayServiceConnectionCreatorTransitGatewayReference unmarshals an instance of VPNGatewayServiceConnectionCreatorTransitGatewayReference from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnectionCreatorTransitGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnectionCreatorTransitGatewayReference) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalVPNGatewayHealthReason) - if err != nil { - err = core.SDKErrorf(err, "", "health_reasons-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) - if err != nil { - err = core.SDKErrorf(err, "", "health_state-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayLifecycleReason) - if err != nil { - err = core.SDKErrorf(err, "", "lifecycle_reasons-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - err = core.SDKErrorf(err, "", "lifecycle_state-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "members", &obj.Members, UnmarshalVPNGatewayMember) - if err != nil { - err = core.SDKErrorf(err, "", "members-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) - return - } err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "subnet", &obj.Subnet, UnmarshalSubnetReference) - if err != nil { - err = core.SDKErrorf(err, "", "subnet-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) - if err != nil { - err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) - if err != nil { - err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -139840,11 +157320,17 @@ type VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext struct { UserTags []string `json:"user_tags,omitempty"` // The capacity to use for the volume (in gigabytes). The specified value must be within the `capacity` range of the - // volume's profile. + // volume's profile or the capacity to use for the volume (in gigabytes). The specified value must be at least the + // snapshot's `minimum_capacity`, and must be within the `capacity` range of the volume's profile. + // + // 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 `encryption` type for the volume will be `provider_managed` or 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"` @@ -140039,6 +157525,247 @@ func UnmarshalVolumeIdentityByID(m map[string]json.RawMessage, result interface{ return } +// VolumeJobPrototypeVolumeJobTypeMigratePrototype : VolumeJobPrototypeVolumeJobTypeMigratePrototype struct +// This model "extends" VolumeJobPrototype +type VolumeJobPrototypeVolumeJobTypeMigratePrototype struct { + // The name for this volume job. The name must not be used by another job for this volume. If unspecified, the name + // will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The type of job this volume job will perform. + // + // The volume must: + // - Have a `status` of `available` + // - Not currently have another `migrate` job with a `status` of `queued` or `running`. + // + // If the volume is attached to an instance, the instance must be in `running` state. + JobType *string `json:"job_type" validate:"required"` + + // The parameters to use after the volume is migrated. + Parameters *VolumeJobTypeMigrateParameters `json:"parameters" validate:"required"` +} + +// Constants associated with the VolumeJobPrototypeVolumeJobTypeMigratePrototype.JobType property. +// The type of job this volume job will perform. +// +// The volume must: +// - Have a `status` of `available` +// - Not currently have another `migrate` job with a `status` of `queued` or `running`. +// +// If the volume is attached to an instance, the instance must be in `running` state. +const ( + VolumeJobPrototypeVolumeJobTypeMigratePrototypeJobTypeMigrateConst = "migrate" +) + +// NewVolumeJobPrototypeVolumeJobTypeMigratePrototype : Instantiate VolumeJobPrototypeVolumeJobTypeMigratePrototype (Generic Model Constructor) +func (*VpcV1) NewVolumeJobPrototypeVolumeJobTypeMigratePrototype(jobType string, parameters *VolumeJobTypeMigrateParameters) (_model *VolumeJobPrototypeVolumeJobTypeMigratePrototype, err error) { + _model = &VolumeJobPrototypeVolumeJobTypeMigratePrototype{ + JobType: core.StringPtr(jobType), + Parameters: parameters, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*VolumeJobPrototypeVolumeJobTypeMigratePrototype) isaVolumeJobPrototype() bool { + return true +} + +// UnmarshalVolumeJobPrototypeVolumeJobTypeMigratePrototype unmarshals an instance of VolumeJobPrototypeVolumeJobTypeMigratePrototype from the specified map of raw messages. +func UnmarshalVolumeJobPrototypeVolumeJobTypeMigratePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeJobPrototypeVolumeJobTypeMigratePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "job_type", &obj.JobType) + if err != nil { + err = core.SDKErrorf(err, "", "job_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "parameters", &obj.Parameters, UnmarshalVolumeJobTypeMigrateParameters) + if err != nil { + err = core.SDKErrorf(err, "", "parameters-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VolumeJobTypeMigrate : VolumeJobTypeMigrate struct +// This model "extends" VolumeJob +type VolumeJobTypeMigrate struct { + // Indicates whether this volume job will be automatically deleted after it completes. At present, this is always + // `false`, but may be modifiable in the future. + AutoDelete *bool `json:"auto_delete" validate:"required"` + + // The date and time that the volume job was completed. + // + // If absent, the volume job has not yet completed. + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // The date and time that the volume job was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The date and time that the volume job is estimated to complete. + // + // If absent, the volume job is still queued and has not yet started. + EstimatedCompletionAt *strfmt.DateTime `json:"estimated_completion_at,omitempty"` + + // The URL for this volume job. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this volume job. + ID *string `json:"id" validate:"required"` + + // The name for this volume job. The name must not be used by another job for this volume. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The date and time that the volume job was started. + // + // If absent, the volume job has not yet started. + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // The status of this volume job: + // - `canceled`: the job is canceled + // - `canceling`: the job is being canceled + // - `deleting`: the job is being deleted + // - `failed`: the job could not be completed successfully + // - `queued`: the job is queued + // - `running`: the job is in progress + // - `succeeded`: the job completed successfully + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + StatusReasons []VolumeJobStatusReason `json:"status_reasons" validate:"required"` + + // The type of volume job. + JobType *string `json:"job_type" validate:"required"` + + // The parameters to use after the volume is migrated. + Parameters *VolumeJobTypeMigrateParameters `json:"parameters" validate:"required"` +} + +// Constants associated with the VolumeJobTypeMigrate.ResourceType property. +// The resource type. +const ( + VolumeJobTypeMigrateResourceTypeVolumeJobConst = "volume_job" +) + +// Constants associated with the VolumeJobTypeMigrate.Status property. +// The status of this volume job: +// - `canceled`: the job is canceled +// - `canceling`: the job is being canceled +// - `deleting`: the job is being deleted +// - `failed`: the job could not be completed successfully +// - `queued`: the job is queued +// - `running`: the job is in progress +// - `succeeded`: the job completed successfully +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + VolumeJobTypeMigrateStatusCanceledConst = "canceled" + VolumeJobTypeMigrateStatusCancelingConst = "canceling" + VolumeJobTypeMigrateStatusDeletingConst = "deleting" + VolumeJobTypeMigrateStatusFailedConst = "failed" + VolumeJobTypeMigrateStatusQueuedConst = "queued" + VolumeJobTypeMigrateStatusRunningConst = "running" + VolumeJobTypeMigrateStatusSucceededConst = "succeeded" +) + +// Constants associated with the VolumeJobTypeMigrate.JobType property. +// The type of volume job. +const ( + VolumeJobTypeMigrateJobTypeMigrateConst = "migrate" +) + +func (*VolumeJobTypeMigrate) isaVolumeJob() bool { + return true +} + +// UnmarshalVolumeJobTypeMigrate unmarshals an instance of VolumeJobTypeMigrate from the specified map of raw messages. +func UnmarshalVolumeJobTypeMigrate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeJobTypeMigrate) + err = core.UnmarshalPrimitive(m, "auto_delete", &obj.AutoDelete) + if err != nil { + err = core.SDKErrorf(err, "", "auto_delete-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "completed_at", &obj.CompletedAt) + if err != nil { + err = core.SDKErrorf(err, "", "completed_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "estimated_completion_at", &obj.EstimatedCompletionAt) + if err != nil { + err = core.SDKErrorf(err, "", "estimated_completion_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "started_at", &obj.StartedAt) + if err != nil { + err = core.SDKErrorf(err, "", "started_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVolumeJobStatusReason) + if err != nil { + err = core.SDKErrorf(err, "", "status_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "job_type", &obj.JobType) + if err != nil { + err = core.SDKErrorf(err, "", "job_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "parameters", &obj.Parameters, UnmarshalVolumeJobTypeMigrateParameters) + if err != nil { + err = core.SDKErrorf(err, "", "parameters-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VolumeProfileBandwidthDependent : The maximum bandwidth (in Mbps) of a volume with this profile depends on its configuration. // This model "extends" VolumeProfileBandwidth type VolumeProfileBandwidthDependent struct { @@ -142966,45 +160693,44 @@ func UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceCl return } -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager +// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup struct // This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec struct { +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup struct { // The name for this instance group manager action. The name must not be used by another action for the instance group // 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 // period. - CronSpec *string `json:"cron_spec,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` -} + CronSpec *string `json:"cron_spec" validate:"required"` -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool { - return true + Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group" validate:"required"` } -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecIntf interface { - InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf - isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool +// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup(cronSpec string, group *InstanceGroupManagerScheduledActionGroupPrototype) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup, err error) { + _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup{ + CronSpec: core.StringPtr(cronSpec), + Group: group, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { return true } -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototype() bool { +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup) isaInstanceGroupManagerActionPrototype() bool { return true } -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) +// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) @@ -143020,6 +160746,58 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronS err = core.SDKErrorf(err, "", "group-error", common.GetComponentInfo()) return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager struct +// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager struct { + // The name for this instance group manager action. The name must not be used by another action for the instance group + // 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 + // period. + CronSpec *string `json:"cron_spec" validate:"required"` + + Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager" validate:"required"` +} + +// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager(cronSpec string, manager InstanceGroupManagerScheduledActionManagerPrototypeIntf) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager, err error) { + _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager{ + CronSpec: core.StringPtr(cronSpec), + Manager: manager, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { + return true +} + +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager) isaInstanceGroupManagerActionPrototype() bool { + return true +} + +// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + if err != nil { + err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) if err != nil { err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) @@ -143029,57 +160807,102 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronS return } -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager +// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup struct // This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt struct { +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup struct { // The name for this instance group manager action. The name must not be used by another action for the instance group // 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. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` -} + Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group" validate:"required"` -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool { - return true + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at" validate:"required"` } -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtIntf interface { - InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf - isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool +// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup(group *InstanceGroupManagerScheduledActionGroupPrototype, runAt *strfmt.DateTime) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup, err error) { + _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup{ + Group: group, + RunAt: runAt, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { return true } -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototype() bool { +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup) isaInstanceGroupManagerActionPrototype() bool { return true } -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) +// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "group-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) if err != nil { err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager struct +// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager struct { + // The name for this instance group manager action. The name must not be used by another action for the instance group + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager" validate:"required"` + + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at" validate:"required"` +} + +// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager(manager InstanceGroupManagerScheduledActionManagerPrototypeIntf, runAt *strfmt.DateTime) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager, err error) { + _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager{ + Manager: manager, + RunAt: runAt, + } + err = core.ValidateStruct(_model, "required parameters") if err != nil { - err = core.SDKErrorf(err, "", "group-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { + return true +} + +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager) isaInstanceGroupManagerActionPrototype() bool { + return true +} + +// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) @@ -143087,6 +160910,11 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + if err != nil { + err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -144312,6 +162140,8 @@ func UnmarshalInstancePlacementTargetPrototypePlacementGroupIdentityPlacementGro // InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment : InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment struct // This model "extends" InstancePrototypeInstanceByCatalogOffering type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -144362,7 +162192,8 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -144378,9 +162209,17 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -144412,6 +162251,16 @@ const ( InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment{ @@ -144437,6 +162286,11 @@ func (*InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstan // UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -144507,11 +162361,21 @@ func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferin err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -144549,6 +162413,8 @@ func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferin // InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface : InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface struct // This model "extends" InstancePrototypeInstanceByCatalogOffering type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -144599,7 +162465,8 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -144615,9 +162482,17 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -144649,6 +162524,16 @@ const ( InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface, err error) { _model = &InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface{ @@ -144674,6 +162559,11 @@ func (*InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstan // UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -144744,11 +162634,21 @@ func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferin err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -144786,6 +162686,8 @@ func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferin // InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment : InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment struct // This model "extends" InstancePrototypeInstanceByImage type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -144836,7 +162738,8 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -144852,9 +162755,17 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -144887,6 +162798,16 @@ const ( InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment{ @@ -144912,6 +162833,11 @@ func (*InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmen // UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -144982,11 +162908,21 @@ func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAt err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -145024,6 +162960,8 @@ func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAt // InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface : InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface struct // This model "extends" InstancePrototypeInstanceByImage type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -145074,7 +163012,8 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface s // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -145090,9 +163029,17 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface s // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -145125,6 +163072,16 @@ const ( InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface, err error) { _model = &InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface{ @@ -145150,6 +163107,11 @@ func (*InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface // UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -145220,11 +163182,21 @@ func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkIn err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -145262,6 +163234,8 @@ func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkIn // InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment : InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment struct // This model "extends" InstancePrototypeInstanceBySourceSnapshot type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -145312,7 +163286,8 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -145328,9 +163303,17 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -145360,6 +163343,16 @@ const ( InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment{ @@ -145385,6 +163378,11 @@ func (*InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstance // UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -145455,11 +163453,21 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotI err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -145492,6 +163500,8 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotI // InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface : InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface struct // This model "extends" InstancePrototypeInstanceBySourceSnapshot type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -145542,7 +163552,8 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -145558,9 +163569,17 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -145590,6 +163609,16 @@ const ( InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface, err error) { _model = &InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface{ @@ -145615,6 +163644,11 @@ func (*InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstance // UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -145685,11 +163719,21 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotI err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -145722,6 +163766,8 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotI // InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment : InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment struct // This model "extends" InstancePrototypeInstanceByVolume type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -145772,7 +163818,8 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmen // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -145788,9 +163835,17 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmen // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -145820,6 +163875,16 @@ const ( InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment{ @@ -145845,6 +163910,11 @@ func (*InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachm // UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment unmarshals an instance of InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -145915,11 +163985,21 @@ func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwork err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -145952,6 +164032,8 @@ func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwork // InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface : InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface struct // This model "extends" InstancePrototypeInstanceByVolume type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -146002,7 +164084,8 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -146018,9 +164101,17 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -146050,6 +164141,16 @@ const ( InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface, err error) { _model = &InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface{ @@ -146075,6 +164176,11 @@ func (*InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfa // UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface unmarshals an instance of InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface from the specified map of raw messages. func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -146145,11 +164251,21 @@ func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwork err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -146182,6 +164298,8 @@ func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwork // InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment : InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment struct // This model "extends" InstanceTemplatePrototypeInstanceTemplateByCatalogOffering type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -146230,7 +164348,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -146246,9 +164365,17 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -146280,6 +164407,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment{ @@ -146305,6 +164442,11 @@ func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplat // UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -146375,11 +164517,21 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstance err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -146417,6 +164569,8 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstance // InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface : InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface struct // This model "extends" InstanceTemplatePrototypeInstanceTemplateByCatalogOffering type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -146465,7 +164619,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -146481,9 +164636,17 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -146515,6 +164678,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface{ @@ -146540,6 +164713,11 @@ func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplat // UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -146610,11 +164788,21 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstance err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -146652,6 +164840,8 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstance // InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment : InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment struct // This model "extends" InstanceTemplatePrototypeInstanceTemplateByImage type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -146700,7 +164890,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -146716,9 +164907,17 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -146751,6 +164950,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment{ @@ -146776,6 +164985,11 @@ func (*InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageIn // UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -146846,11 +165060,21 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateBy err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -146888,6 +165112,8 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateBy // InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface : InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface struct // This model "extends" InstanceTemplatePrototypeInstanceTemplateByImage type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -146936,7 +165162,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -146952,9 +165179,17 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -146987,6 +165222,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface{ @@ -147012,6 +165257,11 @@ func (*InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageIn // UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -147082,11 +165332,21 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateBy err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -147124,6 +165384,8 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateBy // InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment : InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment struct // This model "extends" InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -147172,7 +165434,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -147188,9 +165451,17 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -147220,6 +165491,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment{ @@ -147245,6 +165526,11 @@ func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplate // UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -147315,11 +165601,21 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceT err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -147352,6 +165648,8 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceT // InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface : InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface struct // This model "extends" InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -147400,7 +165698,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -147416,9 +165715,17 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -147448,6 +165755,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface{ @@ -147473,6 +165790,11 @@ func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplate // UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface unmarshals an instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface from the specified map of raw messages. func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -147543,11 +165865,21 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceT err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -147580,6 +165912,8 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceT // InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment : InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment struct // This model "extends" InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -147639,7 +165973,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -147656,9 +165991,17 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -147690,6 +166033,16 @@ const ( InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { return true } @@ -147701,6 +166054,11 @@ func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceB // UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment unmarshals an instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment from the specified map of raw messages. func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -147791,11 +166149,21 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextIn err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -147833,6 +166201,8 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextIn // InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface : InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface struct // This model "extends" InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -147892,7 +166262,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -147909,9 +166280,17 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -147943,6 +166322,16 @@ const ( InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { return true } @@ -147954,6 +166343,11 @@ func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceB // UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface unmarshals an instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface from the specified map of raw messages. func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -148044,11 +166438,21 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextIn err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -148086,6 +166490,8 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextIn // InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment : InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment struct // This model "extends" InstanceTemplateInstanceByImageInstanceTemplateContext type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -148145,7 +166551,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -148162,9 +166569,17 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -148197,6 +166612,16 @@ const ( InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { return true } @@ -148208,6 +166633,11 @@ func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInst // UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment unmarshals an instance of InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment from the specified map of raw messages. func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -148298,11 +166728,21 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByIm err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -148340,6 +166780,8 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByIm // InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface : InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface struct // This model "extends" InstanceTemplateInstanceByImageInstanceTemplateContext type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -148399,7 +166841,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -148416,9 +166859,17 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -148451,6 +166902,16 @@ const ( InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { return true } @@ -148462,6 +166923,11 @@ func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInst // UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface unmarshals an instance of InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface from the specified map of raw messages. func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -148552,11 +167018,21 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByIm err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -148594,6 +167070,8 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByIm // InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment : InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment struct // This model "extends" InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -148653,7 +167131,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -148670,9 +167149,17 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -148705,6 +167192,16 @@ const ( InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { return true } @@ -148716,6 +167213,11 @@ func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBy // UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment unmarshals an instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment from the specified map of raw messages. func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -148806,11 +167308,21 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextIns err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -148848,6 +167360,8 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextIns // InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface : InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface struct // This model "extends" InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface struct { + Availability *InstanceAvailabilityPrototype `json:"availability,omitempty"` + AvailabilityPolicy *InstanceAvailabilityPolicyPrototype `json:"availability_policy,omitempty"` // The cluster network attachments to create for this virtual server instance. A cluster network attachment represents @@ -148907,7 +167421,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) 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. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -148924,9 +167439,17 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo // server instance. UserData *string `json:"user_data,omitempty"` + Vcpu *InstanceVcpuPrototype `json:"vcpu,omitempty"` + // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -148962,6 +167485,16 @@ const ( InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { return true } @@ -148973,6 +167506,11 @@ func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBy // UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface unmarshals an instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface from the specified map of raw messages. func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface) + err = core.UnmarshalModel(m, "availability", &obj.Availability, UnmarshalInstanceAvailabilityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) if err != nil { err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) @@ -149063,11 +167601,21 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextIns err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "vcpu", &obj.Vcpu, UnmarshalInstanceVcpuPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "vcpu-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) if err != nil { err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -149753,6 +168301,104 @@ func (loadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdent return } +// LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref : LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref struct +// This model "extends" LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity +type LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref struct { + // The URL for this reserved IP. + Href *string `json:"href" validate:"required"` +} + +// NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref : Instantiate LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref(href string) (_model *LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref, err error) { + _model = &LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref) isaLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity() bool { + return true +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref) isaLoadBalancerPoolMemberTargetPrototype() bool { + return true +} + +// UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref +func (loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref *LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref.Href) { + _patch["href"] = loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref.Href + } + + return +} + +// LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID : LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID struct +// This model "extends" LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity +type LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID struct { + // The unique identifier for this reserved IP. + ID *string `json:"id" validate:"required"` +} + +// NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID : Instantiate LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID(id string) (_model *LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID, err error) { + _model = &LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID) isaLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity() bool { + return true +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID) isaLoadBalancerPoolMemberTargetPrototype() bool { + return true +} + +// UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID +func (loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID *LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID.ID) { + _patch["id"] = loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID.ID + } + + return +} + // NetworkInterfaceIPPrototypeReservedIPIdentityByHref : NetworkInterfaceIPPrototypeReservedIPIdentityByHref struct // This model "extends" NetworkInterfaceIPPrototypeReservedIPIdentity type NetworkInterfaceIPPrototypeReservedIPIdentityByHref struct { @@ -151091,11 +169737,149 @@ func UnmarshalShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIden return } +// VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch : VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch struct +// This model "extends" VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch +type VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn,omitempty"` + + // The IP address of the peer VPN gateway for this connection. + Address *string `json:"address" validate:"required"` +} + +// NewVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch : Instantiate VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch(address string) (_model *VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch, err error) { + _model = &VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch{ + Address: core.StringPtr(address), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch() bool { + return true +} + +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) isaVPNGatewayConnectionPeerPatch() bool { + return true +} + +// UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch unmarshals an instance of VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch +func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch *VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.Asn) { + _patch["asn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.Asn + } + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.Address) { + _patch["address"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.Address + } + + return +} + +// VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch : VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch struct +// This model "extends" VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch +type VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn,omitempty"` + + // The FQDN of the peer VPN gateway for this connection. + Fqdn *string `json:"fqdn" validate:"required"` +} + +// NewVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch : Instantiate VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch(fqdn string) (_model *VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch, err error) { + _model = &VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch{ + Fqdn: core.StringPtr(fqdn), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch() bool { + return true +} + +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) isaVPNGatewayConnectionPeerPatch() bool { + return true +} + +// UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch unmarshals an instance of VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) + if err != nil { + err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch +func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch *VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch.Asn) { + _patch["asn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch.Asn + } + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch.Fqdn) { + _patch["fqdn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch.Fqdn + } + + return +} + // VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch : VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch struct // This model "extends" VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch type VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch struct { // The IP address of the peer VPN gateway for this connection. - Address *string `json:"address,omitempty"` + Address *string `json:"address" validate:"required"` +} + +// NewVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch : Instantiate VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch(address string) (_model *VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch, err error) { + _model = &VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch{ + Address: core.StringPtr(address), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch() bool { @@ -151132,7 +169916,19 @@ func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGat // This model "extends" VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch type VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch struct { // The FQDN of the peer VPN gateway for this connection. - Fqdn *string `json:"fqdn,omitempty"` + Fqdn *string `json:"fqdn" validate:"required"` +} + +// NewVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch : Instantiate VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch(fqdn string) (_model *VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch, err error) { + _model = &VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch{ + Fqdn: core.StringPtr(fqdn), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFqdnPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch() bool { @@ -151165,77 +169961,246 @@ func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGat return } -// VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch : VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch struct -// This model "extends" VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch -type VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch struct { - // The IP address of the peer VPN gateway for this connection. - Address *string `json:"address,omitempty"` -} +// VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode : VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode struct +// This model "extends" VPNGatewayConnectionRouteMode +type VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up" validate:"required"` -func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch() bool { - return true -} + // The authentication mode. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + AuthenticationMode *string `json:"authentication_mode" validate:"required"` -func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) isaVPNGatewayConnectionPeerPatch() bool { - return true -} + // The date and time that this VPN gateway connection was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` -// UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch unmarshals an instance of VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) - err = core.UnmarshalPrimitive(m, "address", &obj.Address) - if err != nil { - err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} + DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` -// asPatch returns a generic map representation of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch -func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch *VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) asPatch() (_patch map[string]interface{}) { - _patch = map[string]interface{}{} - if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.Address) { - _patch["address"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.Address - } + // The establish mode of the VPN gateway connection: + // - `bidirectional`: Either side of the VPN gateway can initiate IKE protocol + // negotiations or rekeying processes. + // - `peer_only`: Only the peer can initiate IKE protocol negotiations for this VPN gateway + // connection. Additionally, the peer is responsible for initiating the rekeying process + // after the connection is established. If rekeying does not occur, the VPN gateway + // connection will be brought down after its lifetime expires. + EstablishMode *string `json:"establish_mode" validate:"required"` - return -} + // The URL for this VPN gateway connection. + Href *string `json:"href" validate:"required"` -// VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch : VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch struct -// This model "extends" VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch -type VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch struct { - // The FQDN of the peer VPN gateway for this connection. - Fqdn *string `json:"fqdn,omitempty"` + // The unique identifier for this VPN gateway connection. + 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. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Mode *string `json:"mode" validate:"required"` + + // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. + Name *string `json:"name" validate:"required"` + + // The pre-shared 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"` + + // The reasons for the current VPN gateway connection status (if any). + StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` + + // Indicates whether the traffic is distributed between the `up` tunnels of the VPN gateway connection when the VPC + // route's next hop is a VPN connection. If `false`, the traffic is only routed through the `up` tunnel with the lower + // `public_ip` address. + DistributeTraffic *bool `json:"distribute_traffic" validate:"required"` + + Local *VPNGatewayConnectionDynamicRouteModeLocal `json:"local" validate:"required"` + + Peer VPNGatewayConnectionDynamicRouteModePeerIntf `json:"peer" validate:"required"` + + // The routing protocol for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol" validate:"required"` + + // The VPN tunnel configuration for this VPN gateway connection (in dynamic route mode). + Tunnels []VPNGatewayConnectionDynamicRouteModeTunnel `json:"tunnels" validate:"required"` } -func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch() bool { +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.AuthenticationMode property. +// The authentication mode. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeAuthenticationModePskConst = "psk" +) + +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.EstablishMode property. +// The establish mode of the VPN gateway connection: +// - `bidirectional`: Either side of the VPN gateway can initiate IKE protocol +// negotiations or rekeying processes. +// - `peer_only`: Only the peer can initiate IKE protocol negotiations for this VPN gateway +// connection. Additionally, the peer is responsible for initiating the rekeying process +// after the connection is established. If rekeying does not occur, the VPN gateway +// connection will be brought down after its lifetime expires. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeEstablishModeBidirectionalConst = "bidirectional" + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeEstablishModePeerOnlyConst = "peer_only" +) + +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.Mode property. +// The mode of the VPN gateway. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeModePolicyConst = "policy" + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeModeRouteConst = "route" +) + +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.ResourceType property. +// The resource type. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" +) + +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.Status property. +// The status of a VPN gateway connection. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeStatusDownConst = "down" + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeStatusUpConst = "up" +) + +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.RoutingProtocol property. +// The routing protocol for this VPN gateway connection. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeRoutingProtocolBgpConst = "bgp" +) + +func (*VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode) isaVPNGatewayConnectionRouteMode() bool { return true } -func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) isaVPNGatewayConnectionPeerPatch() bool { +func (*VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode) isaVPNGatewayConnection() bool { return true } -// UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch unmarshals an instance of VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) - err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) +// UnmarshalVPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode unmarshals an instance of VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) if err != nil { - err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "admin_state_up-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// asPatch returns a generic map representation of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch -func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch *VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) asPatch() (_patch map[string]interface{}) { - _patch = map[string]interface{}{} - if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch.Fqdn) { - _patch["fqdn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionStaticRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch.Fqdn + err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) + if err != nil { + err = core.SDKErrorf(err, "", "authentication_mode-error", common.GetComponentInfo()) + return } - + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) + if err != nil { + err = core.SDKErrorf(err, "", "dead_peer_detection-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "establish_mode", &obj.EstablishMode) + if err != nil { + err = core.SDKErrorf(err, "", "establish_mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) + if err != nil { + err = core.SDKErrorf(err, "", "ike_policy-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) + if err != nil { + err = core.SDKErrorf(err, "", "ipsec_policy-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + if err != nil { + err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + if err != nil { + err = core.SDKErrorf(err, "", "psk-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) + if err != nil { + err = core.SDKErrorf(err, "", "status_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "distribute_traffic", &obj.DistributeTraffic) + if err != nil { + err = core.SDKErrorf(err, "", "distribute_traffic-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalVPNGatewayConnectionDynamicRouteModeLocal) + if err != nil { + err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "peer", &obj.Peer, UnmarshalVPNGatewayConnectionDynamicRouteModePeer) + if err != nil { + err = core.SDKErrorf(err, "", "peer-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "routing_protocol-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionDynamicRouteModeTunnel) + if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -152006,244 +170971,6 @@ func UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolum return } -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // 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 - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(group *InstanceGroupManagerScheduledActionGroupPrototype) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup{ - Group: group, - } - err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "group-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // 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 - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager(manager InstanceGroupManagerScheduledActionManagerPrototypeIntf) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager{ - Manager: manager, - } - err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // 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. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(group *InstanceGroupManagerScheduledActionGroupPrototype) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup{ - Group: group, - } - err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "group-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // 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. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager(manager InstanceGroupManagerScheduledActionManagerPrototypeIntf) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager{ - Manager: manager, - } - err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // BackupPoliciesPager can be used to simplify the use of the "ListBackupPolicies" method. type BackupPoliciesPager struct { hasNext bool @@ -153716,6 +172443,98 @@ func (pager *EndpointGatewayIpsPager) GetAll() (allItems []ReservedIP, err error return } +// EndpointGatewayResourceBindingsPager can be used to simplify the use of the "ListEndpointGatewayResourceBindings" method. +type EndpointGatewayResourceBindingsPager struct { + hasNext bool + options *ListEndpointGatewayResourceBindingsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewEndpointGatewayResourceBindingsPager returns a new EndpointGatewayResourceBindingsPager instance. +func (vpc *VpcV1) NewEndpointGatewayResourceBindingsPager(options *ListEndpointGatewayResourceBindingsOptions) (pager *EndpointGatewayResourceBindingsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListEndpointGatewayResourceBindingsOptions = *options + pager = &EndpointGatewayResourceBindingsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *EndpointGatewayResourceBindingsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *EndpointGatewayResourceBindingsPager) GetNextWithContext(ctx context.Context) (page []EndpointGatewayResourceBinding, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListEndpointGatewayResourceBindingsWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + errMsg := fmt.Sprintf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + err = core.SDKErrorf(err, errMsg, "get-query-error", common.GetComponentInfo()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.ResourceBindings + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *EndpointGatewayResourceBindingsPager) GetAllWithContext(ctx context.Context) (allItems []EndpointGatewayResourceBinding, err error) { + for pager.HasNext() { + var nextPage []EndpointGatewayResourceBinding + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *EndpointGatewayResourceBindingsPager) GetNext() (page []EndpointGatewayResourceBinding, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *EndpointGatewayResourceBindingsPager) GetAll() (allItems []EndpointGatewayResourceBinding, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + // FloatingIpsPager can be used to simplify the use of the "ListFloatingIps" method. type FloatingIpsPager struct { hasNext bool @@ -154728,6 +173547,98 @@ func (pager *InstanceGroupMembershipsPager) GetAll() (allItems []InstanceGroupMe return } +// InstanceProfilesPager can be used to simplify the use of the "ListInstanceProfiles" method. +type InstanceProfilesPager struct { + hasNext bool + options *ListInstanceProfilesOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewInstanceProfilesPager returns a new InstanceProfilesPager instance. +func (vpc *VpcV1) NewInstanceProfilesPager(options *ListInstanceProfilesOptions) (pager *InstanceProfilesPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListInstanceProfilesOptions = *options + pager = &InstanceProfilesPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *InstanceProfilesPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *InstanceProfilesPager) GetNextWithContext(ctx context.Context) (page []InstanceProfile, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListInstanceProfilesWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + errMsg := fmt.Sprintf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + err = core.SDKErrorf(err, errMsg, "get-query-error", common.GetComponentInfo()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.Profiles + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *InstanceProfilesPager) GetAllWithContext(ctx context.Context) (allItems []InstanceProfile, err error) { + for pager.HasNext() { + var nextPage []InstanceProfile + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *InstanceProfilesPager) GetNext() (page []InstanceProfile, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *InstanceProfilesPager) GetAll() (allItems []InstanceProfile, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + // InstancesPager can be used to simplify the use of the "ListInstances" method. type InstancesPager struct { hasNext bool @@ -157764,6 +176675,98 @@ func (pager *VolumeInstanceProfilesPager) GetAll() (allItems []InstanceProfileRe return } +// VolumeJobsPager can be used to simplify the use of the "ListVolumeJobs" method. +type VolumeJobsPager struct { + hasNext bool + options *ListVolumeJobsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewVolumeJobsPager returns a new VolumeJobsPager instance. +func (vpc *VpcV1) NewVolumeJobsPager(options *ListVolumeJobsOptions) (pager *VolumeJobsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListVolumeJobsOptions = *options + pager = &VolumeJobsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *VolumeJobsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *VolumeJobsPager) GetNextWithContext(ctx context.Context) (page []VolumeJobIntf, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListVolumeJobsWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + errMsg := fmt.Sprintf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + err = core.SDKErrorf(err, errMsg, "get-query-error", common.GetComponentInfo()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.Jobs + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *VolumeJobsPager) GetAllWithContext(ctx context.Context) (allItems []VolumeJobIntf, err error) { + for pager.HasNext() { + var nextPage []VolumeJobIntf + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *VolumeJobsPager) GetNext() (page []VolumeJobIntf, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *VolumeJobsPager) GetAll() (allItems []VolumeJobIntf, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + // VpcsPager can be used to simplify the use of the "ListVpcs" method. type VpcsPager struct { hasNext bool @@ -158868,6 +177871,98 @@ func (pager *VPNGatewayConnectionsPager) GetAll() (allItems []VPNGatewayConnecti return } +// VPNGatewayServiceConnectionsPager can be used to simplify the use of the "ListVPNGatewayServiceConnections" method. +type VPNGatewayServiceConnectionsPager struct { + hasNext bool + options *ListVPNGatewayServiceConnectionsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewVPNGatewayServiceConnectionsPager returns a new VPNGatewayServiceConnectionsPager instance. +func (vpc *VpcV1) NewVPNGatewayServiceConnectionsPager(options *ListVPNGatewayServiceConnectionsOptions) (pager *VPNGatewayServiceConnectionsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListVPNGatewayServiceConnectionsOptions = *options + pager = &VPNGatewayServiceConnectionsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *VPNGatewayServiceConnectionsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *VPNGatewayServiceConnectionsPager) GetNextWithContext(ctx context.Context) (page []VPNGatewayServiceConnection, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListVPNGatewayServiceConnectionsWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + errMsg := fmt.Sprintf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + err = core.SDKErrorf(err, errMsg, "get-query-error", common.GetComponentInfo()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.ServiceConnections + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *VPNGatewayServiceConnectionsPager) GetAllWithContext(ctx context.Context) (allItems []VPNGatewayServiceConnection, err error) { + for pager.HasNext() { + var nextPage []VPNGatewayServiceConnection + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *VPNGatewayServiceConnectionsPager) GetNext() (page []VPNGatewayServiceConnection, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *VPNGatewayServiceConnectionsPager) GetAll() (allItems []VPNGatewayServiceConnection, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + // VPNServersPager can be used to simplify the use of the "ListVPNServers" method. type VPNServersPager struct { hasNext bool diff --git a/vendor/github.com/asaskevich/govalidator/.gitignore b/vendor/github.com/asaskevich/govalidator/.gitignore deleted file mode 100644 index 8d69a9418aa3..000000000000 --- a/vendor/github.com/asaskevich/govalidator/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -bin/ -.idea/ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - diff --git a/vendor/github.com/asaskevich/govalidator/.travis.yml b/vendor/github.com/asaskevich/govalidator/.travis.yml deleted file mode 100644 index bb83c6670df6..000000000000 --- a/vendor/github.com/asaskevich/govalidator/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go -dist: xenial -go: - - '1.10' - - '1.11' - - '1.12' - - '1.13' - - 'tip' - -script: - - go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md b/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md deleted file mode 100644 index 4b462b0d81b1..000000000000 --- a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,43 +0,0 @@ -# Contributor Code of Conduct - -This project adheres to [The Code Manifesto](http://codemanifesto.com) -as its guidelines for contributor interactions. - -## The Code Manifesto - -We want to work in an ecosystem that empowers developers to reach their -potential — one that encourages growth and effective collaboration. A space -that is safe for all. - -A space such as this benefits everyone that participates in it. It encourages -new developers to enter our field. It is through discussion and collaboration -that we grow, and through growth that we improve. - -In the effort to create such a place, we hold to these values: - -1. **Discrimination limits us.** This includes discrimination on the basis of - race, gender, sexual orientation, gender identity, age, nationality, - technology and any other arbitrary exclusion of a group of people. -2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort - levels. Remember that, and if brought to your attention, heed it. -3. **We are our biggest assets.** None of us were born masters of our trade. - Each of us has been helped along the way. Return that favor, when and where - you can. -4. **We are resources for the future.** As an extension of #3, share what you - know. Make yourself a resource to help those that come after you. -5. **Respect defines us.** Treat others as you wish to be treated. Make your - discussions, criticisms and debates from a position of respectfulness. Ask - yourself, is it true? Is it necessary? Is it constructive? Anything less is - unacceptable. -6. **Reactions require grace.** Angry responses are valid, but abusive language - and vindictive actions are toxic. When something happens that offends you, - handle it assertively, but be respectful. Escalate reasonably, and try to - allow the offender an opportunity to explain themselves, and possibly - correct the issue. -7. **Opinions are just that: opinions.** Each and every one of us, due to our - background and upbringing, have varying opinions. That is perfectly - acceptable. Remember this: if you respect your own opinions, you should - respect the opinions of others. -8. **To err is human.** You might not intend it, but mistakes do happen and - contribute to build experience. Tolerate honest mistakes, and don't - hesitate to apologize if you make one yourself. diff --git a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md b/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md deleted file mode 100644 index 7ed268a1edd9..000000000000 --- a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md +++ /dev/null @@ -1,63 +0,0 @@ -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Financial contributions - -We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/govalidator). -Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. - - -## Credits - - -### Contributors - -Thank you to all the people who have already contributed to govalidator! - - - -### Backers - -Thank you to all our backers! [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/govalidator#sponsor)) - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/LICENSE b/vendor/github.com/asaskevich/govalidator/LICENSE deleted file mode 100644 index cacba9102400..000000000000 --- a/vendor/github.com/asaskevich/govalidator/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2020 Alex Saskevich - -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. \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/README.md b/vendor/github.com/asaskevich/govalidator/README.md deleted file mode 100644 index 2c3fc35eb644..000000000000 --- a/vendor/github.com/asaskevich/govalidator/README.md +++ /dev/null @@ -1,622 +0,0 @@ -govalidator -=========== -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![GoDoc](https://godoc.org/github.com/asaskevich/govalidator?status.png)](https://godoc.org/github.com/asaskevich/govalidator) -[![Build Status](https://travis-ci.org/asaskevich/govalidator.svg?branch=master)](https://travis-ci.org/asaskevich/govalidator) -[![Coverage](https://codecov.io/gh/asaskevich/govalidator/branch/master/graph/badge.svg)](https://codecov.io/gh/asaskevich/govalidator) [![Go Report Card](https://goreportcard.com/badge/github.com/asaskevich/govalidator)](https://goreportcard.com/report/github.com/asaskevich/govalidator) [![GoSearch](http://go-search.org/badge?id=github.com%2Fasaskevich%2Fgovalidator)](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [![Backers on Open Collective](https://opencollective.com/govalidator/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/govalidator/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield) - -A package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js). - -#### Installation -Make sure that Go is installed on your computer. -Type the following command in your terminal: - - go get github.com/asaskevich/govalidator - -or you can get specified release of the package with `gopkg.in`: - - go get gopkg.in/asaskevich/govalidator.v10 - -After it the package is ready to use. - - -#### Import package in your project -Add following line in your `*.go` file: -```go -import "github.com/asaskevich/govalidator" -``` -If you are unhappy to use long `govalidator`, you can do something like this: -```go -import ( - valid "github.com/asaskevich/govalidator" -) -``` - -#### Activate behavior to require all fields have a validation tag by default -`SetFieldsRequiredByDefault` causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). A good place to activate this is a package init function or the main() function. - -`SetNilPtrAllowedByRequired` causes validation to pass when struct fields marked by `required` are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between `nil` and `zero value` state can use this. If disabled, both `nil` and `zero` values cause validation errors. - -```go -import "github.com/asaskevich/govalidator" - -func init() { - govalidator.SetFieldsRequiredByDefault(true) -} -``` - -Here's some code to explain it: -```go -// this struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -type exampleStruct struct { - Name string `` - Email string `valid:"email"` -} - -// this, however, will only fail when Email is empty or an invalid email address: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email"` -} - -// lastly, this will only fail when Email is an invalid email address but not when it's empty: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email,optional"` -} -``` - -#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123)) -##### Custom validator function signature -A context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible. -```go -import "github.com/asaskevich/govalidator" - -// old signature -func(i interface{}) bool - -// new signature -func(i interface{}, o interface{}) bool -``` - -##### Adding a custom validator -This was changed to prevent data races when accessing custom validators. -```go -import "github.com/asaskevich/govalidator" - -// before -govalidator.CustomTypeTagMap["customByteArrayValidator"] = func(i interface{}, o interface{}) bool { - // ... -} - -// after -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, o interface{}) bool { - // ... -}) -``` - -#### List of functions: -```go -func Abs(value float64) float64 -func BlackList(str, chars string) string -func ByteLength(str string, params ...string) bool -func CamelCaseToUnderscore(str string) string -func Contains(str, substring string) bool -func Count(array []interface{}, iterator ConditionIterator) int -func Each(array []interface{}, iterator Iterator) -func ErrorByField(e error, field string) string -func ErrorsByField(e error) map[string]string -func Filter(array []interface{}, iterator ConditionIterator) []interface{} -func Find(array []interface{}, iterator ConditionIterator) interface{} -func GetLine(s string, index int) (string, error) -func GetLines(s string) []string -func HasLowerCase(str string) bool -func HasUpperCase(str string) bool -func HasWhitespace(str string) bool -func HasWhitespaceOnly(str string) bool -func InRange(value interface{}, left interface{}, right interface{}) bool -func InRangeFloat32(value, left, right float32) bool -func InRangeFloat64(value, left, right float64) bool -func InRangeInt(value, left, right interface{}) bool -func IsASCII(str string) bool -func IsAlpha(str string) bool -func IsAlphanumeric(str string) bool -func IsBase64(str string) bool -func IsByteLength(str string, min, max int) bool -func IsCIDR(str string) bool -func IsCRC32(str string) bool -func IsCRC32b(str string) bool -func IsCreditCard(str string) bool -func IsDNSName(str string) bool -func IsDataURI(str string) bool -func IsDialString(str string) bool -func IsDivisibleBy(str, num string) bool -func IsEmail(str string) bool -func IsExistingEmail(email string) bool -func IsFilePath(str string) (bool, int) -func IsFloat(str string) bool -func IsFullWidth(str string) bool -func IsHalfWidth(str string) bool -func IsHash(str string, algorithm string) bool -func IsHexadecimal(str string) bool -func IsHexcolor(str string) bool -func IsHost(str string) bool -func IsIP(str string) bool -func IsIPv4(str string) bool -func IsIPv6(str string) bool -func IsISBN(str string, version int) bool -func IsISBN10(str string) bool -func IsISBN13(str string) bool -func IsISO3166Alpha2(str string) bool -func IsISO3166Alpha3(str string) bool -func IsISO4217(str string) bool -func IsISO693Alpha2(str string) bool -func IsISO693Alpha3b(str string) bool -func IsIn(str string, params ...string) bool -func IsInRaw(str string, params ...string) bool -func IsInt(str string) bool -func IsJSON(str string) bool -func IsLatitude(str string) bool -func IsLongitude(str string) bool -func IsLowerCase(str string) bool -func IsMAC(str string) bool -func IsMD4(str string) bool -func IsMD5(str string) bool -func IsMagnetURI(str string) bool -func IsMongoID(str string) bool -func IsMultibyte(str string) bool -func IsNatural(value float64) bool -func IsNegative(value float64) bool -func IsNonNegative(value float64) bool -func IsNonPositive(value float64) bool -func IsNotNull(str string) bool -func IsNull(str string) bool -func IsNumeric(str string) bool -func IsPort(str string) bool -func IsPositive(value float64) bool -func IsPrintableASCII(str string) bool -func IsRFC3339(str string) bool -func IsRFC3339WithoutZone(str string) bool -func IsRGBcolor(str string) bool -func IsRegex(str string) bool -func IsRequestURI(rawurl string) bool -func IsRequestURL(rawurl string) bool -func IsRipeMD128(str string) bool -func IsRipeMD160(str string) bool -func IsRsaPub(str string, params ...string) bool -func IsRsaPublicKey(str string, keylen int) bool -func IsSHA1(str string) bool -func IsSHA256(str string) bool -func IsSHA384(str string) bool -func IsSHA512(str string) bool -func IsSSN(str string) bool -func IsSemver(str string) bool -func IsTiger128(str string) bool -func IsTiger160(str string) bool -func IsTiger192(str string) bool -func IsTime(str string, format string) bool -func IsType(v interface{}, params ...string) bool -func IsURL(str string) bool -func IsUTFDigit(str string) bool -func IsUTFLetter(str string) bool -func IsUTFLetterNumeric(str string) bool -func IsUTFNumeric(str string) bool -func IsUUID(str string) bool -func IsUUIDv3(str string) bool -func IsUUIDv4(str string) bool -func IsUUIDv5(str string) bool -func IsULID(str string) bool -func IsUnixTime(str string) bool -func IsUpperCase(str string) bool -func IsVariableWidth(str string) bool -func IsWhole(value float64) bool -func LeftTrim(str, chars string) string -func Map(array []interface{}, iterator ResultIterator) []interface{} -func Matches(str, pattern string) bool -func MaxStringLength(str string, params ...string) bool -func MinStringLength(str string, params ...string) bool -func NormalizeEmail(str string) (string, error) -func PadBoth(str string, padStr string, padLen int) string -func PadLeft(str string, padStr string, padLen int) string -func PadRight(str string, padStr string, padLen int) string -func PrependPathToErrors(err error, path string) error -func Range(str string, params ...string) bool -func RemoveTags(s string) string -func ReplacePattern(str, pattern, replace string) string -func Reverse(s string) string -func RightTrim(str, chars string) string -func RuneLength(str string, params ...string) bool -func SafeFileName(str string) string -func SetFieldsRequiredByDefault(value bool) -func SetNilPtrAllowedByRequired(value bool) -func Sign(value float64) float64 -func StringLength(str string, params ...string) bool -func StringMatches(s string, params ...string) bool -func StripLow(str string, keepNewLines bool) string -func ToBoolean(str string) (bool, error) -func ToFloat(str string) (float64, error) -func ToInt(value interface{}) (res int64, err error) -func ToJSON(obj interface{}) (string, error) -func ToString(obj interface{}) string -func Trim(str, chars string) string -func Truncate(str string, length int, ending string) string -func TruncatingErrorf(str string, args ...interface{}) error -func UnderscoreToCamelCase(s string) string -func ValidateMap(inputMap map[string]interface{}, validationMap map[string]interface{}) (bool, error) -func ValidateStruct(s interface{}) (bool, error) -func WhiteList(str, chars string) string -type ConditionIterator -type CustomTypeValidator -type Error -func (e Error) Error() string -type Errors -func (es Errors) Error() string -func (es Errors) Errors() []error -type ISO3166Entry -type ISO693Entry -type InterfaceParamValidator -type Iterator -type ParamValidator -type ResultIterator -type UnsupportedTypeError -func (e *UnsupportedTypeError) Error() string -type Validator -``` - -#### Examples -###### IsURL -```go -println(govalidator.IsURL(`http://user@pass:domain.com/path/page`)) -``` -###### IsType -```go -println(govalidator.IsType("Bob", "string")) -println(govalidator.IsType(1, "int")) -i := 1 -println(govalidator.IsType(&i, "*int")) -``` - -IsType can be used through the tag `type` which is essential for map validation: -```go -type User struct { - Name string `valid:"type(string)"` - Age int `valid:"type(int)"` - Meta interface{} `valid:"type(string)"` -} -result, err := govalidator.ValidateStruct(User{"Bob", 20, "meta"}) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ToString -```go -type User struct { - FirstName string - LastName string -} - -str := govalidator.ToString(&User{"John", "Juan"}) -println(str) -``` -###### Each, Map, Filter, Count for slices -Each iterates over the slice/array and calls Iterator for every item -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.Iterator = func(value interface{}, index int) { - println(value.(int)) -} -govalidator.Each(data, fn) -``` -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.ResultIterator = func(value interface{}, index int) interface{} { - return value.(int) * 3 -} -_ = govalidator.Map(data, fn) // result = []interface{}{1, 6, 9, 12, 15} -``` -```go -data := []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} -var fn govalidator.ConditionIterator = func(value interface{}, index int) bool { - return value.(int)%2 == 0 -} -_ = govalidator.Filter(data, fn) // result = []interface{}{2, 4, 6, 8, 10} -_ = govalidator.Count(data, fn) // result = 5 -``` -###### ValidateStruct [#2](https://github.com/asaskevich/govalidator/pull/2) -If you want to validate structs, you can use tag `valid` for any field in your structure. All validators used with this field in one tag are separated by comma. If you want to skip validation, place `-` in your tag. If you need a validator that is not on the list below, you can add it like this: -```go -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) -``` -For completely custom validators (interface-based), see below. - -Here is a list of available validators for struct fields (validator - used function): -```go -"email": IsEmail, -"url": IsURL, -"dialstring": IsDialString, -"requrl": IsRequestURL, -"requri": IsRequestURI, -"alpha": IsAlpha, -"utfletter": IsUTFLetter, -"alphanum": IsAlphanumeric, -"utfletternum": IsUTFLetterNumeric, -"numeric": IsNumeric, -"utfnumeric": IsUTFNumeric, -"utfdigit": IsUTFDigit, -"hexadecimal": IsHexadecimal, -"hexcolor": IsHexcolor, -"rgbcolor": IsRGBcolor, -"lowercase": IsLowerCase, -"uppercase": IsUpperCase, -"int": IsInt, -"float": IsFloat, -"null": IsNull, -"uuid": IsUUID, -"uuidv3": IsUUIDv3, -"uuidv4": IsUUIDv4, -"uuidv5": IsUUIDv5, -"creditcard": IsCreditCard, -"isbn10": IsISBN10, -"isbn13": IsISBN13, -"json": IsJSON, -"multibyte": IsMultibyte, -"ascii": IsASCII, -"printableascii": IsPrintableASCII, -"fullwidth": IsFullWidth, -"halfwidth": IsHalfWidth, -"variablewidth": IsVariableWidth, -"base64": IsBase64, -"datauri": IsDataURI, -"ip": IsIP, -"port": IsPort, -"ipv4": IsIPv4, -"ipv6": IsIPv6, -"dns": IsDNSName, -"host": IsHost, -"mac": IsMAC, -"latitude": IsLatitude, -"longitude": IsLongitude, -"ssn": IsSSN, -"semver": IsSemver, -"rfc3339": IsRFC3339, -"rfc3339WithoutZone": IsRFC3339WithoutZone, -"ISO3166Alpha2": IsISO3166Alpha2, -"ISO3166Alpha3": IsISO3166Alpha3, -"ulid": IsULID, -``` -Validators with parameters - -```go -"range(min|max)": Range, -"length(min|max)": ByteLength, -"runelength(min|max)": RuneLength, -"stringlength(min|max)": StringLength, -"matches(pattern)": StringMatches, -"in(string1|string2|...|stringN)": IsIn, -"rsapub(keylength)" : IsRsaPub, -"minstringlength(int): MinStringLength, -"maxstringlength(int): MaxStringLength, -``` -Validators with parameters for any type - -```go -"type(type)": IsType, -``` - -And here is small example of usage: -```go -type Post struct { - Title string `valid:"alphanum,required"` - Message string `valid:"duck,ascii"` - Message2 string `valid:"animal(dog)"` - AuthorIP string `valid:"ipv4"` - Date string `valid:"-"` -} -post := &Post{ - Title: "My Example Post", - Message: "duck", - Message2: "dog", - AuthorIP: "123.234.54.3", -} - -// Add your own struct validation tags -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) - -// Add your own struct validation tags with parameter -govalidator.ParamTagMap["animal"] = govalidator.ParamValidator(func(str string, params ...string) bool { - species := params[0] - return str == species -}) -govalidator.ParamTagRegexMap["animal"] = regexp.MustCompile("^animal\\((\\w+)\\)$") - -result, err := govalidator.ValidateStruct(post) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ValidateMap [#2](https://github.com/asaskevich/govalidator/pull/338) -If you want to validate maps, you can use the map to be validated and a validation map that contain the same tags used in ValidateStruct, both maps have to be in the form `map[string]interface{}` - -So here is small example of usage: -```go -var mapTemplate = map[string]interface{}{ - "name":"required,alpha", - "family":"required,alpha", - "email":"required,email", - "cell-phone":"numeric", - "address":map[string]interface{}{ - "line1":"required,alphanum", - "line2":"alphanum", - "postal-code":"numeric", - }, -} - -var inputMap = map[string]interface{}{ - "name":"Bob", - "family":"Smith", - "email":"foo@bar.baz", - "address":map[string]interface{}{ - "line1":"", - "line2":"", - "postal-code":"", - }, -} - -result, err := govalidator.ValidateMap(inputMap, mapTemplate) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` - -###### WhiteList -```go -// Remove all characters from string ignoring characters between "a" and "z" -println(govalidator.WhiteList("a3a43a5a4a3a2a23a4a5a4a3a4", "a-z") == "aaaaaaaaaaaa") -``` - -###### Custom validation functions -Custom validation using your own domain specific validators is also available - here's an example of how to use it: -```go -import "github.com/asaskevich/govalidator" - -type CustomByteArray [6]byte // custom types are supported and can be validated - -type StructWithCustomByteArray struct { - ID CustomByteArray `valid:"customByteArrayValidator,customMinLengthValidator"` // multiple custom validators are possible as well and will be evaluated in sequence - Email string `valid:"email"` - CustomMinLength int `valid:"-"` -} - -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // you can type switch on the context interface being validated - case StructWithCustomByteArray: - // you can check and validate against some other field in the context, - // return early or not validate against the context at all – your choice - case SomeOtherType: - // ... - default: - // expecting some other type? Throw/panic here or continue - } - - switch v := i.(type) { // type switch on the struct field being validated - case CustomByteArray: - for _, e := range v { // this validator checks that the byte array is not empty, i.e. not all zeroes - if e != 0 { - return true - } - } - } - return false -}) -govalidator.CustomTypeTagMap.Set("customMinLengthValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation - case StructWithCustomByteArray: - return len(v.ID) >= v.CustomMinLength - } - return false -}) -``` - -###### Loop over Error() -By default .Error() returns all errors in a single String. To access each error you can do this: -```go - if err != nil { - errs := err.(govalidator.Errors).Errors() - for _, e := range errs { - fmt.Println(e.Error()) - } - } -``` - -###### Custom error messages -Custom error messages are supported via annotations by adding the `~` separator - here's an example of how to use it: -```go -type Ticket struct { - Id int64 `json:"id"` - FirstName string `json:"firstname" valid:"required~First name is blank"` -} -``` - -#### Notes -Documentation is available here: [godoc.org](https://godoc.org/github.com/asaskevich/govalidator). -Full information about code coverage is also available here: [govalidator on gocover.io](http://gocover.io/github.com/asaskevich/govalidator). - -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Credits -### Contributors - -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. - -#### Special thanks to [contributors](https://github.com/asaskevich/govalidator/graphs/contributors) -* [Daniel Lohse](https://github.com/annismckenzie) -* [Attila Oláh](https://github.com/attilaolah) -* [Daniel Korner](https://github.com/Dadie) -* [Steven Wilkin](https://github.com/stevenwilkin) -* [Deiwin Sarjas](https://github.com/deiwin) -* [Noah Shibley](https://github.com/slugmobile) -* [Nathan Davies](https://github.com/nathj07) -* [Matt Sanford](https://github.com/mzsanford) -* [Simon ccl1115](https://github.com/ccl1115) - - - - -### Backers - -Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/govalidator#sponsor)] - - - - - - - - - - - - - - - -## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large) diff --git a/vendor/github.com/asaskevich/govalidator/arrays.go b/vendor/github.com/asaskevich/govalidator/arrays.go deleted file mode 100644 index 3e1da7cb480e..000000000000 --- a/vendor/github.com/asaskevich/govalidator/arrays.go +++ /dev/null @@ -1,87 +0,0 @@ -package govalidator - -// Iterator is the function that accepts element of slice/array and its index -type Iterator func(interface{}, int) - -// ResultIterator is the function that accepts element of slice/array and its index and returns any result -type ResultIterator func(interface{}, int) interface{} - -// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean -type ConditionIterator func(interface{}, int) bool - -// ReduceIterator is the function that accepts two element of slice/array and returns result of merging those values -type ReduceIterator func(interface{}, interface{}) interface{} - -// Some validates that any item of array corresponds to ConditionIterator. Returns boolean. -func Some(array []interface{}, iterator ConditionIterator) bool { - res := false - for index, data := range array { - res = res || iterator(data, index) - } - return res -} - -// Every validates that every item of array corresponds to ConditionIterator. Returns boolean. -func Every(array []interface{}, iterator ConditionIterator) bool { - res := true - for index, data := range array { - res = res && iterator(data, index) - } - return res -} - -// Reduce boils down a list of values into a single value by ReduceIterator -func Reduce(array []interface{}, iterator ReduceIterator, initialValue interface{}) interface{} { - for _, data := range array { - initialValue = iterator(initialValue, data) - } - return initialValue -} - -// Each iterates over the slice and apply Iterator to every item -func Each(array []interface{}, iterator Iterator) { - for index, data := range array { - iterator(data, index) - } -} - -// Map iterates over the slice and apply ResultIterator to every item. Returns new slice as a result. -func Map(array []interface{}, iterator ResultIterator) []interface{} { - var result = make([]interface{}, len(array)) - for index, data := range array { - result[index] = iterator(data, index) - } - return result -} - -// Find iterates over the slice and apply ConditionIterator to every item. Returns first item that meet ConditionIterator or nil otherwise. -func Find(array []interface{}, iterator ConditionIterator) interface{} { - for index, data := range array { - if iterator(data, index) { - return data - } - } - return nil -} - -// Filter iterates over the slice and apply ConditionIterator to every item. Returns new slice. -func Filter(array []interface{}, iterator ConditionIterator) []interface{} { - var result = make([]interface{}, 0) - for index, data := range array { - if iterator(data, index) { - result = append(result, data) - } - } - return result -} - -// Count iterates over the slice and apply ConditionIterator to every item. Returns count of items that meets ConditionIterator. -func Count(array []interface{}, iterator ConditionIterator) int { - count := 0 - for index, data := range array { - if iterator(data, index) { - count = count + 1 - } - } - return count -} diff --git a/vendor/github.com/asaskevich/govalidator/converter.go b/vendor/github.com/asaskevich/govalidator/converter.go deleted file mode 100644 index d68e990fc256..000000000000 --- a/vendor/github.com/asaskevich/govalidator/converter.go +++ /dev/null @@ -1,81 +0,0 @@ -package govalidator - -import ( - "encoding/json" - "fmt" - "reflect" - "strconv" -) - -// ToString convert the input to a string. -func ToString(obj interface{}) string { - res := fmt.Sprintf("%v", obj) - return res -} - -// ToJSON convert the input to a valid JSON string -func ToJSON(obj interface{}) (string, error) { - res, err := json.Marshal(obj) - if err != nil { - res = []byte("") - } - return string(res), err -} - -// ToFloat convert the input string to a float, or 0.0 if the input is not a float. -func ToFloat(value interface{}) (res float64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = float64(val.Int()) - case uint, uint8, uint16, uint32, uint64: - res = float64(val.Uint()) - case float32, float64: - res = val.Float() - case string: - res, err = strconv.ParseFloat(val.String(), 64) - if err != nil { - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer. -func ToInt(value interface{}) (res int64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = val.Int() - case uint, uint8, uint16, uint32, uint64: - res = int64(val.Uint()) - case float32, float64: - res = int64(val.Float()) - case string: - if IsInt(val.String()) { - res, err = strconv.ParseInt(val.String(), 0, 64) - if err != nil { - res = 0 - } - } else { - err = fmt.Errorf("ToInt: invalid numeric format %g", value) - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToBoolean convert the input string to a boolean. -func ToBoolean(str string) (bool, error) { - return strconv.ParseBool(str) -} diff --git a/vendor/github.com/asaskevich/govalidator/doc.go b/vendor/github.com/asaskevich/govalidator/doc.go deleted file mode 100644 index 55dce62dc8c3..000000000000 --- a/vendor/github.com/asaskevich/govalidator/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -package govalidator - -// A package of validators and sanitizers for strings, structures and collections. diff --git a/vendor/github.com/asaskevich/govalidator/error.go b/vendor/github.com/asaskevich/govalidator/error.go deleted file mode 100644 index 1da2336f47ee..000000000000 --- a/vendor/github.com/asaskevich/govalidator/error.go +++ /dev/null @@ -1,47 +0,0 @@ -package govalidator - -import ( - "sort" - "strings" -) - -// Errors is an array of multiple errors and conforms to the error interface. -type Errors []error - -// Errors returns itself. -func (es Errors) Errors() []error { - return es -} - -func (es Errors) Error() string { - var errs []string - for _, e := range es { - errs = append(errs, e.Error()) - } - sort.Strings(errs) - return strings.Join(errs, ";") -} - -// Error encapsulates a name, an error and whether there's a custom error message or not. -type Error struct { - Name string - Err error - CustomErrorMessageExists bool - - // Validator indicates the name of the validator that failed - Validator string - Path []string -} - -func (e Error) Error() string { - if e.CustomErrorMessageExists { - return e.Err.Error() - } - - errName := e.Name - if len(e.Path) > 0 { - errName = strings.Join(append(e.Path, e.Name), ".") - } - - return errName + ": " + e.Err.Error() -} diff --git a/vendor/github.com/asaskevich/govalidator/numerics.go b/vendor/github.com/asaskevich/govalidator/numerics.go deleted file mode 100644 index 5041d9e86844..000000000000 --- a/vendor/github.com/asaskevich/govalidator/numerics.go +++ /dev/null @@ -1,100 +0,0 @@ -package govalidator - -import ( - "math" -) - -// Abs returns absolute value of number -func Abs(value float64) float64 { - return math.Abs(value) -} - -// Sign returns signum of number: 1 in case of value > 0, -1 in case of value < 0, 0 otherwise -func Sign(value float64) float64 { - if value > 0 { - return 1 - } else if value < 0 { - return -1 - } else { - return 0 - } -} - -// IsNegative returns true if value < 0 -func IsNegative(value float64) bool { - return value < 0 -} - -// IsPositive returns true if value > 0 -func IsPositive(value float64) bool { - return value > 0 -} - -// IsNonNegative returns true if value >= 0 -func IsNonNegative(value float64) bool { - return value >= 0 -} - -// IsNonPositive returns true if value <= 0 -func IsNonPositive(value float64) bool { - return value <= 0 -} - -// InRangeInt returns true if value lies between left and right border -func InRangeInt(value, left, right interface{}) bool { - value64, _ := ToInt(value) - left64, _ := ToInt(left) - right64, _ := ToInt(right) - if left64 > right64 { - left64, right64 = right64, left64 - } - return value64 >= left64 && value64 <= right64 -} - -// InRangeFloat32 returns true if value lies between left and right border -func InRangeFloat32(value, left, right float32) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRangeFloat64 returns true if value lies between left and right border -func InRangeFloat64(value, left, right float64) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRange returns true if value lies between left and right border, generic type to handle int, float32, float64 and string. -// All types must the same type. -// False if value doesn't lie in range or if it incompatible or not comparable -func InRange(value interface{}, left interface{}, right interface{}) bool { - switch value.(type) { - case int: - intValue, _ := ToInt(value) - intLeft, _ := ToInt(left) - intRight, _ := ToInt(right) - return InRangeInt(intValue, intLeft, intRight) - case float32, float64: - intValue, _ := ToFloat(value) - intLeft, _ := ToFloat(left) - intRight, _ := ToFloat(right) - return InRangeFloat64(intValue, intLeft, intRight) - case string: - return value.(string) >= left.(string) && value.(string) <= right.(string) - default: - return false - } -} - -// IsWhole returns true if value is whole number -func IsWhole(value float64) bool { - return math.Remainder(value, 1) == 0 -} - -// IsNatural returns true if value is natural number (positive and whole) -func IsNatural(value float64) bool { - return IsWhole(value) && IsPositive(value) -} diff --git a/vendor/github.com/asaskevich/govalidator/patterns.go b/vendor/github.com/asaskevich/govalidator/patterns.go deleted file mode 100644 index bafc3765ea12..000000000000 --- a/vendor/github.com/asaskevich/govalidator/patterns.go +++ /dev/null @@ -1,113 +0,0 @@ -package govalidator - -import "regexp" - -// Basic regular expressions for validating strings -const ( - Email string = "^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$" - CreditCard string = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$" - ISBN10 string = "^(?:[0-9]{9}X|[0-9]{10})$" - ISBN13 string = "^(?:[0-9]{13})$" - UUID3 string = "^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$" - UUID4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID5 string = "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - Alpha string = "^[a-zA-Z]+$" - Alphanumeric string = "^[a-zA-Z0-9]+$" - Numeric string = "^[0-9]+$" - Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$" - Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$" - Hexadecimal string = "^[0-9a-fA-F]+$" - Hexcolor string = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" - RGBcolor string = "^rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$" - ASCII string = "^[\x00-\x7F]+$" - Multibyte string = "[^\x00-\x7F]" - FullWidth string = "[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - HalfWidth string = "[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$" - PrintableASCII string = "^[\x20-\x7E]+$" - DataURI string = "^data:.+\\/(.+);base64$" - MagnetURI string = "^magnet:\\?xt=urn:[a-zA-Z0-9]+:[a-zA-Z0-9]{32,40}&dn=.+&tr=.+$" - Latitude string = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)$" - Longitude string = "^[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$" - DNSName string = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$` - IP string = `(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))` - URLSchema string = `((ftp|tcp|udp|wss?|https?):\/\/)` - URLUsername string = `(\S+(:\S*)?@)` - URLPath string = `((\/|\?|#)[^\s]*)` - URLPort string = `(:(\d{1,5}))` - URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3]|24\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-5]))` - URLSubdomain string = `((www\.)|([a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\.[a-zA-Z0-9]+))` - URL = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$` - SSN string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$` - WinPath string = `^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixPath string = `^(/[^/\x00]*)+/?$` - WinARPath string = `^(?:(?:[a-zA-Z]:|\\\\[a-z0-9_.$●-]+\\[a-z0-9_.$●-]+)\\|\\?[^\\/:*?"<>|\r\n]+\\?)(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixARPath string = `^((\.{0,2}/)?([^/\x00]*))+/?$` - Semver string = "^v?(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$" - tagName string = "valid" - hasLowerCase string = ".*[[:lower:]]" - hasUpperCase string = ".*[[:upper:]]" - hasWhitespace string = ".*[[:space:]]" - hasWhitespaceOnly string = "^[[:space:]]+$" - IMEI string = "^[0-9a-f]{14}$|^\\d{15}$|^\\d{18}$" - IMSI string = "^\\d{14,15}$" - E164 string = `^\+?[1-9]\d{1,14}$` -) - -// Used by IsFilePath func -const ( - // Unknown is unresolved OS type - Unknown = iota - // Win is Windows type - Win - // Unix is *nix OS types - Unix -) - -var ( - userRegexp = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+$") - hostRegexp = regexp.MustCompile("^[^\\s]+\\.[^\\s]+$") - userDotRegexp = regexp.MustCompile("(^[.]{1})|([.]{1}$)|([.]{2,})") - rxEmail = regexp.MustCompile(Email) - rxCreditCard = regexp.MustCompile(CreditCard) - rxISBN10 = regexp.MustCompile(ISBN10) - rxISBN13 = regexp.MustCompile(ISBN13) - rxUUID3 = regexp.MustCompile(UUID3) - rxUUID4 = regexp.MustCompile(UUID4) - rxUUID5 = regexp.MustCompile(UUID5) - rxUUID = regexp.MustCompile(UUID) - rxAlpha = regexp.MustCompile(Alpha) - rxAlphanumeric = regexp.MustCompile(Alphanumeric) - rxNumeric = regexp.MustCompile(Numeric) - rxInt = regexp.MustCompile(Int) - rxFloat = regexp.MustCompile(Float) - rxHexadecimal = regexp.MustCompile(Hexadecimal) - rxHexcolor = regexp.MustCompile(Hexcolor) - rxRGBcolor = regexp.MustCompile(RGBcolor) - rxASCII = regexp.MustCompile(ASCII) - rxPrintableASCII = regexp.MustCompile(PrintableASCII) - rxMultibyte = regexp.MustCompile(Multibyte) - rxFullWidth = regexp.MustCompile(FullWidth) - rxHalfWidth = regexp.MustCompile(HalfWidth) - rxBase64 = regexp.MustCompile(Base64) - rxDataURI = regexp.MustCompile(DataURI) - rxMagnetURI = regexp.MustCompile(MagnetURI) - rxLatitude = regexp.MustCompile(Latitude) - rxLongitude = regexp.MustCompile(Longitude) - rxDNSName = regexp.MustCompile(DNSName) - rxURL = regexp.MustCompile(URL) - rxSSN = regexp.MustCompile(SSN) - rxWinPath = regexp.MustCompile(WinPath) - rxUnixPath = regexp.MustCompile(UnixPath) - rxARWinPath = regexp.MustCompile(WinARPath) - rxARUnixPath = regexp.MustCompile(UnixARPath) - rxSemver = regexp.MustCompile(Semver) - rxHasLowerCase = regexp.MustCompile(hasLowerCase) - rxHasUpperCase = regexp.MustCompile(hasUpperCase) - rxHasWhitespace = regexp.MustCompile(hasWhitespace) - rxHasWhitespaceOnly = regexp.MustCompile(hasWhitespaceOnly) - rxIMEI = regexp.MustCompile(IMEI) - rxIMSI = regexp.MustCompile(IMSI) - rxE164 = regexp.MustCompile(E164) -) diff --git a/vendor/github.com/asaskevich/govalidator/types.go b/vendor/github.com/asaskevich/govalidator/types.go deleted file mode 100644 index c573abb51aff..000000000000 --- a/vendor/github.com/asaskevich/govalidator/types.go +++ /dev/null @@ -1,656 +0,0 @@ -package govalidator - -import ( - "reflect" - "regexp" - "sort" - "sync" -) - -// Validator is a wrapper for a validator function that returns bool and accepts string. -type Validator func(str string) bool - -// CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type. -// The second parameter should be the context (in the case of validating a struct: the whole object being validated). -type CustomTypeValidator func(i interface{}, o interface{}) bool - -// ParamValidator is a wrapper for validator functions that accept additional parameters. -type ParamValidator func(str string, params ...string) bool - -// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value -type InterfaceParamValidator func(in interface{}, params ...string) bool -type tagOptionsMap map[string]tagOption - -func (t tagOptionsMap) orderedKeys() []string { - var keys []string - for k := range t { - keys = append(keys, k) - } - - sort.Slice(keys, func(a, b int) bool { - return t[keys[a]].order < t[keys[b]].order - }) - - return keys -} - -type tagOption struct { - name string - customErrorMessage string - order int -} - -// UnsupportedTypeError is a wrapper for reflect.Type -type UnsupportedTypeError struct { - Type reflect.Type -} - -// stringValues is a slice of reflect.Value holding *reflect.StringValue. -// It implements the methods to sort by string. -type stringValues []reflect.Value - -// InterfaceParamTagMap is a map of functions accept variants parameters for an interface value -var InterfaceParamTagMap = map[string]InterfaceParamValidator{ - "type": IsType, -} - -// InterfaceParamTagRegexMap maps interface param tags to their respective regexes. -var InterfaceParamTagRegexMap = map[string]*regexp.Regexp{ - "type": regexp.MustCompile(`^type\((.*)\)$`), -} - -// ParamTagMap is a map of functions accept variants parameters -var ParamTagMap = map[string]ParamValidator{ - "length": ByteLength, - "range": Range, - "runelength": RuneLength, - "stringlength": StringLength, - "matches": StringMatches, - "in": IsInRaw, - "rsapub": IsRsaPub, - "minstringlength": MinStringLength, - "maxstringlength": MaxStringLength, -} - -// ParamTagRegexMap maps param tags to their respective regexes. -var ParamTagRegexMap = map[string]*regexp.Regexp{ - "range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"), - "length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"), - "runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"), - "stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"), - "in": regexp.MustCompile(`^in\((.*)\)`), - "matches": regexp.MustCompile(`^matches\((.+)\)$`), - "rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"), - "minstringlength": regexp.MustCompile("^minstringlength\\((\\d+)\\)$"), - "maxstringlength": regexp.MustCompile("^maxstringlength\\((\\d+)\\)$"), -} - -type customTypeTagMap struct { - validators map[string]CustomTypeValidator - - sync.RWMutex -} - -func (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) { - tm.RLock() - defer tm.RUnlock() - v, ok := tm.validators[name] - return v, ok -} - -func (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) { - tm.Lock() - defer tm.Unlock() - tm.validators[name] = ctv -} - -// CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function. -// Use this to validate compound or custom types that need to be handled as a whole, e.g. -// `type UUID [16]byte` (this would be handled as an array of bytes). -var CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)} - -// TagMap is a map of functions, that can be used as tags for ValidateStruct function. -var TagMap = map[string]Validator{ - "email": IsEmail, - "url": IsURL, - "dialstring": IsDialString, - "requrl": IsRequestURL, - "requri": IsRequestURI, - "alpha": IsAlpha, - "utfletter": IsUTFLetter, - "alphanum": IsAlphanumeric, - "utfletternum": IsUTFLetterNumeric, - "numeric": IsNumeric, - "utfnumeric": IsUTFNumeric, - "utfdigit": IsUTFDigit, - "hexadecimal": IsHexadecimal, - "hexcolor": IsHexcolor, - "rgbcolor": IsRGBcolor, - "lowercase": IsLowerCase, - "uppercase": IsUpperCase, - "int": IsInt, - "float": IsFloat, - "null": IsNull, - "notnull": IsNotNull, - "uuid": IsUUID, - "uuidv3": IsUUIDv3, - "uuidv4": IsUUIDv4, - "uuidv5": IsUUIDv5, - "creditcard": IsCreditCard, - "isbn10": IsISBN10, - "isbn13": IsISBN13, - "json": IsJSON, - "multibyte": IsMultibyte, - "ascii": IsASCII, - "printableascii": IsPrintableASCII, - "fullwidth": IsFullWidth, - "halfwidth": IsHalfWidth, - "variablewidth": IsVariableWidth, - "base64": IsBase64, - "datauri": IsDataURI, - "ip": IsIP, - "port": IsPort, - "ipv4": IsIPv4, - "ipv6": IsIPv6, - "dns": IsDNSName, - "host": IsHost, - "mac": IsMAC, - "latitude": IsLatitude, - "longitude": IsLongitude, - "ssn": IsSSN, - "semver": IsSemver, - "rfc3339": IsRFC3339, - "rfc3339WithoutZone": IsRFC3339WithoutZone, - "ISO3166Alpha2": IsISO3166Alpha2, - "ISO3166Alpha3": IsISO3166Alpha3, - "ISO4217": IsISO4217, - "IMEI": IsIMEI, - "ulid": IsULID, -} - -// ISO3166Entry stores country codes -type ISO3166Entry struct { - EnglishShortName string - FrenchShortName string - Alpha2Code string - Alpha3Code string - Numeric string -} - -//ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type "Officially Assigned Codes" -var ISO3166List = []ISO3166Entry{ - {"Afghanistan", "Afghanistan (l')", "AF", "AFG", "004"}, - {"Albania", "Albanie (l')", "AL", "ALB", "008"}, - {"Antarctica", "Antarctique (l')", "AQ", "ATA", "010"}, - {"Algeria", "Algérie (l')", "DZ", "DZA", "012"}, - {"American Samoa", "Samoa américaines (les)", "AS", "ASM", "016"}, - {"Andorra", "Andorre (l')", "AD", "AND", "020"}, - {"Angola", "Angola (l')", "AO", "AGO", "024"}, - {"Antigua and Barbuda", "Antigua-et-Barbuda", "AG", "ATG", "028"}, - {"Azerbaijan", "Azerbaïdjan (l')", "AZ", "AZE", "031"}, - {"Argentina", "Argentine (l')", "AR", "ARG", "032"}, - {"Australia", "Australie (l')", "AU", "AUS", "036"}, - {"Austria", "Autriche (l')", "AT", "AUT", "040"}, - {"Bahamas (the)", "Bahamas (les)", "BS", "BHS", "044"}, - {"Bahrain", "Bahreïn", "BH", "BHR", "048"}, - {"Bangladesh", "Bangladesh (le)", "BD", "BGD", "050"}, - {"Armenia", "Arménie (l')", "AM", "ARM", "051"}, - {"Barbados", "Barbade (la)", "BB", "BRB", "052"}, - {"Belgium", "Belgique (la)", "BE", "BEL", "056"}, - {"Bermuda", "Bermudes (les)", "BM", "BMU", "060"}, - {"Bhutan", "Bhoutan (le)", "BT", "BTN", "064"}, - {"Bolivia (Plurinational State of)", "Bolivie (État plurinational de)", "BO", "BOL", "068"}, - {"Bosnia and Herzegovina", "Bosnie-Herzégovine (la)", "BA", "BIH", "070"}, - {"Botswana", "Botswana (le)", "BW", "BWA", "072"}, - {"Bouvet Island", "Bouvet (l'Île)", "BV", "BVT", "074"}, - {"Brazil", "Brésil (le)", "BR", "BRA", "076"}, - {"Belize", "Belize (le)", "BZ", "BLZ", "084"}, - {"British Indian Ocean Territory (the)", "Indien (le Territoire britannique de l'océan)", "IO", "IOT", "086"}, - {"Solomon Islands", "Salomon (Îles)", "SB", "SLB", "090"}, - {"Virgin Islands (British)", "Vierges britanniques (les Îles)", "VG", "VGB", "092"}, - {"Brunei Darussalam", "Brunéi Darussalam (le)", "BN", "BRN", "096"}, - {"Bulgaria", "Bulgarie (la)", "BG", "BGR", "100"}, - {"Myanmar", "Myanmar (le)", "MM", "MMR", "104"}, - {"Burundi", "Burundi (le)", "BI", "BDI", "108"}, - {"Belarus", "Bélarus (le)", "BY", "BLR", "112"}, - {"Cambodia", "Cambodge (le)", "KH", "KHM", "116"}, - {"Cameroon", "Cameroun (le)", "CM", "CMR", "120"}, - {"Canada", "Canada (le)", "CA", "CAN", "124"}, - {"Cabo Verde", "Cabo Verde", "CV", "CPV", "132"}, - {"Cayman Islands (the)", "Caïmans (les Îles)", "KY", "CYM", "136"}, - {"Central African Republic (the)", "République centrafricaine (la)", "CF", "CAF", "140"}, - {"Sri Lanka", "Sri Lanka", "LK", "LKA", "144"}, - {"Chad", "Tchad (le)", "TD", "TCD", "148"}, - {"Chile", "Chili (le)", "CL", "CHL", "152"}, - {"China", "Chine (la)", "CN", "CHN", "156"}, - {"Taiwan (Province of China)", "Taïwan (Province de Chine)", "TW", "TWN", "158"}, - {"Christmas Island", "Christmas (l'Île)", "CX", "CXR", "162"}, - {"Cocos (Keeling) Islands (the)", "Cocos (les Îles)/ Keeling (les Îles)", "CC", "CCK", "166"}, - {"Colombia", "Colombie (la)", "CO", "COL", "170"}, - {"Comoros (the)", "Comores (les)", "KM", "COM", "174"}, - {"Mayotte", "Mayotte", "YT", "MYT", "175"}, - {"Congo (the)", "Congo (le)", "CG", "COG", "178"}, - {"Congo (the Democratic Republic of the)", "Congo (la République démocratique du)", "CD", "COD", "180"}, - {"Cook Islands (the)", "Cook (les Îles)", "CK", "COK", "184"}, - {"Costa Rica", "Costa Rica (le)", "CR", "CRI", "188"}, - {"Croatia", "Croatie (la)", "HR", "HRV", "191"}, - {"Cuba", "Cuba", "CU", "CUB", "192"}, - {"Cyprus", "Chypre", "CY", "CYP", "196"}, - {"Czech Republic (the)", "tchèque (la République)", "CZ", "CZE", "203"}, - {"Benin", "Bénin (le)", "BJ", "BEN", "204"}, - {"Denmark", "Danemark (le)", "DK", "DNK", "208"}, - {"Dominica", "Dominique (la)", "DM", "DMA", "212"}, - {"Dominican Republic (the)", "dominicaine (la République)", "DO", "DOM", "214"}, - {"Ecuador", "Équateur (l')", "EC", "ECU", "218"}, - {"El Salvador", "El Salvador", "SV", "SLV", "222"}, - {"Equatorial Guinea", "Guinée équatoriale (la)", "GQ", "GNQ", "226"}, - {"Ethiopia", "Éthiopie (l')", "ET", "ETH", "231"}, - {"Eritrea", "Érythrée (l')", "ER", "ERI", "232"}, - {"Estonia", "Estonie (l')", "EE", "EST", "233"}, - {"Faroe Islands (the)", "Féroé (les Îles)", "FO", "FRO", "234"}, - {"Falkland Islands (the) [Malvinas]", "Falkland (les Îles)/Malouines (les Îles)", "FK", "FLK", "238"}, - {"South Georgia and the South Sandwich Islands", "Géorgie du Sud-et-les Îles Sandwich du Sud (la)", "GS", "SGS", "239"}, - {"Fiji", "Fidji (les)", "FJ", "FJI", "242"}, - {"Finland", "Finlande (la)", "FI", "FIN", "246"}, - {"Åland Islands", "Åland(les Îles)", "AX", "ALA", "248"}, - {"France", "France (la)", "FR", "FRA", "250"}, - {"French Guiana", "Guyane française (la )", "GF", "GUF", "254"}, - {"French Polynesia", "Polynésie française (la)", "PF", "PYF", "258"}, - {"French Southern Territories (the)", "Terres australes françaises (les)", "TF", "ATF", "260"}, - {"Djibouti", "Djibouti", "DJ", "DJI", "262"}, - {"Gabon", "Gabon (le)", "GA", "GAB", "266"}, - {"Georgia", "Géorgie (la)", "GE", "GEO", "268"}, - {"Gambia (the)", "Gambie (la)", "GM", "GMB", "270"}, - {"Palestine, State of", "Palestine, État de", "PS", "PSE", "275"}, - {"Germany", "Allemagne (l')", "DE", "DEU", "276"}, - {"Ghana", "Ghana (le)", "GH", "GHA", "288"}, - {"Gibraltar", "Gibraltar", "GI", "GIB", "292"}, - {"Kiribati", "Kiribati", "KI", "KIR", "296"}, - {"Greece", "Grèce (la)", "GR", "GRC", "300"}, - {"Greenland", "Groenland (le)", "GL", "GRL", "304"}, - {"Grenada", "Grenade (la)", "GD", "GRD", "308"}, - {"Guadeloupe", "Guadeloupe (la)", "GP", "GLP", "312"}, - {"Guam", "Guam", "GU", "GUM", "316"}, - {"Guatemala", "Guatemala (le)", "GT", "GTM", "320"}, - {"Guinea", "Guinée (la)", "GN", "GIN", "324"}, - {"Guyana", "Guyana (le)", "GY", "GUY", "328"}, - {"Haiti", "Haïti", "HT", "HTI", "332"}, - {"Heard Island and McDonald Islands", "Heard-et-Îles MacDonald (l'Île)", "HM", "HMD", "334"}, - {"Holy See (the)", "Saint-Siège (le)", "VA", "VAT", "336"}, - {"Honduras", "Honduras (le)", "HN", "HND", "340"}, - {"Hong Kong", "Hong Kong", "HK", "HKG", "344"}, - {"Hungary", "Hongrie (la)", "HU", "HUN", "348"}, - {"Iceland", "Islande (l')", "IS", "ISL", "352"}, - {"India", "Inde (l')", "IN", "IND", "356"}, - {"Indonesia", "Indonésie (l')", "ID", "IDN", "360"}, - {"Iran (Islamic Republic of)", "Iran (République Islamique d')", "IR", "IRN", "364"}, - {"Iraq", "Iraq (l')", "IQ", "IRQ", "368"}, - {"Ireland", "Irlande (l')", "IE", "IRL", "372"}, - {"Israel", "Israël", "IL", "ISR", "376"}, - {"Italy", "Italie (l')", "IT", "ITA", "380"}, - {"Côte d'Ivoire", "Côte d'Ivoire (la)", "CI", "CIV", "384"}, - {"Jamaica", "Jamaïque (la)", "JM", "JAM", "388"}, - {"Japan", "Japon (le)", "JP", "JPN", "392"}, - {"Kazakhstan", "Kazakhstan (le)", "KZ", "KAZ", "398"}, - {"Jordan", "Jordanie (la)", "JO", "JOR", "400"}, - {"Kenya", "Kenya (le)", "KE", "KEN", "404"}, - {"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"}, - {"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"}, - {"Kuwait", "Koweït (le)", "KW", "KWT", "414"}, - {"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"}, - {"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"}, - {"Lebanon", "Liban (le)", "LB", "LBN", "422"}, - {"Lesotho", "Lesotho (le)", "LS", "LSO", "426"}, - {"Latvia", "Lettonie (la)", "LV", "LVA", "428"}, - {"Liberia", "Libéria (le)", "LR", "LBR", "430"}, - {"Libya", "Libye (la)", "LY", "LBY", "434"}, - {"Liechtenstein", "Liechtenstein (le)", "LI", "LIE", "438"}, - {"Lithuania", "Lituanie (la)", "LT", "LTU", "440"}, - {"Luxembourg", "Luxembourg (le)", "LU", "LUX", "442"}, - {"Macao", "Macao", "MO", "MAC", "446"}, - {"Madagascar", "Madagascar", "MG", "MDG", "450"}, - {"Malawi", "Malawi (le)", "MW", "MWI", "454"}, - {"Malaysia", "Malaisie (la)", "MY", "MYS", "458"}, - {"Maldives", "Maldives (les)", "MV", "MDV", "462"}, - {"Mali", "Mali (le)", "ML", "MLI", "466"}, - {"Malta", "Malte", "MT", "MLT", "470"}, - {"Martinique", "Martinique (la)", "MQ", "MTQ", "474"}, - {"Mauritania", "Mauritanie (la)", "MR", "MRT", "478"}, - {"Mauritius", "Maurice", "MU", "MUS", "480"}, - {"Mexico", "Mexique (le)", "MX", "MEX", "484"}, - {"Monaco", "Monaco", "MC", "MCO", "492"}, - {"Mongolia", "Mongolie (la)", "MN", "MNG", "496"}, - {"Moldova (the Republic of)", "Moldova , République de", "MD", "MDA", "498"}, - {"Montenegro", "Monténégro (le)", "ME", "MNE", "499"}, - {"Montserrat", "Montserrat", "MS", "MSR", "500"}, - {"Morocco", "Maroc (le)", "MA", "MAR", "504"}, - {"Mozambique", "Mozambique (le)", "MZ", "MOZ", "508"}, - {"Oman", "Oman", "OM", "OMN", "512"}, - {"Namibia", "Namibie (la)", "NA", "NAM", "516"}, - {"Nauru", "Nauru", "NR", "NRU", "520"}, - {"Nepal", "Népal (le)", "NP", "NPL", "524"}, - {"Netherlands (the)", "Pays-Bas (les)", "NL", "NLD", "528"}, - {"Curaçao", "Curaçao", "CW", "CUW", "531"}, - {"Aruba", "Aruba", "AW", "ABW", "533"}, - {"Sint Maarten (Dutch part)", "Saint-Martin (partie néerlandaise)", "SX", "SXM", "534"}, - {"Bonaire, Sint Eustatius and Saba", "Bonaire, Saint-Eustache et Saba", "BQ", "BES", "535"}, - {"New Caledonia", "Nouvelle-Calédonie (la)", "NC", "NCL", "540"}, - {"Vanuatu", "Vanuatu (le)", "VU", "VUT", "548"}, - {"New Zealand", "Nouvelle-Zélande (la)", "NZ", "NZL", "554"}, - {"Nicaragua", "Nicaragua (le)", "NI", "NIC", "558"}, - {"Niger (the)", "Niger (le)", "NE", "NER", "562"}, - {"Nigeria", "Nigéria (le)", "NG", "NGA", "566"}, - {"Niue", "Niue", "NU", "NIU", "570"}, - {"Norfolk Island", "Norfolk (l'Île)", "NF", "NFK", "574"}, - {"Norway", "Norvège (la)", "NO", "NOR", "578"}, - {"Northern Mariana Islands (the)", "Mariannes du Nord (les Îles)", "MP", "MNP", "580"}, - {"United States Minor Outlying Islands (the)", "Îles mineures éloignées des États-Unis (les)", "UM", "UMI", "581"}, - {"Micronesia (Federated States of)", "Micronésie (États fédérés de)", "FM", "FSM", "583"}, - {"Marshall Islands (the)", "Marshall (Îles)", "MH", "MHL", "584"}, - {"Palau", "Palaos (les)", "PW", "PLW", "585"}, - {"Pakistan", "Pakistan (le)", "PK", "PAK", "586"}, - {"Panama", "Panama (le)", "PA", "PAN", "591"}, - {"Papua New Guinea", "Papouasie-Nouvelle-Guinée (la)", "PG", "PNG", "598"}, - {"Paraguay", "Paraguay (le)", "PY", "PRY", "600"}, - {"Peru", "Pérou (le)", "PE", "PER", "604"}, - {"Philippines (the)", "Philippines (les)", "PH", "PHL", "608"}, - {"Pitcairn", "Pitcairn", "PN", "PCN", "612"}, - {"Poland", "Pologne (la)", "PL", "POL", "616"}, - {"Portugal", "Portugal (le)", "PT", "PRT", "620"}, - {"Guinea-Bissau", "Guinée-Bissau (la)", "GW", "GNB", "624"}, - {"Timor-Leste", "Timor-Leste (le)", "TL", "TLS", "626"}, - {"Puerto Rico", "Porto Rico", "PR", "PRI", "630"}, - {"Qatar", "Qatar (le)", "QA", "QAT", "634"}, - {"Réunion", "Réunion (La)", "RE", "REU", "638"}, - {"Romania", "Roumanie (la)", "RO", "ROU", "642"}, - {"Russian Federation (the)", "Russie (la Fédération de)", "RU", "RUS", "643"}, - {"Rwanda", "Rwanda (le)", "RW", "RWA", "646"}, - {"Saint Barthélemy", "Saint-Barthélemy", "BL", "BLM", "652"}, - {"Saint Helena, Ascension and Tristan da Cunha", "Sainte-Hélène, Ascension et Tristan da Cunha", "SH", "SHN", "654"}, - {"Saint Kitts and Nevis", "Saint-Kitts-et-Nevis", "KN", "KNA", "659"}, - {"Anguilla", "Anguilla", "AI", "AIA", "660"}, - {"Saint Lucia", "Sainte-Lucie", "LC", "LCA", "662"}, - {"Saint Martin (French part)", "Saint-Martin (partie française)", "MF", "MAF", "663"}, - {"Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "PM", "SPM", "666"}, - {"Saint Vincent and the Grenadines", "Saint-Vincent-et-les Grenadines", "VC", "VCT", "670"}, - {"San Marino", "Saint-Marin", "SM", "SMR", "674"}, - {"Sao Tome and Principe", "Sao Tomé-et-Principe", "ST", "STP", "678"}, - {"Saudi Arabia", "Arabie saoudite (l')", "SA", "SAU", "682"}, - {"Senegal", "Sénégal (le)", "SN", "SEN", "686"}, - {"Serbia", "Serbie (la)", "RS", "SRB", "688"}, - {"Seychelles", "Seychelles (les)", "SC", "SYC", "690"}, - {"Sierra Leone", "Sierra Leone (la)", "SL", "SLE", "694"}, - {"Singapore", "Singapour", "SG", "SGP", "702"}, - {"Slovakia", "Slovaquie (la)", "SK", "SVK", "703"}, - {"Viet Nam", "Viet Nam (le)", "VN", "VNM", "704"}, - {"Slovenia", "Slovénie (la)", "SI", "SVN", "705"}, - {"Somalia", "Somalie (la)", "SO", "SOM", "706"}, - {"South Africa", "Afrique du Sud (l')", "ZA", "ZAF", "710"}, - {"Zimbabwe", "Zimbabwe (le)", "ZW", "ZWE", "716"}, - {"Spain", "Espagne (l')", "ES", "ESP", "724"}, - {"South Sudan", "Soudan du Sud (le)", "SS", "SSD", "728"}, - {"Sudan (the)", "Soudan (le)", "SD", "SDN", "729"}, - {"Western Sahara*", "Sahara occidental (le)*", "EH", "ESH", "732"}, - {"Suriname", "Suriname (le)", "SR", "SUR", "740"}, - {"Svalbard and Jan Mayen", "Svalbard et l'Île Jan Mayen (le)", "SJ", "SJM", "744"}, - {"Swaziland", "Swaziland (le)", "SZ", "SWZ", "748"}, - {"Sweden", "Suède (la)", "SE", "SWE", "752"}, - {"Switzerland", "Suisse (la)", "CH", "CHE", "756"}, - {"Syrian Arab Republic", "République arabe syrienne (la)", "SY", "SYR", "760"}, - {"Tajikistan", "Tadjikistan (le)", "TJ", "TJK", "762"}, - {"Thailand", "Thaïlande (la)", "TH", "THA", "764"}, - {"Togo", "Togo (le)", "TG", "TGO", "768"}, - {"Tokelau", "Tokelau (les)", "TK", "TKL", "772"}, - {"Tonga", "Tonga (les)", "TO", "TON", "776"}, - {"Trinidad and Tobago", "Trinité-et-Tobago (la)", "TT", "TTO", "780"}, - {"United Arab Emirates (the)", "Émirats arabes unis (les)", "AE", "ARE", "784"}, - {"Tunisia", "Tunisie (la)", "TN", "TUN", "788"}, - {"Turkey", "Turquie (la)", "TR", "TUR", "792"}, - {"Turkmenistan", "Turkménistan (le)", "TM", "TKM", "795"}, - {"Turks and Caicos Islands (the)", "Turks-et-Caïcos (les Îles)", "TC", "TCA", "796"}, - {"Tuvalu", "Tuvalu (les)", "TV", "TUV", "798"}, - {"Uganda", "Ouganda (l')", "UG", "UGA", "800"}, - {"Ukraine", "Ukraine (l')", "UA", "UKR", "804"}, - {"Macedonia (the former Yugoslav Republic of)", "Macédoine (l'ex‑République yougoslave de)", "MK", "MKD", "807"}, - {"Egypt", "Égypte (l')", "EG", "EGY", "818"}, - {"United Kingdom of Great Britain and Northern Ireland (the)", "Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)", "GB", "GBR", "826"}, - {"Guernsey", "Guernesey", "GG", "GGY", "831"}, - {"Jersey", "Jersey", "JE", "JEY", "832"}, - {"Isle of Man", "Île de Man", "IM", "IMN", "833"}, - {"Tanzania, United Republic of", "Tanzanie, République-Unie de", "TZ", "TZA", "834"}, - {"United States of America (the)", "États-Unis d'Amérique (les)", "US", "USA", "840"}, - {"Virgin Islands (U.S.)", "Vierges des États-Unis (les Îles)", "VI", "VIR", "850"}, - {"Burkina Faso", "Burkina Faso (le)", "BF", "BFA", "854"}, - {"Uruguay", "Uruguay (l')", "UY", "URY", "858"}, - {"Uzbekistan", "Ouzbékistan (l')", "UZ", "UZB", "860"}, - {"Venezuela (Bolivarian Republic of)", "Venezuela (République bolivarienne du)", "VE", "VEN", "862"}, - {"Wallis and Futuna", "Wallis-et-Futuna", "WF", "WLF", "876"}, - {"Samoa", "Samoa (le)", "WS", "WSM", "882"}, - {"Yemen", "Yémen (le)", "YE", "YEM", "887"}, - {"Zambia", "Zambie (la)", "ZM", "ZMB", "894"}, -} - -// ISO4217List is the list of ISO currency codes -var ISO4217List = []string{ - "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", - "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", - "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", - "DJF", "DKK", "DOP", "DZD", - "EGP", "ERN", "ETB", "EUR", - "FJD", "FKP", - "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", - "HKD", "HNL", "HRK", "HTG", "HUF", - "IDR", "ILS", "INR", "IQD", "IRR", "ISK", - "JMD", "JOD", "JPY", - "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", - "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", - "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", - "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", - "OMR", - "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", - "QAR", - "RON", "RSD", "RUB", "RWF", - "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "STN", "SVC", "SYP", "SZL", - "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", - "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS", - "VEF", "VES", "VND", "VUV", - "WST", - "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", - "YER", - "ZAR", "ZMW", "ZWL", -} - -// ISO693Entry stores ISO language codes -type ISO693Entry struct { - Alpha3bCode string - Alpha2Code string - English string -} - -//ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json -var ISO693List = []ISO693Entry{ - {Alpha3bCode: "aar", Alpha2Code: "aa", English: "Afar"}, - {Alpha3bCode: "abk", Alpha2Code: "ab", English: "Abkhazian"}, - {Alpha3bCode: "afr", Alpha2Code: "af", English: "Afrikaans"}, - {Alpha3bCode: "aka", Alpha2Code: "ak", English: "Akan"}, - {Alpha3bCode: "alb", Alpha2Code: "sq", English: "Albanian"}, - {Alpha3bCode: "amh", Alpha2Code: "am", English: "Amharic"}, - {Alpha3bCode: "ara", Alpha2Code: "ar", English: "Arabic"}, - {Alpha3bCode: "arg", Alpha2Code: "an", English: "Aragonese"}, - {Alpha3bCode: "arm", Alpha2Code: "hy", English: "Armenian"}, - {Alpha3bCode: "asm", Alpha2Code: "as", English: "Assamese"}, - {Alpha3bCode: "ava", Alpha2Code: "av", English: "Avaric"}, - {Alpha3bCode: "ave", Alpha2Code: "ae", English: "Avestan"}, - {Alpha3bCode: "aym", Alpha2Code: "ay", English: "Aymara"}, - {Alpha3bCode: "aze", Alpha2Code: "az", English: "Azerbaijani"}, - {Alpha3bCode: "bak", Alpha2Code: "ba", English: "Bashkir"}, - {Alpha3bCode: "bam", Alpha2Code: "bm", English: "Bambara"}, - {Alpha3bCode: "baq", Alpha2Code: "eu", English: "Basque"}, - {Alpha3bCode: "bel", Alpha2Code: "be", English: "Belarusian"}, - {Alpha3bCode: "ben", Alpha2Code: "bn", English: "Bengali"}, - {Alpha3bCode: "bih", Alpha2Code: "bh", English: "Bihari languages"}, - {Alpha3bCode: "bis", Alpha2Code: "bi", English: "Bislama"}, - {Alpha3bCode: "bos", Alpha2Code: "bs", English: "Bosnian"}, - {Alpha3bCode: "bre", Alpha2Code: "br", English: "Breton"}, - {Alpha3bCode: "bul", Alpha2Code: "bg", English: "Bulgarian"}, - {Alpha3bCode: "bur", Alpha2Code: "my", English: "Burmese"}, - {Alpha3bCode: "cat", Alpha2Code: "ca", English: "Catalan; Valencian"}, - {Alpha3bCode: "cha", Alpha2Code: "ch", English: "Chamorro"}, - {Alpha3bCode: "che", Alpha2Code: "ce", English: "Chechen"}, - {Alpha3bCode: "chi", Alpha2Code: "zh", English: "Chinese"}, - {Alpha3bCode: "chu", Alpha2Code: "cu", English: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"}, - {Alpha3bCode: "chv", Alpha2Code: "cv", English: "Chuvash"}, - {Alpha3bCode: "cor", Alpha2Code: "kw", English: "Cornish"}, - {Alpha3bCode: "cos", Alpha2Code: "co", English: "Corsican"}, - {Alpha3bCode: "cre", Alpha2Code: "cr", English: "Cree"}, - {Alpha3bCode: "cze", Alpha2Code: "cs", English: "Czech"}, - {Alpha3bCode: "dan", Alpha2Code: "da", English: "Danish"}, - {Alpha3bCode: "div", Alpha2Code: "dv", English: "Divehi; Dhivehi; Maldivian"}, - {Alpha3bCode: "dut", Alpha2Code: "nl", English: "Dutch; Flemish"}, - {Alpha3bCode: "dzo", Alpha2Code: "dz", English: "Dzongkha"}, - {Alpha3bCode: "eng", Alpha2Code: "en", English: "English"}, - {Alpha3bCode: "epo", Alpha2Code: "eo", English: "Esperanto"}, - {Alpha3bCode: "est", Alpha2Code: "et", English: "Estonian"}, - {Alpha3bCode: "ewe", Alpha2Code: "ee", English: "Ewe"}, - {Alpha3bCode: "fao", Alpha2Code: "fo", English: "Faroese"}, - {Alpha3bCode: "fij", Alpha2Code: "fj", English: "Fijian"}, - {Alpha3bCode: "fin", Alpha2Code: "fi", English: "Finnish"}, - {Alpha3bCode: "fre", Alpha2Code: "fr", English: "French"}, - {Alpha3bCode: "fry", Alpha2Code: "fy", English: "Western Frisian"}, - {Alpha3bCode: "ful", Alpha2Code: "ff", English: "Fulah"}, - {Alpha3bCode: "geo", Alpha2Code: "ka", English: "Georgian"}, - {Alpha3bCode: "ger", Alpha2Code: "de", English: "German"}, - {Alpha3bCode: "gla", Alpha2Code: "gd", English: "Gaelic; Scottish Gaelic"}, - {Alpha3bCode: "gle", Alpha2Code: "ga", English: "Irish"}, - {Alpha3bCode: "glg", Alpha2Code: "gl", English: "Galician"}, - {Alpha3bCode: "glv", Alpha2Code: "gv", English: "Manx"}, - {Alpha3bCode: "gre", Alpha2Code: "el", English: "Greek, Modern (1453-)"}, - {Alpha3bCode: "grn", Alpha2Code: "gn", English: "Guarani"}, - {Alpha3bCode: "guj", Alpha2Code: "gu", English: "Gujarati"}, - {Alpha3bCode: "hat", Alpha2Code: "ht", English: "Haitian; Haitian Creole"}, - {Alpha3bCode: "hau", Alpha2Code: "ha", English: "Hausa"}, - {Alpha3bCode: "heb", Alpha2Code: "he", English: "Hebrew"}, - {Alpha3bCode: "her", Alpha2Code: "hz", English: "Herero"}, - {Alpha3bCode: "hin", Alpha2Code: "hi", English: "Hindi"}, - {Alpha3bCode: "hmo", Alpha2Code: "ho", English: "Hiri Motu"}, - {Alpha3bCode: "hrv", Alpha2Code: "hr", English: "Croatian"}, - {Alpha3bCode: "hun", Alpha2Code: "hu", English: "Hungarian"}, - {Alpha3bCode: "ibo", Alpha2Code: "ig", English: "Igbo"}, - {Alpha3bCode: "ice", Alpha2Code: "is", English: "Icelandic"}, - {Alpha3bCode: "ido", Alpha2Code: "io", English: "Ido"}, - {Alpha3bCode: "iii", Alpha2Code: "ii", English: "Sichuan Yi; Nuosu"}, - {Alpha3bCode: "iku", Alpha2Code: "iu", English: "Inuktitut"}, - {Alpha3bCode: "ile", Alpha2Code: "ie", English: "Interlingue; Occidental"}, - {Alpha3bCode: "ina", Alpha2Code: "ia", English: "Interlingua (International Auxiliary Language Association)"}, - {Alpha3bCode: "ind", Alpha2Code: "id", English: "Indonesian"}, - {Alpha3bCode: "ipk", Alpha2Code: "ik", English: "Inupiaq"}, - {Alpha3bCode: "ita", Alpha2Code: "it", English: "Italian"}, - {Alpha3bCode: "jav", Alpha2Code: "jv", English: "Javanese"}, - {Alpha3bCode: "jpn", Alpha2Code: "ja", English: "Japanese"}, - {Alpha3bCode: "kal", Alpha2Code: "kl", English: "Kalaallisut; Greenlandic"}, - {Alpha3bCode: "kan", Alpha2Code: "kn", English: "Kannada"}, - {Alpha3bCode: "kas", Alpha2Code: "ks", English: "Kashmiri"}, - {Alpha3bCode: "kau", Alpha2Code: "kr", English: "Kanuri"}, - {Alpha3bCode: "kaz", Alpha2Code: "kk", English: "Kazakh"}, - {Alpha3bCode: "khm", Alpha2Code: "km", English: "Central Khmer"}, - {Alpha3bCode: "kik", Alpha2Code: "ki", English: "Kikuyu; Gikuyu"}, - {Alpha3bCode: "kin", Alpha2Code: "rw", English: "Kinyarwanda"}, - {Alpha3bCode: "kir", Alpha2Code: "ky", English: "Kirghiz; Kyrgyz"}, - {Alpha3bCode: "kom", Alpha2Code: "kv", English: "Komi"}, - {Alpha3bCode: "kon", Alpha2Code: "kg", English: "Kongo"}, - {Alpha3bCode: "kor", Alpha2Code: "ko", English: "Korean"}, - {Alpha3bCode: "kua", Alpha2Code: "kj", English: "Kuanyama; Kwanyama"}, - {Alpha3bCode: "kur", Alpha2Code: "ku", English: "Kurdish"}, - {Alpha3bCode: "lao", Alpha2Code: "lo", English: "Lao"}, - {Alpha3bCode: "lat", Alpha2Code: "la", English: "Latin"}, - {Alpha3bCode: "lav", Alpha2Code: "lv", English: "Latvian"}, - {Alpha3bCode: "lim", Alpha2Code: "li", English: "Limburgan; Limburger; Limburgish"}, - {Alpha3bCode: "lin", Alpha2Code: "ln", English: "Lingala"}, - {Alpha3bCode: "lit", Alpha2Code: "lt", English: "Lithuanian"}, - {Alpha3bCode: "ltz", Alpha2Code: "lb", English: "Luxembourgish; Letzeburgesch"}, - {Alpha3bCode: "lub", Alpha2Code: "lu", English: "Luba-Katanga"}, - {Alpha3bCode: "lug", Alpha2Code: "lg", English: "Ganda"}, - {Alpha3bCode: "mac", Alpha2Code: "mk", English: "Macedonian"}, - {Alpha3bCode: "mah", Alpha2Code: "mh", English: "Marshallese"}, - {Alpha3bCode: "mal", Alpha2Code: "ml", English: "Malayalam"}, - {Alpha3bCode: "mao", Alpha2Code: "mi", English: "Maori"}, - {Alpha3bCode: "mar", Alpha2Code: "mr", English: "Marathi"}, - {Alpha3bCode: "may", Alpha2Code: "ms", English: "Malay"}, - {Alpha3bCode: "mlg", Alpha2Code: "mg", English: "Malagasy"}, - {Alpha3bCode: "mlt", Alpha2Code: "mt", English: "Maltese"}, - {Alpha3bCode: "mon", Alpha2Code: "mn", English: "Mongolian"}, - {Alpha3bCode: "nau", Alpha2Code: "na", English: "Nauru"}, - {Alpha3bCode: "nav", Alpha2Code: "nv", English: "Navajo; Navaho"}, - {Alpha3bCode: "nbl", Alpha2Code: "nr", English: "Ndebele, South; South Ndebele"}, - {Alpha3bCode: "nde", Alpha2Code: "nd", English: "Ndebele, North; North Ndebele"}, - {Alpha3bCode: "ndo", Alpha2Code: "ng", English: "Ndonga"}, - {Alpha3bCode: "nep", Alpha2Code: "ne", English: "Nepali"}, - {Alpha3bCode: "nno", Alpha2Code: "nn", English: "Norwegian Nynorsk; Nynorsk, Norwegian"}, - {Alpha3bCode: "nob", Alpha2Code: "nb", English: "Bokmål, Norwegian; Norwegian Bokmål"}, - {Alpha3bCode: "nor", Alpha2Code: "no", English: "Norwegian"}, - {Alpha3bCode: "nya", Alpha2Code: "ny", English: "Chichewa; Chewa; Nyanja"}, - {Alpha3bCode: "oci", Alpha2Code: "oc", English: "Occitan (post 1500); Provençal"}, - {Alpha3bCode: "oji", Alpha2Code: "oj", English: "Ojibwa"}, - {Alpha3bCode: "ori", Alpha2Code: "or", English: "Oriya"}, - {Alpha3bCode: "orm", Alpha2Code: "om", English: "Oromo"}, - {Alpha3bCode: "oss", Alpha2Code: "os", English: "Ossetian; Ossetic"}, - {Alpha3bCode: "pan", Alpha2Code: "pa", English: "Panjabi; Punjabi"}, - {Alpha3bCode: "per", Alpha2Code: "fa", English: "Persian"}, - {Alpha3bCode: "pli", Alpha2Code: "pi", English: "Pali"}, - {Alpha3bCode: "pol", Alpha2Code: "pl", English: "Polish"}, - {Alpha3bCode: "por", Alpha2Code: "pt", English: "Portuguese"}, - {Alpha3bCode: "pus", Alpha2Code: "ps", English: "Pushto; Pashto"}, - {Alpha3bCode: "que", Alpha2Code: "qu", English: "Quechua"}, - {Alpha3bCode: "roh", Alpha2Code: "rm", English: "Romansh"}, - {Alpha3bCode: "rum", Alpha2Code: "ro", English: "Romanian; Moldavian; Moldovan"}, - {Alpha3bCode: "run", Alpha2Code: "rn", English: "Rundi"}, - {Alpha3bCode: "rus", Alpha2Code: "ru", English: "Russian"}, - {Alpha3bCode: "sag", Alpha2Code: "sg", English: "Sango"}, - {Alpha3bCode: "san", Alpha2Code: "sa", English: "Sanskrit"}, - {Alpha3bCode: "sin", Alpha2Code: "si", English: "Sinhala; Sinhalese"}, - {Alpha3bCode: "slo", Alpha2Code: "sk", English: "Slovak"}, - {Alpha3bCode: "slv", Alpha2Code: "sl", English: "Slovenian"}, - {Alpha3bCode: "sme", Alpha2Code: "se", English: "Northern Sami"}, - {Alpha3bCode: "smo", Alpha2Code: "sm", English: "Samoan"}, - {Alpha3bCode: "sna", Alpha2Code: "sn", English: "Shona"}, - {Alpha3bCode: "snd", Alpha2Code: "sd", English: "Sindhi"}, - {Alpha3bCode: "som", Alpha2Code: "so", English: "Somali"}, - {Alpha3bCode: "sot", Alpha2Code: "st", English: "Sotho, Southern"}, - {Alpha3bCode: "spa", Alpha2Code: "es", English: "Spanish; Castilian"}, - {Alpha3bCode: "srd", Alpha2Code: "sc", English: "Sardinian"}, - {Alpha3bCode: "srp", Alpha2Code: "sr", English: "Serbian"}, - {Alpha3bCode: "ssw", Alpha2Code: "ss", English: "Swati"}, - {Alpha3bCode: "sun", Alpha2Code: "su", English: "Sundanese"}, - {Alpha3bCode: "swa", Alpha2Code: "sw", English: "Swahili"}, - {Alpha3bCode: "swe", Alpha2Code: "sv", English: "Swedish"}, - {Alpha3bCode: "tah", Alpha2Code: "ty", English: "Tahitian"}, - {Alpha3bCode: "tam", Alpha2Code: "ta", English: "Tamil"}, - {Alpha3bCode: "tat", Alpha2Code: "tt", English: "Tatar"}, - {Alpha3bCode: "tel", Alpha2Code: "te", English: "Telugu"}, - {Alpha3bCode: "tgk", Alpha2Code: "tg", English: "Tajik"}, - {Alpha3bCode: "tgl", Alpha2Code: "tl", English: "Tagalog"}, - {Alpha3bCode: "tha", Alpha2Code: "th", English: "Thai"}, - {Alpha3bCode: "tib", Alpha2Code: "bo", English: "Tibetan"}, - {Alpha3bCode: "tir", Alpha2Code: "ti", English: "Tigrinya"}, - {Alpha3bCode: "ton", Alpha2Code: "to", English: "Tonga (Tonga Islands)"}, - {Alpha3bCode: "tsn", Alpha2Code: "tn", English: "Tswana"}, - {Alpha3bCode: "tso", Alpha2Code: "ts", English: "Tsonga"}, - {Alpha3bCode: "tuk", Alpha2Code: "tk", English: "Turkmen"}, - {Alpha3bCode: "tur", Alpha2Code: "tr", English: "Turkish"}, - {Alpha3bCode: "twi", Alpha2Code: "tw", English: "Twi"}, - {Alpha3bCode: "uig", Alpha2Code: "ug", English: "Uighur; Uyghur"}, - {Alpha3bCode: "ukr", Alpha2Code: "uk", English: "Ukrainian"}, - {Alpha3bCode: "urd", Alpha2Code: "ur", English: "Urdu"}, - {Alpha3bCode: "uzb", Alpha2Code: "uz", English: "Uzbek"}, - {Alpha3bCode: "ven", Alpha2Code: "ve", English: "Venda"}, - {Alpha3bCode: "vie", Alpha2Code: "vi", English: "Vietnamese"}, - {Alpha3bCode: "vol", Alpha2Code: "vo", English: "Volapük"}, - {Alpha3bCode: "wel", Alpha2Code: "cy", English: "Welsh"}, - {Alpha3bCode: "wln", Alpha2Code: "wa", English: "Walloon"}, - {Alpha3bCode: "wol", Alpha2Code: "wo", English: "Wolof"}, - {Alpha3bCode: "xho", Alpha2Code: "xh", English: "Xhosa"}, - {Alpha3bCode: "yid", Alpha2Code: "yi", English: "Yiddish"}, - {Alpha3bCode: "yor", Alpha2Code: "yo", English: "Yoruba"}, - {Alpha3bCode: "zha", Alpha2Code: "za", English: "Zhuang; Chuang"}, - {Alpha3bCode: "zul", Alpha2Code: "zu", English: "Zulu"}, -} diff --git a/vendor/github.com/asaskevich/govalidator/utils.go b/vendor/github.com/asaskevich/govalidator/utils.go deleted file mode 100644 index f4c30f824a22..000000000000 --- a/vendor/github.com/asaskevich/govalidator/utils.go +++ /dev/null @@ -1,270 +0,0 @@ -package govalidator - -import ( - "errors" - "fmt" - "html" - "math" - "path" - "regexp" - "strings" - "unicode" - "unicode/utf8" -) - -// Contains checks if the string contains the substring. -func Contains(str, substring string) bool { - return strings.Contains(str, substring) -} - -// Matches checks if string matches the pattern (pattern is regular expression) -// In case of error return false -func Matches(str, pattern string) bool { - match, _ := regexp.MatchString(pattern, str) - return match -} - -// LeftTrim trims characters from the left side of the input. -// If second argument is empty, it will remove leading spaces. -func LeftTrim(str, chars string) string { - if chars == "" { - return strings.TrimLeftFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("^[" + chars + "]+") - return r.ReplaceAllString(str, "") -} - -// RightTrim trims characters from the right side of the input. -// If second argument is empty, it will remove trailing spaces. -func RightTrim(str, chars string) string { - if chars == "" { - return strings.TrimRightFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("[" + chars + "]+$") - return r.ReplaceAllString(str, "") -} - -// Trim trims characters from both sides of the input. -// If second argument is empty, it will remove spaces. -func Trim(str, chars string) string { - return LeftTrim(RightTrim(str, chars), chars) -} - -// WhiteList removes characters that do not appear in the whitelist. -func WhiteList(str, chars string) string { - pattern := "[^" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// BlackList removes characters that appear in the blacklist. -func BlackList(str, chars string) string { - pattern := "[" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// StripLow removes characters with a numerical value < 32 and 127, mostly control characters. -// If keep_new_lines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD). -func StripLow(str string, keepNewLines bool) string { - chars := "" - if keepNewLines { - chars = "\x00-\x09\x0B\x0C\x0E-\x1F\x7F" - } else { - chars = "\x00-\x1F\x7F" - } - return BlackList(str, chars) -} - -// ReplacePattern replaces regular expression pattern in string -func ReplacePattern(str, pattern, replace string) string { - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, replace) -} - -// Escape replaces <, >, & and " with HTML entities. -var Escape = html.EscapeString - -func addSegment(inrune, segment []rune) []rune { - if len(segment) == 0 { - return inrune - } - if len(inrune) != 0 { - inrune = append(inrune, '_') - } - inrune = append(inrune, segment...) - return inrune -} - -// UnderscoreToCamelCase converts from underscore separated form to camel case form. -// Ex.: my_func => MyFunc -func UnderscoreToCamelCase(s string) string { - return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1) -} - -// CamelCaseToUnderscore converts from camel case form to underscore separated form. -// Ex.: MyFunc => my_func -func CamelCaseToUnderscore(str string) string { - var output []rune - var segment []rune - for _, r := range str { - - // not treat number as separate segment - if !unicode.IsLower(r) && string(r) != "_" && !unicode.IsNumber(r) { - output = addSegment(output, segment) - segment = nil - } - segment = append(segment, unicode.ToLower(r)) - } - output = addSegment(output, segment) - return string(output) -} - -// Reverse returns reversed string -func Reverse(s string) string { - r := []rune(s) - for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 { - r[i], r[j] = r[j], r[i] - } - return string(r) -} - -// GetLines splits string by "\n" and return array of lines -func GetLines(s string) []string { - return strings.Split(s, "\n") -} - -// GetLine returns specified line of multiline string -func GetLine(s string, index int) (string, error) { - lines := GetLines(s) - if index < 0 || index >= len(lines) { - return "", errors.New("line index out of bounds") - } - return lines[index], nil -} - -// RemoveTags removes all tags from HTML string -func RemoveTags(s string) string { - return ReplacePattern(s, "<[^>]*>", "") -} - -// SafeFileName returns safe string that can be used in file names -func SafeFileName(str string) string { - name := strings.ToLower(str) - name = path.Clean(path.Base(name)) - name = strings.Trim(name, " ") - separators, err := regexp.Compile(`[ &_=+:]`) - if err == nil { - name = separators.ReplaceAllString(name, "-") - } - legal, err := regexp.Compile(`[^[:alnum:]-.]`) - if err == nil { - name = legal.ReplaceAllString(name, "") - } - for strings.Contains(name, "--") { - name = strings.Replace(name, "--", "-", -1) - } - return name -} - -// NormalizeEmail canonicalize an email address. -// The local part of the email address is lowercased for all domains; the hostname is always lowercased and -// the local part of the email address is always lowercased for hosts that are known to be case-insensitive (currently only GMail). -// Normalization follows special rules for known providers: currently, GMail addresses have dots removed in the local part and -// are stripped of tags (e.g. some.one+tag@gmail.com becomes someone@gmail.com) and all @googlemail.com addresses are -// normalized to @gmail.com. -func NormalizeEmail(str string) (string, error) { - if !IsEmail(str) { - return "", fmt.Errorf("%s is not an email", str) - } - parts := strings.Split(str, "@") - parts[0] = strings.ToLower(parts[0]) - parts[1] = strings.ToLower(parts[1]) - if parts[1] == "gmail.com" || parts[1] == "googlemail.com" { - parts[1] = "gmail.com" - parts[0] = strings.Split(ReplacePattern(parts[0], `\.`, ""), "+")[0] - } - return strings.Join(parts, "@"), nil -} - -// Truncate a string to the closest length without breaking words. -func Truncate(str string, length int, ending string) string { - var aftstr, befstr string - if len(str) > length { - words := strings.Fields(str) - before, present := 0, 0 - for i := range words { - befstr = aftstr - before = present - aftstr = aftstr + words[i] + " " - present = len(aftstr) - if present > length && i != 0 { - if (length - before) < (present - length) { - return Trim(befstr, " /\\.,\"'#!?&@+-") + ending - } - return Trim(aftstr, " /\\.,\"'#!?&@+-") + ending - } - } - } - - return str -} - -// PadLeft pads left side of a string if size of string is less then indicated pad length -func PadLeft(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, false) -} - -// PadRight pads right side of a string if size of string is less then indicated pad length -func PadRight(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, false, true) -} - -// PadBoth pads both sides of a string if size of string is less then indicated pad length -func PadBoth(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, true) -} - -// PadString either left, right or both sides. -// Note that padding string can be unicode and more then one character -func buildPadStr(str string, padStr string, padLen int, padLeft bool, padRight bool) string { - - // When padded length is less then the current string size - if padLen < utf8.RuneCountInString(str) { - return str - } - - padLen -= utf8.RuneCountInString(str) - - targetLen := padLen - - targetLenLeft := targetLen - targetLenRight := targetLen - if padLeft && padRight { - targetLenLeft = padLen / 2 - targetLenRight = padLen - targetLenLeft - } - - strToRepeatLen := utf8.RuneCountInString(padStr) - - repeatTimes := int(math.Ceil(float64(targetLen) / float64(strToRepeatLen))) - repeatedString := strings.Repeat(padStr, repeatTimes) - - leftSide := "" - if padLeft { - leftSide = repeatedString[0:targetLenLeft] - } - - rightSide := "" - if padRight { - rightSide = repeatedString[0:targetLenRight] - } - - return leftSide + str + rightSide -} - -// TruncatingErrorf removes extra args from fmt.Errorf if not formatted in the str object -func TruncatingErrorf(str string, args ...interface{}) error { - n := strings.Count(str, "%s") - return fmt.Errorf(str, args[:n]...) -} diff --git a/vendor/github.com/asaskevich/govalidator/validator.go b/vendor/github.com/asaskevich/govalidator/validator.go deleted file mode 100644 index c9c4fac0655a..000000000000 --- a/vendor/github.com/asaskevich/govalidator/validator.go +++ /dev/null @@ -1,1768 +0,0 @@ -// Package govalidator is package of validators and sanitizers for strings, structs and collections. -package govalidator - -import ( - "bytes" - "crypto/rsa" - "crypto/x509" - "encoding/base64" - "encoding/json" - "encoding/pem" - "fmt" - "io/ioutil" - "net" - "net/url" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "time" - "unicode" - "unicode/utf8" -) - -var ( - fieldsRequiredByDefault bool - nilPtrAllowedByRequired = false - notNumberRegexp = regexp.MustCompile("[^0-9]+") - whiteSpacesAndMinus = regexp.MustCompile(`[\s-]+`) - paramsRegexp = regexp.MustCompile(`\(.*\)$`) -) - -const maxURLRuneCount = 2083 -const minURLRuneCount = 3 -const rfc3339WithoutZone = "2006-01-02T15:04:05" - -// SetFieldsRequiredByDefault causes validation to fail when struct fields -// do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). -// This struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -// type exampleStruct struct { -// Name string `` -// Email string `valid:"email"` -// This, however, will only fail when Email is empty or an invalid email address: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email"` -// Lastly, this will only fail when Email is an invalid email address but not when it's empty: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email,optional"` -func SetFieldsRequiredByDefault(value bool) { - fieldsRequiredByDefault = value -} - -// SetNilPtrAllowedByRequired causes validation to pass for nil ptrs when a field is set to required. -// The validation will still reject ptr fields in their zero value state. Example with this enabled: -// type exampleStruct struct { -// Name *string `valid:"required"` -// With `Name` set to "", this will be considered invalid input and will cause a validation error. -// With `Name` set to nil, this will be considered valid by validation. -// By default this is disabled. -func SetNilPtrAllowedByRequired(value bool) { - nilPtrAllowedByRequired = value -} - -// IsEmail checks if the string is an email. -func IsEmail(str string) bool { - // TODO uppercase letters are not supported - return rxEmail.MatchString(str) -} - -// IsExistingEmail checks if the string is an email of existing domain -func IsExistingEmail(email string) bool { - - if len(email) < 6 || len(email) > 254 { - return false - } - at := strings.LastIndex(email, "@") - if at <= 0 || at > len(email)-3 { - return false - } - user := email[:at] - host := email[at+1:] - if len(user) > 64 { - return false - } - switch host { - case "localhost", "example.com": - return true - } - if userDotRegexp.MatchString(user) || !userRegexp.MatchString(user) || !hostRegexp.MatchString(host) { - return false - } - if _, err := net.LookupMX(host); err != nil { - if _, err := net.LookupIP(host); err != nil { - return false - } - } - - return true -} - -// IsURL checks if the string is an URL. -func IsURL(str string) bool { - if str == "" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, ".") { - return false - } - strTemp := str - if strings.Contains(str, ":") && !strings.Contains(str, "://") { - // support no indicated urlscheme but with colon for port number - // http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString - strTemp = "http://" + str - } - u, err := url.Parse(strTemp) - if err != nil { - return false - } - if strings.HasPrefix(u.Host, ".") { - return false - } - if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) { - return false - } - return rxURL.MatchString(str) -} - -// IsRequestURL checks if the string rawurl, assuming -// it was received in an HTTP request, is a valid -// URL confirm to RFC 3986 -func IsRequestURL(rawurl string) bool { - url, err := url.ParseRequestURI(rawurl) - if err != nil { - return false //Couldn't even parse the rawurl - } - if len(url.Scheme) == 0 { - return false //No Scheme found - } - return true -} - -// IsRequestURI checks if the string rawurl, assuming -// it was received in an HTTP request, is an -// absolute URI or an absolute path. -func IsRequestURI(rawurl string) bool { - _, err := url.ParseRequestURI(rawurl) - return err == nil -} - -// IsAlpha checks if the string contains only letters (a-zA-Z). Empty string is valid. -func IsAlpha(str string) bool { - if IsNull(str) { - return true - } - return rxAlpha.MatchString(str) -} - -//IsUTFLetter checks if the string contains only unicode letter characters. -//Similar to IsAlpha but for all languages. Empty string is valid. -func IsUTFLetter(str string) bool { - if IsNull(str) { - return true - } - - for _, c := range str { - if !unicode.IsLetter(c) { - return false - } - } - return true - -} - -// IsAlphanumeric checks if the string contains only letters and numbers. Empty string is valid. -func IsAlphanumeric(str string) bool { - if IsNull(str) { - return true - } - return rxAlphanumeric.MatchString(str) -} - -// IsUTFLetterNumeric checks if the string contains only unicode letters and numbers. Empty string is valid. -func IsUTFLetterNumeric(str string) bool { - if IsNull(str) { - return true - } - for _, c := range str { - if !unicode.IsLetter(c) && !unicode.IsNumber(c) { //letters && numbers are ok - return false - } - } - return true - -} - -// IsNumeric checks if the string contains only numbers. Empty string is valid. -func IsNumeric(str string) bool { - if IsNull(str) { - return true - } - return rxNumeric.MatchString(str) -} - -// IsUTFNumeric checks if the string contains only unicode numbers of any kind. -// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid. -func IsUTFNumeric(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsNumber(c) { //numbers && minus sign are ok - return false - } - } - return true - -} - -// IsUTFDigit checks if the string contains only unicode radix-10 decimal digits. Empty string is valid. -func IsUTFDigit(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsDigit(c) { //digits && minus sign are ok - return false - } - } - return true - -} - -// IsHexadecimal checks if the string is a hexadecimal number. -func IsHexadecimal(str string) bool { - return rxHexadecimal.MatchString(str) -} - -// IsHexcolor checks if the string is a hexadecimal color. -func IsHexcolor(str string) bool { - return rxHexcolor.MatchString(str) -} - -// IsRGBcolor checks if the string is a valid RGB color in form rgb(RRR, GGG, BBB). -func IsRGBcolor(str string) bool { - return rxRGBcolor.MatchString(str) -} - -// IsLowerCase checks if the string is lowercase. Empty string is valid. -func IsLowerCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToLower(str) -} - -// IsUpperCase checks if the string is uppercase. Empty string is valid. -func IsUpperCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToUpper(str) -} - -// HasLowerCase checks if the string contains at least 1 lowercase. Empty string is valid. -func HasLowerCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasLowerCase.MatchString(str) -} - -// HasUpperCase checks if the string contains as least 1 uppercase. Empty string is valid. -func HasUpperCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasUpperCase.MatchString(str) -} - -// IsInt checks if the string is an integer. Empty string is valid. -func IsInt(str string) bool { - if IsNull(str) { - return true - } - return rxInt.MatchString(str) -} - -// IsFloat checks if the string is a float. -func IsFloat(str string) bool { - return str != "" && rxFloat.MatchString(str) -} - -// IsDivisibleBy checks if the string is a number that's divisible by another. -// If second argument is not valid integer or zero, it's return false. -// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero). -func IsDivisibleBy(str, num string) bool { - f, _ := ToFloat(str) - p := int64(f) - q, _ := ToInt(num) - if q == 0 { - return false - } - return (p == 0) || (p%q == 0) -} - -// IsNull checks if the string is null. -func IsNull(str string) bool { - return len(str) == 0 -} - -// IsNotNull checks if the string is not null. -func IsNotNull(str string) bool { - return !IsNull(str) -} - -// HasWhitespaceOnly checks the string only contains whitespace -func HasWhitespaceOnly(str string) bool { - return len(str) > 0 && rxHasWhitespaceOnly.MatchString(str) -} - -// HasWhitespace checks if the string contains any whitespace -func HasWhitespace(str string) bool { - return len(str) > 0 && rxHasWhitespace.MatchString(str) -} - -// IsByteLength checks if the string's length (in bytes) falls in a range. -func IsByteLength(str string, min, max int) bool { - return len(str) >= min && len(str) <= max -} - -// IsUUIDv3 checks if the string is a UUID version 3. -func IsUUIDv3(str string) bool { - return rxUUID3.MatchString(str) -} - -// IsUUIDv4 checks if the string is a UUID version 4. -func IsUUIDv4(str string) bool { - return rxUUID4.MatchString(str) -} - -// IsUUIDv5 checks if the string is a UUID version 5. -func IsUUIDv5(str string) bool { - return rxUUID5.MatchString(str) -} - -// IsUUID checks if the string is a UUID (version 3, 4 or 5). -func IsUUID(str string) bool { - return rxUUID.MatchString(str) -} - -// Byte to index table for O(1) lookups when unmarshaling. -// We use 0xFF as sentinel value for invalid indexes. -var ulidDec = [...]byte{ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, - 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, 0x15, 0xFF, - 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, 0x1D, 0x1E, - 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, - 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, - 0x15, 0xFF, 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, - 0x1D, 0x1E, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -} - -// EncodedSize is the length of a text encoded ULID. -const ulidEncodedSize = 26 - -// IsULID checks if the string is a ULID. -// -// Implementation got from: -// https://github.com/oklog/ulid (Apache-2.0 License) -// -func IsULID(str string) bool { - // Check if a base32 encoded ULID is the right length. - if len(str) != ulidEncodedSize { - return false - } - - // Check if all the characters in a base32 encoded ULID are part of the - // expected base32 character set. - if ulidDec[str[0]] == 0xFF || - ulidDec[str[1]] == 0xFF || - ulidDec[str[2]] == 0xFF || - ulidDec[str[3]] == 0xFF || - ulidDec[str[4]] == 0xFF || - ulidDec[str[5]] == 0xFF || - ulidDec[str[6]] == 0xFF || - ulidDec[str[7]] == 0xFF || - ulidDec[str[8]] == 0xFF || - ulidDec[str[9]] == 0xFF || - ulidDec[str[10]] == 0xFF || - ulidDec[str[11]] == 0xFF || - ulidDec[str[12]] == 0xFF || - ulidDec[str[13]] == 0xFF || - ulidDec[str[14]] == 0xFF || - ulidDec[str[15]] == 0xFF || - ulidDec[str[16]] == 0xFF || - ulidDec[str[17]] == 0xFF || - ulidDec[str[18]] == 0xFF || - ulidDec[str[19]] == 0xFF || - ulidDec[str[20]] == 0xFF || - ulidDec[str[21]] == 0xFF || - ulidDec[str[22]] == 0xFF || - ulidDec[str[23]] == 0xFF || - ulidDec[str[24]] == 0xFF || - ulidDec[str[25]] == 0xFF { - return false - } - - // Check if the first character in a base32 encoded ULID will overflow. This - // happens because the base32 representation encodes 130 bits, while the - // ULID is only 128 bits. - // - // See https://github.com/oklog/ulid/issues/9 for details. - if str[0] > '7' { - return false - } - return true -} - -// IsCreditCard checks if the string is a credit card. -func IsCreditCard(str string) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - if !rxCreditCard.MatchString(sanitized) { - return false - } - - number, _ := ToInt(sanitized) - number, lastDigit := number / 10, number % 10 - - var sum int64 - for i:=0; number > 0; i++ { - digit := number % 10 - - if i % 2 == 0 { - digit *= 2 - if digit > 9 { - digit -= 9 - } - } - - sum += digit - number = number / 10 - } - - return (sum + lastDigit) % 10 == 0 -} - -// IsISBN10 checks if the string is an ISBN version 10. -func IsISBN10(str string) bool { - return IsISBN(str, 10) -} - -// IsISBN13 checks if the string is an ISBN version 13. -func IsISBN13(str string) bool { - return IsISBN(str, 13) -} - -// IsISBN checks if the string is an ISBN (version 10 or 13). -// If version value is not equal to 10 or 13, it will be checks both variants. -func IsISBN(str string, version int) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - var checksum int32 - var i int32 - if version == 10 { - if !rxISBN10.MatchString(sanitized) { - return false - } - for i = 0; i < 9; i++ { - checksum += (i + 1) * int32(sanitized[i]-'0') - } - if sanitized[9] == 'X' { - checksum += 10 * 10 - } else { - checksum += 10 * int32(sanitized[9]-'0') - } - if checksum%11 == 0 { - return true - } - return false - } else if version == 13 { - if !rxISBN13.MatchString(sanitized) { - return false - } - factor := []int32{1, 3} - for i = 0; i < 12; i++ { - checksum += factor[i%2] * int32(sanitized[i]-'0') - } - return (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0 - } - return IsISBN(str, 10) || IsISBN(str, 13) -} - -// IsJSON checks if the string is valid JSON (note: uses json.Unmarshal). -func IsJSON(str string) bool { - var js json.RawMessage - return json.Unmarshal([]byte(str), &js) == nil -} - -// IsMultibyte checks if the string contains one or more multibyte chars. Empty string is valid. -func IsMultibyte(str string) bool { - if IsNull(str) { - return true - } - return rxMultibyte.MatchString(str) -} - -// IsASCII checks if the string contains ASCII chars only. Empty string is valid. -func IsASCII(str string) bool { - if IsNull(str) { - return true - } - return rxASCII.MatchString(str) -} - -// IsPrintableASCII checks if the string contains printable ASCII chars only. Empty string is valid. -func IsPrintableASCII(str string) bool { - if IsNull(str) { - return true - } - return rxPrintableASCII.MatchString(str) -} - -// IsFullWidth checks if the string contains any full-width chars. Empty string is valid. -func IsFullWidth(str string) bool { - if IsNull(str) { - return true - } - return rxFullWidth.MatchString(str) -} - -// IsHalfWidth checks if the string contains any half-width chars. Empty string is valid. -func IsHalfWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) -} - -// IsVariableWidth checks if the string contains a mixture of full and half-width chars. Empty string is valid. -func IsVariableWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str) -} - -// IsBase64 checks if a string is base64 encoded. -func IsBase64(str string) bool { - return rxBase64.MatchString(str) -} - -// IsFilePath checks is a string is Win or Unix file path and returns it's type. -func IsFilePath(str string) (bool, int) { - if rxWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false, Win - } - return true, Win - } else if rxUnixPath.MatchString(str) { - return true, Unix - } - return false, Unknown -} - -//IsWinFilePath checks both relative & absolute paths in Windows -func IsWinFilePath(str string) bool { - if rxARWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false - } - return true - } - return false -} - -//IsUnixFilePath checks both relative & absolute paths in Unix -func IsUnixFilePath(str string) bool { - if rxARUnixPath.MatchString(str) { - return true - } - return false -} - -// IsDataURI checks if a string is base64 encoded data URI such as an image -func IsDataURI(str string) bool { - dataURI := strings.Split(str, ",") - if !rxDataURI.MatchString(dataURI[0]) { - return false - } - return IsBase64(dataURI[1]) -} - -// IsMagnetURI checks if a string is valid magnet URI -func IsMagnetURI(str string) bool { - return rxMagnetURI.MatchString(str) -} - -// IsISO3166Alpha2 checks if a string is valid two-letter country code -func IsISO3166Alpha2(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO3166Alpha3 checks if a string is valid three-letter country code -func IsISO3166Alpha3(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha3Code { - return true - } - } - return false -} - -// IsISO693Alpha2 checks if a string is valid two-letter language code -func IsISO693Alpha2(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO693Alpha3b checks if a string is valid three-letter language code -func IsISO693Alpha3b(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha3bCode { - return true - } - } - return false -} - -// IsDNSName will validate the given string as a DNS name -func IsDNSName(str string) bool { - if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 { - // constraints already violated - return false - } - return !IsIP(str) && rxDNSName.MatchString(str) -} - -// IsHash checks if a string is a hash of type algorithm. -// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'] -func IsHash(str string, algorithm string) bool { - var len string - algo := strings.ToLower(algorithm) - - if algo == "crc32" || algo == "crc32b" { - len = "8" - } else if algo == "md5" || algo == "md4" || algo == "ripemd128" || algo == "tiger128" { - len = "32" - } else if algo == "sha1" || algo == "ripemd160" || algo == "tiger160" { - len = "40" - } else if algo == "tiger192" { - len = "48" - } else if algo == "sha3-224" { - len = "56" - } else if algo == "sha256" || algo == "sha3-256" { - len = "64" - } else if algo == "sha384" || algo == "sha3-384" { - len = "96" - } else if algo == "sha512" || algo == "sha3-512" { - len = "128" - } else { - return false - } - - return Matches(str, "^[a-f0-9]{"+len+"}$") -} - -// IsSHA3224 checks is a string is a SHA3-224 hash. Alias for `IsHash(str, "sha3-224")` -func IsSHA3224(str string) bool { - return IsHash(str, "sha3-224") -} - -// IsSHA3256 checks is a string is a SHA3-256 hash. Alias for `IsHash(str, "sha3-256")` -func IsSHA3256(str string) bool { - return IsHash(str, "sha3-256") -} - -// IsSHA3384 checks is a string is a SHA3-384 hash. Alias for `IsHash(str, "sha3-384")` -func IsSHA3384(str string) bool { - return IsHash(str, "sha3-384") -} - -// IsSHA3512 checks is a string is a SHA3-512 hash. Alias for `IsHash(str, "sha3-512")` -func IsSHA3512(str string) bool { - return IsHash(str, "sha3-512") -} - -// IsSHA512 checks is a string is a SHA512 hash. Alias for `IsHash(str, "sha512")` -func IsSHA512(str string) bool { - return IsHash(str, "sha512") -} - -// IsSHA384 checks is a string is a SHA384 hash. Alias for `IsHash(str, "sha384")` -func IsSHA384(str string) bool { - return IsHash(str, "sha384") -} - -// IsSHA256 checks is a string is a SHA256 hash. Alias for `IsHash(str, "sha256")` -func IsSHA256(str string) bool { - return IsHash(str, "sha256") -} - -// IsTiger192 checks is a string is a Tiger192 hash. Alias for `IsHash(str, "tiger192")` -func IsTiger192(str string) bool { - return IsHash(str, "tiger192") -} - -// IsTiger160 checks is a string is a Tiger160 hash. Alias for `IsHash(str, "tiger160")` -func IsTiger160(str string) bool { - return IsHash(str, "tiger160") -} - -// IsRipeMD160 checks is a string is a RipeMD160 hash. Alias for `IsHash(str, "ripemd160")` -func IsRipeMD160(str string) bool { - return IsHash(str, "ripemd160") -} - -// IsSHA1 checks is a string is a SHA-1 hash. Alias for `IsHash(str, "sha1")` -func IsSHA1(str string) bool { - return IsHash(str, "sha1") -} - -// IsTiger128 checks is a string is a Tiger128 hash. Alias for `IsHash(str, "tiger128")` -func IsTiger128(str string) bool { - return IsHash(str, "tiger128") -} - -// IsRipeMD128 checks is a string is a RipeMD128 hash. Alias for `IsHash(str, "ripemd128")` -func IsRipeMD128(str string) bool { - return IsHash(str, "ripemd128") -} - -// IsCRC32 checks is a string is a CRC32 hash. Alias for `IsHash(str, "crc32")` -func IsCRC32(str string) bool { - return IsHash(str, "crc32") -} - -// IsCRC32b checks is a string is a CRC32b hash. Alias for `IsHash(str, "crc32b")` -func IsCRC32b(str string) bool { - return IsHash(str, "crc32b") -} - -// IsMD5 checks is a string is a MD5 hash. Alias for `IsHash(str, "md5")` -func IsMD5(str string) bool { - return IsHash(str, "md5") -} - -// IsMD4 checks is a string is a MD4 hash. Alias for `IsHash(str, "md4")` -func IsMD4(str string) bool { - return IsHash(str, "md4") -} - -// IsDialString validates the given string for usage with the various Dial() functions -func IsDialString(str string) bool { - if h, p, err := net.SplitHostPort(str); err == nil && h != "" && p != "" && (IsDNSName(h) || IsIP(h)) && IsPort(p) { - return true - } - - return false -} - -// IsIP checks if a string is either IP version 4 or 6. Alias for `net.ParseIP` -func IsIP(str string) bool { - return net.ParseIP(str) != nil -} - -// IsPort checks if a string represents a valid port -func IsPort(str string) bool { - if i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 { - return true - } - return false -} - -// IsIPv4 checks if the string is an IP version 4. -func IsIPv4(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ".") -} - -// IsIPv6 checks if the string is an IP version 6. -func IsIPv6(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ":") -} - -// IsCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6) -func IsCIDR(str string) bool { - _, _, err := net.ParseCIDR(str) - return err == nil -} - -// IsMAC checks if a string is valid MAC address. -// Possible MAC formats: -// 01:23:45:67:89:ab -// 01:23:45:67:89:ab:cd:ef -// 01-23-45-67-89-ab -// 01-23-45-67-89-ab-cd-ef -// 0123.4567.89ab -// 0123.4567.89ab.cdef -func IsMAC(str string) bool { - _, err := net.ParseMAC(str) - return err == nil -} - -// IsHost checks if the string is a valid IP (both v4 and v6) or a valid DNS name -func IsHost(str string) bool { - return IsIP(str) || IsDNSName(str) -} - -// IsMongoID checks if the string is a valid hex-encoded representation of a MongoDB ObjectId. -func IsMongoID(str string) bool { - return rxHexadecimal.MatchString(str) && (len(str) == 24) -} - -// IsLatitude checks if a string is valid latitude. -func IsLatitude(str string) bool { - return rxLatitude.MatchString(str) -} - -// IsLongitude checks if a string is valid longitude. -func IsLongitude(str string) bool { - return rxLongitude.MatchString(str) -} - -// IsIMEI checks if a string is valid IMEI -func IsIMEI(str string) bool { - return rxIMEI.MatchString(str) -} - -// IsIMSI checks if a string is valid IMSI -func IsIMSI(str string) bool { - if !rxIMSI.MatchString(str) { - return false - } - - mcc, err := strconv.ParseInt(str[0:3], 10, 32) - if err != nil { - return false - } - - switch mcc { - case 202, 204, 206, 208, 212, 213, 214, 216, 218, 219: - case 220, 221, 222, 226, 228, 230, 231, 232, 234, 235: - case 238, 240, 242, 244, 246, 247, 248, 250, 255, 257: - case 259, 260, 262, 266, 268, 270, 272, 274, 276, 278: - case 280, 282, 283, 284, 286, 288, 289, 290, 292, 293: - case 294, 295, 297, 302, 308, 310, 311, 312, 313, 314: - case 315, 316, 330, 332, 334, 338, 340, 342, 344, 346: - case 348, 350, 352, 354, 356, 358, 360, 362, 363, 364: - case 365, 366, 368, 370, 372, 374, 376, 400, 401, 402: - case 404, 405, 406, 410, 412, 413, 414, 415, 416, 417: - case 418, 419, 420, 421, 422, 424, 425, 426, 427, 428: - case 429, 430, 431, 432, 434, 436, 437, 438, 440, 441: - case 450, 452, 454, 455, 456, 457, 460, 461, 466, 467: - case 470, 472, 502, 505, 510, 514, 515, 520, 525, 528: - case 530, 536, 537, 539, 540, 541, 542, 543, 544, 545: - case 546, 547, 548, 549, 550, 551, 552, 553, 554, 555: - case 602, 603, 604, 605, 606, 607, 608, 609, 610, 611: - case 612, 613, 614, 615, 616, 617, 618, 619, 620, 621: - case 622, 623, 624, 625, 626, 627, 628, 629, 630, 631: - case 632, 633, 634, 635, 636, 637, 638, 639, 640, 641: - case 642, 643, 645, 646, 647, 648, 649, 650, 651, 652: - case 653, 654, 655, 657, 658, 659, 702, 704, 706, 708: - case 710, 712, 714, 716, 722, 724, 730, 732, 734, 736: - case 738, 740, 742, 744, 746, 748, 750, 995: - return true - default: - return false - } - return true -} - -// IsRsaPublicKey checks if a string is valid public key with provided length -func IsRsaPublicKey(str string, keylen int) bool { - bb := bytes.NewBufferString(str) - pemBytes, err := ioutil.ReadAll(bb) - if err != nil { - return false - } - block, _ := pem.Decode(pemBytes) - if block != nil && block.Type != "PUBLIC KEY" { - return false - } - var der []byte - - if block != nil { - der = block.Bytes - } else { - der, err = base64.StdEncoding.DecodeString(str) - if err != nil { - return false - } - } - - key, err := x509.ParsePKIXPublicKey(der) - if err != nil { - return false - } - pubkey, ok := key.(*rsa.PublicKey) - if !ok { - return false - } - bitlen := len(pubkey.N.Bytes()) * 8 - return bitlen == int(keylen) -} - -// IsRegex checks if a give string is a valid regex with RE2 syntax or not -func IsRegex(str string) bool { - if _, err := regexp.Compile(str); err == nil { - return true - } - return false -} - -func toJSONName(tag string) string { - if tag == "" { - return "" - } - - // JSON name always comes first. If there's no options then split[0] is - // JSON name, if JSON name is not set, then split[0] is an empty string. - split := strings.SplitN(tag, ",", 2) - - name := split[0] - - // However it is possible that the field is skipped when - // (de-)serializing from/to JSON, in which case assume that there is no - // tag name to use - if name == "-" { - return "" - } - return name -} - -func prependPathToErrors(err error, path string) error { - switch err2 := err.(type) { - case Error: - err2.Path = append([]string{path}, err2.Path...) - return err2 - case Errors: - errors := err2.Errors() - for i, err3 := range errors { - errors[i] = prependPathToErrors(err3, path) - } - return err2 - } - return err -} - -// ValidateArray performs validation according to condition iterator that validates every element of the array -func ValidateArray(array []interface{}, iterator ConditionIterator) bool { - return Every(array, iterator) -} - -// ValidateMap use validation map for fields. -// result will be equal to `false` if there are any errors. -// s is the map containing the data to be validated. -// m is the validation map in the form: -// map[string]interface{}{"name":"required,alpha","address":map[string]interface{}{"line1":"required,alphanum"}} -func ValidateMap(s map[string]interface{}, m map[string]interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - var errs Errors - var index int - val := reflect.ValueOf(s) - for key, value := range s { - presentResult := true - validator, ok := m[key] - if !ok { - presentResult = false - var err error - err = fmt.Errorf("all map keys has to be present in the validation map; got %s", key) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - valueField := reflect.ValueOf(value) - mapResult := true - typeResult := true - structResult := true - resultField := true - switch subValidator := validator.(type) { - case map[string]interface{}: - var err error - if v, ok := value.(map[string]interface{}); !ok { - mapResult = false - err = fmt.Errorf("map validator has to be for the map type only; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } else { - mapResult, err = ValidateMap(v, subValidator) - if err != nil { - mapResult = false - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - case string: - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - subValidator != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - resultField, err = typeCheck(valueField, reflect.StructField{ - Name: key, - PkgPath: "", - Type: val.Type(), - Tag: reflect.StructTag(fmt.Sprintf("%s:%q", tagName, subValidator)), - Offset: 0, - Index: []int{index}, - Anonymous: false, - }, val, nil) - if err != nil { - errs = append(errs, err) - } - case nil: - // already handlerd when checked before - default: - typeResult = false - err = fmt.Errorf("map validator has to be either map[string]interface{} or string; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - result = result && presentResult && typeResult && resultField && structResult && mapResult - index++ - } - // checks required keys - requiredResult := true - for key, value := range m { - if schema, ok := value.(string); ok { - tags := parseTagIntoMap(schema) - if required, ok := tags["required"]; ok { - if _, ok := s[key]; !ok { - requiredResult = false - if required.customErrorMessage != "" { - err = Error{key, fmt.Errorf(required.customErrorMessage), true, "required", []string{}} - } else { - err = Error{key, fmt.Errorf("required field missing"), false, "required", []string{}} - } - errs = append(errs, err) - } - } - } - } - - if len(errs) > 0 { - err = errs - } - return result && requiredResult, err -} - -// ValidateStruct use tags for fields. -// result will be equal to `false` if there are any errors. -// todo currently there is no guarantee that errors will be returned in predictable order (tests may to fail) -func ValidateStruct(s interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - val := reflect.ValueOf(s) - if val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr { - val = val.Elem() - } - // we only accept structs - if val.Kind() != reflect.Struct { - return false, fmt.Errorf("function only accepts structs; got %s", val.Kind()) - } - var errs Errors - for i := 0; i < val.NumField(); i++ { - valueField := val.Field(i) - typeField := val.Type().Field(i) - if typeField.PkgPath != "" { - continue // Private field - } - structResult := true - if valueField.Kind() == reflect.Interface { - valueField = valueField.Elem() - } - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - typeField.Tag.Get(tagName) != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, typeField.Name) - errs = append(errs, err) - } - } - resultField, err2 := typeCheck(valueField, typeField, val, nil) - if err2 != nil { - - // Replace structure name with JSON name if there is a tag on the variable - jsonTag := toJSONName(typeField.Tag.Get("json")) - if jsonTag != "" { - switch jsonError := err2.(type) { - case Error: - jsonError.Name = jsonTag - err2 = jsonError - case Errors: - for i2, err3 := range jsonError { - switch customErr := err3.(type) { - case Error: - customErr.Name = jsonTag - jsonError[i2] = customErr - } - } - - err2 = jsonError - } - } - - errs = append(errs, err2) - } - result = result && resultField && structResult - } - if len(errs) > 0 { - err = errs - } - return result, err -} - -// ValidateStructAsync performs async validation of the struct and returns results through the channels -func ValidateStructAsync(s interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateStruct(s) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// ValidateMapAsync performs async validation of the map and returns results through the channels -func ValidateMapAsync(s map[string]interface{}, m map[string]interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateMap(s, m) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// parseTagIntoMap parses a struct tag `valid:required~Some error message,length(2|3)` into map[string]string{"required": "Some error message", "length(2|3)": ""} -func parseTagIntoMap(tag string) tagOptionsMap { - optionsMap := make(tagOptionsMap) - options := strings.Split(tag, ",") - - for i, option := range options { - option = strings.TrimSpace(option) - - validationOptions := strings.Split(option, "~") - if !isValidTag(validationOptions[0]) { - continue - } - if len(validationOptions) == 2 { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], validationOptions[1], i} - } else { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], "", i} - } - } - return optionsMap -} - -func isValidTag(s string) bool { - if s == "" { - return false - } - for _, c := range s { - switch { - case strings.ContainsRune("\\'\"!#$%&()*+-./:<=>?@[]^_{|}~ ", c): - // Backslash and quote chars are reserved, but - // otherwise any punctuation chars are allowed - // in a tag name. - default: - if !unicode.IsLetter(c) && !unicode.IsDigit(c) { - return false - } - } - } - return true -} - -// IsSSN will validate the given string as a U.S. Social Security Number -func IsSSN(str string) bool { - if str == "" || len(str) != 11 { - return false - } - return rxSSN.MatchString(str) -} - -// IsSemver checks if string is valid semantic version -func IsSemver(str string) bool { - return rxSemver.MatchString(str) -} - -// IsType checks if interface is of some type -func IsType(v interface{}, params ...string) bool { - if len(params) == 1 { - typ := params[0] - return strings.Replace(reflect.TypeOf(v).String(), " ", "", -1) == strings.Replace(typ, " ", "", -1) - } - return false -} - -// IsTime checks if string is valid according to given format -func IsTime(str string, format string) bool { - _, err := time.Parse(format, str) - return err == nil -} - -// IsUnixTime checks if string is valid unix timestamp value -func IsUnixTime(str string) bool { - if _, err := strconv.Atoi(str); err == nil { - return true - } - return false -} - -// IsRFC3339 checks if string is valid timestamp value according to RFC3339 -func IsRFC3339(str string) bool { - return IsTime(str, time.RFC3339) -} - -// IsRFC3339WithoutZone checks if string is valid timestamp value according to RFC3339 which excludes the timezone. -func IsRFC3339WithoutZone(str string) bool { - return IsTime(str, rfc3339WithoutZone) -} - -// IsISO4217 checks if string is valid ISO currency code -func IsISO4217(str string) bool { - for _, currency := range ISO4217List { - if str == currency { - return true - } - } - - return false -} - -// ByteLength checks string's length -func ByteLength(str string, params ...string) bool { - if len(params) == 2 { - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return len(str) >= int(min) && len(str) <= int(max) - } - - return false -} - -// RuneLength checks string's length -// Alias for StringLength -func RuneLength(str string, params ...string) bool { - return StringLength(str, params...) -} - -// IsRsaPub checks whether string is valid RSA key -// Alias for IsRsaPublicKey -func IsRsaPub(str string, params ...string) bool { - if len(params) == 1 { - len, _ := ToInt(params[0]) - return IsRsaPublicKey(str, int(len)) - } - - return false -} - -// StringMatches checks if a string matches a given pattern. -func StringMatches(s string, params ...string) bool { - if len(params) == 1 { - pattern := params[0] - return Matches(s, pattern) - } - return false -} - -// StringLength checks string's length (including multi byte strings) -func StringLength(str string, params ...string) bool { - - if len(params) == 2 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return strLength >= int(min) && strLength <= int(max) - } - - return false -} - -// MinStringLength checks string's minimum length (including multi byte strings) -func MinStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - return strLength >= int(min) - } - - return false -} - -// MaxStringLength checks string's maximum length (including multi byte strings) -func MaxStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - max, _ := ToInt(params[0]) - return strLength <= int(max) - } - - return false -} - -// Range checks string's length -func Range(str string, params ...string) bool { - if len(params) == 2 { - value, _ := ToFloat(str) - min, _ := ToFloat(params[0]) - max, _ := ToFloat(params[1]) - return InRange(value, min, max) - } - - return false -} - -// IsInRaw checks if string is in list of allowed values -func IsInRaw(str string, params ...string) bool { - if len(params) == 1 { - rawParams := params[0] - - parsedParams := strings.Split(rawParams, "|") - - return IsIn(str, parsedParams...) - } - - return false -} - -// IsIn checks if string str is a member of the set of strings params -func IsIn(str string, params ...string) bool { - for _, param := range params { - if str == param { - return true - } - } - - return false -} - -func checkRequired(v reflect.Value, t reflect.StructField, options tagOptionsMap) (bool, error) { - if nilPtrAllowedByRequired { - k := v.Kind() - if (k == reflect.Ptr || k == reflect.Interface) && v.IsNil() { - return true, nil - } - } - - if requiredOption, isRequired := options["required"]; isRequired { - if len(requiredOption.customErrorMessage) > 0 { - return false, Error{t.Name, fmt.Errorf(requiredOption.customErrorMessage), true, "required", []string{}} - } - return false, Error{t.Name, fmt.Errorf("non zero value required"), false, "required", []string{}} - } else if _, isOptional := options["optional"]; fieldsRequiredByDefault && !isOptional { - return false, Error{t.Name, fmt.Errorf("Missing required field"), false, "required", []string{}} - } - // not required and empty is valid - return true, nil -} - -func typeCheck(v reflect.Value, t reflect.StructField, o reflect.Value, options tagOptionsMap) (isValid bool, resultErr error) { - if !v.IsValid() { - return false, nil - } - - tag := t.Tag.Get(tagName) - - // checks if the field should be ignored - switch tag { - case "": - if v.Kind() != reflect.Slice && v.Kind() != reflect.Map { - if !fieldsRequiredByDefault { - return true, nil - } - return false, Error{t.Name, fmt.Errorf("All fields are required to at least have one validation defined"), false, "required", []string{}} - } - case "-": - return true, nil - } - - isRootType := false - if options == nil { - isRootType = true - options = parseTagIntoMap(tag) - } - - if isEmptyValue(v) { - // an empty value is not validated, checks only required - isValid, resultErr = checkRequired(v, t, options) - for key := range options { - delete(options, key) - } - return isValid, resultErr - } - - var customTypeErrors Errors - optionsOrder := options.orderedKeys() - for _, validatorName := range optionsOrder { - validatorStruct := options[validatorName] - if validatefunc, ok := CustomTypeTagMap.Get(validatorName); ok { - delete(options, validatorName) - - if result := validatefunc(v.Interface(), o.Interface()); !result { - if len(validatorStruct.customErrorMessage) > 0 { - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: TruncatingErrorf(validatorStruct.customErrorMessage, fmt.Sprint(v), validatorName), CustomErrorMessageExists: true, Validator: stripParams(validatorName)}) - continue - } - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf("%s does not validate as %s", fmt.Sprint(v), validatorName), CustomErrorMessageExists: false, Validator: stripParams(validatorName)}) - } - } - } - - if len(customTypeErrors.Errors()) > 0 { - return false, customTypeErrors - } - - if isRootType { - // Ensure that we've checked the value by all specified validators before report that the value is valid - defer func() { - delete(options, "optional") - delete(options, "required") - - if isValid && resultErr == nil && len(options) != 0 { - optionsOrder := options.orderedKeys() - for _, validator := range optionsOrder { - isValid = false - resultErr = Error{t.Name, fmt.Errorf( - "The following validator is invalid or can't be applied to the field: %q", validator), false, stripParams(validator), []string{}} - return - } - } - }() - } - - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for interface param validators - for key, value := range InterfaceParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := InterfaceParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - field := fmt.Sprint(v) - if result := validatefunc(v.Interface(), ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - } - } - - switch v.Kind() { - case reflect.Bool, - 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.String: - // for each tag option checks the map of validator functions - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for param validators - for key, value := range ParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := ParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field, ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - // type not yet supported, fail - return false, Error{t.Name, fmt.Errorf("Validator %s doesn't support kind %s", validator, v.Kind()), false, stripParams(validatorSpec), []string{}} - } - } - - if validatefunc, ok := TagMap[validator]; ok { - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field); !result && !negate || result && negate { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - //Not Yet Supported Types (Fail here!) - err := fmt.Errorf("Validator %s doesn't support kind %s for value %v", validator, v.Kind(), v) - return false, Error{t.Name, err, false, stripParams(validatorSpec), []string{}} - } - } - } - return true, nil - case reflect.Map: - if v.Type().Key().Kind() != reflect.String { - return false, &UnsupportedTypeError{v.Type()} - } - var sv stringValues - sv = v.MapKeys() - sort.Sort(sv) - result := true - for i, k := range sv { - var resultItem bool - var err error - if v.MapIndex(k).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.MapIndex(k), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.MapIndex(k).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+sv[i].Interface().(string)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Slice, reflect.Array: - result := true - for i := 0; i < v.Len(); i++ { - var resultItem bool - var err error - if v.Index(i).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.Index(i), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.Index(i).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+strconv.Itoa(i)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Interface: - // If the value is an interface then encode its element - if v.IsNil() { - return true, nil - } - return ValidateStruct(v.Interface()) - case reflect.Ptr: - // If the value is a pointer then checks its element - if v.IsNil() { - return true, nil - } - return typeCheck(v.Elem(), t, o, options) - case reflect.Struct: - return true, nil - default: - return false, &UnsupportedTypeError{v.Type()} - } -} - -func stripParams(validatorString string) string { - return paramsRegexp.ReplaceAllString(validatorString, "") -} - -// isEmptyValue checks whether value empty or not -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.String, reflect.Array: - return v.Len() == 0 - case reflect.Map, reflect.Slice: - return v.Len() == 0 || v.IsNil() - 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 reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) -} - -// ErrorByField returns error for specified field of the struct -// validated by ValidateStruct or empty string if there are no errors -// or this field doesn't exists or doesn't have any errors. -func ErrorByField(e error, field string) string { - if e == nil { - return "" - } - return ErrorsByField(e)[field] -} - -// ErrorsByField returns map of errors of the struct validated -// by ValidateStruct or empty map if there are no errors. -func ErrorsByField(e error) map[string]string { - m := make(map[string]string) - if e == nil { - return m - } - // prototype for ValidateStruct - - switch e := e.(type) { - case Error: - m[e.Name] = e.Err.Error() - case Errors: - for _, item := range e.Errors() { - n := ErrorsByField(item) - for k, v := range n { - m[k] = v - } - } - } - - return m -} - -// Error returns string equivalent for reflect.Type -func (e *UnsupportedTypeError) Error() string { - return "validator: unsupported type: " + e.Type.String() -} - -func (sv stringValues) Len() int { return len(sv) } -func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } -func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) } -func (sv stringValues) get(i int) string { return sv[i].String() } - -func IsE164(str string) bool { - return rxE164.MatchString(str) -} diff --git a/vendor/github.com/asaskevich/govalidator/wercker.yml b/vendor/github.com/asaskevich/govalidator/wercker.yml deleted file mode 100644 index bc5f7b0864bd..000000000000 --- a/vendor/github.com/asaskevich/govalidator/wercker.yml +++ /dev/null @@ -1,15 +0,0 @@ -box: golang -build: - steps: - - setup-go-workspace - - - script: - name: go get - code: | - go version - go get -t ./... - - - script: - name: go test - code: | - go test -race -v ./... diff --git a/vendor/github.com/gabriel-vasile/mimetype/.git-blame-ignore-revs b/vendor/github.com/gabriel-vasile/mimetype/.git-blame-ignore-revs new file mode 100644 index 000000000000..3892826a7490 --- /dev/null +++ b/vendor/github.com/gabriel-vasile/mimetype/.git-blame-ignore-revs @@ -0,0 +1,9 @@ +# Github is obeying this ignore file by default. +# Run this command on local to ignore formatting commits in `git blame` +# git config blame.ignoreRevsFile .git-blame-ignore-revs + +# Added a new column to supported_mimes.md +# The supported_mimes.md file was a nice way to find when a file format was +# introduced. However, when I changed to add a new column in the table, the +# whole git blame got poisoned for the file. +eb497f9bc5d31c6eab2929a112051218670137ba diff --git a/vendor/github.com/gabriel-vasile/mimetype/CODE_OF_CONDUCT.md b/vendor/github.com/gabriel-vasile/mimetype/CODE_OF_CONDUCT.md deleted file mode 100644 index 8479cd87d674..000000000000 --- a/vendor/github.com/gabriel-vasile/mimetype/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,76 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -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, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at vasile.gabriel@email.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq diff --git a/vendor/github.com/gabriel-vasile/mimetype/CONTRIBUTING.md b/vendor/github.com/gabriel-vasile/mimetype/CONTRIBUTING.md deleted file mode 100644 index 56ae4e57c6ce..000000000000 --- a/vendor/github.com/gabriel-vasile/mimetype/CONTRIBUTING.md +++ /dev/null @@ -1,12 +0,0 @@ -## Contribute -Contributions to **mimetype** are welcome. If you find an issue and you consider -contributing, you can use the [Github issues tracker](https://github.com/gabriel-vasile/mimetype/issues) -in order to report it, or better yet, open a pull request. - -Code contributions must respect these rules: - - code must be test covered - - code must be formatted using gofmt tool - - exported names must be documented - -**Important**: By submitting a pull request, you agree to allow the project -owner to license your work under the same license as that used by the project. diff --git a/vendor/github.com/gabriel-vasile/mimetype/README.md b/vendor/github.com/gabriel-vasile/mimetype/README.md index aa88b4bda6ca..ea5c89a945fd 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/README.md +++ b/vendor/github.com/gabriel-vasile/mimetype/README.md @@ -27,6 +27,7 @@ - possibility to [extend](https://pkg.go.dev/github.com/gabriel-vasile/mimetype#example-package-Extend) with other file formats - common file formats are prioritized - [text vs. binary files differentiation](https://pkg.go.dev/github.com/gabriel-vasile/mimetype#example-package-TextVsBinary) +- no external dependencies - safe for concurrent usage ## Install @@ -45,8 +46,7 @@ fmt.Println(mtype.String(), mtype.Extension()) ``` See the [runnable Go Playground examples](https://pkg.go.dev/github.com/gabriel-vasile/mimetype#pkg-overview). -## Usage' -Only use libraries like **mimetype** as a last resort. Content type detection +Caution: only use libraries like **mimetype** as a last resort. Content type detection using magic numbers is slow, inaccurate, and non-standard. Most of the times protocols have methods for specifying such metadata; e.g., `Content-Type` header in HTTP and SMTP. @@ -67,6 +67,18 @@ mimetype.DetectFile("file.doc") If increasing the limit does not help, please [open an issue](https://github.com/gabriel-vasile/mimetype/issues/new?assignees=&labels=&template=mismatched-mime-type-detected.md&title=). +## Tests +In addition to unit tests, +[mimetype_tests](https://github.com/gabriel-vasile/mimetype_tests) compares the +library with the [Unix file utility](https://en.wikipedia.org/wiki/File_(command)) +for around 50 000 sample files. Check the latest comparison results +[here](https://github.com/gabriel-vasile/mimetype_tests/actions). + +## Benchmarks +Benchmarks for each file format are performed when a PR is open. The results can +be seen on the [workflows page](https://github.com/gabriel-vasile/mimetype/actions/workflows/benchmark.yml). +Performance improvements are welcome but correctness is prioritized. + ## Structure **mimetype** uses a hierarchical structure to keep the MIME type detection logic. This reduces the number of calls needed for detecting the file type. The reason @@ -84,19 +96,10 @@ or from a [file](https://pkg.go.dev/github.com/gabriel-vasile/mimetype#DetectFil how project is structured -## Performance -Thanks to the hierarchical structure, searching for common formats first, -and limiting itself to file headers, **mimetype** matches the performance of -stdlib `http.DetectContentType` while outperforming the alternative package. - -```bash - mimetype http.DetectContentType filetype -BenchmarkMatchTar-24 250 ns/op 400 ns/op 3778 ns/op -BenchmarkMatchZip-24 524 ns/op 351 ns/op 4884 ns/op -BenchmarkMatchJpeg-24 103 ns/op 228 ns/op 839 ns/op -BenchmarkMatchGif-24 139 ns/op 202 ns/op 751 ns/op -BenchmarkMatchPng-24 165 ns/op 221 ns/op 1176 ns/op -``` - ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md). +Contributions are never expected but very much welcome. +[mimetype_tests](https://github.com/gabriel-vasile/mimetype_tests/actions/workflows/test.yml) +shows which file formats are most often misidentified and can help prioritise. +When submitting a PR for detection of a new file format, please make sure to +add a record to the list of testcases in [mimetype_test.go](mimetype_test.go). +For complex files a record can be added in the [testdata](testdata) directory. diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/charset/charset.go b/vendor/github.com/gabriel-vasile/mimetype/internal/charset/charset.go index 0647f730e531..3373274ad9d7 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/charset/charset.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/charset/charset.go @@ -2,11 +2,11 @@ package charset import ( "bytes" - "encoding/xml" "strings" "unicode/utf8" - "golang.org/x/net/html" + "github.com/gabriel-vasile/mimetype/internal/markup" + "github.com/gabriel-vasile/mimetype/internal/scan" ) const ( @@ -141,20 +141,29 @@ func FromXML(content []byte) string { } return FromPlain(content) } -func fromXML(content []byte) string { - content = trimLWS(content) - dec := xml.NewDecoder(bytes.NewReader(content)) - rawT, err := dec.RawToken() - if err != nil { - return "" - } +func fromXML(s scan.Bytes) string { + xml := []byte(" 0 && line[n-1] == '\r' { + return line[:n-1], false // drop \r at end of line + } + + // This line is problematic. The logic from CountFields comes from + // encoding/csv.Reader which relies on mutating the input bytes. + // https://github.com/golang/go/blob/b3251514531123d7fd007682389bce7428d159a0/src/encoding/csv/reader.go#L275-L279 + // To avoid mutating the input, we return cutShort. #680 + if n >= 2 && line[n-2] == '\r' && line[n-1] == '\n' { + return line[:n-2], true + } + return line, false +} + +// CountFields reads one CSV line and counts how many records that line contained. +// hasMore reports whether there are more lines in the input. +// collectIndexes makes CountFields return a list of indexes where CSV fields +// start in the line. These indexes are used to test the correctness against the +// encoding/csv parser. +func (r *Parser) CountFields(collectIndexes bool) (fields int, fieldPos []int, hasMore bool) { + finished := false + var line scan.Bytes + cutShort := false + for { + line, cutShort = r.readLine() + if finished { + return 0, nil, false + } + finished = len(r.s) == 0 && len(line) == 0 + if len(line) == lengthNL(line) { + line = nil + continue // Skip empty lines. + } + if len(line) > 0 && line[0] == r.comment { + line = nil + continue + } + break + } + + indexes := []int{} + originalLine := line +parseField: + for { + if len(line) == 0 || line[0] != '"' { // non-quoted string field + fields++ + if collectIndexes { + indexes = append(indexes, len(originalLine)-len(line)) + } + i := bytes.IndexByte(line, r.comma) + if i >= 0 { + line.Advance(i + 1) // 1 to get over ending comma + continue parseField + } + break parseField + } else { // Quoted string field. + if collectIndexes { + indexes = append(indexes, len(originalLine)-len(line)) + } + line.Advance(1) // get over starting quote + for { + i := bytes.IndexByte(line, '"') + if i >= 0 { + line.Advance(i + 1) // 1 for ending quote + switch rn := line.Peek(); { + case rn == '"': + line.Advance(1) + case rn == r.comma: + line.Advance(1) + fields++ + continue parseField + case lengthNL(line) == len(line): + fields++ + break parseField + } + } else if len(line) > 0 || cutShort { + line, cutShort = r.readLine() + originalLine = line + } else { + fields++ + break parseField + } + } + } + } + + return fields, indexes, fields != 0 +} + +// lengthNL reports the number of bytes for the trailing \n. +func lengthNL(b []byte) int { + if len(b) > 0 && b[len(b)-1] == '\n' { + return 1 + } + return 0 +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go b/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go index fd8dd520280f..d11c0a883a94 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go @@ -257,8 +257,11 @@ out: return 0 } +// openArray is used instead of an inline []byte{'['} to avoid mem alllocs. +var openArray = []byte{'['} + func (p *parserState) consumeArray(b []byte, qs []query, lvl int) (n int) { - p.currPath = append(p.currPath, []byte{'['}) + p.appendPath(openArray, qs) if len(b) == 0 { return 0 } @@ -270,7 +273,7 @@ func (p *parserState) consumeArray(b []byte, qs []query, lvl int) (n int) { } if b[n] == ']' { p.ib++ - p.currPath = p.currPath[:len(p.currPath)-1] + p.popLastPath(qs) return n + 1 } innerParsed := p.consumeAny(b[n:], qs, lvl) @@ -305,6 +308,20 @@ func queryPathMatch(qs []query, path [][]byte) int { return -1 } +// appendPath will append a path fragment if queries is not empty. +// If we don't need query functionality (just checking if a JSON is valid), +// then we can skip keeping track of the path we're currently in. +func (p *parserState) appendPath(path []byte, qs []query) { + if len(qs) != 0 { + p.currPath = append(p.currPath, path) + } +} +func (p *parserState) popLastPath(qs []query) { + if len(qs) != 0 { + p.currPath = p.currPath[:len(p.currPath)-1] + } +} + func (p *parserState) consumeObject(b []byte, qs []query, lvl int) (n int) { for n < len(b) { n += p.consumeSpace(b[n:]) @@ -326,7 +343,7 @@ func (p *parserState) consumeObject(b []byte, qs []query, lvl int) (n int) { if keyLen := p.consumeString(b[n:]); keyLen == 0 { return 0 } else { - p.currPath = append(p.currPath, b[n:n+keyLen-1]) + p.appendPath(b[n:n+keyLen-1], qs) if !p.querySatisfied { queryMatched = queryPathMatch(qs, p.currPath) } @@ -368,12 +385,12 @@ func (p *parserState) consumeObject(b []byte, qs []query, lvl int) (n int) { } switch b[n] { case ',': - p.currPath = p.currPath[:len(p.currPath)-1] + p.popLastPath(qs) n++ p.ib++ continue case '}': - p.currPath = p.currPath[:len(p.currPath)-1] + p.popLastPath(qs) p.ib++ return n + 1 default: @@ -388,6 +405,9 @@ func (p *parserState) consumeAny(b []byte, qs []query, lvl int) (n int) { if p.maxRecursion != 0 && lvl > p.maxRecursion { return 0 } + if len(qs) == 0 { + p.querySatisfied = true + } n += p.consumeSpace(b) if len(b[n:]) == 0 { return 0 @@ -426,9 +446,6 @@ func (p *parserState) consumeAny(b []byte, qs []query, lvl int) (n int) { if lvl == 0 { p.firstToken = t } - if len(qs) == 0 { - p.querySatisfied = true - } if rv <= 0 { return n } diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go index dd7f2417c6ef..8a0c8499776a 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go @@ -5,43 +5,80 @@ import ( "encoding/binary" ) -var ( - // SevenZ matches a 7z archive. - SevenZ = prefix([]byte{0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C}) - // Gzip matches gzip files based on http://www.zlib.org/rfc-gzip.html#header-trailer. - Gzip = prefix([]byte{0x1f, 0x8b}) - // Fits matches an Flexible Image Transport System file. - Fits = prefix([]byte{ +// SevenZ matches a 7z archive. +func SevenZ(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C}) +} + +// Gzip matches gzip files based on http://www.zlib.org/rfc-gzip.html#header-trailer. +func Gzip(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x1f, 0x8b}) +} + +// Fits matches an Flexible Image Transport System file. +func Fits(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{ 0x53, 0x49, 0x4D, 0x50, 0x4C, 0x45, 0x20, 0x20, 0x3D, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, }) - // Xar matches an eXtensible ARchive format file. - Xar = prefix([]byte{0x78, 0x61, 0x72, 0x21}) - // Bz2 matches a bzip2 file. - Bz2 = prefix([]byte{0x42, 0x5A, 0x68}) - // Ar matches an ar (Unix) archive file. - Ar = prefix([]byte{0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E}) - // Deb matches a Debian package file. - Deb = offset([]byte{ +} + +// Xar matches an eXtensible ARchive format file. +func Xar(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x78, 0x61, 0x72, 0x21}) +} + +// Bz2 matches a bzip2 file. +func Bz2(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x42, 0x5A, 0x68}) +} + +// Ar matches an ar (Unix) archive file. +func Ar(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E}) +} + +// Deb matches a Debian package file. +func Deb(raw []byte, _ uint32) bool { + return offset(raw, []byte{ 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79, }, 8) - // Warc matches a Web ARChive file. - Warc = prefix([]byte("WARC/1.0"), []byte("WARC/1.1")) - // Cab matches a Microsoft Cabinet archive file. - Cab = prefix([]byte("MSCF\x00\x00\x00\x00")) - // Xz matches an xz compressed stream based on https://tukaani.org/xz/xz-file-format.txt. - Xz = prefix([]byte{0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00}) - // Lzip matches an Lzip compressed file. - Lzip = prefix([]byte{0x4c, 0x5a, 0x49, 0x50}) - // RPM matches an RPM or Delta RPM package file. - RPM = prefix([]byte{0xed, 0xab, 0xee, 0xdb}, []byte("drpm")) - // Cpio matches a cpio archive file. - Cpio = prefix([]byte("070707"), []byte("070701"), []byte("070702")) - // RAR matches a RAR archive file. - RAR = prefix([]byte("Rar!\x1A\x07\x00"), []byte("Rar!\x1A\x07\x01\x00")) -) +} + +// Warc matches a Web ARChive file. +func Warc(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("WARC/1.0")) || + bytes.HasPrefix(raw, []byte("WARC/1.1")) +} + +// Cab matches a Microsoft Cabinet archive file. +func Cab(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("MSCF\x00\x00\x00\x00")) +} + +// Xz matches an xz compressed stream based on https://tukaani.org/xz/xz-file-format.txt. +func Xz(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00}) +} + +// Lzip matches an Lzip compressed file. +func Lzip(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x4c, 0x5a, 0x49, 0x50}) +} + +// RPM matches an RPM or Delta RPM package file. +func RPM(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0xed, 0xab, 0xee, 0xdb}) || + bytes.HasPrefix(raw, []byte("drpm")) +} + +// RAR matches a RAR archive file. +func RAR(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("Rar!\x1A\x07\x00")) || + bytes.HasPrefix(raw, []byte("Rar!\x1A\x07\x01\x00")) +} // InstallShieldCab matches an InstallShield Cabinet archive file. func InstallShieldCab(raw []byte, _ uint32) bool { @@ -78,6 +115,17 @@ func CRX(raw []byte, limit uint32) bool { return Zip(raw[zipOffset:], limit) } +// Cpio matches a cpio archive file. +func Cpio(raw []byte, _ uint32) bool { + if len(raw) < 6 { + return false + } + return binary.LittleEndian.Uint16(raw) == 070707 || // binary cpio + bytes.HasPrefix(raw, []byte("070707")) || // portable ASCII cpios + bytes.HasPrefix(raw, []byte("070701")) || + bytes.HasPrefix(raw, []byte("070702")) +} + // Tar matches a (t)ape (ar)chive file. // Tar files are divided into 512 bytes records. First record contains a 257 // bytes header padded with NUL. diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/audio.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/audio.go index d17e32482c99..2b160711ff7e 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/audio.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/audio.go @@ -5,26 +5,50 @@ import ( "encoding/binary" ) -var ( - // Flac matches a Free Lossless Audio Codec file. - Flac = prefix([]byte("\x66\x4C\x61\x43\x00\x00\x00\x22")) - // Midi matches a Musical Instrument Digital Interface file. - Midi = prefix([]byte("\x4D\x54\x68\x64")) - // Ape matches a Monkey's Audio file. - Ape = prefix([]byte("\x4D\x41\x43\x20\x96\x0F\x00\x00\x34\x00\x00\x00\x18\x00\x00\x00\x90\xE3")) - // MusePack matches a Musepack file. - MusePack = prefix([]byte("MPCK")) - // Au matches a Sun Microsystems au file. - Au = prefix([]byte("\x2E\x73\x6E\x64")) - // Amr matches an Adaptive Multi-Rate file. - Amr = prefix([]byte("\x23\x21\x41\x4D\x52")) - // Voc matches a Creative Voice file. - Voc = prefix([]byte("Creative Voice File")) - // M3u matches a Playlist file. - M3u = prefix([]byte("#EXTM3U")) - // AAC matches an Advanced Audio Coding file. - AAC = prefix([]byte{0xFF, 0xF1}, []byte{0xFF, 0xF9}) -) +// Flac matches a Free Lossless Audio Codec file. +func Flac(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x66\x4C\x61\x43\x00\x00\x00\x22")) +} + +// Midi matches a Musical Instrument Digital Interface file. +func Midi(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x4D\x54\x68\x64")) +} + +// Ape matches a Monkey's Audio file. +func Ape(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x4D\x41\x43\x20\x96\x0F\x00\x00\x34\x00\x00\x00\x18\x00\x00\x00\x90\xE3")) +} + +// MusePack matches a Musepack file. +func MusePack(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("MPCK")) +} + +// Au matches a Sun Microsystems au file. +func Au(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x2E\x73\x6E\x64")) +} + +// Amr matches an Adaptive Multi-Rate file. +func Amr(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x23\x21\x41\x4D\x52")) +} + +// Voc matches a Creative Voice file. +func Voc(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("Creative Voice File")) +} + +// M3u matches a Playlist file. +func M3u(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("#EXTM3U")) +} + +// AAC matches an Advanced Audio Coding file. +func AAC(raw []byte, _ uint32) bool { + return len(raw) > 1 && ((raw[0] == 0xFF && raw[1] == 0xF1) || (raw[0] == 0xFF && raw[1] == 0xF9)) +} // Mp3 matches an mp3 file. func Mp3(raw []byte, limit uint32) bool { diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/binary.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/binary.go index 70599b342094..37ad6a9fb148 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/binary.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/binary.go @@ -6,26 +6,52 @@ import ( "encoding/binary" ) -var ( - // Lnk matches Microsoft lnk binary format. - Lnk = prefix([]byte{0x4C, 0x00, 0x00, 0x00, 0x01, 0x14, 0x02, 0x00}) - // Wasm matches a web assembly File Format file. - Wasm = prefix([]byte{0x00, 0x61, 0x73, 0x6D}) - // Exe matches a Windows/DOS executable file. - Exe = prefix([]byte{0x4D, 0x5A}) - // Elf matches an Executable and Linkable Format file. - Elf = prefix([]byte{0x7F, 0x45, 0x4C, 0x46}) - // Nes matches a Nintendo Entertainment system ROM file. - Nes = prefix([]byte{0x4E, 0x45, 0x53, 0x1A}) - // SWF matches an Adobe Flash swf file. - SWF = prefix([]byte("CWS"), []byte("FWS"), []byte("ZWS")) - // Torrent has bencoded text in the beginning. - Torrent = prefix([]byte("d8:announce")) - // PAR1 matches a parquet file. - Par1 = prefix([]byte{0x50, 0x41, 0x52, 0x31}) - // CBOR matches a Concise Binary Object Representation https://cbor.io/ - CBOR = prefix([]byte{0xD9, 0xD9, 0xF7}) -) +// Lnk matches Microsoft lnk binary format. +func Lnk(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x4C, 0x00, 0x00, 0x00, 0x01, 0x14, 0x02, 0x00}) +} + +// Wasm matches a web assembly File Format file. +func Wasm(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x00, 0x61, 0x73, 0x6D}) +} + +// Exe matches a Windows/DOS executable file. +func Exe(raw []byte, _ uint32) bool { + return len(raw) > 1 && raw[0] == 0x4D && raw[1] == 0x5A +} + +// Elf matches an Executable and Linkable Format file. +func Elf(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x7F, 0x45, 0x4C, 0x46}) +} + +// Nes matches a Nintendo Entertainment system ROM file. +func Nes(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x4E, 0x45, 0x53, 0x1A}) +} + +// SWF matches an Adobe Flash swf file. +func SWF(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("CWS")) || + bytes.HasPrefix(raw, []byte("FWS")) || + bytes.HasPrefix(raw, []byte("ZWS")) +} + +// Torrent has bencoded text in the beginning. +func Torrent(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("d8:announce")) +} + +// PAR1 matches a parquet file. +func Par1(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x50, 0x41, 0x52, 0x31}) +} + +// CBOR matches a Concise Binary Object Representation https://cbor.io/ +func CBOR(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0xD9, 0xD9, 0xF7}) +} // Java bytecode and Mach-O binaries share the same magic number. // More info here https://github.com/threatstack/libmagic/blob/master/magic/Magdir/cafebabe @@ -168,8 +194,10 @@ func Marc(raw []byte, limit uint32) bool { // // [glTF specification]: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html // [IANA glTF entry]: https://www.iana.org/assignments/media-types/model/gltf-binary -var GLB = prefix([]byte("\x67\x6C\x54\x46\x02\x00\x00\x00"), - []byte("\x67\x6C\x54\x46\x01\x00\x00\x00")) +func GLB(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x67\x6C\x54\x46\x02\x00\x00\x00")) || + bytes.HasPrefix(raw, []byte("\x67\x6C\x54\x46\x01\x00\x00\x00")) +} // TzIf matches a Time Zone Information Format (TZif) file. // See more: https://tools.ietf.org/id/draft-murchison-tzdist-tzif-00.html#rfc.section.3 diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/database.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/database.go index cb1fed12f7a6..35c3f911eaa7 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/database.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/database.go @@ -1,13 +1,21 @@ package magic -var ( - // Sqlite matches an SQLite database file. - Sqlite = prefix([]byte{ +import "bytes" + +// Sqlite matches an SQLite database file. +func Sqlite(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{ 0x53, 0x51, 0x4c, 0x69, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x33, 0x00, }) - // MsAccessAce matches Microsoft Access dababase file. - MsAccessAce = offset([]byte("Standard ACE DB"), 4) - // MsAccessMdb matches legacy Microsoft Access database file (JET, 2003 and earlier). - MsAccessMdb = offset([]byte("Standard Jet DB"), 4) -) +} + +// MsAccessAce matches Microsoft Access dababase file. +func MsAccessAce(raw []byte, _ uint32) bool { + return offset(raw, []byte("Standard ACE DB"), 4) +} + +// MsAccessMdb matches legacy Microsoft Access database file (JET, 2003 and earlier). +func MsAccessMdb(raw []byte, _ uint32) bool { + return offset(raw, []byte("Standard Jet DB"), 4) +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/document.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/document.go index b3b26d5a12b7..72080395807e 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/document.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/document.go @@ -1,28 +1,48 @@ package magic -import "bytes" - -var ( - // Pdf matches a Portable Document Format file. - // https://github.com/file/file/blob/11010cc805546a3e35597e67e1129a481aed40e8/magic/Magdir/pdf - Pdf = prefix( - // usual pdf signature - []byte("%PDF-"), +import ( + "bytes" + "encoding/binary" +) + +// Pdf matches a Portable Document Format file. +// https://github.com/file/file/blob/11010cc805546a3e35597e67e1129a481aed40e8/magic/Magdir/pdf +func Pdf(raw []byte, _ uint32) bool { + // usual pdf signature + return bytes.HasPrefix(raw, []byte("%PDF-")) || // new-line prefixed signature - []byte("\012%PDF-"), + bytes.HasPrefix(raw, []byte("\012%PDF-")) || // UTF-8 BOM prefixed signature - []byte("\xef\xbb\xbf%PDF-"), - ) - // Fdf matches a Forms Data Format file. - Fdf = prefix([]byte("%FDF")) - // Mobi matches a Mobi file. - Mobi = offset([]byte("BOOKMOBI"), 60) - // Lit matches a Microsoft Lit file. - Lit = prefix([]byte("ITOLITLS")) -) + bytes.HasPrefix(raw, []byte("\xef\xbb\xbf%PDF-")) +} + +// Fdf matches a Forms Data Format file. +func Fdf(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("%FDF")) +} + +// Mobi matches a Mobi file. +func Mobi(raw []byte, _ uint32) bool { + return offset(raw, []byte("BOOKMOBI"), 60) +} + +// Lit matches a Microsoft Lit file. +func Lit(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("ITOLITLS")) +} + +// PDF matches a Portable Document Format file. +// The %PDF- header should be the first thing inside the file but many +// implementations don't follow the rule. The PDF spec at Appendix H says the +// signature can be prepended by anything. +// https://bugs.astron.com/view.php?id=446 +func PDF(raw []byte, _ uint32) bool { + raw = raw[:min(len(raw), 1024)] + return bytes.Contains(raw, []byte("%PDF-")) +} // DjVu matches a DjVu file. -func DjVu(raw []byte, limit uint32) bool { +func DjVu(raw []byte, _ uint32) bool { if len(raw) < 12 { return false } @@ -36,7 +56,7 @@ func DjVu(raw []byte, limit uint32) bool { } // P7s matches an .p7s signature File (PEM, Base64). -func P7s(raw []byte, limit uint32) bool { +func P7s(raw []byte, _ uint32) bool { // Check for PEM Encoding. if bytes.HasPrefix(raw, []byte("-----BEGIN PKCS7")) { return true @@ -60,3 +80,21 @@ func P7s(raw []byte, limit uint32) bool { return false } + +// Lotus123 matches a Lotus 1-2-3 spreadsheet document. +func Lotus123(raw []byte, _ uint32) bool { + if len(raw) <= 20 { + return false + } + version := binary.BigEndian.Uint32(raw) + if version == 0x00000200 { + return raw[6] != 0 && raw[7] == 0 + } + + return version == 0x00001a00 && raw[20] > 0 && raw[20] < 32 +} + +// CHM matches a Microsoft Compiled HTML Help file. +func CHM(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("ITSF\003\000\000\000\x60\000\000\000")) +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/font.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/font.go index 43af28212e7b..857cfcc552c2 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/font.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/font.go @@ -4,14 +4,20 @@ import ( "bytes" ) -var ( - // Woff matches a Web Open Font Format file. - Woff = prefix([]byte("wOFF")) - // Woff2 matches a Web Open Font Format version 2 file. - Woff2 = prefix([]byte("wOF2")) - // Otf matches an OpenType font file. - Otf = prefix([]byte{0x4F, 0x54, 0x54, 0x4F, 0x00}) -) +// Woff matches a Web Open Font Format file. +func Woff(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("wOFF")) +} + +// Woff2 matches a Web Open Font Format version 2 file. +func Woff2(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("wOF2")) +} + +// Otf matches an OpenType font file. +func Otf(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x4F, 0x54, 0x54, 0x4F, 0x00}) +} // Ttf matches a TrueType font file. func Ttf(raw []byte, limit uint32) bool { diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ftyp.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ftyp.go index ac727139ef20..fc642ef433c3 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ftyp.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ftyp.go @@ -4,24 +4,33 @@ import ( "bytes" ) -var ( - // AVIF matches an AV1 Image File Format still or animated. - // Wikipedia page seems outdated listing image/avif-sequence for animations. - // https://github.com/AOMediaCodec/av1-avif/issues/59 - AVIF = ftyp([]byte("avif"), []byte("avis")) - // ThreeGP matches a 3GPP file. - ThreeGP = ftyp( +// AVIF matches an AV1 Image File Format still or animated. +// Wikipedia page seems outdated listing image/avif-sequence for animations. +// https://github.com/AOMediaCodec/av1-avif/issues/59 +func AVIF(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("avif"), []byte("avis")) +} + +// ThreeGP matches a 3GPP file. +func ThreeGP(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("3gp1"), []byte("3gp2"), []byte("3gp3"), []byte("3gp4"), []byte("3gp5"), []byte("3gp6"), []byte("3gp7"), []byte("3gs7"), []byte("3ge6"), []byte("3ge7"), []byte("3gg6"), ) - // ThreeG2 matches a 3GPP2 file. - ThreeG2 = ftyp( +} + +// ThreeG2 matches a 3GPP2 file. +func ThreeG2(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("3g24"), []byte("3g25"), []byte("3g26"), []byte("3g2a"), []byte("3g2b"), []byte("3g2c"), []byte("KDDI"), ) - // AMp4 matches an audio MP4 file. - AMp4 = ftyp( +} + +// AMp4 matches an audio MP4 file. +func AMp4(raw []byte, _ uint32) bool { + return ftyp(raw, // audio for Adobe Flash Player 9+ []byte("F4A "), []byte("F4B "), // Apple iTunes AAC-LC (.M4A) Audio @@ -31,33 +40,61 @@ var ( // Nero Digital AAC Audio []byte("NDAS"), ) - // Mqv matches a Sony / Mobile QuickTime file. - Mqv = ftyp([]byte("mqt ")) - // M4a matches an audio M4A file. - M4a = ftyp([]byte("M4A ")) - // M4v matches an Appl4 M4V video file. - M4v = ftyp([]byte("M4V "), []byte("M4VH"), []byte("M4VP")) - // Heic matches a High Efficiency Image Coding (HEIC) file. - Heic = ftyp([]byte("heic"), []byte("heix")) - // HeicSequence matches a High Efficiency Image Coding (HEIC) file sequence. - HeicSequence = ftyp([]byte("hevc"), []byte("hevx")) - // Heif matches a High Efficiency Image File Format (HEIF) file. - Heif = ftyp([]byte("mif1"), []byte("heim"), []byte("heis"), []byte("avic")) - // HeifSequence matches a High Efficiency Image File Format (HEIF) file sequence. - HeifSequence = ftyp([]byte("msf1"), []byte("hevm"), []byte("hevs"), []byte("avcs")) - // Mj2 matches a Motion JPEG 2000 file: https://en.wikipedia.org/wiki/Motion_JPEG_2000. - Mj2 = ftyp([]byte("mj2s"), []byte("mjp2"), []byte("MFSM"), []byte("MGSV")) - // Dvb matches a Digital Video Broadcasting file: https://dvb.org. - // https://cconcolato.github.io/mp4ra/filetype.html - // https://github.com/file/file/blob/512840337ead1076519332d24fefcaa8fac36e06/magic/Magdir/animation#L135-L154 - Dvb = ftyp( +} + +// Mqv matches a Sony / Mobile QuickTime file. +func Mqv(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("mqt ")) +} + +// M4a matches an audio M4A file. +func M4a(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("M4A ")) +} + +// M4v matches an Appl4 M4V video file. +func M4v(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("M4V "), []byte("M4VH"), []byte("M4VP")) +} + +// Heic matches a High Efficiency Image Coding (HEIC) file. +func Heic(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("heic"), []byte("heix")) +} + +// HeicSequence matches a High Efficiency Image Coding (HEIC) file sequence. +func HeicSequence(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("hevc"), []byte("hevx")) +} + +// Heif matches a High Efficiency Image File Format (HEIF) file. +func Heif(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("mif1"), []byte("heim"), []byte("heis"), []byte("avic")) +} + +// HeifSequence matches a High Efficiency Image File Format (HEIF) file sequence. +func HeifSequence(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("msf1"), []byte("hevm"), []byte("hevs"), []byte("avcs")) +} + +// Mj2 matches a Motion JPEG 2000 file: https://en.wikipedia.org/wiki/Motion_JPEG_2000. +func Mj2(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("mj2s"), []byte("mjp2"), []byte("MFSM"), []byte("MGSV")) +} + +// Dvb matches a Digital Video Broadcasting file: https://dvb.org. +// https://cconcolato.github.io/mp4ra/filetype.html +// https://github.com/file/file/blob/512840337ead1076519332d24fefcaa8fac36e06/magic/Magdir/animation#L135-L154 +func Dvb(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("dby1"), []byte("dsms"), []byte("dts1"), []byte("dts2"), []byte("dts3"), []byte("dxo "), []byte("dmb1"), []byte("dmpf"), []byte("drc1"), []byte("dv1a"), []byte("dv1b"), []byte("dv2a"), []byte("dv2b"), []byte("dv3a"), []byte("dv3b"), []byte("dvr1"), []byte("dvt1"), []byte("emsg")) - // TODO: add support for remaining video formats at ftyps.com. -) +} + +// TODO: add support for remaining video formats at ftyps.com. // QuickTime matches a QuickTime File Format file. // https://www.loc.gov/preservation/digital/formats/fdd/fdd000052.shtml diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/image.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/image.go index 0eb7e95f3753..788f5478b49b 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/image.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/image.go @@ -2,66 +2,127 @@ package magic import "bytes" -var ( - // Png matches a Portable Network Graphics file. - // https://www.w3.org/TR/PNG/ - Png = prefix([]byte{0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A}) - // Apng matches an Animated Portable Network Graphics file. - // https://wiki.mozilla.org/APNG_Specification - Apng = offset([]byte("acTL"), 37) - // Jpg matches a Joint Photographic Experts Group file. - Jpg = prefix([]byte{0xFF, 0xD8, 0xFF}) - // Jp2 matches a JPEG 2000 Image file (ISO 15444-1). - Jp2 = jpeg2k([]byte{0x6a, 0x70, 0x32, 0x20}) - // Jpx matches a JPEG 2000 Image file (ISO 15444-2). - Jpx = jpeg2k([]byte{0x6a, 0x70, 0x78, 0x20}) - // Jpm matches a JPEG 2000 Image file (ISO 15444-6). - Jpm = jpeg2k([]byte{0x6a, 0x70, 0x6D, 0x20}) - // Gif matches a Graphics Interchange Format file. - Gif = prefix([]byte("GIF87a"), []byte("GIF89a")) - // Bmp matches a bitmap image file. - Bmp = prefix([]byte{0x42, 0x4D}) - // Ps matches a PostScript file. - Ps = prefix([]byte("%!PS-Adobe-")) - // Psd matches a Photoshop Document file. - Psd = prefix([]byte("8BPS")) - // Ico matches an ICO file. - Ico = prefix([]byte{0x00, 0x00, 0x01, 0x00}, []byte{0x00, 0x00, 0x02, 0x00}) - // Icns matches an ICNS (Apple Icon Image format) file. - Icns = prefix([]byte("icns")) - // Tiff matches a Tagged Image File Format file. - Tiff = prefix([]byte{0x49, 0x49, 0x2A, 0x00}, []byte{0x4D, 0x4D, 0x00, 0x2A}) - // Bpg matches a Better Portable Graphics file. - Bpg = prefix([]byte{0x42, 0x50, 0x47, 0xFB}) - // Xcf matches GIMP image data. - Xcf = prefix([]byte("gimp xcf")) - // Pat matches GIMP pattern data. - Pat = offset([]byte("GPAT"), 20) - // Gbr matches GIMP brush data. - Gbr = offset([]byte("GIMP"), 20) - // Hdr matches Radiance HDR image. - // https://web.archive.org/web/20060913152809/http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/ - Hdr = prefix([]byte("#?RADIANCE\n")) - // Xpm matches X PixMap image data. - Xpm = prefix([]byte{0x2F, 0x2A, 0x20, 0x58, 0x50, 0x4D, 0x20, 0x2A, 0x2F}) - // Jxs matches a JPEG XS coded image file (ISO/IEC 21122-3). - Jxs = prefix([]byte{0x00, 0x00, 0x00, 0x0C, 0x4A, 0x58, 0x53, 0x20, 0x0D, 0x0A, 0x87, 0x0A}) - // Jxr matches Microsoft HD JXR photo file. - Jxr = prefix([]byte{0x49, 0x49, 0xBC, 0x01}) -) - -func jpeg2k(sig []byte) Detector { - return func(raw []byte, _ uint32) bool { - if len(raw) < 24 { - return false - } +// Png matches a Portable Network Graphics file. +// https://www.w3.org/TR/PNG/ +func Png(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A}) +} - if !bytes.Equal(raw[4:8], []byte{0x6A, 0x50, 0x20, 0x20}) && - !bytes.Equal(raw[4:8], []byte{0x6A, 0x50, 0x32, 0x20}) { - return false - } - return bytes.Equal(raw[20:24], sig) +// Apng matches an Animated Portable Network Graphics file. +// https://wiki.mozilla.org/APNG_Specification +func Apng(raw []byte, _ uint32) bool { + return offset(raw, []byte("acTL"), 37) +} + +// Jpg matches a Joint Photographic Experts Group file. +func Jpg(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0xFF, 0xD8, 0xFF}) +} + +// Jp2 matches a JPEG 2000 Image file (ISO 15444-1). +func Jp2(raw []byte, _ uint32) bool { + return jpeg2k(raw, []byte{0x6a, 0x70, 0x32, 0x20}) +} + +// Jpx matches a JPEG 2000 Image file (ISO 15444-2). +func Jpx(raw []byte, _ uint32) bool { + return jpeg2k(raw, []byte{0x6a, 0x70, 0x78, 0x20}) +} + +// Jpm matches a JPEG 2000 Image file (ISO 15444-6). +func Jpm(raw []byte, _ uint32) bool { + return jpeg2k(raw, []byte{0x6a, 0x70, 0x6D, 0x20}) +} + +// Gif matches a Graphics Interchange Format file. +func Gif(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("GIF87a")) || + bytes.HasPrefix(raw, []byte("GIF89a")) +} + +// Bmp matches a bitmap image file. +func Bmp(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x42, 0x4D}) +} + +// Ps matches a PostScript file. +func Ps(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("%!PS-Adobe-")) +} + +// Psd matches a Photoshop Document file. +func Psd(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("8BPS")) +} + +// Ico matches an ICO file. +func Ico(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x00, 0x00, 0x01, 0x00}) || + bytes.HasPrefix(raw, []byte{0x00, 0x00, 0x02, 0x00}) +} + +// Icns matches an ICNS (Apple Icon Image format) file. +func Icns(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("icns")) +} + +// Tiff matches a Tagged Image File Format file. +func Tiff(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x49, 0x49, 0x2A, 0x00}) || + bytes.HasPrefix(raw, []byte{0x4D, 0x4D, 0x00, 0x2A}) +} + +// Bpg matches a Better Portable Graphics file. +func Bpg(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x42, 0x50, 0x47, 0xFB}) +} + +// Xcf matches GIMP image data. +func Xcf(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("gimp xcf")) +} + +// Pat matches GIMP pattern data. +func Pat(raw []byte, _ uint32) bool { + return offset(raw, []byte("GPAT"), 20) +} + +// Gbr matches GIMP brush data. +func Gbr(raw []byte, _ uint32) bool { + return offset(raw, []byte("GIMP"), 20) +} + +// Hdr matches Radiance HDR image. +// https://web.archive.org/web/20060913152809/http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/ +func Hdr(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("#?RADIANCE\n")) +} + +// Xpm matches X PixMap image data. +func Xpm(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x2F, 0x2A, 0x20, 0x58, 0x50, 0x4D, 0x20, 0x2A, 0x2F}) +} + +// Jxs matches a JPEG XS coded image file (ISO/IEC 21122-3). +func Jxs(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x00, 0x00, 0x00, 0x0C, 0x4A, 0x58, 0x53, 0x20, 0x0D, 0x0A, 0x87, 0x0A}) +} + +// Jxr matches Microsoft HD JXR photo file. +func Jxr(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x49, 0x49, 0xBC, 0x01}) +} + +func jpeg2k(raw []byte, sig []byte) bool { + if len(raw) < 24 { + return false + } + + if !bytes.Equal(raw[4:8], []byte{0x6A, 0x50, 0x20, 0x20}) && + !bytes.Equal(raw[4:8], []byte{0x6A, 0x50, 0x32, 0x20}) { + return false } + return bytes.Equal(raw[20:24], sig) } // Webp matches a WebP file. @@ -108,3 +169,20 @@ func Jxl(raw []byte, _ uint32) bool { return bytes.HasPrefix(raw, []byte{0xFF, 0x0A}) || bytes.HasPrefix(raw, []byte("\x00\x00\x00\x0cJXL\x20\x0d\x0a\x87\x0a")) } + +// DXF matches Drawing Exchange Format AutoCAD file. +// There does not seem to be a clear specification and the files in the wild +// differ wildly. +// https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf +// +// I collected these signatures by downloading a few dozen files from +// http://cd.textfiles.com/amigaenv/DXF/OBJEKTE/ and +// https://sembiance.com/fileFormatSamples/poly/dxf/ and then +// xxd -l 16 {} | sort | uniq. +// These signatures are only for the ASCII version of DXF. There is a binary version too. +func DXF(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte(" 0\x0ASECTION\x0A")) || + bytes.HasPrefix(raw, []byte(" 0\x0D\x0ASECTION\x0D\x0A")) || + bytes.HasPrefix(raw, []byte("0\x0ASECTION\x0A")) || + bytes.HasPrefix(raw, []byte("0\x0D\x0ASECTION\x0D\x0A")) +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/magic.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/magic.go index a34c60984212..6103c12d364f 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/magic.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/magic.go @@ -3,7 +3,8 @@ package magic import ( "bytes" - "fmt" + + "github.com/gabriel-vasile/mimetype/internal/scan" ) type ( @@ -20,37 +21,20 @@ type ( } ) -// prefix creates a Detector which returns true if any of the provided signatures -// is the prefix of the raw input. -func prefix(sigs ...[]byte) Detector { - return func(raw []byte, limit uint32) bool { - for _, s := range sigs { - if bytes.HasPrefix(raw, s) { - return true - } - } - return false - } -} - -// offset creates a Detector which returns true if the provided signature can be +// offset returns true if the provided signature can be // found at offset in the raw input. -func offset(sig []byte, offset int) Detector { - return func(raw []byte, limit uint32) bool { - return len(raw) > offset && bytes.HasPrefix(raw[offset:], sig) - } +func offset(raw []byte, sig []byte, offset int) bool { + return len(raw) > offset && bytes.HasPrefix(raw[offset:], sig) } // ciPrefix is like prefix but the check is case insensitive. -func ciPrefix(sigs ...[]byte) Detector { - return func(raw []byte, limit uint32) bool { - for _, s := range sigs { - if ciCheck(s, raw) { - return true - } +func ciPrefix(raw []byte, sigs ...[]byte) bool { + for _, s := range sigs { + if ciCheck(s, raw) { + return true } - return false } + return false } func ciCheck(sig, raw []byte) bool { if len(raw) < len(sig)+1 { @@ -70,21 +54,18 @@ func ciCheck(sig, raw []byte) bool { return true } -// xml creates a Detector which returns true if any of the provided XML signatures -// matches the raw input. -func xml(sigs ...xmlSig) Detector { - return func(raw []byte, limit uint32) bool { - raw = trimLWS(raw) - if len(raw) == 0 { - return false - } - for _, s := range sigs { - if xmlCheck(s, raw) { - return true - } - } +// xml returns true if any of the provided XML signatures matches the raw input. +func xml(b scan.Bytes, sigs ...xmlSig) bool { + b.TrimLWS() + if len(b) == 0 { return false } + for _, s := range sigs { + if xmlCheck(s, b) { + return true + } + } + return false } func xmlCheck(sig xmlSig, raw []byte) bool { raw = raw[:min(len(raw), 512)] @@ -100,28 +81,24 @@ func xmlCheck(sig xmlSig, raw []byte) bool { return localNameIndex != -1 && localNameIndex < bytes.Index(raw, sig.xmlns) } -// markup creates a Detector which returns true is any of the HTML signatures -// matches the raw input. -func markup(sigs ...[]byte) Detector { - return func(raw []byte, limit uint32) bool { - if bytes.HasPrefix(raw, []byte{0xEF, 0xBB, 0xBF}) { - // We skip the UTF-8 BOM if present to ensure we correctly - // process any leading whitespace. The presence of the BOM - // is taken into account during charset detection in charset.go. - raw = trimLWS(raw[3:]) - } else { - raw = trimLWS(raw) - } - if len(raw) == 0 { - return false - } - for _, s := range sigs { - if markupCheck(s, raw) { - return true - } - } +// markup returns true is any of the HTML signatures matches the raw input. +func markup(b scan.Bytes, sigs ...[]byte) bool { + if bytes.HasPrefix(b, []byte{0xEF, 0xBB, 0xBF}) { + // We skip the UTF-8 BOM if present to ensure we correctly + // process any leading whitespace. The presence of the BOM + // is taken into account during charset detection in charset.go. + b.Advance(3) + } + b.TrimLWS() + if len(b) == 0 { return false } + for _, s := range sigs { + if markupCheck(s, b) { + return true + } + } + return false } func markupCheck(sig, raw []byte) bool { if len(raw) < len(sig)+1 { @@ -139,36 +116,24 @@ func markupCheck(sig, raw []byte) bool { } } // Next byte must be space or right angle bracket. - if db := raw[len(sig)]; db != ' ' && db != '>' { + if db := raw[len(sig)]; !scan.ByteIsWS(db) && db != '>' { return false } return true } -// ftyp creates a Detector which returns true if any of the FTYP signatures -// matches the raw input. -func ftyp(sigs ...[]byte) Detector { - return func(raw []byte, limit uint32) bool { - if len(raw) < 12 { - return false - } - for _, s := range sigs { - if bytes.Equal(raw[8:12], s) { - return true - } - } +// ftyp returns true if any of the FTYP signatures matches the raw input. +func ftyp(raw []byte, sigs ...[]byte) bool { + if len(raw) < 12 { return false } -} - -func newXMLSig(localName, xmlns string) xmlSig { - ret := xmlSig{xmlns: []byte(xmlns)} - if localName != "" { - ret.localName = []byte(fmt.Sprintf("<%s", localName)) + for _, s := range sigs { + if bytes.Equal(raw[8:12], s) { + return true + } } - - return ret + return false } // A valid shebang starts with the "#!" characters, @@ -181,71 +146,17 @@ func newXMLSig(localName, xmlns string) xmlSig { // #! /usr/bin/env php // // /usr/bin/env is the interpreter, php is the first and only argument. -func shebang(sigs ...[]byte) Detector { - return func(raw []byte, limit uint32) bool { - for _, s := range sigs { - if shebangCheck(s, firstLine(raw)) { - return true - } - } - return false - } -} - -func shebangCheck(sig, raw []byte) bool { - if len(raw) < len(sig)+2 { - return false - } - if raw[0] != '#' || raw[1] != '!' { +func shebang(b scan.Bytes, matchFlags scan.Flags, sigs ...[]byte) bool { + line := b.Line() + if len(line) < 2 || line[0] != '#' || line[1] != '!' { return false } - - return bytes.Equal(trimLWS(trimRWS(raw[2:])), sig) -} - -// trimLWS trims whitespace from beginning of the input. -func trimLWS(in []byte) []byte { - firstNonWS := 0 - for ; firstNonWS < len(in) && isWS(in[firstNonWS]); firstNonWS++ { - } - - return in[firstNonWS:] -} - -// trimRWS trims whitespace from the end of the input. -func trimRWS(in []byte) []byte { - lastNonWS := len(in) - 1 - for ; lastNonWS > 0 && isWS(in[lastNonWS]); lastNonWS-- { - } - - return in[:lastNonWS+1] -} - -func firstLine(in []byte) []byte { - lineEnd := 0 - for ; lineEnd < len(in) && in[lineEnd] != '\n'; lineEnd++ { - } - - return in[:lineEnd] -} - -func isWS(b byte) bool { - return b == '\t' || b == '\n' || b == '\x0c' || b == '\r' || b == ' ' -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -type readBuf []byte - -func (b *readBuf) advance(n int) bool { - if n < 0 || len(*b) < n { - return false + line = line[2:] + line.TrimLWS() + for _, s := range sigs { + if line.Match(s, matchFlags) != -1 { + return true + } } - *b = (*b)[n:] - return true + return false } diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go index 7d60e22e26e9..bd4a0c365941 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go @@ -7,17 +7,34 @@ import ( // Xlsx matches a Microsoft Excel 2007 file. func Xlsx(raw []byte, limit uint32) bool { - return zipContains(raw, []byte("xl/"), true) + return msoxml(raw, zipEntries{{ + name: []byte("xl/"), + dir: true, + }}, 100) } // Docx matches a Microsoft Word 2007 file. func Docx(raw []byte, limit uint32) bool { - return zipContains(raw, []byte("word/"), true) + return msoxml(raw, zipEntries{{ + name: []byte("word/"), + dir: true, + }}, 100) } // Pptx matches a Microsoft PowerPoint 2007 file. func Pptx(raw []byte, limit uint32) bool { - return zipContains(raw, []byte("ppt/"), true) + return msoxml(raw, zipEntries{{ + name: []byte("ppt/"), + dir: true, + }}, 100) +} + +// Visio matches a Microsoft Visio 2013+ file. +func Visio(raw []byte, limit uint32) bool { + return msoxml(raw, zipEntries{{ + name: []byte("visio/"), + dir: true, + }}, 100) } // Ole matches an Open Linking and Embedding file. @@ -27,17 +44,6 @@ func Ole(raw []byte, limit uint32) bool { return bytes.HasPrefix(raw, []byte{0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1}) } -// Aaf matches an Advanced Authoring Format file. -// See: https://pyaaf.readthedocs.io/en/latest/about.html -// See: https://en.wikipedia.org/wiki/Advanced_Authoring_Format -func Aaf(raw []byte, limit uint32) bool { - if len(raw) < 31 { - return false - } - return bytes.HasPrefix(raw[8:], []byte{0x41, 0x41, 0x46, 0x42, 0x0D, 0x00, 0x4F, 0x4D}) && - (raw[30] == 0x09 || raw[30] == 0x0C) -} - // Doc matches a Microsoft Word 97-2003 file. // See: https://github.com/decalage2/oletools/blob/412ee36ae45e70f42123e835871bac956d958461/oletools/common/clsid.py func Doc(raw []byte, _ uint32) bool { @@ -157,6 +163,14 @@ func Msi(raw []byte, limit uint32) bool { }) } +// One matches a Microsoft OneNote file. +func One(raw []byte, limit uint32) bool { + return bytes.HasPrefix(raw, []byte{ + 0xe4, 0x52, 0x5c, 0x7b, 0x8c, 0xd8, 0xa7, 0x4d, + 0xae, 0xb1, 0x53, 0x78, 0xd0, 0x29, 0x96, 0xd3, + }) +} + // Helper to match by a specific CLSID of a compound file. // // http://fileformats.archiveteam.org/wiki/Microsoft_Compound_File @@ -184,3 +198,14 @@ func matchOleClsid(in []byte, clsid []byte) bool { return bytes.HasPrefix(in[clsidOffset:], clsid) } + +// WPD matches a WordPerfect document. +func WPD(raw []byte, _ uint32) bool { + if len(raw) < 10 { + return false + } + if !bytes.HasPrefix(raw, []byte("\xffWPC")) { + return false + } + return raw[8] == 1 && raw[9] == 10 +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/netpbm.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/netpbm.go new file mode 100644 index 000000000000..4baa25767fc4 --- /dev/null +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/netpbm.go @@ -0,0 +1,111 @@ +package magic + +import ( + "bytes" + "strconv" + + "github.com/gabriel-vasile/mimetype/internal/scan" +) + +// NetPBM matches a Netpbm Portable BitMap ASCII/Binary file. +// +// See: https://en.wikipedia.org/wiki/Netpbm +func NetPBM(raw []byte, _ uint32) bool { + return netp(raw, "P1\n", "P4\n") +} + +// NetPGM matches a Netpbm Portable GrayMap ASCII/Binary file. +// +// See: https://en.wikipedia.org/wiki/Netpbm +func NetPGM(raw []byte, _ uint32) bool { + return netp(raw, "P2\n", "P5\n") +} + +// NetPPM matches a Netpbm Portable PixMap ASCII/Binary file. +// +// See: https://en.wikipedia.org/wiki/Netpbm +func NetPPM(raw []byte, _ uint32) bool { + return netp(raw, "P3\n", "P6\n") +} + +// NetPAM matches a Netpbm Portable Arbitrary Map file. +// +// See: https://en.wikipedia.org/wiki/Netpbm +func NetPAM(raw []byte, _ uint32) bool { + if !bytes.HasPrefix(raw, []byte("P7\n")) { + return false + } + w, h, d, m, e := false, false, false, false, false + s := scan.Bytes(raw) + var l scan.Bytes + // Read line by line. + for i := 0; i < 128; i++ { + l = s.Line() + // If the line is empty or a comment, skip. + if len(l) == 0 || l.Peek() == '#' { + if len(s) == 0 { + return false + } + continue + } else if bytes.HasPrefix(l, []byte("TUPLTYPE")) { + continue + } else if bytes.HasPrefix(l, []byte("WIDTH ")) { + w = true + } else if bytes.HasPrefix(l, []byte("HEIGHT ")) { + h = true + } else if bytes.HasPrefix(l, []byte("DEPTH ")) { + d = true + } else if bytes.HasPrefix(l, []byte("MAXVAL ")) { + m = true + } else if bytes.HasPrefix(l, []byte("ENDHDR")) { + e = true + } + // When we reached header, return true if we collected all four required headers. + // WIDTH, HEIGHT, DEPTH and MAXVAL. + if e { + return w && h && d && m + } + } + return false +} + +func netp(s scan.Bytes, prefixes ...string) bool { + foundPrefix := "" + for _, p := range prefixes { + if bytes.HasPrefix(s, []byte(p)) { + foundPrefix = p + } + } + if foundPrefix == "" { + return false + } + s.Advance(len(foundPrefix)) // jump over P1, P2, P3, etc. + + var l scan.Bytes + // Read line by line. + for i := 0; i < 128; i++ { + l = s.Line() + // If the line is a comment, skip. + if l.Peek() == '#' { + continue + } + // If line has leading whitespace, then skip over whitespace. + for scan.ByteIsWS(l.Peek()) { + l.Advance(1) + } + if len(s) == 0 || len(l) > 0 { + break + } + } + + // At this point l should be the two integers denoting the size of the matrix. + width := l.PopUntil(scan.ASCIISpaces...) + for scan.ByteIsWS(l.Peek()) { + l.Advance(1) + } + height := l.PopUntil(scan.ASCIISpaces...) + + w, errw := strconv.ParseInt(string(width), 10, 64) + h, errh := strconv.ParseInt(string(height), 10, 64) + return errw == nil && errh == nil && w > 0 && h > 0 +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go index 8178e4707c7a..fb84e8543d32 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go @@ -6,11 +6,13 @@ import ( "github.com/gabriel-vasile/mimetype/internal/charset" "github.com/gabriel-vasile/mimetype/internal/json" + mkup "github.com/gabriel-vasile/mimetype/internal/markup" + "github.com/gabriel-vasile/mimetype/internal/scan" ) -var ( - // HTML matches a Hypertext Markup Language file. - HTML = markup( +// HTML matches a Hypertext Markup Language file. +func HTML(raw []byte, _ uint32) bool { + return markup(raw, []byte(" +// +// +// +func svgWithoutXMLDeclaration(s scan.Bytes) bool { + for scan.ByteIsWS(s.Peek()) { + s.Advance(1) + } + for mkup.SkipAComment(&s) { + } + if !bytes.HasPrefix(s, []byte(" +// +// +// +func svgWithXMLDeclaration(s scan.Bytes) bool { + for scan.ByteIsWS(s.Peek()) { + s.Advance(1) + } + if !bytes.HasPrefix(s, []byte(" 4096 { + s = s[:4096] + } + return hasVersion && bytes.Contains(s, []byte(" 00:02:19,376) limits second line // length to exactly 29 characters. if len(line) != 29 { @@ -266,7 +507,7 @@ func Srt(raw []byte, _ uint32) bool { return false } - line, _ = scanLine(raw) + line = s.Line() // A third line must exist and not be empty. This is the actual subtitle text. return len(line) != 0 } @@ -295,15 +536,3 @@ func Vtt(raw []byte, limit uint32) bool { return bytes.Equal(raw, []byte{0xEF, 0xBB, 0xBF, 0x57, 0x45, 0x42, 0x56, 0x54, 0x54}) || // UTF-8 BOM and "WEBVTT" bytes.Equal(raw, []byte{0x57, 0x45, 0x42, 0x56, 0x54, 0x54}) // "WEBVTT" } - -// dropCR drops a terminal \r from the data. -func dropCR(data []byte) []byte { - if len(data) > 0 && data[len(data)-1] == '\r' { - return data[0 : len(data)-1] - } - return data -} -func scanLine(b []byte) (line, remainder []byte) { - line, remainder, _ = bytes.Cut(b, []byte("\n")) - return dropCR(line), remainder -} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text_csv.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text_csv.go index 6083ba8c00cd..020b5ee75bdc 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text_csv.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text_csv.go @@ -1,77 +1,43 @@ package magic import ( - "bufio" - "bytes" - "encoding/csv" - "errors" - "io" - "sync" + "github.com/gabriel-vasile/mimetype/internal/csv" + "github.com/gabriel-vasile/mimetype/internal/scan" ) -// A bufio.Reader pool to alleviate problems with memory allocations. -var readerPool = sync.Pool{ - New: func() any { - // Initiate with empty source reader. - return bufio.NewReader(nil) - }, -} - -func newReader(r io.Reader) *bufio.Reader { - br := readerPool.Get().(*bufio.Reader) - br.Reset(r) - return br -} - -// Csv matches a comma-separated values file. -func Csv(raw []byte, limit uint32) bool { +// CSV matches a comma-separated values file. +func CSV(raw []byte, limit uint32) bool { return sv(raw, ',', limit) } -// Tsv matches a tab-separated values file. -func Tsv(raw []byte, limit uint32) bool { +// TSV matches a tab-separated values file. +func TSV(raw []byte, limit uint32) bool { return sv(raw, '\t', limit) } -func sv(in []byte, comma rune, limit uint32) bool { - in = dropLastLine(in, limit) - - br := newReader(bytes.NewReader(in)) - defer readerPool.Put(br) - r := csv.NewReader(br) - r.Comma = comma - r.ReuseRecord = true - r.LazyQuotes = true - r.Comment = '#' +func sv(in []byte, comma byte, limit uint32) bool { + s := scan.Bytes(in) + s.DropLastLine(limit) + r := csv.NewParser(comma, '#', s) - lines := 0 + headerFields, _, hasMore := r.CountFields(false) + if headerFields < 2 || !hasMore { + return false + } + csvLines := 1 // 1 for header for { - _, err := r.Read() - if errors.Is(err, io.EOF) { + fields, _, hasMore := r.CountFields(false) + if !hasMore && fields == 0 { break } - if err != nil { + csvLines++ + if fields != headerFields { return false } - lines++ - } - - return r.FieldsPerRecord > 1 && lines > 1 -} - -// dropLastLine drops the last incomplete line from b. -// -// mimetype limits itself to ReadLimit bytes when performing a detection. -// This means, for file formats like CSV for NDJSON, the last line of the input -// can be an incomplete line. -func dropLastLine(b []byte, readLimit uint32) []byte { - if readLimit == 0 || uint32(len(b)) < readLimit { - return b - } - for i := len(b) - 1; i > 0; i-- { - if b[i] == '\n' { - return b[:i] + if csvLines >= 10 { + return true } } - return b + + return csvLines >= 2 } diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go index 9caf55538a3c..830c5ed20407 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go @@ -4,17 +4,23 @@ import ( "bytes" ) -var ( - // Flv matches a Flash video file. - Flv = prefix([]byte("\x46\x4C\x56\x01")) - // Asf matches an Advanced Systems Format file. - Asf = prefix([]byte{ +// Flv matches a Flash video file. +func Flv(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x46\x4C\x56\x01")) +} + +// Asf matches an Advanced Systems Format file. +func Asf(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{ 0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C, }) - // Rmvb matches a RealMedia Variable Bitrate file. - Rmvb = prefix([]byte{0x2E, 0x52, 0x4D, 0x46}) -) +} + +// Rmvb matches a RealMedia Variable Bitrate file. +func Rmvb(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x2E, 0x52, 0x4D, 0x46}) +} // WebM matches a WebM file. func WebM(raw []byte, limit uint32) bool { diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go index f6c64829d924..31f42482d991 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go @@ -2,36 +2,70 @@ package magic import ( "bytes" - "encoding/binary" -) -var ( - // Odt matches an OpenDocument Text file. - Odt = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.text"), 30) - // Ott matches an OpenDocument Text Template file. - Ott = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.text-template"), 30) - // Ods matches an OpenDocument Spreadsheet file. - Ods = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.spreadsheet"), 30) - // Ots matches an OpenDocument Spreadsheet Template file. - Ots = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.spreadsheet-template"), 30) - // Odp matches an OpenDocument Presentation file. - Odp = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.presentation"), 30) - // Otp matches an OpenDocument Presentation Template file. - Otp = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.presentation-template"), 30) - // Odg matches an OpenDocument Drawing file. - Odg = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.graphics"), 30) - // Otg matches an OpenDocument Drawing Template file. - Otg = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.graphics-template"), 30) - // Odf matches an OpenDocument Formula file. - Odf = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.formula"), 30) - // Odc matches an OpenDocument Chart file. - Odc = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.chart"), 30) - // Epub matches an EPUB file. - Epub = offset([]byte("mimetypeapplication/epub+zip"), 30) - // Sxc matches an OpenOffice Spreadsheet file. - Sxc = offset([]byte("mimetypeapplication/vnd.sun.xml.calc"), 30) + "github.com/gabriel-vasile/mimetype/internal/scan" ) +// Odt matches an OpenDocument Text file. +func Odt(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.text"), 30) +} + +// Ott matches an OpenDocument Text Template file. +func Ott(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.text-template"), 30) +} + +// Ods matches an OpenDocument Spreadsheet file. +func Ods(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.spreadsheet"), 30) +} + +// Ots matches an OpenDocument Spreadsheet Template file. +func Ots(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.spreadsheet-template"), 30) +} + +// Odp matches an OpenDocument Presentation file. +func Odp(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.presentation"), 30) +} + +// Otp matches an OpenDocument Presentation Template file. +func Otp(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.presentation-template"), 30) +} + +// Odg matches an OpenDocument Drawing file. +func Odg(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.graphics"), 30) +} + +// Otg matches an OpenDocument Drawing Template file. +func Otg(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.graphics-template"), 30) +} + +// Odf matches an OpenDocument Formula file. +func Odf(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.formula"), 30) +} + +// Odc matches an OpenDocument Chart file. +func Odc(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.chart"), 30) +} + +// Epub matches an EPUB file. +func Epub(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/epub+zip"), 30) +} + +// Sxc matches an OpenOffice Spreadsheet file. +func Sxc(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.sun.xml.calc"), 30) +} + // Zip matches a zip archive. func Zip(raw []byte, limit uint32) bool { return len(raw) > 3 && @@ -40,92 +74,149 @@ func Zip(raw []byte, limit uint32) bool { (raw[3] == 0x4 || raw[3] == 0x6 || raw[3] == 0x8) } -// Jar matches a Java archive file. +// Jar matches a Java archive file. There are two types of Jar files: +// 1. the ones that can be opened with jexec and have 0xCAFE optional flag +// https://stackoverflow.com/tags/executable-jar/info +// 2. regular jars, same as above, just without the executable flag +// https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262278#c0 +// There is an argument to only check for manifest, since it's the common nominator +// for both executable and non-executable versions. But the traversing zip entries +// is unreliable because it does linear search for signatures +// (instead of relying on offsets told by the file.) func Jar(raw []byte, limit uint32) bool { - return zipContains(raw, []byte("META-INF/MANIFEST.MF"), false) + return executableJar(raw) || + zipHas(raw, zipEntries{{ + name: []byte("META-INF/MANIFEST.MF"), + }, { + name: []byte("META-INF/"), + }}, 1) } -func zipContains(raw, sig []byte, msoCheck bool) bool { - b := readBuf(raw) - pk := []byte("PK\003\004") - if len(b) < 0x1E { - return false - } +// KMZ matches a zipped KML file, which is "doc.kml" by convention. +func KMZ(raw []byte, _ uint32) bool { + return zipHas(raw, zipEntries{{ + name: []byte("doc.kml"), + }}, 100) +} - if !b.advance(0x1E) { +// An executable Jar has a 0xCAFE flag enabled in the first zip entry. +// The rule from file/file is: +// >(26.s+30) leshort 0xcafe Java archive data (JAR) +func executableJar(b scan.Bytes) bool { + b.Advance(0x1A) + offset, ok := b.Uint16() + if !ok { return false } - if bytes.HasPrefix(b, sig) { - return true - } + b.Advance(int(offset) + 2) - if msoCheck { - skipFiles := [][]byte{ - []byte("[Content_Types].xml"), - []byte("_rels/.rels"), - []byte("docProps"), - []byte("customXml"), - []byte("[trash]"), - } + cafe, ok := b.Uint16() + return ok && cafe == 0xCAFE +} - hasSkipFile := false - for _, sf := range skipFiles { - if bytes.HasPrefix(b, sf) { - hasSkipFile = true - break - } +// zipIterator iterates over a zip file returning the name of the zip entries +// in that file. +type zipIterator struct { + b scan.Bytes +} + +type zipEntries []struct { + name []byte + dir bool // dir means checking just the prefix of the entry, not the whole path +} + +func (z zipEntries) match(file []byte) bool { + for i := range z { + if z[i].dir && bytes.HasPrefix(file, z[i].name) { + return true } - if !hasSkipFile { - return false + if bytes.Equal(file, z[i].name) { + return true } } + return false +} - searchOffset := binary.LittleEndian.Uint32(raw[18:]) + 49 - if !b.advance(int(searchOffset)) { - return false +func zipHas(raw scan.Bytes, searchFor zipEntries, stopAfter int) bool { + iter := zipIterator{raw} + for i := 0; i < stopAfter; i++ { + f := iter.next() + if len(f) == 0 { + break + } + if searchFor.match(f) { + return true + } } - nextHeader := bytes.Index(raw[searchOffset:], pk) - if !b.advance(nextHeader) { - return false - } - if bytes.HasPrefix(b, sig) { - return true - } + return false +} - for i := 0; i < 4; i++ { - if !b.advance(0x1A) { - return false - } - nextHeader = bytes.Index(b, pk) - if nextHeader == -1 { - return false +// msoxml behaves like zipHas, but it puts restrictions on what the first zip +// entry can be. +func msoxml(raw scan.Bytes, searchFor zipEntries, stopAfter int) bool { + iter := zipIterator{raw} + for i := 0; i < stopAfter; i++ { + f := iter.next() + if len(f) == 0 { + break } - if !b.advance(nextHeader + 0x1E) { - return false - } - if bytes.HasPrefix(b, sig) { + if searchFor.match(f) { return true } + // If the first is not one of the next usually expected entries, + // then abort this check. + if i == 0 { + if !bytes.Equal(f, []byte("[Content_Types].xml")) && // this is a file + !bytes.HasPrefix(f, []byte("_rels/")) && // these are directories + !bytes.HasPrefix(f, []byte("docProps/")) && + !bytes.HasPrefix(f, []byte("customXml/")) && + !bytes.HasPrefix(f, []byte("[trash]/")) { + return false + } + } } + return false } -// APK matches an Android Package Archive. -// The source of signatures is https://github.com/file/file/blob/1778642b8ba3d947a779a36fcd81f8e807220a19/magic/Magdir/archive#L1820-L1887 -func APK(raw []byte, _ uint32) bool { - apkSignatures := [][]byte{ - []byte("AndroidManifest.xml"), - []byte("META-INF/com/android/build/gradle/app-metadata.properties"), - []byte("classes.dex"), - []byte("resources.arsc"), - []byte("res/drawable"), +// next extracts the name of the next zip entry. +func (i *zipIterator) next() []byte { + pk := []byte("PK\003\004") + + n := bytes.Index(i.b, pk) + if n == -1 { + return nil } - for _, sig := range apkSignatures { - if zipContains(raw, sig, false) { - return true - } + i.b.Advance(n) + if !i.b.Advance(0x1A) { + return nil } + l, ok := i.b.Uint16() + if !ok { + return nil + } + if !i.b.Advance(0x02) { + return nil + } + if len(i.b) < int(l) { + return nil + } + return i.b[:l] +} - return false +// APK matches an Android Package Archive. +// The source of signatures is https://github.com/file/file/blob/1778642b8ba3d947a779a36fcd81f8e807220a19/magic/Magdir/archive#L1820-L1887 +func APK(raw []byte, _ uint32) bool { + return zipHas(raw, zipEntries{{ + name: []byte("AndroidManifest.xml"), + }, { + name: []byte("META-INF/com/android/build/gradle/app-metadata.properties"), + }, { + name: []byte("classes.dex"), + }, { + name: []byte("resources.arsc"), + }, { + name: []byte("res/drawable"), + }}, 100) } diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/markup/markup.go b/vendor/github.com/gabriel-vasile/mimetype/internal/markup/markup.go new file mode 100644 index 000000000000..b9abc6dab191 --- /dev/null +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/markup/markup.go @@ -0,0 +1,105 @@ +// Package markup implements functions for extracting info from +// HTML and XML documents. +package markup + +import ( + "bytes" + + "github.com/gabriel-vasile/mimetype/internal/scan" +) + +// GetAnAttribute assumes we passed over an SGML tag and extracts first +// attribute and its value. +// +// Initially, this code existed inside charset/charset.go, because it was part of +// implementing the https://html.spec.whatwg.org/multipage/parsing.html#prescan-a-byte-stream-to-determine-its-encoding +// algorithm. But because extracting an attribute from a tag is the same for +// both HTML and XML, then the code was moved here. +func GetAnAttribute(s *scan.Bytes) (name, val []byte, hasMore bool) { + for scan.ByteIsWS(s.Peek()) || s.Peek() == '/' { + s.Advance(1) + } + if s.Peek() == '>' { + return nil, nil, false + } + origS, end := *s, 0 + // step 4 and 5 + for { + // bap means byte at position in the specification. + bap := s.Pop() + if bap == 0 { + return nil, nil, false + } + if bap == '=' && end > 0 { + val, hasMore := getAValue(s) + return origS[:end], val, hasMore + } else if scan.ByteIsWS(bap) { + for scan.ByteIsWS(s.Peek()) { + s.Advance(1) + } + if s.Peek() != '=' { + return origS[:end], nil, true + } + s.Advance(1) + for scan.ByteIsWS(s.Peek()) { + s.Advance(1) + } + val, hasMore := getAValue(s) + return origS[:end], val, hasMore + } else if bap == '/' || bap == '>' { + return origS[:end], nil, false + } else { // for any ASCII, non-ASCII, just advance + end++ + } + } +} + +func getAValue(s *scan.Bytes) (_ []byte, hasMore bool) { + for scan.ByteIsWS(s.Peek()) { + s.Advance(1) + } + origS, end := *s, 0 + bap := s.Pop() + if bap == 0 { + return nil, false + } + end++ + // Step 10 + switch bap { + case '"', '\'': + val := s.PopUntil(bap) + if s.Pop() != bap { + return nil, false + } + return val, s.Peek() != 0 && s.Peek() != '>' + case '>': + return nil, false + } + + // Step 11 + for { + bap = s.Pop() + if bap == 0 { + return nil, false + } + switch { + case scan.ByteIsWS(bap): + return origS[:end], true + case bap == '>': + return origS[:end], false + default: + end++ + } + } +} + +func SkipAComment(s *scan.Bytes) (skipped bool) { + if bytes.HasPrefix(*s, []byte("")); i != -1 { + s.Advance(i + 2 + 3) // 2 comes from len(). + return true + } + } + return false +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/scan/bytes.go b/vendor/github.com/gabriel-vasile/mimetype/internal/scan/bytes.go new file mode 100644 index 000000000000..b19a94926270 --- /dev/null +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/scan/bytes.go @@ -0,0 +1,262 @@ +// Package scan has functions for scanning byte slices. +package scan + +import ( + "bytes" + "encoding/binary" +) + +// Bytes is a byte slice with helper methods for easier scanning. +type Bytes []byte + +func (b *Bytes) Advance(n int) bool { + if n < 0 || len(*b) < n { + return false + } + *b = (*b)[n:] + return true +} + +// TrimLWS trims whitespace from beginning of the bytes. +func (b *Bytes) TrimLWS() { + firstNonWS := 0 + for ; firstNonWS < len(*b) && ByteIsWS((*b)[firstNonWS]); firstNonWS++ { + } + + *b = (*b)[firstNonWS:] +} + +// TrimRWS trims whitespace from the end of the bytes. +func (b *Bytes) TrimRWS() { + lb := len(*b) + for lb > 0 && ByteIsWS((*b)[lb-1]) { + *b = (*b)[:lb-1] + lb-- + } +} + +// Peek one byte from b or 0x00 if b is empty. +func (b *Bytes) Peek() byte { + if len(*b) > 0 { + return (*b)[0] + } + return 0 +} + +// Pop one byte from b or 0x00 if b is empty. +func (b *Bytes) Pop() byte { + if len(*b) > 0 { + ret := (*b)[0] + *b = (*b)[1:] + return ret + } + return 0 +} + +// PopN pops n bytes from b or nil if b is empty. +func (b *Bytes) PopN(n int) []byte { + if len(*b) >= n { + ret := (*b)[:n] + *b = (*b)[n:] + return ret + } + return nil +} + +// PopUntil will advance b until, but not including, the first occurence of stopAt +// character. If no occurence is found, then it will advance until the end of b. +// The returned Bytes is a slice of all the bytes that we're advanced over. +func (b *Bytes) PopUntil(stopAt ...byte) Bytes { + if len(*b) == 0 { + return Bytes{} + } + i := bytes.IndexAny(*b, string(stopAt)) + if i == -1 { + i = len(*b) + } + + prefix := (*b)[:i] + *b = (*b)[i:] + return Bytes(prefix) +} + +// ReadSlice is the same as PopUntil, but the returned value includes stopAt as well. +func (b *Bytes) ReadSlice(stopAt byte) Bytes { + if len(*b) == 0 { + return Bytes{} + } + i := bytes.IndexByte(*b, stopAt) + if i == -1 { + i = len(*b) + } else { + i++ + } + + prefix := (*b)[:i] + *b = (*b)[i:] + return Bytes(prefix) +} + +// Line returns the first line from b and advances b with the length of the +// line. One new line character is trimmed after the line if it exists. +func (b *Bytes) Line() Bytes { + line := b.PopUntil('\n') + lline := len(line) + if lline > 0 && line[lline-1] == '\r' { + line = line[:lline-1] + } + b.Advance(1) + return line +} + +// DropLastLine drops the last incomplete line from b. +// +// mimetype limits itself to ReadLimit bytes when performing a detection. +// This means, for file formats like CSV for NDJSON, the last line of the input +// can be an incomplete line. +// If b length is less than readLimit, it means we received an incomplete file +// and proceed with dropping the last line. +func (b *Bytes) DropLastLine(readLimit uint32) { + if readLimit == 0 || uint32(len(*b)) < readLimit { + return + } + + for i := len(*b) - 1; i > 0; i-- { + if (*b)[i] == '\n' { + *b = (*b)[:i] + return + } + } +} + +func (b *Bytes) Uint16() (uint16, bool) { + if len(*b) < 2 { + return 0, false + } + v := binary.LittleEndian.Uint16(*b) + *b = (*b)[2:] + return v, true +} + +type Flags int + +const ( + // CompactWS will make one whitespace from pattern to match one or more spaces from input. + CompactWS Flags = 1 << iota + // IgnoreCase will match lower case from pattern with lower case from input. + // IgnoreCase will match upper case from pattern with both lower and upper case from input. + // This flag is not really well named, + IgnoreCase + // FullWord ensures the input ends with a full word (it's followed by spaces.) + FullWord +) + +// Search for occurences of pattern p inside b at any index. +// It returns the index where p was found in b and how many bytes were needed +// for matching the pattern. +func (b Bytes) Search(p []byte, flags Flags) (i int, l int) { + lb, lp := len(b), len(p) + if lp == 0 { + return 0, 0 + } + if lb == 0 { + return -1, 0 + } + if flags == 0 { + if i = bytes.Index(b, p); i == -1 { + return -1, 0 + } else { + return i, lp + } + } + + for i := range b { + if lb-i < lp { + return -1, 0 + } + if l = b[i:].Match(p, flags); l != -1 { + return i, l + } + } + + return -1, 0 +} + +// Match returns how many bytes were needed to match pattern p. +// It returns -1 if p does not match b. +func (b Bytes) Match(p []byte, flags Flags) int { + l := len(b) + if len(p) == 0 { + return 0 + } + if l == 0 { + return -1 + } + // If no flags, or scanning for full word at the end of pattern then + // do a fast HasPrefix check. + // For other flags it's not possible to use HasPrefix. + if flags == 0 || flags&FullWord > 0 { + if bytes.HasPrefix(b, p) { + b = b[len(p):] + p = p[len(p):] + goto out + } + return -1 + } + for len(b) > 0 { + // If we finished all we were looking for from p. + if len(p) == 0 { + goto out + } + if flags&IgnoreCase > 0 && isUpper(p[0]) { + if upper(b[0]) != p[0] { + return -1 + } + b, p = b[1:], p[1:] + } else if flags&CompactWS > 0 && ByteIsWS(p[0]) { + p = p[1:] + if !ByteIsWS(b[0]) { + return -1 + } + b = b[1:] + if !ByteIsWS(p[0]) { + b.TrimLWS() + } + } else { + if b[0] != p[0] { + return -1 + } + b, p = b[1:], p[1:] + } + } +out: + // If p still has leftover characters, it means it didn't fully match b. + if len(p) > 0 { + return -1 + } + if flags&FullWord > 0 { + if len(b) > 0 && !ByteIsWS(b[0]) { + return -1 + } + } + return l - len(b) +} + +func isUpper(c byte) bool { + return c >= 'A' && c <= 'Z' +} +func upper(c byte) byte { + if c >= 'a' && c <= 'z' { + return c - ('a' - 'A') + } + return c +} + +func ByteIsWS(b byte) bool { + return b == '\t' || b == '\n' || b == '\x0c' || b == '\r' || b == ' ' +} + +var ( + ASCIISpaces = []byte{' ', '\r', '\n', '\x0c', '\t'} + ASCIIDigits = []byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} +) diff --git a/vendor/github.com/gabriel-vasile/mimetype/mime.go b/vendor/github.com/gabriel-vasile/mimetype/mime.go index 62cb15f5932c..ec2bc5bf07ff 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/mime.go +++ b/vendor/github.com/gabriel-vasile/mimetype/mime.go @@ -2,6 +2,7 @@ package mimetype import ( "mime" + "strings" "github.com/gabriel-vasile/mimetype/internal/charset" "github.com/gabriel-vasile/mimetype/internal/magic" @@ -103,15 +104,17 @@ func (m *MIME) match(in []byte, readLimit uint32) *MIME { "text/html": charset.FromHTML, "text/xml": charset.FromXML, } - // ps holds optional MIME parameters. - ps := map[string]string{} + charset := "" if f, ok := needsCharset[m.mime]; ok { - if cset := f(in); cset != "" { - ps["charset"] = cset - } + // The charset comes from BOM, from HTML headers, from XML headers. + // Limit the number of bytes searched for to 1024. + charset = f(in[:min(len(in), 1024)]) + } + if m == root || charset == "" { + return m } - return m.cloneHierarchy(ps) + return m.cloneHierarchy(charset) } // flatten transforms an hierarchy of MIMEs into a slice of MIMEs. @@ -124,11 +127,32 @@ func (m *MIME) flatten() []*MIME { return out } +// hierarchy returns an easy to read list of ancestors for m. +// For example, application/json would return json>txt>root. +func (m *MIME) hierarchy() string { + h := "" + for m := m; m != nil; m = m.Parent() { + e := strings.TrimPrefix(m.Extension(), ".") + if e == "" { + // There are some MIME without extensions. When generating the hierarchy, + // it would be confusing to use empty string as extension. + // Use the subtype instead; ex: application/x-executable -> x-executable. + e = strings.Split(m.String(), "/")[1] + if m.Is("application/octet-stream") { + // for octet-stream use root, because it's short and used in many places + e = "root" + } + } + h += ">" + e + } + return strings.TrimPrefix(h, ">") +} + // clone creates a new MIME with the provided optional MIME parameters. -func (m *MIME) clone(ps map[string]string) *MIME { +func (m *MIME) clone(charset string) *MIME { clonedMIME := m.mime - if len(ps) > 0 { - clonedMIME = mime.FormatMediaType(m.mime, ps) + if charset != "" { + clonedMIME = m.mime + "; charset=" + charset } return &MIME{ @@ -140,11 +164,11 @@ func (m *MIME) clone(ps map[string]string) *MIME { // cloneHierarchy creates a clone of m and all its ancestors. The optional MIME // parameters are set on the last child of the hierarchy. -func (m *MIME) cloneHierarchy(ps map[string]string) *MIME { - ret := m.clone(ps) +func (m *MIME) cloneHierarchy(charset string) *MIME { + ret := m.clone(charset) lastChild := ret for p := m.Parent(); p != nil; p = p.Parent() { - pClone := p.clone(nil) + pClone := p.clone("") lastChild.parent = pClone lastChild = pClone } @@ -153,7 +177,10 @@ func (m *MIME) cloneHierarchy(ps map[string]string) *MIME { } func (m *MIME) lookup(mime string) *MIME { - for _, n := range append(m.aliases, m.mime) { + if mime == m.mime { + return m + } + for _, n := range m.aliases { if n == mime { return m } diff --git a/vendor/github.com/gabriel-vasile/mimetype/mimetype.go b/vendor/github.com/gabriel-vasile/mimetype/mimetype.go index d8d512b8062e..792741732b7c 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/mimetype.go +++ b/vendor/github.com/gabriel-vasile/mimetype/mimetype.go @@ -12,7 +12,7 @@ import ( "sync/atomic" ) -var defaultLimit uint32 = 3072 +const defaultLimit uint32 = 3072 // readLimit is the maximum number of bytes from the input used when detecting. var readLimit uint32 = defaultLimit @@ -112,15 +112,18 @@ func SetLimit(limit uint32) { } // Extend adds detection for other file formats. -// It is equivalent to calling Extend() on the root mime type "application/octet-stream". +// It is equivalent to calling Extend() on the root MIME type "application/octet-stream". func Extend(detector func(raw []byte, limit uint32) bool, mime, extension string, aliases ...string) { root.Extend(detector, mime, extension, aliases...) } // Lookup finds a MIME object by its string representation. -// The representation can be the main mime type, or any of its aliases. -func Lookup(mime string) *MIME { +// The representation can be the main MIME type, or any of its aliases. +func Lookup(m string) *MIME { + // We store the MIME types without optional params, so + // perform parsing to extract the target MIME type without optional params. + m, _, _ = mime.ParseMediaType(m) mu.RLock() defer mu.RUnlock() - return root.lookup(mime) + return root.lookup(m) } diff --git a/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md b/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md index 6f45bfbb6480..241a81f4af31 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md +++ b/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md @@ -1,184 +1,197 @@ -## 179 Supported MIME types +## 192 Supported MIME types This file is automatically generated when running tests. Do not edit manually. -Extension | MIME type | Aliases ---------- | --------- | ------- -**n/a** | application/octet-stream | - -**.xpm** | image/x-xpixmap | - -**.7z** | application/x-7z-compressed | - -**.zip** | application/zip | application/x-zip, application/x-zip-compressed -**.xlsx** | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | - -**.docx** | application/vnd.openxmlformats-officedocument.wordprocessingml.document | - -**.pptx** | application/vnd.openxmlformats-officedocument.presentationml.presentation | - -**.epub** | application/epub+zip | - -**.apk** | application/vnd.android.package-archive | - -**.jar** | application/jar | - -**.odt** | application/vnd.oasis.opendocument.text | application/x-vnd.oasis.opendocument.text -**.ott** | application/vnd.oasis.opendocument.text-template | application/x-vnd.oasis.opendocument.text-template -**.ods** | application/vnd.oasis.opendocument.spreadsheet | application/x-vnd.oasis.opendocument.spreadsheet -**.ots** | application/vnd.oasis.opendocument.spreadsheet-template | application/x-vnd.oasis.opendocument.spreadsheet-template -**.odp** | application/vnd.oasis.opendocument.presentation | application/x-vnd.oasis.opendocument.presentation -**.otp** | application/vnd.oasis.opendocument.presentation-template | application/x-vnd.oasis.opendocument.presentation-template -**.odg** | application/vnd.oasis.opendocument.graphics | application/x-vnd.oasis.opendocument.graphics -**.otg** | application/vnd.oasis.opendocument.graphics-template | application/x-vnd.oasis.opendocument.graphics-template -**.odf** | application/vnd.oasis.opendocument.formula | application/x-vnd.oasis.opendocument.formula -**.odc** | application/vnd.oasis.opendocument.chart | application/x-vnd.oasis.opendocument.chart -**.sxc** | application/vnd.sun.xml.calc | - -**.pdf** | application/pdf | application/x-pdf -**.fdf** | application/vnd.fdf | - -**n/a** | application/x-ole-storage | - -**.msi** | application/x-ms-installer | application/x-windows-installer, application/x-msi -**.aaf** | application/octet-stream | - -**.msg** | application/vnd.ms-outlook | - -**.xls** | application/vnd.ms-excel | application/msexcel -**.pub** | application/vnd.ms-publisher | - -**.ppt** | application/vnd.ms-powerpoint | application/mspowerpoint -**.doc** | application/msword | application/vnd.ms-word -**.ps** | application/postscript | - -**.psd** | image/vnd.adobe.photoshop | image/x-psd, application/photoshop -**.p7s** | application/pkcs7-signature | - -**.ogg** | application/ogg | application/x-ogg -**.oga** | audio/ogg | - -**.ogv** | video/ogg | - -**.png** | image/png | - -**.png** | image/vnd.mozilla.apng | - -**.jpg** | image/jpeg | - -**.jxl** | image/jxl | - -**.jp2** | image/jp2 | - -**.jpf** | image/jpx | - -**.jpm** | image/jpm | video/jpm -**.jxs** | image/jxs | - -**.gif** | image/gif | - -**.webp** | image/webp | - -**.exe** | application/vnd.microsoft.portable-executable | - -**n/a** | application/x-elf | - -**n/a** | application/x-object | - -**n/a** | application/x-executable | - -**.so** | application/x-sharedlib | - -**n/a** | application/x-coredump | - -**.a** | application/x-archive | application/x-unix-archive -**.deb** | application/vnd.debian.binary-package | - -**.tar** | application/x-tar | - -**.xar** | application/x-xar | - -**.bz2** | application/x-bzip2 | - -**.fits** | application/fits | - -**.tiff** | image/tiff | - -**.bmp** | image/bmp | image/x-bmp, image/x-ms-bmp -**.ico** | image/x-icon | - -**.mp3** | audio/mpeg | audio/x-mpeg, audio/mp3 -**.flac** | audio/flac | - -**.midi** | audio/midi | audio/mid, audio/sp-midi, audio/x-mid, audio/x-midi -**.ape** | audio/ape | - -**.mpc** | audio/musepack | - -**.amr** | audio/amr | audio/amr-nb -**.wav** | audio/wav | audio/x-wav, audio/vnd.wave, audio/wave -**.aiff** | audio/aiff | audio/x-aiff -**.au** | audio/basic | - -**.mpeg** | video/mpeg | - -**.mov** | video/quicktime | - -**.mp4** | video/mp4 | - -**.avif** | image/avif | - -**.3gp** | video/3gpp | video/3gp, audio/3gpp -**.3g2** | video/3gpp2 | video/3g2, audio/3gpp2 -**.mp4** | audio/mp4 | audio/x-mp4a -**.mqv** | video/quicktime | - -**.m4a** | audio/x-m4a | - -**.m4v** | video/x-m4v | - -**.heic** | image/heic | - -**.heic** | image/heic-sequence | - -**.heif** | image/heif | - -**.heif** | image/heif-sequence | - -**.mj2** | video/mj2 | - -**.dvb** | video/vnd.dvb.file | - -**.webm** | video/webm | audio/webm -**.avi** | video/x-msvideo | video/avi, video/msvideo -**.flv** | video/x-flv | - -**.mkv** | video/x-matroska | - -**.asf** | video/x-ms-asf | video/asf, video/x-ms-wmv -**.aac** | audio/aac | - -**.voc** | audio/x-unknown | - -**.m3u** | application/vnd.apple.mpegurl | audio/mpegurl -**.rmvb** | application/vnd.rn-realmedia-vbr | - -**.gz** | application/gzip | application/x-gzip, application/x-gunzip, application/gzipped, application/gzip-compressed, application/x-gzip-compressed, gzip/document -**.class** | application/x-java-applet | - -**.swf** | application/x-shockwave-flash | - -**.crx** | application/x-chrome-extension | - -**.ttf** | font/ttf | font/sfnt, application/x-font-ttf, application/font-sfnt -**.woff** | font/woff | - -**.woff2** | font/woff2 | - -**.otf** | font/otf | - -**.ttc** | font/collection | - -**.eot** | application/vnd.ms-fontobject | - -**.wasm** | application/wasm | - -**.shx** | application/vnd.shx | - -**.shp** | application/vnd.shp | - -**.dbf** | application/x-dbf | - -**.dcm** | application/dicom | - -**.rar** | application/x-rar-compressed | application/x-rar -**.djvu** | image/vnd.djvu | - -**.mobi** | application/x-mobipocket-ebook | - -**.lit** | application/x-ms-reader | - -**.bpg** | image/bpg | - -**.cbor** | application/cbor | - -**.sqlite** | application/vnd.sqlite3 | application/x-sqlite3 -**.dwg** | image/vnd.dwg | image/x-dwg, application/acad, application/x-acad, application/autocad_dwg, application/dwg, application/x-dwg, application/x-autocad, drawing/dwg -**.nes** | application/vnd.nintendo.snes.rom | - -**.lnk** | application/x-ms-shortcut | - -**.macho** | application/x-mach-binary | - -**.qcp** | audio/qcelp | - -**.icns** | image/x-icns | - -**.hdr** | image/vnd.radiance | - -**.mrc** | application/marc | - -**.mdb** | application/x-msaccess | - -**.accdb** | application/x-msaccess | - -**.zst** | application/zstd | - -**.cab** | application/vnd.ms-cab-compressed | - -**.rpm** | application/x-rpm | - -**.xz** | application/x-xz | - -**.lz** | application/lzip | application/x-lzip -**.torrent** | application/x-bittorrent | - -**.cpio** | application/x-cpio | - -**n/a** | application/tzif | - -**.xcf** | image/x-xcf | - -**.pat** | image/x-gimp-pat | - -**.gbr** | image/x-gimp-gbr | - -**.glb** | model/gltf-binary | - -**.cab** | application/x-installshield | - -**.jxr** | image/jxr | image/vnd.ms-photo -**.parquet** | application/vnd.apache.parquet | application/x-parquet -**.txt** | text/plain | - -**.html** | text/html | - -**.svg** | image/svg+xml | - -**.xml** | text/xml | application/xml -**.rss** | application/rss+xml | text/rss -**.atom** | application/atom+xml | - -**.x3d** | model/x3d+xml | - -**.kml** | application/vnd.google-earth.kml+xml | - -**.xlf** | application/x-xliff+xml | - -**.dae** | model/vnd.collada+xml | - -**.gml** | application/gml+xml | - -**.gpx** | application/gpx+xml | - -**.tcx** | application/vnd.garmin.tcx+xml | - -**.amf** | application/x-amf | - -**.3mf** | application/vnd.ms-package.3dmanufacturing-3dmodel+xml | - -**.xfdf** | application/vnd.adobe.xfdf | - -**.owl** | application/owl+xml | - -**.php** | text/x-php | - -**.js** | text/javascript | application/x-javascript, application/javascript -**.lua** | text/x-lua | - -**.pl** | text/x-perl | - -**.py** | text/x-python | text/x-script.python, application/x-python -**.json** | application/json | - -**.geojson** | application/geo+json | - -**.har** | application/json | - -**.gltf** | model/gltf+json | - -**.ndjson** | application/x-ndjson | - -**.rtf** | text/rtf | application/rtf -**.srt** | application/x-subrip | application/x-srt, text/x-srt -**.tcl** | text/x-tcl | application/x-tcl -**.csv** | text/csv | - -**.tsv** | text/tab-separated-values | - -**.vcf** | text/vcard | - -**.ics** | text/calendar | - -**.warc** | application/warc | - -**.vtt** | text/vtt | - +Extension | MIME type
Aliases | Hierarchy +--------- | ---------------------- | --------- +**n/a** | **application/octet-stream** | root +**.xpm** | **image/x-xpixmap** | xpm>root +**.7z** | **application/x-7z-compressed** | 7z>root +**.zip** | **application/zip**
application/x-zip, application/x-zip-compressed | zip>root +**.docx** | **application/vnd.openxmlformats-officedocument.wordprocessingml.document** | docx>zip>root +**.pptx** | **application/vnd.openxmlformats-officedocument.presentationml.presentation** | pptx>zip>root +**.xlsx** | **application/vnd.openxmlformats-officedocument.spreadsheetml.sheet** | xlsx>zip>root +**.epub** | **application/epub+zip** | epub>zip>root +**.apk** | **application/vnd.android.package-archive** | apk>zip>root +**.jar** | **application/java-archive**
application/jar, application/jar-archive, application/x-java-archive | jar>zip>root +**.odt** | **application/vnd.oasis.opendocument.text**
application/x-vnd.oasis.opendocument.text | odt>zip>root +**.ott** | **application/vnd.oasis.opendocument.text-template**
application/x-vnd.oasis.opendocument.text-template | ott>odt>zip>root +**.ods** | **application/vnd.oasis.opendocument.spreadsheet**
application/x-vnd.oasis.opendocument.spreadsheet | ods>zip>root +**.ots** | **application/vnd.oasis.opendocument.spreadsheet-template**
application/x-vnd.oasis.opendocument.spreadsheet-template | ots>ods>zip>root +**.odp** | **application/vnd.oasis.opendocument.presentation**
application/x-vnd.oasis.opendocument.presentation | odp>zip>root +**.otp** | **application/vnd.oasis.opendocument.presentation-template**
application/x-vnd.oasis.opendocument.presentation-template | otp>odp>zip>root +**.odg** | **application/vnd.oasis.opendocument.graphics**
application/x-vnd.oasis.opendocument.graphics | odg>zip>root +**.otg** | **application/vnd.oasis.opendocument.graphics-template**
application/x-vnd.oasis.opendocument.graphics-template | otg>odg>zip>root +**.odf** | **application/vnd.oasis.opendocument.formula**
application/x-vnd.oasis.opendocument.formula | odf>zip>root +**.odc** | **application/vnd.oasis.opendocument.chart**
application/x-vnd.oasis.opendocument.chart | odc>zip>root +**.sxc** | **application/vnd.sun.xml.calc** | sxc>zip>root +**.kmz** | **application/vnd.google-earth.kmz** | kmz>zip>root +**.vsdx** | **application/vnd.ms-visio.drawing.main+xml** | vsdx>zip>root +**.pdf** | **application/pdf**
application/x-pdf | pdf>root +**.fdf** | **application/vnd.fdf** | fdf>root +**n/a** | **application/x-ole-storage** | x-ole-storage>root +**.msi** | **application/x-ms-installer**
application/x-windows-installer, application/x-msi | msi>x-ole-storage>root +**.msg** | **application/vnd.ms-outlook** | msg>x-ole-storage>root +**.xls** | **application/vnd.ms-excel**
application/msexcel | xls>x-ole-storage>root +**.pub** | **application/vnd.ms-publisher** | pub>x-ole-storage>root +**.ppt** | **application/vnd.ms-powerpoint**
application/mspowerpoint | ppt>x-ole-storage>root +**.doc** | **application/msword**
application/vnd.ms-word | doc>x-ole-storage>root +**.ps** | **application/postscript** | ps>root +**.psd** | **image/vnd.adobe.photoshop**
image/x-psd, application/photoshop | psd>root +**.p7s** | **application/pkcs7-signature** | p7s>root +**.ogg** | **application/ogg**
application/x-ogg | ogg>root +**.oga** | **audio/ogg** | oga>ogg>root +**.ogv** | **video/ogg** | ogv>ogg>root +**.png** | **image/png** | png>root +**.png** | **image/vnd.mozilla.apng** | png>png>root +**.jpg** | **image/jpeg** | jpg>root +**.jxl** | **image/jxl** | jxl>root +**.jp2** | **image/jp2** | jp2>root +**.jpf** | **image/jpx** | jpf>root +**.jpm** | **image/jpm**
video/jpm | jpm>root +**.jxs** | **image/jxs** | jxs>root +**.gif** | **image/gif** | gif>root +**.webp** | **image/webp** | webp>root +**.exe** | **application/vnd.microsoft.portable-executable** | exe>root +**n/a** | **application/x-elf** | x-elf>root +**n/a** | **application/x-object** | x-object>x-elf>root +**n/a** | **application/x-executable** | x-executable>x-elf>root +**.so** | **application/x-sharedlib** | so>x-elf>root +**n/a** | **application/x-coredump** | x-coredump>x-elf>root +**.a** | **application/x-archive**
application/x-unix-archive | a>root +**.deb** | **application/vnd.debian.binary-package** | deb>a>root +**.tar** | **application/x-tar** | tar>root +**.xar** | **application/x-xar** | xar>root +**.bz2** | **application/x-bzip2** | bz2>root +**.fits** | **application/fits**
image/fits | fits>root +**.tiff** | **image/tiff** | tiff>root +**.bmp** | **image/bmp**
image/x-bmp, image/x-ms-bmp | bmp>root +**.123** | **application/vnd.lotus-1-2-3** | 123>root +**.ico** | **image/x-icon** | ico>root +**.mp3** | **audio/mpeg**
audio/x-mpeg, audio/mp3 | mp3>root +**.flac** | **audio/flac** | flac>root +**.midi** | **audio/midi**
audio/mid, audio/sp-midi, audio/x-mid, audio/x-midi | midi>root +**.ape** | **audio/ape** | ape>root +**.mpc** | **audio/musepack** | mpc>root +**.amr** | **audio/amr**
audio/amr-nb | amr>root +**.wav** | **audio/wav**
audio/x-wav, audio/vnd.wave, audio/wave | wav>root +**.aiff** | **audio/aiff**
audio/x-aiff | aiff>root +**.au** | **audio/basic** | au>root +**.mpeg** | **video/mpeg** | mpeg>root +**.mov** | **video/quicktime** | mov>root +**.mp4** | **video/mp4** | mp4>root +**.avif** | **image/avif** | avif>mp4>root +**.3gp** | **video/3gpp**
video/3gp, audio/3gpp | 3gp>mp4>root +**.3g2** | **video/3gpp2**
video/3g2, audio/3gpp2 | 3g2>mp4>root +**.mp4** | **audio/mp4**
audio/x-mp4a | mp4>mp4>root +**.mqv** | **video/quicktime** | mqv>mp4>root +**.m4a** | **audio/x-m4a** | m4a>mp4>root +**.m4v** | **video/x-m4v** | m4v>mp4>root +**.heic** | **image/heic** | heic>mp4>root +**.heic** | **image/heic-sequence** | heic>mp4>root +**.heif** | **image/heif** | heif>mp4>root +**.heif** | **image/heif-sequence** | heif>mp4>root +**.mj2** | **video/mj2** | mj2>mp4>root +**.dvb** | **video/vnd.dvb.file** | dvb>mp4>root +**.webm** | **video/webm**
audio/webm | webm>root +**.avi** | **video/x-msvideo**
video/avi, video/msvideo | avi>root +**.flv** | **video/x-flv** | flv>root +**.mkv** | **video/x-matroska** | mkv>root +**.asf** | **video/x-ms-asf**
video/asf, video/x-ms-wmv | asf>root +**.aac** | **audio/aac** | aac>root +**.voc** | **audio/x-unknown** | voc>root +**.m3u** | **application/vnd.apple.mpegurl**
audio/mpegurl | m3u>root +**.rmvb** | **application/vnd.rn-realmedia-vbr** | rmvb>root +**.gz** | **application/gzip**
application/x-gzip, application/x-gunzip, application/gzipped, application/gzip-compressed, application/x-gzip-compressed, gzip/document | gz>root +**.class** | **application/x-java-applet** | class>root +**.swf** | **application/x-shockwave-flash** | swf>root +**.crx** | **application/x-chrome-extension** | crx>root +**.ttf** | **font/ttf**
font/sfnt, application/x-font-ttf, application/font-sfnt | ttf>root +**.woff** | **font/woff** | woff>root +**.woff2** | **font/woff2** | woff2>root +**.otf** | **font/otf** | otf>root +**.ttc** | **font/collection** | ttc>root +**.eot** | **application/vnd.ms-fontobject** | eot>root +**.wasm** | **application/wasm** | wasm>root +**.shx** | **application/vnd.shx** | shx>root +**.shp** | **application/vnd.shp** | shp>shx>root +**.dbf** | **application/x-dbf** | dbf>root +**.dcm** | **application/dicom** | dcm>root +**.rar** | **application/x-rar-compressed**
application/x-rar | rar>root +**.djvu** | **image/vnd.djvu** | djvu>root +**.mobi** | **application/x-mobipocket-ebook** | mobi>root +**.lit** | **application/x-ms-reader** | lit>root +**.bpg** | **image/bpg** | bpg>root +**.cbor** | **application/cbor** | cbor>root +**.sqlite** | **application/vnd.sqlite3**
application/x-sqlite3 | sqlite>root +**.dwg** | **image/vnd.dwg**
image/x-dwg, application/acad, application/x-acad, application/autocad_dwg, application/dwg, application/x-dwg, application/x-autocad, drawing/dwg | dwg>root +**.nes** | **application/vnd.nintendo.snes.rom** | nes>root +**.lnk** | **application/x-ms-shortcut** | lnk>root +**.macho** | **application/x-mach-binary** | macho>root +**.qcp** | **audio/qcelp** | qcp>root +**.icns** | **image/x-icns** | icns>root +**.hdr** | **image/vnd.radiance** | hdr>root +**.mrc** | **application/marc** | mrc>root +**.mdb** | **application/x-msaccess** | mdb>root +**.accdb** | **application/x-msaccess** | accdb>root +**.zst** | **application/zstd** | zst>root +**.cab** | **application/vnd.ms-cab-compressed** | cab>root +**.rpm** | **application/x-rpm** | rpm>root +**.xz** | **application/x-xz** | xz>root +**.lz** | **application/lzip**
application/x-lzip | lz>root +**.torrent** | **application/x-bittorrent** | torrent>root +**.cpio** | **application/x-cpio** | cpio>root +**n/a** | **application/tzif** | tzif>root +**.xcf** | **image/x-xcf** | xcf>root +**.pat** | **image/x-gimp-pat** | pat>root +**.gbr** | **image/x-gimp-gbr** | gbr>root +**.glb** | **model/gltf-binary** | glb>root +**.cab** | **application/x-installshield** | cab>root +**.jxr** | **image/jxr**
image/vnd.ms-photo | jxr>root +**.parquet** | **application/vnd.apache.parquet**
application/x-parquet | parquet>root +**.one** | **application/onenote** | one>root +**.chm** | **application/vnd.ms-htmlhelp** | chm>root +**.wpd** | **application/vnd.wordperfect** | wpd>root +**.dxf** | **image/vnd.dxf** | dxf>root +**.txt** | **text/plain** | txt>root +**.svg** | **image/svg+xml** | svg>txt>root +**.html** | **text/html** | html>txt>root +**.xml** | **text/xml**
application/xml | xml>txt>root +**.rss** | **application/rss+xml**
text/rss | rss>xml>txt>root +**.atom** | **application/atom+xml** | atom>xml>txt>root +**.x3d** | **model/x3d+xml** | x3d>xml>txt>root +**.kml** | **application/vnd.google-earth.kml+xml** | kml>xml>txt>root +**.xlf** | **application/x-xliff+xml** | xlf>xml>txt>root +**.dae** | **model/vnd.collada+xml** | dae>xml>txt>root +**.gml** | **application/gml+xml** | gml>xml>txt>root +**.gpx** | **application/gpx+xml** | gpx>xml>txt>root +**.tcx** | **application/vnd.garmin.tcx+xml** | tcx>xml>txt>root +**.amf** | **application/x-amf** | amf>xml>txt>root +**.3mf** | **application/vnd.ms-package.3dmanufacturing-3dmodel+xml** | 3mf>xml>txt>root +**.xfdf** | **application/vnd.adobe.xfdf** | xfdf>xml>txt>root +**.owl** | **application/owl+xml** | owl>xml>txt>root +**.html** | **application/xhtml+xml** | html>xml>txt>root +**.php** | **text/x-php** | php>txt>root +**.js** | **text/javascript**
application/x-javascript, application/javascript | js>txt>root +**.lua** | **text/x-lua** | lua>txt>root +**.pl** | **text/x-perl** | pl>txt>root +**.py** | **text/x-python**
text/x-script.python, application/x-python | py>txt>root +**.rb** | **text/x-ruby**
application/x-ruby | rb>txt>root +**.json** | **application/json** | json>txt>root +**.geojson** | **application/geo+json** | geojson>json>txt>root +**.har** | **application/json** | har>json>txt>root +**.gltf** | **model/gltf+json** | gltf>json>txt>root +**.ndjson** | **application/x-ndjson** | ndjson>txt>root +**.rtf** | **text/rtf**
application/rtf | rtf>txt>root +**.srt** | **application/x-subrip**
application/x-srt, text/x-srt | srt>txt>root +**.tcl** | **text/x-tcl**
application/x-tcl | tcl>txt>root +**.csv** | **text/csv** | csv>txt>root +**.tsv** | **text/tab-separated-values** | tsv>txt>root +**.vcf** | **text/vcard** | vcf>txt>root +**.ics** | **text/calendar** | ics>txt>root +**.warc** | **application/warc** | warc>txt>root +**.vtt** | **text/vtt** | vtt>txt>root +**.sh** | **text/x-shellscript**
text/x-sh, application/x-shellscript, application/x-sh | sh>txt>root +**.pbm** | **image/x-portable-bitmap** | pbm>txt>root +**.pgm** | **image/x-portable-graymap** | pgm>txt>root +**.ppm** | **image/x-portable-pixmap** | ppm>txt>root +**.pam** | **image/x-portable-arbitrarymap** | pam>txt>root diff --git a/vendor/github.com/gabriel-vasile/mimetype/tree.go b/vendor/github.com/gabriel-vasile/mimetype/tree.go index 63a2093a4b6f..21b70d5c9197 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/tree.go +++ b/vendor/github.com/gabriel-vasile/mimetype/tree.go @@ -18,12 +18,13 @@ import ( var root = newMIME("application/octet-stream", "", func([]byte, uint32) bool { return true }, xpm, sevenZ, zip, pdf, fdf, ole, ps, psd, p7s, ogg, png, jpg, jxl, jp2, jpx, - jpm, jxs, gif, webp, exe, elf, ar, tar, xar, bz2, fits, tiff, bmp, ico, mp3, - flac, midi, ape, musePack, amr, wav, aiff, au, mpeg, quickTime, mp4, webM, + jpm, jxs, gif, webp, exe, elf, ar, tar, xar, bz2, fits, tiff, bmp, lotus, ico, + mp3, flac, midi, ape, musePack, amr, wav, aiff, au, mpeg, quickTime, mp4, webM, avi, flv, mkv, asf, aac, voc, m3u, rmvb, gzip, class, swf, crx, ttf, woff, woff2, otf, ttc, eot, wasm, shx, dbf, dcm, rar, djvu, mobi, lit, bpg, cbor, sqlite3, dwg, nes, lnk, macho, qcp, icns, hdr, mrc, mdb, accdb, zstd, cab, rpm, xz, lzip, torrent, cpio, tzif, xcf, pat, gbr, glb, cabIS, jxr, parquet, + oneNote, chm, wpd, dxf, // Keep text last because it is the slowest check. text, ) @@ -48,24 +49,25 @@ var ( // This means APK should be a child of JAR detector, but in practice, // the decisive signature for JAR might be located at the end of the file // and not reachable because of library readLimit. - zip = newMIME("application/zip", ".zip", magic.Zip, xlsx, docx, pptx, epub, apk, jar, odt, ods, odp, odg, odf, odc, sxc). + zip = newMIME("application/zip", ".zip", magic.Zip, docx, pptx, xlsx, epub, apk, jar, odt, ods, odp, odg, odf, odc, sxc, kmz, visio). alias("application/x-zip", "application/x-zip-compressed") tar = newMIME("application/x-tar", ".tar", magic.Tar) xar = newMIME("application/x-xar", ".xar", magic.Xar) bz2 = newMIME("application/x-bzip2", ".bz2", magic.Bz2) - pdf = newMIME("application/pdf", ".pdf", magic.Pdf). + pdf = newMIME("application/pdf", ".pdf", magic.PDF). alias("application/x-pdf") - fdf = newMIME("application/vnd.fdf", ".fdf", magic.Fdf) - xlsx = newMIME("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ".xlsx", magic.Xlsx) - docx = newMIME("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx", magic.Docx) - pptx = newMIME("application/vnd.openxmlformats-officedocument.presentationml.presentation", ".pptx", magic.Pptx) - epub = newMIME("application/epub+zip", ".epub", magic.Epub) - jar = newMIME("application/jar", ".jar", magic.Jar) - apk = newMIME("application/vnd.android.package-archive", ".apk", magic.APK) - ole = newMIME("application/x-ole-storage", "", magic.Ole, msi, aaf, msg, xls, pub, ppt, doc) - msi = newMIME("application/x-ms-installer", ".msi", magic.Msi). + fdf = newMIME("application/vnd.fdf", ".fdf", magic.Fdf) + xlsx = newMIME("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ".xlsx", magic.Xlsx) + docx = newMIME("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx", magic.Docx) + pptx = newMIME("application/vnd.openxmlformats-officedocument.presentationml.presentation", ".pptx", magic.Pptx) + visio = newMIME("application/vnd.ms-visio.drawing.main+xml", ".vsdx", magic.Visio) + epub = newMIME("application/epub+zip", ".epub", magic.Epub) + jar = newMIME("application/java-archive", ".jar", magic.Jar). + alias("application/jar", "application/jar-archive", "application/x-java-archive") + apk = newMIME("application/vnd.android.package-archive", ".apk", magic.APK) + ole = newMIME("application/x-ole-storage", "", magic.Ole, msi, msg, xls, pub, ppt, doc) + msi = newMIME("application/x-ms-installer", ".msi", magic.Msi). alias("application/x-windows-installer", "application/x-msi") - aaf = newMIME("application/octet-stream", ".aaf", magic.Aaf) doc = newMIME("application/msword", ".doc", magic.Doc). alias("application/vnd.ms-word") ppt = newMIME("application/vnd.ms-powerpoint", ".ppt", magic.Ppt). @@ -75,18 +77,19 @@ var ( alias("application/msexcel") msg = newMIME("application/vnd.ms-outlook", ".msg", magic.Msg) ps = newMIME("application/postscript", ".ps", magic.Ps) - fits = newMIME("application/fits", ".fits", magic.Fits) + fits = newMIME("application/fits", ".fits", magic.Fits).alias("image/fits") ogg = newMIME("application/ogg", ".ogg", magic.Ogg, oggAudio, oggVideo). alias("application/x-ogg") oggAudio = newMIME("audio/ogg", ".oga", magic.OggAudio) oggVideo = newMIME("video/ogg", ".ogv", magic.OggVideo) - text = newMIME("text/plain", ".txt", magic.Text, html, svg, xml, php, js, lua, perl, python, json, ndJSON, rtf, srt, tcl, csv, tsv, vCard, iCalendar, warc, vtt) - xml = newMIME("text/xml", ".xml", magic.XML, rss, atom, x3d, kml, xliff, collada, gml, gpx, tcx, amf, threemf, xfdf, owl2). + text = newMIME("text/plain", ".txt", magic.Text, svg, html, xml, php, js, lua, perl, python, ruby, json, ndJSON, rtf, srt, tcl, csv, tsv, vCard, iCalendar, warc, vtt, shell, netpbm, netpgm, netppm, netpam) + xml = newMIME("text/xml", ".xml", magic.XML, rss, atom, x3d, kml, xliff, collada, gml, gpx, tcx, amf, threemf, xfdf, owl2, xhtml). alias("application/xml") + xhtml = newMIME("application/xhtml+xml", ".html", magic.XHTML) json = newMIME("application/json", ".json", magic.JSON, geoJSON, har, gltf) har = newMIME("application/json", ".har", magic.HAR) - csv = newMIME("text/csv", ".csv", magic.Csv) - tsv = newMIME("text/tab-separated-values", ".tsv", magic.Tsv) + csv = newMIME("text/csv", ".csv", magic.CSV) + tsv = newMIME("text/tab-separated-values", ".tsv", magic.TSV) geoJSON = newMIME("application/geo+json", ".geojson", magic.GeoJSON) ndJSON = newMIME("application/x-ndjson", ".ndjson", magic.NdJSON) html = newMIME("text/html", ".html", magic.HTML) @@ -101,6 +104,10 @@ var ( perl = newMIME("text/x-perl", ".pl", magic.Perl) python = newMIME("text/x-python", ".py", magic.Python). alias("text/x-script.python", "application/x-python") + ruby = newMIME("text/x-ruby", ".rb", magic.Ruby). + alias("application/x-ruby") + shell = newMIME("text/x-shellscript", ".sh", magic.Shell). + alias("text/x-sh", "application/x-shellscript", "application/x-sh") tcl = newMIME("text/x-tcl", ".tcl", magic.Tcl). alias("application/x-tcl") vCard = newMIME("text/vcard", ".vcf", magic.VCard) @@ -112,6 +119,7 @@ var ( atom = newMIME("application/atom+xml", ".atom", magic.Atom) x3d = newMIME("model/x3d+xml", ".x3d", magic.X3d) kml = newMIME("application/vnd.google-earth.kml+xml", ".kml", magic.Kml) + kmz = newMIME("application/vnd.google-earth.kmz", ".kmz", magic.KMZ) xliff = newMIME("application/x-xliff+xml", ".xlf", magic.Xliff) collada = newMIME("model/vnd.collada+xml", ".dae", magic.Collada) gml = newMIME("application/gml+xml", ".gml", magic.Gml) @@ -135,9 +143,12 @@ var ( tiff = newMIME("image/tiff", ".tiff", magic.Tiff) bmp = newMIME("image/bmp", ".bmp", magic.Bmp). alias("image/x-bmp", "image/x-ms-bmp") - ico = newMIME("image/x-icon", ".ico", magic.Ico) - icns = newMIME("image/x-icns", ".icns", magic.Icns) - psd = newMIME("image/vnd.adobe.photoshop", ".psd", magic.Psd). + // lotus check must be done before ico because some ico detection is a bit + // relaxed and some lotus files are wrongfully identified as ico otherwise. + lotus = newMIME("application/vnd.lotus-1-2-3", ".123", magic.Lotus123) + ico = newMIME("image/x-icon", ".ico", magic.Ico) + icns = newMIME("image/x-icns", ".icns", magic.Icns) + psd = newMIME("image/vnd.adobe.photoshop", ".psd", magic.Psd). alias("image/x-psd", "application/photoshop") heic = newMIME("image/heic", ".heic", magic.Heic) heicSeq = newMIME("image/heic-sequence", ".heic", magic.HeicSequence) @@ -267,5 +278,13 @@ var ( jxr = newMIME("image/jxr", ".jxr", magic.Jxr).alias("image/vnd.ms-photo") parquet = newMIME("application/vnd.apache.parquet", ".parquet", magic.Par1). alias("application/x-parquet") - cbor = newMIME("application/cbor", ".cbor", magic.CBOR) + netpbm = newMIME("image/x-portable-bitmap", ".pbm", magic.NetPBM) + netpgm = newMIME("image/x-portable-graymap", ".pgm", magic.NetPGM) + netppm = newMIME("image/x-portable-pixmap", ".ppm", magic.NetPPM) + netpam = newMIME("image/x-portable-arbitrarymap", ".pam", magic.NetPAM) + cbor = newMIME("application/cbor", ".cbor", magic.CBOR) + oneNote = newMIME("application/onenote", ".one", magic.One) + chm = newMIME("application/vnd.ms-htmlhelp", ".chm", magic.CHM) + wpd = newMIME("application/vnd.wordperfect", ".wpd", magic.WPD) + dxf = newMIME("image/vnd.dxf", ".dxf", magic.DXF) ) diff --git a/vendor/github.com/go-openapi/errors/.golangci.yml b/vendor/github.com/go-openapi/errors/.golangci.yml index ee8b9bd1f141..5609b4fea9cb 100644 --- a/vendor/github.com/go-openapi/errors/.golangci.yml +++ b/vendor/github.com/go-openapi/errors/.golangci.yml @@ -1,55 +1,75 @@ -linters-settings: - gocyclo: - min-complexity: 45 - dupl: - threshold: 200 - goconst: - min-len: 2 - min-occurrences: 3 - +version: "2" linters: - enable-all: true + default: all disable: - - unparam - - lll - - gochecknoinits - - gochecknoglobals + - cyclop + - depguard + - errchkjson + - errorlint + - exhaustruct + - forcetypeassert - funlen - - godox + - gochecknoglobals + - gochecknoinits - gocognit - - whitespace - - wsl - - wrapcheck - - testpackage - - nlreturn - - errorlint - - nestif - godot - - gofumpt + - godox + - gosmopolitan + - inamedparam + #- intrange # disabled while < go1.22 + - ireturn + - lll + - musttag + - nestif + - nlreturn + - noinlineerr + - nonamedreturns - paralleltest - - tparallel + - recvcheck + - testpackage - thelper - - exhaustruct + - tparallel + - unparam - varnamelen - - gci - - depguard - - errchkjson - - inamedparam - - nonamedreturns - - musttag - - ireturn - - forcetypeassert - - cyclop - # deprecated linters - #- deadcode - #- interfacer - #- scopelint - #- varcheck - #- structcheck - #- golint - #- nosnakecase - #- maligned - #- goerr113 - #- ifshort - #- gomnd - #- exhaustivestruct + - whitespace + - wrapcheck + - wsl + - wsl_v5 + settings: + dupl: + threshold: 200 + goconst: + min-len: 2 + min-occurrences: 3 + gocyclo: + min-complexity: 45 + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ +issues: + # Maximum issues count per one linter. + # Set to 0 to disable. + # Default: 50 + max-issues-per-linter: 0 + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + max-same-issues: 0 diff --git a/vendor/github.com/go-openapi/errors/README.md b/vendor/github.com/go-openapi/errors/README.md index 6d57ea55c7c1..d7e3a18bcf54 100644 --- a/vendor/github.com/go-openapi/errors/README.md +++ b/vendor/github.com/go-openapi/errors/README.md @@ -6,3 +6,7 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/errors)](https://goreportcard.com/report/github.com/go-openapi/errors) Shared errors and error interface used throughout the various libraries found in the go-openapi toolkit. + +## Licensing + +This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE). diff --git a/vendor/github.com/go-openapi/errors/api.go b/vendor/github.com/go-openapi/errors/api.go index d6f507f42de2..d39233bafe42 100644 --- a/vendor/github.com/go-openapi/errors/api.go +++ b/vendor/github.com/go-openapi/errors/api.go @@ -1,16 +1,5 @@ -// 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. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -46,14 +35,14 @@ func (a *apiError) Code() int32 { // MarshalJSON implements the JSON encoding interface func (a apiError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": a.code, "message": a.message, }) } // New creates a new API error with a code and a message -func New(code int32, message string, args ...interface{}) Error { +func New(code int32, message string, args ...any) Error { if len(args) > 0 { return &apiError{ code: code, @@ -67,16 +56,16 @@ func New(code int32, message string, args ...interface{}) Error { } // NotFound creates a new not found error -func NotFound(message string, args ...interface{}) Error { +func NotFound(message string, args ...any) Error { if message == "" { message = "Not found" } - return New(http.StatusNotFound, fmt.Sprintf(message, args...)) + return New(http.StatusNotFound, message, args...) } // NotImplemented creates a new not implemented error func NotImplemented(message string) Error { - return New(http.StatusNotImplemented, message) + return New(http.StatusNotImplemented, "%s", message) } // MethodNotAllowedError represents an error for when the path matches but the method doesn't @@ -97,7 +86,7 @@ func (m *MethodNotAllowedError) Code() int32 { // MarshalJSON implements the JSON encoding interface func (m MethodNotAllowedError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": m.code, "message": m.message, "allowed": m.Allowed, @@ -179,7 +168,7 @@ func ServeError(rw http.ResponseWriter, r *http.Request, err error) { default: rw.WriteHeader(http.StatusInternalServerError) if r == nil || r.Method != http.MethodHead { - _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, err.Error()))) + _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, "%v", err))) } } } diff --git a/vendor/github.com/go-openapi/errors/auth.go b/vendor/github.com/go-openapi/errors/auth.go index 0545b501bd7c..08de582e5db2 100644 --- a/vendor/github.com/go-openapi/errors/auth.go +++ b/vendor/github.com/go-openapi/errors/auth.go @@ -1,16 +1,5 @@ -// 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. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors diff --git a/vendor/github.com/go-openapi/errors/doc.go b/vendor/github.com/go-openapi/errors/doc.go index af01190ce610..b4627f30f4c9 100644 --- a/vendor/github.com/go-openapi/errors/doc.go +++ b/vendor/github.com/go-openapi/errors/doc.go @@ -1,16 +1,5 @@ -// 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. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 /* Package errors provides an Error interface and several concrete types diff --git a/vendor/github.com/go-openapi/errors/headers.go b/vendor/github.com/go-openapi/errors/headers.go index 6ea1151f4155..2d837c34ac47 100644 --- a/vendor/github.com/go-openapi/errors/headers.go +++ b/vendor/github.com/go-openapi/errors/headers.go @@ -1,16 +1,5 @@ -// 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. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -25,9 +14,9 @@ type Validation struct { //nolint: errname code int32 Name string In string - Value interface{} + Value any message string - Values []interface{} + Values []any } func (e *Validation) Error() string { @@ -41,7 +30,7 @@ func (e *Validation) Code() int32 { // MarshalJSON implements the JSON encoding interface func (e Validation) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": e.code, "message": e.message, "in": e.In, @@ -72,7 +61,7 @@ const ( // InvalidContentType error for an invalid content type func InvalidContentType(value string, allowed []string) *Validation { - values := make([]interface{}, 0, len(allowed)) + values := make([]any, 0, len(allowed)) for _, v := range allowed { values = append(values, v) } @@ -88,7 +77,7 @@ func InvalidContentType(value string, allowed []string) *Validation { // InvalidResponseFormat error for an unacceptable response format request func InvalidResponseFormat(value string, allowed []string) *Validation { - values := make([]interface{}, 0, len(allowed)) + values := make([]any, 0, len(allowed)) for _, v := range allowed { values = append(values, v) } diff --git a/vendor/github.com/go-openapi/errors/middleware.go b/vendor/github.com/go-openapi/errors/middleware.go index 67f80386a2ec..c434e59a6fa2 100644 --- a/vendor/github.com/go-openapi/errors/middleware.go +++ b/vendor/github.com/go-openapi/errors/middleware.go @@ -1,16 +1,5 @@ -// 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. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -35,7 +24,7 @@ func (v *APIVerificationFailed) Error() string { hasSpecMissing := len(v.MissingSpecification) > 0 if hasRegMissing { - buf.WriteString(fmt.Sprintf("missing [%s] %s registrations", strings.Join(v.MissingRegistration, ", "), v.Section)) + fmt.Fprintf(buf, "missing [%s] %s registrations", strings.Join(v.MissingRegistration, ", "), v.Section) } if hasRegMissing && hasSpecMissing { @@ -43,7 +32,7 @@ func (v *APIVerificationFailed) Error() string { } if hasSpecMissing { - buf.WriteString(fmt.Sprintf("missing from spec file [%s] %s", strings.Join(v.MissingSpecification, ", "), v.Section)) + fmt.Fprintf(buf, "missing from spec file [%s] %s", strings.Join(v.MissingSpecification, ", "), v.Section) } return buf.String() diff --git a/vendor/github.com/go-openapi/errors/parsing.go b/vendor/github.com/go-openapi/errors/parsing.go index ce1ef9cb675d..ea2a7c603771 100644 --- a/vendor/github.com/go-openapi/errors/parsing.go +++ b/vendor/github.com/go-openapi/errors/parsing.go @@ -1,16 +1,5 @@ -// 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. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -30,6 +19,24 @@ type ParseError struct { message string } +// NewParseError creates a new parse error +func NewParseError(name, in, value string, reason error) *ParseError { + var msg string + if in == "" { + msg = fmt.Sprintf(parseErrorTemplContentNoIn, name, value, reason) + } else { + msg = fmt.Sprintf(parseErrorTemplContent, name, in, value, reason) + } + return &ParseError{ + code: http.StatusBadRequest, + Name: name, + In: in, + Value: value, + Reason: reason, + message: msg, + } +} + func (e *ParseError) Error() string { return e.message } @@ -45,7 +52,7 @@ func (e ParseError) MarshalJSON() ([]byte, error) { if e.Reason != nil { reason = e.Reason.Error() } - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": e.code, "message": e.message, "in": e.In, @@ -59,21 +66,3 @@ const ( parseErrorTemplContent = `parsing %s %s from %q failed, because %s` parseErrorTemplContentNoIn = `parsing %s from %q failed, because %s` ) - -// NewParseError creates a new parse error -func NewParseError(name, in, value string, reason error) *ParseError { - var msg string - if in == "" { - msg = fmt.Sprintf(parseErrorTemplContentNoIn, name, value, reason) - } else { - msg = fmt.Sprintf(parseErrorTemplContent, name, in, value, reason) - } - return &ParseError{ - code: http.StatusBadRequest, - Name: name, - In: in, - Value: value, - Reason: reason, - message: msg, - } -} diff --git a/vendor/github.com/go-openapi/errors/schema.go b/vendor/github.com/go-openapi/errors/schema.go index 8f3239dfd9bd..e59ca4f863f2 100644 --- a/vendor/github.com/go-openapi/errors/schema.go +++ b/vendor/github.com/go-openapi/errors/schema.go @@ -1,16 +1,5 @@ -// 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. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -130,7 +119,7 @@ func (c *CompositeError) Unwrap() []error { // MarshalJSON implements the JSON encoding interface func (c CompositeError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": c.code, "message": c.message, "errors": c.Errors, @@ -254,7 +243,7 @@ func InvalidTypeName(typeName string) *Validation { } // InvalidType creates an error for when the type is invalid -func InvalidType(name, in, typeName string, value interface{}) *Validation { +func InvalidType(name, in, typeName string, value any) *Validation { var message string if in != "" { @@ -302,7 +291,7 @@ func DuplicateItems(name, in string) *Validation { } // TooManyItems error for when an array contains too many items -func TooManyItems(name, in string, maximum int64, value interface{}) *Validation { +func TooManyItems(name, in string, maximum int64, value any) *Validation { msg := fmt.Sprintf(maximumItemsFail, name, in, maximum) if in == "" { msg = fmt.Sprintf(maximumItemsFailNoIn, name, maximum) @@ -318,7 +307,7 @@ func TooManyItems(name, in string, maximum int64, value interface{}) *Validation } // TooFewItems error for when an array contains too few items -func TooFewItems(name, in string, minimum int64, value interface{}) *Validation { +func TooFewItems(name, in string, minimum int64, value any) *Validation { msg := fmt.Sprintf(minItemsFail, name, in, minimum) if in == "" { msg = fmt.Sprintf(minItemsFailNoIn, name, minimum) @@ -333,7 +322,7 @@ func TooFewItems(name, in string, minimum int64, value interface{}) *Validation } // ExceedsMaximumInt error for when maximumimum validation fails -func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value interface{}) *Validation { +func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value any) *Validation { var message string if in == "" { m := maximumIncFailNoIn @@ -358,7 +347,7 @@ func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value int } // ExceedsMaximumUint error for when maximumimum validation fails -func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value interface{}) *Validation { +func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value any) *Validation { var message string if in == "" { m := maximumIncFailNoIn @@ -383,7 +372,7 @@ func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value i } // ExceedsMaximum error for when maximumimum validation fails -func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value interface{}) *Validation { +func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value any) *Validation { var message string if in == "" { m := maximumIncFailNoIn @@ -408,7 +397,7 @@ func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value inte } // ExceedsMinimumInt error for when minimum validation fails -func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value interface{}) *Validation { +func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value any) *Validation { var message string if in == "" { m := minIncFailNoIn @@ -433,7 +422,7 @@ func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value int } // ExceedsMinimumUint error for when minimum validation fails -func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value interface{}) *Validation { +func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value any) *Validation { var message string if in == "" { m := minIncFailNoIn @@ -458,7 +447,7 @@ func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value i } // ExceedsMinimum error for when minimum validation fails -func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value interface{}) *Validation { +func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value any) *Validation { var message string if in == "" { m := minIncFailNoIn @@ -483,7 +472,7 @@ func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value inte } // NotMultipleOf error for when multiple of validation fails -func NotMultipleOf(name, in string, multiple, value interface{}) *Validation { +func NotMultipleOf(name, in string, multiple, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(multipleOfFailNoIn, name, multiple) @@ -500,7 +489,7 @@ func NotMultipleOf(name, in string, multiple, value interface{}) *Validation { } // EnumFail error for when an enum validation fails -func EnumFail(name, in string, value interface{}, values []interface{}) *Validation { +func EnumFail(name, in string, value any, values []any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(enumFailNoIn, name, values) @@ -519,7 +508,7 @@ func EnumFail(name, in string, value interface{}, values []interface{}) *Validat } // Required error for when a value is missing -func Required(name, in string, value interface{}) *Validation { +func Required(name, in string, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(requiredFailNoIn, name) @@ -536,7 +525,7 @@ func Required(name, in string, value interface{}) *Validation { } // ReadOnly error for when a value is present in request -func ReadOnly(name, in string, value interface{}) *Validation { +func ReadOnly(name, in string, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(readOnlyFailNoIn, name) @@ -553,7 +542,7 @@ func ReadOnly(name, in string, value interface{}) *Validation { } // TooLong error for when a string is too long -func TooLong(name, in string, maximum int64, value interface{}) *Validation { +func TooLong(name, in string, maximum int64, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(tooLongMessageNoIn, name, maximum) @@ -570,7 +559,7 @@ func TooLong(name, in string, maximum int64, value interface{}) *Validation { } // TooShort error for when a string is too short -func TooShort(name, in string, minimum int64, value interface{}) *Validation { +func TooShort(name, in string, minimum int64, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(tooShortMessageNoIn, name, minimum) @@ -589,7 +578,7 @@ func TooShort(name, in string, minimum int64, value interface{}) *Validation { // FailedPattern error for when a string fails a regex pattern match // the pattern that is returned is the ECMA syntax version of the pattern not the golang version. -func FailedPattern(name, in, pattern string, value interface{}) *Validation { +func FailedPattern(name, in, pattern string, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(patternFailNoIn, name, pattern) @@ -608,7 +597,7 @@ func FailedPattern(name, in, pattern string, value interface{}) *Validation { // MultipleOfMustBePositive error for when a // multipleOf factor is negative -func MultipleOfMustBePositive(name, in string, factor interface{}) *Validation { +func MultipleOfMustBePositive(name, in string, factor any) *Validation { return &Validation{ code: MultipleOfMustBePositiveCode, Name: name, diff --git a/vendor/github.com/go-openapi/strfmt/.golangci.yml b/vendor/github.com/go-openapi/strfmt/.golangci.yml index 22f8d21cca19..1ad5adf47e69 100644 --- a/vendor/github.com/go-openapi/strfmt/.golangci.yml +++ b/vendor/github.com/go-openapi/strfmt/.golangci.yml @@ -1,61 +1,75 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 45 - maligned: - suggest-new: true - dupl: - threshold: 200 - goconst: - min-len: 2 - min-occurrences: 3 - +version: "2" linters: - enable-all: true + default: all disable: - - maligned - - unparam - - lll - - gochecknoinits - - gochecknoglobals + - cyclop + - depguard + - errchkjson + - errorlint + - exhaustruct + - forcetypeassert - funlen - - godox + - gochecknoglobals + - gochecknoinits - gocognit - - whitespace - - wsl - - wrapcheck - - testpackage - - nlreturn - - gomnd - - exhaustivestruct - - goerr113 - - errorlint - - nestif - godot - - gofumpt + - godox + - gosmopolitan + - inamedparam + - intrange + - ireturn + - lll + - musttag + - nestif + - nlreturn + - nonamedreturns + - noinlineerr - paralleltest - - tparallel + - recvcheck + - testpackage - thelper - - ifshort - - exhaustruct + - tparallel + - unparam - varnamelen - - gci - - depguard - - errchkjson - - inamedparam - - nonamedreturns - - musttag - - ireturn - - forcetypeassert - - cyclop - # deprecated linters - - deadcode - - interfacer - - scopelint - - varcheck - - structcheck - - golint - - nosnakecase + - whitespace + - wrapcheck + - wsl + - wsl_v5 + settings: + dupl: + threshold: 200 + goconst: + min-len: 2 + min-occurrences: 3 + gocyclo: + min-complexity: 45 + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ +issues: + # Maximum issues count per one linter. + # Set to 0 to disable. + # Default: 50 + max-issues-per-linter: 0 + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + max-same-issues: 0 diff --git a/vendor/github.com/go-openapi/strfmt/README.md b/vendor/github.com/go-openapi/strfmt/README.md index f6b39c6c56c5..de5afe137606 100644 --- a/vendor/github.com/go-openapi/strfmt/README.md +++ b/vendor/github.com/go-openapi/strfmt/README.md @@ -35,7 +35,7 @@ It also provides convenient extensions to go-openapi users. - mac (e.g "01:02:03:04:05:06") - rgbcolor (e.g. "rgb(100,100,100)") - ssn - - uuid, uuid3, uuid4, uuid5 + - uuid, uuid3, uuid4, uuid5, uuid7 - cidr (e.g. "192.0.2.1/24", "2001:db8:a0b:12f0::1/32") - ulid (e.g. "00000PP9HGSBSSDZ1JTEXBJ0PW", [spec](https://github.com/ulid/spec)) @@ -81,7 +81,12 @@ List of defined types: - SSN - URI - UUID -- UUID3 -- UUID4 -- UUID5 +- [UUID3](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-3) +- [UUID4](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-4) +- [UUID5](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-5) +- [UUID7](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7) - [ULID](https://github.com/ulid/spec) + +## Licensing + +This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE). diff --git a/vendor/github.com/go-openapi/strfmt/bson.go b/vendor/github.com/go-openapi/strfmt/bson.go index cfa9a526feb9..0eec8f6432ce 100644 --- a/vendor/github.com/go-openapi/strfmt/bson.go +++ b/vendor/github.com/go-openapi/strfmt/bson.go @@ -1,16 +1,5 @@ -// 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. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt @@ -18,9 +7,6 @@ import ( "database/sql/driver" "fmt" - "go.mongodb.org/mongo-driver/bson" - - "go.mongodb.org/mongo-driver/bson/bsontype" bsonprim "go.mongodb.org/mongo-driver/bson/primitive" ) @@ -39,10 +25,10 @@ func IsBSONObjectID(str string) bool { // ObjectId represents a BSON object ID (alias to go.mongodb.org/mongo-driver/bson/primitive.ObjectID) // // swagger:strfmt bsonobjectid -type ObjectId bsonprim.ObjectID //nolint:revive,stylecheck +type ObjectId bsonprim.ObjectID //nolint:revive // NewObjectId creates a ObjectId from a Hex String -func NewObjectId(hex string) ObjectId { //nolint:revive,stylecheck +func NewObjectId(hex string) ObjectId { //nolint:revive oid, err := bsonprim.ObjectIDFromHex(hex) if err != nil { panic(err) @@ -75,7 +61,7 @@ func (id *ObjectId) UnmarshalText(data []byte) error { // validation is performe } // Scan read a value from a database driver -func (id *ObjectId) Scan(raw interface{}) error { +func (id *ObjectId) Scan(raw any) error { var data []byte switch v := raw.(type) { case []byte: @@ -83,7 +69,7 @@ func (id *ObjectId) Scan(raw interface{}) error { case string: data = []byte(v) default: - return fmt.Errorf("cannot sql.Scan() strfmt.URI from: %#v", v) + return fmt.Errorf("cannot sql.Scan() strfmt.URI from: %#v: %w", v, ErrFormat) } return id.UnmarshalText(data) @@ -113,42 +99,6 @@ func (id *ObjectId) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON renders the object id as a BSON document -func (id ObjectId) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": bsonprim.ObjectID(id)}) -} - -// UnmarshalBSON reads the objectId from a BSON document -func (id *ObjectId) UnmarshalBSON(data []byte) error { - var obj struct { - Data bsonprim.ObjectID - } - if err := bson.Unmarshal(data, &obj); err != nil { - return err - } - *id = ObjectId(obj.Data) - return nil -} - -// MarshalBSONValue is an interface implemented by types that can marshal themselves -// into a BSON document represented as bytes. The bytes returned must be a valid -// BSON document if the error is nil. -func (id ObjectId) MarshalBSONValue() (bsontype.Type, []byte, error) { - oid := bsonprim.ObjectID(id) - return bson.TypeObjectID, oid[:], nil -} - -// UnmarshalBSONValue is an interface implemented by types that can unmarshal a -// BSON value representation of themselves. The BSON bytes and type can be -// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it -// wishes to retain the data after returning. -func (id *ObjectId) UnmarshalBSONValue(_ bsontype.Type, data []byte) error { - var oid bsonprim.ObjectID - copy(oid[:], data) - *id = ObjectId(oid) - return nil -} - // DeepCopyInto copies the receiver and writes its value into out. func (id *ObjectId) DeepCopyInto(out *ObjectId) { *out = *id diff --git a/vendor/github.com/go-openapi/strfmt/date.go b/vendor/github.com/go-openapi/strfmt/date.go index 3c93381c7cc1..8aa17b8ea551 100644 --- a/vendor/github.com/go-openapi/strfmt/date.go +++ b/vendor/github.com/go-openapi/strfmt/date.go @@ -1,27 +1,13 @@ -// 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. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt import ( "database/sql/driver" "encoding/json" - "errors" "fmt" "time" - - "go.mongodb.org/mongo-driver/bson" ) func init() { @@ -71,7 +57,7 @@ func (d Date) MarshalText() ([]byte, error) { } // Scan scans a Date value from database driver type. -func (d *Date) Scan(raw interface{}) error { +func (d *Date) Scan(raw any) error { switch v := raw.(type) { case []byte: return d.UnmarshalText(v) @@ -84,7 +70,7 @@ func (d *Date) Scan(raw interface{}) error { *d = Date{} return nil default: - return fmt.Errorf("cannot sql.Scan() strfmt.Date from: %#v", v) + return fmt.Errorf("cannot sql.Scan() strfmt.Date from: %#v: %w", v, ErrFormat) } } @@ -115,28 +101,6 @@ func (d *Date) UnmarshalJSON(data []byte) error { return nil } -func (d Date) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": d.String()}) -} - -func (d *Date) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if data, ok := m["data"].(string); ok { - rd, err := time.ParseInLocation(RFC3339FullDate, data, DefaultTimeLocation) - if err != nil { - return err - } - *d = Date(rd) - return nil - } - - return errors.New("couldn't unmarshal bson bytes value as Date") -} - // DeepCopyInto copies the receiver and writes its value into out. func (d *Date) DeepCopyInto(out *Date) { *out = *d diff --git a/vendor/github.com/go-openapi/strfmt/default.go b/vendor/github.com/go-openapi/strfmt/default.go index 2813714060eb..8a80cfbdb8ae 100644 --- a/vendor/github.com/go-openapi/strfmt/default.go +++ b/vendor/github.com/go-openapi/strfmt/default.go @@ -1,16 +1,5 @@ -// 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. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt @@ -18,46 +7,24 @@ import ( "database/sql/driver" "encoding/base64" "encoding/json" - "errors" "fmt" + "net" "net/mail" + "net/netip" + "net/url" "regexp" + "strconv" "strings" - "github.com/asaskevich/govalidator" "github.com/google/uuid" - "go.mongodb.org/mongo-driver/bson" + "golang.org/x/net/idna" ) const ( - // HostnamePattern http://json-schema.org/latest/json-schema-validation.html#anchor114 - // A string instance is valid against this attribute if it is a valid - // representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - // http://tools.ietf.org/html/rfc1034#section-3.5 - // ::= any one of the ten digits 0 through 9 - // var digit = /[0-9]/; - // ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case - // var letter = /[a-zA-Z]/; - // ::= | - // var letDig = /[0-9a-zA-Z]/; - // ::= | "-" - // var letDigHyp = /[-0-9a-zA-Z]/; - // ::= | - // var ldhStr = /[-0-9a-zA-Z]+/; - //