diff --git a/README.md b/README.md index e0d88f3..338fc3b 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/IBM/vpc-go-sdk) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) -# IBM Cloud VPC Go SDK Version 0.17.0 +# IBM Cloud VPC Go SDK Version 0.18.0 Go client library to interact with the various [IBM Cloud VPC Services APIs](https://cloud.ibm.com/apidocs?category=vpc). **Note:** Given the current version of all VPC SDKs across supported languages and the current VPC API specification, we retracted the vpc-go-sdk version 1.x to version v0.6.0, which had the same features as v1.0.1. -Consider using v0.17.0 from now on. Refrain from using commands like `go get -u ..` and `go get ..@latest` as you will not get the latest release. +Consider using v0.18.0 from now on. Refrain from using commands like `go get -u ..` and `go get ..@latest` as you will not get the latest release. This SDK uses [Semantic Versioning](https://semver.org), and as such there may be backward-incompatible changes for any new `0.y.z` version. ## Table of Contents @@ -64,7 +64,7 @@ Use this command to download and install the VPC Go SDK service to allow your Go use it: ``` -go get github.com/IBM/vpc-go-sdk@v0.14.0 +go get github.com/IBM/vpc-go-sdk@v0.18.0 ``` @@ -90,7 +90,7 @@ to your `Gopkg.toml` file. Here is an example: ``` [[constraint]] name = "github.com/IBM/vpc-go-sdk/" - version = "0.17.0" + version = "0.18.0" ``` Then run `dep ensure`. diff --git a/common/version.go b/common/version.go index 51e8486..4304365 100644 --- a/common/version.go +++ b/common/version.go @@ -1,4 +1,4 @@ package common // Version of the SDK -const Version = "0.17.0" +const Version = "0.18.0" diff --git a/go.mod b/go.mod index 4109348..d2042be 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/IBM/vpc-go-sdk go 1.14 require ( - github.com/IBM/go-sdk-core/v5 v5.9.1 + github.com/IBM/go-sdk-core/v5 v5.9.2 github.com/go-openapi/strfmt v0.21.1 github.com/onsi/ginkgo v1.14.2 github.com/onsi/gomega v1.10.5 diff --git a/go.sum b/go.sum index 88c822d..186df44 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/IBM/go-sdk-core/v5 v5.9.1 h1:06pXbD9Rgmqqe2HA5YAeQbB4eYRRFgIoOT+Kh3cp1zo= -github.com/IBM/go-sdk-core/v5 v5.9.1/go.mod h1:axE2JrRq79gIJTjKPBwV6gWHswvVptBjbcvvCPIxARM= +github.com/IBM/go-sdk-core/v5 v5.9.2 h1:QKB5JwhlZfRvFHqcOwMeu/Dis/Q7qCBxrQLhx04onMc= +github.com/IBM/go-sdk-core/v5 v5.9.2/go.mod h1:YlOwV9LeuclmT/qi/LAK2AsobbAP42veV0j68/rlZsE= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -13,10 +13,10 @@ github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAw github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/strfmt v0.21.1 h1:G6s2t5V5kGCHLVbSdZ/6lI8Wm4OzoPFkc3/cjAsKQrM= github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -49,8 +49,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= @@ -73,7 +73,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -110,8 +109,9 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= @@ -134,7 +134,6 @@ gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+a gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vpcv1/vpc_v1.go b/vpcv1/vpc_v1.go index 5c9de3f..8e7258f 100644 --- a/vpcv1/vpc_v1.go +++ b/vpcv1/vpc_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.44.0-98838c07-20220128-151531 + * IBM OpenAPI SDK Code Generator Version: 3.46.0-a4e29da0-20220224-210428 */ // Package vpcv1 : Operations and models for the VpcV1 service @@ -37,7 +37,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: 2022-02-26 +// API Version: 2022-03-22 type VpcV1 struct { Service *core.BaseService @@ -121,7 +121,7 @@ func NewVpcV1(options *VpcV1Options) (service *VpcV1, err error) { } if options.Version == nil { - options.Version = core.StringPtr("2022-02-26") + options.Version = core.StringPtr("2022-03-22") } service = &VpcV1{ @@ -16411,7 +16411,8 @@ func (vpc *VpcV1) CreateLoadBalancerWithContext(ctx context.Context, createLoadB } // DeleteLoadBalancer : Delete a load balancer -// This request deletes a load balancer. This operation cannot be reversed. +// This request deletes a load balancer. This operation cannot be reversed. A load balancer cannot be deleted if its +// `provisioning_status` is `delete_pending`. func (vpc *VpcV1) DeleteLoadBalancer(deleteLoadBalancerOptions *DeleteLoadBalancerOptions) (response *core.DetailedResponse, err error) { return vpc.DeleteLoadBalancerWithContext(context.Background(), deleteLoadBalancerOptions) } @@ -22310,50 +22311,6 @@ func (options *CheckVPNGatewayConnectionPeerCIDROptions) SetHeaders(param map[st return options } -// CloudObjectStorageBucketIdentity : Identifies a Cloud Object Storage bucket by a unique property. -// Models which "extend" this model: -// - CloudObjectStorageBucketIdentityByName -type CloudObjectStorageBucketIdentity struct { - // The globally unique name of this COS bucket. - Name *string `json:"name,omitempty"` -} - -func (*CloudObjectStorageBucketIdentity) isaCloudObjectStorageBucketIdentity() bool { - return true -} - -type CloudObjectStorageBucketIdentityIntf interface { - isaCloudObjectStorageBucketIdentity() bool -} - -// UnmarshalCloudObjectStorageBucketIdentity unmarshals an instance of CloudObjectStorageBucketIdentity from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketIdentity(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketIdentity) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CloudObjectStorageBucketReference : CloudObjectStorageBucketReference struct -type CloudObjectStorageBucketReference struct { - // The globally unique name of this COS bucket. - Name *string `json:"name" validate:"required"` -} - -// UnmarshalCloudObjectStorageBucketReference unmarshals an instance of CloudObjectStorageBucketReference from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketReference(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketReference) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // CreateBareMetalServerConsoleAccessTokenOptions : The CreateBareMetalServerConsoleAccessToken options. type CreateBareMetalServerConsoleAccessTokenOptions struct { // The bare metal server identifier. @@ -22753,7 +22710,7 @@ type CreateFlowLogCollectorOptions struct { // The bucket must exist and an IAM service authorization must grant // `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer // access to the bucket. - StorageBucket CloudObjectStorageBucketIdentityIntf `json:"storage_bucket" validate:"required"` + StorageBucket LegacyCloudObjectStorageBucketIdentityIntf `json:"storage_bucket" validate:"required"` // The target this collector will collect flow logs for. If the target is an instance, // subnet, or VPC, flow logs will not be collected for any network interfaces within the @@ -22776,7 +22733,7 @@ type CreateFlowLogCollectorOptions struct { } // NewCreateFlowLogCollectorOptions : Instantiate CreateFlowLogCollectorOptions -func (*VpcV1) NewCreateFlowLogCollectorOptions(storageBucket CloudObjectStorageBucketIdentityIntf, target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { +func (*VpcV1) NewCreateFlowLogCollectorOptions(storageBucket LegacyCloudObjectStorageBucketIdentityIntf, target FlowLogCollectorTargetPrototypeIntf) *CreateFlowLogCollectorOptions { return &CreateFlowLogCollectorOptions{ StorageBucket: storageBucket, Target: target, @@ -22784,7 +22741,7 @@ func (*VpcV1) NewCreateFlowLogCollectorOptions(storageBucket CloudObjectStorageB } // SetStorageBucket : Allow user to set StorageBucket -func (_options *CreateFlowLogCollectorOptions) SetStorageBucket(storageBucket CloudObjectStorageBucketIdentityIntf) *CreateFlowLogCollectorOptions { +func (_options *CreateFlowLogCollectorOptions) SetStorageBucket(storageBucket LegacyCloudObjectStorageBucketIdentityIntf) *CreateFlowLogCollectorOptions { _options.StorageBucket = storageBucket return _options } @@ -23194,7 +23151,7 @@ func (options *CreateInstanceGroupManagerPolicyOptions) SetHeaders(param map[str return options } -// `CreateInstanceGroupOptions` : The CreateInstanceGroup options. +// CreateInstanceGroupOptions : The CreateInstanceGroup options. type CreateInstanceGroupOptions struct { // Instance template to use when creating new instances. // @@ -23662,8 +23619,7 @@ type CreateLoadBalancerListenerOptions struct { // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. // Additional restrictions: // - If this load balancer is in the `network` family, the protocol must be `tcp`. - // - If this listener has `https_redirect` specified, the protocol must be `http`. - // - If this listener is a listener's `https_redirect` target, the protocol must be `https`. + // - If `https_redirect` is set, the protocol must be `http`. Protocol *string `json:"protocol" validate:"required"` // If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in @@ -23730,8 +23686,7 @@ type CreateLoadBalancerListenerOptions struct { // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. // Additional restrictions: // - If this load balancer is in the `network` family, the protocol must be `tcp`. -// - If this listener has `https_redirect` specified, the protocol must be `http`. -// - If this listener is a listener's `https_redirect` target, the protocol must be `https`. +// - If `https_redirect` is set, the protocol must be `http`. const ( CreateLoadBalancerListenerOptionsProtocolHTTPConst = "http" CreateLoadBalancerListenerOptionsProtocolHTTPSConst = "https" @@ -30010,7 +29965,7 @@ type FlowLogCollector struct { ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` // The Cloud Object Storage bucket where the collected flows are logged. - StorageBucket *CloudObjectStorageBucketReference `json:"storage_bucket" validate:"required"` + StorageBucket *LegacyCloudObjectStorageBucketReference `json:"storage_bucket" validate:"required"` // The target this collector is collecting flow logs for. If the target is an instance, // subnet, or VPC, flow logs will not be collected for any network interfaces within the @@ -30072,7 +30027,7 @@ func UnmarshalFlowLogCollector(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalModel(m, "storage_bucket", &obj.StorageBucket, UnmarshalCloudObjectStorageBucketReference) + err = core.UnmarshalModel(m, "storage_bucket", &obj.StorageBucket, UnmarshalLegacyCloudObjectStorageBucketReference) if err != nil { return } @@ -33714,7 +33669,7 @@ func UnmarshalImageFileChecksums(m map[string]json.RawMessage, result interface{ // ImageFilePrototype : ImageFilePrototype struct type ImageFilePrototype struct { - // The Cloud Object Store (COS) location of the image file. + // The Cloud Object Storage location of the image file. Href *string `json:"href" validate:"required"` } @@ -38289,7 +38244,7 @@ func UnmarshalInstanceProfileVolumeBandwidth(m map[string]json.RawMessage, resul // InstancePrototype : InstancePrototype struct // Models which "extend" this model: // - InstancePrototypeInstanceByImage -// - InstancePrototypeInstanceByVolume +// - InstancePrototypeInstanceBySourceSnapshot // - InstancePrototypeInstanceBySourceTemplate type InstancePrototype struct { // The availability policy to use for this virtual server instance. @@ -38569,7 +38524,6 @@ func UnmarshalInstanceStatusReason(m map[string]json.RawMessage, result interfac // InstanceTemplate : InstanceTemplate struct // Models which "extend" this model: // - InstanceTemplateInstanceByImage -// - InstanceTemplateInstanceByVolume type InstanceTemplate struct { // The availability policy to use for this virtual server instance. AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` @@ -38907,7 +38861,6 @@ func (instanceTemplatePatch *InstanceTemplatePatch) AsPatch() (_patch map[string // InstanceTemplatePrototype : InstanceTemplatePrototype struct // Models which "extend" this model: // - InstanceTemplatePrototypeInstanceByImage -// - InstanceTemplatePrototypeInstanceByVolume // - InstanceTemplatePrototypeInstanceBySourceTemplate type InstanceTemplatePrototype struct { // The availability policy to use for this virtual server instance. @@ -39493,6 +39446,50 @@ func UnmarshalKeyReferenceDeleted(m map[string]json.RawMessage, result interface return } +// LegacyCloudObjectStorageBucketIdentity : Identifies a Cloud Object Storage bucket by a unique property. +// Models which "extend" this model: +// - LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName +type LegacyCloudObjectStorageBucketIdentity struct { + // The globally unique name of this Cloud Object Storage bucket. + Name *string `json:"name,omitempty"` +} + +func (*LegacyCloudObjectStorageBucketIdentity) isaLegacyCloudObjectStorageBucketIdentity() bool { + return true +} + +type LegacyCloudObjectStorageBucketIdentityIntf interface { + isaLegacyCloudObjectStorageBucketIdentity() bool +} + +// UnmarshalLegacyCloudObjectStorageBucketIdentity unmarshals an instance of LegacyCloudObjectStorageBucketIdentity from the specified map of raw messages. +func UnmarshalLegacyCloudObjectStorageBucketIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LegacyCloudObjectStorageBucketIdentity) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LegacyCloudObjectStorageBucketReference : LegacyCloudObjectStorageBucketReference struct +type LegacyCloudObjectStorageBucketReference struct { + // The globally unique name of this Cloud Object Storage bucket. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalLegacyCloudObjectStorageBucketReference unmarshals an instance of LegacyCloudObjectStorageBucketReference from the specified map of raw messages. +func UnmarshalLegacyCloudObjectStorageBucketReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LegacyCloudObjectStorageBucketReference) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // ListBareMetalServerDisksOptions : The ListBareMetalServerDisks options. type ListBareMetalServerDisksOptions struct { // The bare metal server identifier. @@ -43138,8 +43135,9 @@ type LoadBalancerListenerPatch struct { // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. // Additional restrictions: // - If this load balancer is in the `network` family, the protocol must be `tcp`. - // - If this listener has `https_redirect` specified, the protocol must be `http`. - // - If this listener is a listener's `https_redirect` target, the protocol must be `https`. + // - If `https_redirect` is set, the protocol must be `http`. + // - If this listener is a listener's `https_redirect` target, the protocol must be + // `https`. Protocol *string `json:"protocol,omitempty"` } @@ -43147,8 +43145,9 @@ type LoadBalancerListenerPatch struct { // The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. // Additional restrictions: // - If this load balancer is in the `network` family, the protocol must be `tcp`. -// - If this listener has `https_redirect` specified, the protocol must be `http`. -// - If this listener is a listener's `https_redirect` target, the protocol must be `https`. +// - If `https_redirect` is set, the protocol must be `http`. +// - If this listener is a listener's `https_redirect` target, the protocol must be +// `https`. const ( LoadBalancerListenerPatchProtocolHTTPConst = "http" LoadBalancerListenerPatchProtocolHTTPSConst = "https" @@ -45124,12 +45123,11 @@ type LoadBalancerPoolPatch struct { Name *string `json:"name,omitempty"` // The protocol to use for this load balancer pool. Load balancers in the `network` family support `tcp`. Load - // balancers in the `application` family support `tcp`, `http`, and - // `https`. + // balancers in the `application` family support `tcp`, + // `http` and `https`. // // If this pool is associated with a load balancer listener, the specified protocol must be compatible with the - // listener's protocol. At present, the compatible protocols are - // `http` and `https`. + // listener's protocol. At present, the compatible protocols are `http` and `https`. Protocol *string `json:"protocol,omitempty"` // The PROXY protocol setting for this pool: @@ -45154,12 +45152,11 @@ const ( // Constants associated with the LoadBalancerPoolPatch.Protocol property. // The protocol to use for this load balancer pool. Load balancers in the `network` family support `tcp`. Load balancers -// in the `application` family support `tcp`, `http`, and -// `https`. +// in the `application` family support `tcp`, +// `http` and `https`. // // If this pool is associated with a load balancer listener, the specified protocol must be compatible with the -// listener's protocol. At present, the compatible protocols are -// `http` and `https`. +// listener's protocol. At present, the compatible protocols are `http` and `https`. const ( LoadBalancerPoolPatchProtocolHTTPConst = "http" LoadBalancerPoolPatchProtocolHTTPSConst = "https" @@ -56055,9 +56052,9 @@ func UnmarshalVPNGatewayConnectionStaticRouteModeTunnel(m map[string]json.RawMes // VPNGatewayMember : VPNGatewayMember struct type VPNGatewayMember struct { - // The private IP address assigned to the VPN gateway member. This - // property will be present only when the VPN gateway status is - // `available`. + // The private IP address assigned to the VPN gateway member. + // + // This property will be present only when the VPN gateway status is `available`. PrivateIP *IP `json:"private_ip,omitempty"` // The public IP address assigned to the VPN gateway member. @@ -56596,8 +56593,8 @@ func UnmarshalVolumeAttachmentPrototypeInstanceByImageContext(m map[string]json. return } -// VolumeAttachmentPrototypeInstanceByVolumeContext : VolumeAttachmentPrototypeInstanceByVolumeContext struct -type VolumeAttachmentPrototypeInstanceByVolumeContext struct { +// VolumeAttachmentPrototypeInstanceBySourceSnapshotContext : VolumeAttachmentPrototypeInstanceBySourceSnapshotContext struct +type VolumeAttachmentPrototypeInstanceBySourceSnapshotContext struct { // If set to true, when deleting the instance the volume will also be deleted. DeleteVolumeOnInstanceDelete *bool `json:"delete_volume_on_instance_delete,omitempty"` @@ -56605,22 +56602,22 @@ type VolumeAttachmentPrototypeInstanceByVolumeContext struct { // resides in. Name *string `json:"name,omitempty"` - // An existing volume to attach to the instance, or a prototype object for a new volume. - Volume VolumeAttachmentVolumePrototypeInstanceByVolumeContextIntf `json:"volume" validate:"required"` + // A prototype object for a new volume from a snapshot. + Volume *VolumePrototypeInstanceBySourceSnapshotContext `json:"volume" validate:"required"` } -// NewVolumeAttachmentPrototypeInstanceByVolumeContext : Instantiate VolumeAttachmentPrototypeInstanceByVolumeContext (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentPrototypeInstanceByVolumeContext(volume VolumeAttachmentVolumePrototypeInstanceByVolumeContextIntf) (_model *VolumeAttachmentPrototypeInstanceByVolumeContext, err error) { - _model = &VolumeAttachmentPrototypeInstanceByVolumeContext{ +// NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext : Instantiate VolumeAttachmentPrototypeInstanceBySourceSnapshotContext (Generic Model Constructor) +func (*VpcV1) NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(volume *VolumePrototypeInstanceBySourceSnapshotContext) (_model *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, err error) { + _model = &VolumeAttachmentPrototypeInstanceBySourceSnapshotContext{ Volume: volume, } err = core.ValidateStruct(_model, "required parameters") return } -// UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext unmarshals an instance of VolumeAttachmentPrototypeInstanceByVolumeContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentPrototypeInstanceByVolumeContext) +// UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext unmarshals an instance of VolumeAttachmentPrototypeInstanceBySourceSnapshotContext from the specified map of raw messages. +func UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumeAttachmentPrototypeInstanceBySourceSnapshotContext) err = core.UnmarshalPrimitive(m, "delete_volume_on_instance_delete", &obj.DeleteVolumeOnInstanceDelete) if err != nil { return @@ -56629,7 +56626,7 @@ func UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext(m map[string]json if err != nil { return } - err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContext) + err = core.UnmarshalModel(m, "volume", &obj.Volume, UnmarshalVolumePrototypeInstanceBySourceSnapshotContext) if err != nil { return } @@ -56933,74 +56930,6 @@ func UnmarshalVolumeAttachmentReferenceVolumeContextDeleted(m map[string]json.Ra return } -// VolumeAttachmentVolumePrototypeInstanceByVolumeContext : An existing volume to attach to the instance, or a prototype object for a new volume. -// Models which "extend" this model: -// - VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext -type VolumeAttachmentVolumePrototypeInstanceByVolumeContext struct { - // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's - // `minimum_capacity`. The maximum value may increase in the future. - // - // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the snapshot's `encryption_key` will be used. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The unique user-defined name for this volume. - Name *string `json:"name,omitempty"` - - // The profile to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` - - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot,omitempty"` -} - -func (*VolumeAttachmentVolumePrototypeInstanceByVolumeContext) isaVolumeAttachmentVolumePrototypeInstanceByVolumeContext() bool { - return true -} - -type VolumeAttachmentVolumePrototypeInstanceByVolumeContextIntf interface { - isaVolumeAttachmentVolumePrototypeInstanceByVolumeContext() bool -} - -// UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContext unmarshals an instance of VolumeAttachmentVolumePrototypeInstanceByVolumeContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentVolumePrototypeInstanceByVolumeContext) - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // VolumeAttachmentVolumePrototypeInstanceContext : An existing volume to attach to the instance, or a prototype object for a new volume. // Models which "extend" this model: // - VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity @@ -57235,7 +57164,7 @@ type VolumePatch struct { // The profile to use for this volume. The requested profile must be in the same // `family` as the current profile. The volume must be attached as a data volume to a - // running virtual server instance. + // running virtual server instance. Profile VolumeProfileIdentityIntf `json:"profile,omitempty"` } @@ -57604,6 +57533,74 @@ func UnmarshalVolumePrototypeInstanceByImageContext(m map[string]json.RawMessage return } +// VolumePrototypeInstanceBySourceSnapshotContext : VolumePrototypeInstanceBySourceSnapshotContext struct +type VolumePrototypeInstanceBySourceSnapshotContext struct { + // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's + // `minimum_capacity`. The maximum value may increase in the future. + // + // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. + Capacity *int64 `json:"capacity,omitempty"` + + // The root key to use to wrap the data encryption key for the volume. + // + // If unspecified, the snapshot's `encryption_key` will be used. + EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` + + // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile + // `family` of `custom`. + Iops *int64 `json:"iops,omitempty"` + + // The unique user-defined name for this volume. + Name *string `json:"name,omitempty"` + + // The profile to use for this volume. + Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` + + // The snapshot from which to clone the volume. + SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot" validate:"required"` +} + +// NewVolumePrototypeInstanceBySourceSnapshotContext : Instantiate VolumePrototypeInstanceBySourceSnapshotContext (Generic Model Constructor) +func (*VpcV1) NewVolumePrototypeInstanceBySourceSnapshotContext(profile VolumeProfileIdentityIntf, sourceSnapshot SnapshotIdentityIntf) (_model *VolumePrototypeInstanceBySourceSnapshotContext, err error) { + _model = &VolumePrototypeInstanceBySourceSnapshotContext{ + Profile: profile, + SourceSnapshot: sourceSnapshot, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalVolumePrototypeInstanceBySourceSnapshotContext unmarshals an instance of VolumePrototypeInstanceBySourceSnapshotContext from the specified map of raw messages. +func UnmarshalVolumePrototypeInstanceBySourceSnapshotContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VolumePrototypeInstanceBySourceSnapshotContext) + err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VolumeReference : VolumeReference struct type VolumeReference struct { // The CRN for this volume. @@ -59646,37 +59643,6 @@ func UnmarshalCertificateInstanceIdentityByCRN(m map[string]json.RawMessage, res return } -// CloudObjectStorageBucketIdentityByName : CloudObjectStorageBucketIdentityByName struct -// This model "extends" CloudObjectStorageBucketIdentity -type CloudObjectStorageBucketIdentityByName struct { - // The globally unique name of this COS bucket. - Name *string `json:"name" validate:"required"` -} - -// NewCloudObjectStorageBucketIdentityByName : Instantiate CloudObjectStorageBucketIdentityByName (Generic Model Constructor) -func (*VpcV1) NewCloudObjectStorageBucketIdentityByName(name string) (_model *CloudObjectStorageBucketIdentityByName, err error) { - _model = &CloudObjectStorageBucketIdentityByName{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*CloudObjectStorageBucketIdentityByName) isaCloudObjectStorageBucketIdentity() bool { - return true -} - -// UnmarshalCloudObjectStorageBucketIdentityByName unmarshals an instance of CloudObjectStorageBucketIdentityByName from the specified map of raw messages. -func UnmarshalCloudObjectStorageBucketIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CloudObjectStorageBucketIdentityByName) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // DedicatedHostGroupIdentityByCRN : DedicatedHostGroupIdentityByCRN struct // This model "extends" DedicatedHostGroupIdentity type DedicatedHostGroupIdentityByCRN struct { @@ -64601,9 +64567,9 @@ func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, res return } -// InstancePrototypeInstanceBySourceTemplate : InstancePrototypeInstanceBySourceTemplate struct +// InstancePrototypeInstanceBySourceSnapshot : InstancePrototypeInstanceBySourceSnapshot struct // This model "extends" InstancePrototype -type InstancePrototypeInstanceBySourceTemplate struct { +type InstancePrototypeInstanceBySourceSnapshot struct { // The availability policy to use for this virtual server instance. AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` @@ -64661,37 +64627,33 @@ type InstancePrototypeInstanceBySourceTemplate struct { VPC VPCIdentityIntf `json:"vpc,omitempty"` // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` - - // The image to use when provisioning the virtual server instance. - Image ImageIdentityIntf `json:"image,omitempty"` + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` // Primary network interface. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - - // The template to create this virtual server instance from. - SourceTemplate InstanceTemplateIdentityIntf `json:"source_template" validate:"required"` + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone,omitempty"` + Zone ZoneIdentityIntf `json:"zone" validate:"required"` } -// NewInstancePrototypeInstanceBySourceTemplate : Instantiate InstancePrototypeInstanceBySourceTemplate (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstancePrototypeInstanceBySourceTemplate, err error) { - _model = &InstancePrototypeInstanceBySourceTemplate{ - SourceTemplate: sourceTemplate, +// NewInstancePrototypeInstanceBySourceSnapshot : Instantiate InstancePrototypeInstanceBySourceSnapshot (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshot(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstancePrototypeInstanceBySourceSnapshot, err error) { + _model = &InstancePrototypeInstanceBySourceSnapshot{ + BootVolumeAttachment: bootVolumeAttachment, + PrimaryNetworkInterface: primaryNetworkInterface, + Zone: zone, } err = core.ValidateStruct(_model, "required parameters") return } -func (*InstancePrototypeInstanceBySourceTemplate) isaInstancePrototype() bool { +func (*InstancePrototypeInstanceBySourceSnapshot) isaInstancePrototype() bool { return true } -// 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) +// 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_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) if err != nil { return @@ -64744,11 +64706,7 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceBySourceSnapshotContext) if err != nil { return } @@ -64756,10 +64714,6 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes if err != nil { return } - err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) - if err != nil { - return - } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -64768,9 +64722,9 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes return } -// InstancePrototypeInstanceByVolume : InstancePrototypeInstanceByVolume struct +// InstancePrototypeInstanceBySourceTemplate : InstancePrototypeInstanceBySourceTemplate struct // This model "extends" InstancePrototype -type InstancePrototypeInstanceByVolume struct { +type InstancePrototypeInstanceBySourceTemplate struct { // The availability policy to use for this virtual server instance. AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` @@ -64828,33 +64782,37 @@ type InstancePrototypeInstanceByVolume struct { VPC VPCIdentityIntf `json:"vpc,omitempty"` // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` + BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByImageContext `json:"boot_volume_attachment,omitempty"` + + // The image to use when provisioning the virtual server instance. + Image ImageIdentityIntf `json:"image,omitempty"` // Primary network interface. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + + // The template to create this virtual server instance from. + SourceTemplate InstanceTemplateIdentityIntf `json:"source_template" validate:"required"` // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + Zone ZoneIdentityIntf `json:"zone,omitempty"` } -// NewInstancePrototypeInstanceByVolume : Instantiate InstancePrototypeInstanceByVolume (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByVolume(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstancePrototypeInstanceByVolume, err error) { - _model = &InstancePrototypeInstanceByVolume{ - BootVolumeAttachment: bootVolumeAttachment, - PrimaryNetworkInterface: primaryNetworkInterface, - Zone: zone, +// NewInstancePrototypeInstanceBySourceTemplate : Instantiate InstancePrototypeInstanceBySourceTemplate (Generic Model Constructor) +func (*VpcV1) NewInstancePrototypeInstanceBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstancePrototypeInstanceBySourceTemplate, err error) { + _model = &InstancePrototypeInstanceBySourceTemplate{ + SourceTemplate: sourceTemplate, } err = core.ValidateStruct(_model, "required parameters") return } -func (*InstancePrototypeInstanceByVolume) isaInstancePrototype() bool { +func (*InstancePrototypeInstanceBySourceTemplate) isaInstancePrototype() bool { return true } -// 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) +// UnmarshalInstancePrototypeInstanceBySourceTemplate unmarshals an instance of InstancePrototypeInstanceBySourceTemplate from the specified map of raw messages. +func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstancePrototypeInstanceBySourceTemplate) err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) if err != nil { return @@ -64907,7 +64865,11 @@ func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, re if err != nil { return } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) if err != nil { return } @@ -64915,6 +64877,10 @@ func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, re if err != nil { return } + err = core.UnmarshalModel(m, "source_template", &obj.SourceTemplate, UnmarshalInstanceTemplateIdentity) + if err != nil { + return + } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -65345,161 +65311,6 @@ func UnmarshalInstanceTemplatePrototypeInstanceBySourceTemplate(m map[string]jso return } -// InstanceTemplatePrototypeInstanceByVolume : InstanceTemplatePrototypeInstanceByVolume struct -// This model "extends" InstanceTemplatePrototype -type InstanceTemplatePrototypeInstanceByVolume struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` - - // The default trusted profile configuration to use for this virtual server instance This property's value is used - // when provisioning the virtual server instance, but not subsequently managed. Accordingly, it is reflected as an - // [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, at least one key must be specified, and one will be chosen to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - // Configuration options for the instance metadata service. - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the - // name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The additional network interfaces to create for the virtual server instance. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The placement restrictions to use for the virtual server instance. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will be used, but this default value - // is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // User data to be made available when setting up the virtual server instance. - UserData *string `json:"user_data,omitempty"` - - // The volume attachments for this virtual server instance. - VolumeAttachments []VolumeAttachmentPrototypeInstanceContext `json:"volume_attachments,omitempty"` - - // The VPC the virtual server instance is to be a part of. If specified, it must match the VPC referenced by the - // subnets of the instance's network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` - - // Primary network interface. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} - -// NewInstanceTemplatePrototypeInstanceByVolume : Instantiate InstanceTemplatePrototypeInstanceByVolume (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceByVolume(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf) (_model *InstanceTemplatePrototypeInstanceByVolume, err error) { - _model = &InstanceTemplatePrototypeInstanceByVolume{ - BootVolumeAttachment: bootVolumeAttachment, - PrimaryNetworkInterface: primaryNetworkInterface, - Zone: zone, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*InstanceTemplatePrototypeInstanceByVolume) isaInstanceTemplatePrototype() bool { - return true -} - -// UnmarshalInstanceTemplatePrototypeInstanceByVolume unmarshals an instance of InstanceTemplatePrototypeInstanceByVolume from the specified map of raw messages. -func UnmarshalInstanceTemplatePrototypeInstanceByVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplatePrototypeInstanceByVolume) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototypeInstanceContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // InstanceTemplateInstanceByImage : InstanceTemplateInstanceByImage struct // This model "extends" InstanceTemplate type InstanceTemplateInstanceByImage struct { @@ -65679,178 +65490,6 @@ func UnmarshalInstanceTemplateInstanceByImage(m map[string]json.RawMessage, resu return } -// InstanceTemplateInstanceByVolume : InstanceTemplateInstanceByVolume struct -// This model "extends" InstanceTemplate -type InstanceTemplateInstanceByVolume struct { - // The availability policy to use for this virtual server instance. - AvailabilityPolicy *InstanceAvailabilityPrototype `json:"availability_policy,omitempty"` - - // The date and time that the instance template was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // The CRN for this instance template. - CRN *string `json:"crn" validate:"required"` - - // The default trusted profile configuration to use for this virtual server instance This property's value is used - // when provisioning the virtual server instance, but not subsequently managed. Accordingly, it is reflected as an - // [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - DefaultTrustedProfile *InstanceDefaultTrustedProfilePrototype `json:"default_trusted_profile,omitempty"` - - // The URL for this instance template. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this instance template. - ID *string `json:"id" validate:"required"` - - // The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the - // virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as - // SSH authorized keys for the administrative user. - // - // For Windows images, at least one key must be specified, and one will be chosen to encrypt [the administrator - // password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if - // no keys are specified, the instance will be inaccessible unless the specified image provides another means of - // access. - // - // This property's value is used when provisioning the virtual server instance, but not subsequently managed. - // Accordingly, it is reflected as an [instance - // initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - Keys []KeyIdentityIntf `json:"keys,omitempty"` - - // Configuration options for the instance metadata service. - MetadataService *InstanceMetadataServicePrototype `json:"metadata_service,omitempty"` - - // The unique user-defined name for this instance template. - Name *string `json:"name" validate:"required"` - - // The additional network interfaces to create for the virtual server instance. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The placement restrictions to use for the virtual server instance. - PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` - - // The profile to use for this virtual server instance. If unspecified, `bx2-2x8` will be used, but this default value - // is expected to change in the future. - Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - - // The resource group for this instance template. - ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` - - // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in - // this value will result in a corresponding decrease to - // `total_network_bandwidth`. - TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` - - // User data to be made available when setting up the virtual server instance. - UserData *string `json:"user_data,omitempty"` - - // The volume attachments for this virtual server instance. - VolumeAttachments []VolumeAttachmentPrototypeInstanceContext `json:"volume_attachments,omitempty"` - - // The VPC the virtual server instance is to be a part of. If specified, it must match the VPC referenced by the - // subnets of the instance's network interfaces. - VPC VPCIdentityIntf `json:"vpc,omitempty"` - - // The boot volume attachment for the virtual server instance. - BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` - - // Primary network interface. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - - // The zone this virtual server instance will reside in. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` -} - -func (*InstanceTemplateInstanceByVolume) isaInstanceTemplate() bool { - return true -} - -// UnmarshalInstanceTemplateInstanceByVolume unmarshals an instance of InstanceTemplateInstanceByVolume from the specified map of raw messages. -func UnmarshalInstanceTemplateInstanceByVolume(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplateInstanceByVolume) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototypeInstanceContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByVolumeContext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // KeyIdentityByCRN : KeyIdentityByCRN struct // This model "extends" KeyIdentity type KeyIdentityByCRN struct { @@ -65976,6 +65615,37 @@ func UnmarshalKeyIdentityByID(m map[string]json.RawMessage, result interface{}) return } +// LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct +// This model "extends" LegacyCloudObjectStorageBucketIdentity +type LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName struct { + // The globally unique name of this Cloud Object Storage bucket. + Name *string `json:"name" validate:"required"` +} + +// NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName : Instantiate LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName (Generic Model Constructor) +func (*VpcV1) NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(name string) (_model *LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName, err error) { + _model = &LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName{ + Name: core.StringPtr(name), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) isaLegacyCloudObjectStorageBucketIdentity() bool { + return true +} + +// UnmarshalLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName unmarshals an instance of LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName from the specified map of raw messages. +func UnmarshalLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // LoadBalancerIdentityByCRN : LoadBalancerIdentityByCRN struct // This model "extends" LoadBalancerIdentity type LoadBalancerIdentityByCRN struct { @@ -72341,79 +72011,6 @@ func UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext(m ma return } -// VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext : VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext struct -// This model "extends" VolumeAttachmentVolumePrototypeInstanceByVolumeContext -type VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext struct { - // The capacity to use for the volume (in gigabytes). Must be at least the snapshot's - // `minimum_capacity`. The maximum value may increase in the future. - // - // If unspecified, the capacity will be the source snapshot's `minimum_capacity`. - Capacity *int64 `json:"capacity,omitempty"` - - // The root key to use to wrap the data encryption key for the volume. - // - // If unspecified, the snapshot's `encryption_key` will be used. - EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` - - // The maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile - // `family` of `custom`. - Iops *int64 `json:"iops,omitempty"` - - // The unique user-defined name for this volume. - Name *string `json:"name,omitempty"` - - // The profile to use for this volume. - Profile VolumeProfileIdentityIntf `json:"profile" validate:"required"` - - // The snapshot from which to clone the volume. - SourceSnapshot SnapshotIdentityIntf `json:"source_snapshot" validate:"required"` -} - -// NewVolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext : Instantiate VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext (Generic Model Constructor) -func (*VpcV1) NewVolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext(profile VolumeProfileIdentityIntf, sourceSnapshot SnapshotIdentityIntf) (_model *VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext, err error) { - _model = &VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext{ - Profile: profile, - SourceSnapshot: sourceSnapshot, - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -func (*VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext) isaVolumeAttachmentVolumePrototypeInstanceByVolumeContext() bool { - return true -} - -// UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext unmarshals an instance of VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext from the specified map of raw messages. -func UnmarshalVolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext) - err = core.UnmarshalPrimitive(m, "capacity", &obj.Capacity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalVolumeProfileIdentity) - if err != nil { - return - } - err = core.UnmarshalModel(m, "source_snapshot", &obj.SourceSnapshot, UnmarshalSnapshotIdentity) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity : Identifies a volume by a unique property. // Models which "extend" this model: // - VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByID diff --git a/vpcv1/vpc_v1_examples_test.go b/vpcv1/vpc_v1_examples_test.go index a06dc7d..88e6cbc 100644 --- a/vpcv1/vpc_v1_examples_test.go +++ b/vpcv1/vpc_v1_examples_test.go @@ -5297,7 +5297,7 @@ var _ = Describe(`VpcV1 Examples Tests`, func() { options.SetTarget(&vpcv1.FlowLogCollectorTargetPrototypeVPCIdentity{ ID: &vpcID, }) - options.SetStorageBucket(&vpcv1.CloudObjectStorageBucketIdentity{ + options.SetStorageBucket(&vpcv1.LegacyCloudObjectStorageBucketIdentity{ Name: &[]string{"bucket-name"}[0], }) flowLog, response, err := vpcService.CreateFlowLogCollector(options) diff --git a/vpcv1/vpc_v1_integration_utils_test.go b/vpcv1/vpc_v1_integration_utils_test.go index 8802a72..ef4bec3 100644 --- a/vpcv1/vpc_v1_integration_utils_test.go +++ b/vpcv1/vpc_v1_integration_utils_test.go @@ -2408,7 +2408,7 @@ func CreateFlowLogCollector(vpcService *vpcv1.VpcV1, name, bucketName, vpcId str options.SetTarget(&vpcv1.FlowLogCollectorTargetPrototype{ ID: &vpcId, }) - options.SetStorageBucket(&vpcv1.CloudObjectStorageBucketIdentity{ + options.SetStorageBucket(&vpcv1.LegacyCloudObjectStorageBucketIdentity{ Name: &bucketName, }) flowLog, response, err = vpcService.CreateFlowLogCollector(options) diff --git a/vpcv1/vpc_v1_test.go b/vpcv1/vpc_v1_test.go index 2e0da54..b415da2 100644 --- a/vpcv1/vpc_v1_test.go +++ b/vpcv1/vpc_v1_test.go @@ -69218,9 +69218,9 @@ var _ = Describe(`VpcV1`, func() { Expect(serviceErr).To(BeNil()) Expect(vpcService).ToNot(BeNil()) - // Construct an instance of the CloudObjectStorageBucketIdentityByName model - cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityByName) - cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") + // Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model + legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) + legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") // Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID model flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID) @@ -69232,7 +69232,7 @@ var _ = Describe(`VpcV1`, func() { // Construct an instance of the CreateFlowLogCollectorOptions model createFlowLogCollectorOptionsModel := new(vpcv1.CreateFlowLogCollectorOptions) - createFlowLogCollectorOptionsModel.StorageBucket = cloudObjectStorageBucketIdentityModel + createFlowLogCollectorOptionsModel.StorageBucket = legacyCloudObjectStorageBucketIdentityModel createFlowLogCollectorOptionsModel.Target = flowLogCollectorTargetPrototypeModel createFlowLogCollectorOptionsModel.Active = core.BoolPtr(false) createFlowLogCollectorOptionsModel.Name = core.StringPtr("my-flow-log-collector") @@ -69305,9 +69305,9 @@ var _ = Describe(`VpcV1`, func() { Expect(vpcService).ToNot(BeNil()) vpcService.EnableRetries(0, 0) - // Construct an instance of the CloudObjectStorageBucketIdentityByName model - cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityByName) - cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") + // Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model + legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) + legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") // Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID model flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID) @@ -69319,7 +69319,7 @@ var _ = Describe(`VpcV1`, func() { // Construct an instance of the CreateFlowLogCollectorOptions model createFlowLogCollectorOptionsModel := new(vpcv1.CreateFlowLogCollectorOptions) - createFlowLogCollectorOptionsModel.StorageBucket = cloudObjectStorageBucketIdentityModel + createFlowLogCollectorOptionsModel.StorageBucket = legacyCloudObjectStorageBucketIdentityModel createFlowLogCollectorOptionsModel.Target = flowLogCollectorTargetPrototypeModel createFlowLogCollectorOptionsModel.Active = core.BoolPtr(false) createFlowLogCollectorOptionsModel.Name = core.StringPtr("my-flow-log-collector") @@ -69399,9 +69399,9 @@ var _ = Describe(`VpcV1`, func() { Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the CloudObjectStorageBucketIdentityByName model - cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityByName) - cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") + // Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model + legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) + legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") // Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID model flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID) @@ -69413,7 +69413,7 @@ var _ = Describe(`VpcV1`, func() { // Construct an instance of the CreateFlowLogCollectorOptions model createFlowLogCollectorOptionsModel := new(vpcv1.CreateFlowLogCollectorOptions) - createFlowLogCollectorOptionsModel.StorageBucket = cloudObjectStorageBucketIdentityModel + createFlowLogCollectorOptionsModel.StorageBucket = legacyCloudObjectStorageBucketIdentityModel createFlowLogCollectorOptionsModel.Target = flowLogCollectorTargetPrototypeModel createFlowLogCollectorOptionsModel.Active = core.BoolPtr(false) createFlowLogCollectorOptionsModel.Name = core.StringPtr("my-flow-log-collector") @@ -69436,9 +69436,9 @@ var _ = Describe(`VpcV1`, func() { Expect(serviceErr).To(BeNil()) Expect(vpcService).ToNot(BeNil()) - // Construct an instance of the CloudObjectStorageBucketIdentityByName model - cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityByName) - cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") + // Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model + legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) + legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") // Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID model flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID) @@ -69450,7 +69450,7 @@ var _ = Describe(`VpcV1`, func() { // Construct an instance of the CreateFlowLogCollectorOptions model createFlowLogCollectorOptionsModel := new(vpcv1.CreateFlowLogCollectorOptions) - createFlowLogCollectorOptionsModel.StorageBucket = cloudObjectStorageBucketIdentityModel + createFlowLogCollectorOptionsModel.StorageBucket = legacyCloudObjectStorageBucketIdentityModel createFlowLogCollectorOptionsModel.Target = flowLogCollectorTargetPrototypeModel createFlowLogCollectorOptionsModel.Active = core.BoolPtr(false) createFlowLogCollectorOptionsModel.Name = core.StringPtr("my-flow-log-collector") @@ -69494,9 +69494,9 @@ var _ = Describe(`VpcV1`, func() { Expect(serviceErr).To(BeNil()) Expect(vpcService).ToNot(BeNil()) - // Construct an instance of the CloudObjectStorageBucketIdentityByName model - cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityByName) - cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") + // Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model + legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) + legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") // Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID model flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID) @@ -69508,7 +69508,7 @@ var _ = Describe(`VpcV1`, func() { // Construct an instance of the CreateFlowLogCollectorOptions model createFlowLogCollectorOptionsModel := new(vpcv1.CreateFlowLogCollectorOptions) - createFlowLogCollectorOptionsModel.StorageBucket = cloudObjectStorageBucketIdentityModel + createFlowLogCollectorOptionsModel.StorageBucket = legacyCloudObjectStorageBucketIdentityModel createFlowLogCollectorOptionsModel.Target = flowLogCollectorTargetPrototypeModel createFlowLogCollectorOptionsModel.Active = core.BoolPtr(false) createFlowLogCollectorOptionsModel.Name = core.StringPtr("my-flow-log-collector") @@ -70618,11 +70618,11 @@ var _ = Describe(`VpcV1`, func() { Expect(createFloatingIPOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewCreateFlowLogCollectorOptions successfully`, func() { - // Construct an instance of the CloudObjectStorageBucketIdentityByName model - cloudObjectStorageBucketIdentityModel := new(vpcv1.CloudObjectStorageBucketIdentityByName) - Expect(cloudObjectStorageBucketIdentityModel).ToNot(BeNil()) - cloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") - Expect(cloudObjectStorageBucketIdentityModel.Name).To(Equal(core.StringPtr("bucket-27200-lwx4cfvcue"))) + // Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model + legacyCloudObjectStorageBucketIdentityModel := new(vpcv1.LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName) + Expect(legacyCloudObjectStorageBucketIdentityModel).ToNot(BeNil()) + legacyCloudObjectStorageBucketIdentityModel.Name = core.StringPtr("bucket-27200-lwx4cfvcue") + Expect(legacyCloudObjectStorageBucketIdentityModel.Name).To(Equal(core.StringPtr("bucket-27200-lwx4cfvcue"))) // Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID model flowLogCollectorTargetPrototypeModel := new(vpcv1.FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityByID) @@ -70637,17 +70637,17 @@ var _ = Describe(`VpcV1`, func() { Expect(resourceGroupIdentityModel.ID).To(Equal(core.StringPtr("fee82deba12e4c0fb69c3b09d1f12345"))) // Construct an instance of the CreateFlowLogCollectorOptions model - var createFlowLogCollectorOptionsStorageBucket vpcv1.CloudObjectStorageBucketIdentityIntf = nil + var createFlowLogCollectorOptionsStorageBucket vpcv1.LegacyCloudObjectStorageBucketIdentityIntf = nil var createFlowLogCollectorOptionsTarget vpcv1.FlowLogCollectorTargetPrototypeIntf = nil createFlowLogCollectorOptionsModel := vpcService.NewCreateFlowLogCollectorOptions(createFlowLogCollectorOptionsStorageBucket, createFlowLogCollectorOptionsTarget) - createFlowLogCollectorOptionsModel.SetStorageBucket(cloudObjectStorageBucketIdentityModel) + createFlowLogCollectorOptionsModel.SetStorageBucket(legacyCloudObjectStorageBucketIdentityModel) createFlowLogCollectorOptionsModel.SetTarget(flowLogCollectorTargetPrototypeModel) createFlowLogCollectorOptionsModel.SetActive(false) createFlowLogCollectorOptionsModel.SetName("my-flow-log-collector") createFlowLogCollectorOptionsModel.SetResourceGroup(resourceGroupIdentityModel) createFlowLogCollectorOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(createFlowLogCollectorOptionsModel).ToNot(BeNil()) - Expect(createFlowLogCollectorOptionsModel.StorageBucket).To(Equal(cloudObjectStorageBucketIdentityModel)) + Expect(createFlowLogCollectorOptionsModel.StorageBucket).To(Equal(legacyCloudObjectStorageBucketIdentityModel)) Expect(createFlowLogCollectorOptionsModel.Target).To(Equal(flowLogCollectorTargetPrototypeModel)) Expect(createFlowLogCollectorOptionsModel.Active).To(Equal(core.BoolPtr(false))) Expect(createFlowLogCollectorOptionsModel.Name).To(Equal(core.StringPtr("my-flow-log-collector"))) @@ -75725,9 +75725,9 @@ var _ = Describe(`VpcV1`, func() { _, err := vpcService.NewVolumeAttachmentPrototypeInstanceByImageContext(volume) Expect(err).ToNot(BeNil()) }) - It(`Invoke NewVolumeAttachmentPrototypeInstanceByVolumeContext successfully`, func() { - var volume vpcv1.VolumeAttachmentVolumePrototypeInstanceByVolumeContextIntf = nil - _, err := vpcService.NewVolumeAttachmentPrototypeInstanceByVolumeContext(volume) + It(`Invoke NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext successfully`, func() { + var volume *vpcv1.VolumePrototypeInstanceBySourceSnapshotContext = nil + _, err := vpcService.NewVolumeAttachmentPrototypeInstanceBySourceSnapshotContext(volume) Expect(err).ToNot(BeNil()) }) It(`Invoke NewVolumeAttachmentPrototypeInstanceContext successfully`, func() { @@ -75740,6 +75740,12 @@ var _ = Describe(`VpcV1`, func() { _, err := vpcService.NewVolumePrototypeInstanceByImageContext(profile) Expect(err).ToNot(BeNil()) }) + It(`Invoke NewVolumePrototypeInstanceBySourceSnapshotContext successfully`, func() { + var profile vpcv1.VolumeProfileIdentityIntf = nil + var sourceSnapshot vpcv1.SnapshotIdentityIntf = nil + _, err := vpcService.NewVolumePrototypeInstanceBySourceSnapshotContext(profile, sourceSnapshot) + Expect(err).ToNot(BeNil()) + }) It(`Invoke NewBareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPciPrototype successfully`, func() { interfaceType := "pci" var subnet vpcv1.SubnetIdentityIntf = nil @@ -75771,12 +75777,6 @@ var _ = Describe(`VpcV1`, func() { Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) }) - It(`Invoke NewCloudObjectStorageBucketIdentityByName successfully`, func() { - name := "bucket-27200-lwx4cfvcue" - _model, err := vpcService.NewCloudObjectStorageBucketIdentityByName(name) - Expect(_model).ToNot(BeNil()) - Expect(err).To(BeNil()) - }) It(`Invoke NewDedicatedHostGroupIdentityByCRN successfully`, func() { crn := "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0" _model, err := vpcService.NewDedicatedHostGroupIdentityByCRN(crn) @@ -75945,18 +75945,18 @@ var _ = Describe(`VpcV1`, func() { _, err := vpcService.NewInstancePrototypeInstanceByImage(image, primaryNetworkInterface, zone) Expect(err).ToNot(BeNil()) }) + It(`Invoke NewInstancePrototypeInstanceBySourceSnapshot successfully`, func() { + var bootVolumeAttachment *vpcv1.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext = nil + var primaryNetworkInterface *vpcv1.NetworkInterfacePrototype = nil + var zone vpcv1.ZoneIdentityIntf = nil + _, err := vpcService.NewInstancePrototypeInstanceBySourceSnapshot(bootVolumeAttachment, primaryNetworkInterface, zone) + Expect(err).ToNot(BeNil()) + }) It(`Invoke NewInstancePrototypeInstanceBySourceTemplate successfully`, func() { var sourceTemplate vpcv1.InstanceTemplateIdentityIntf = nil _, err := vpcService.NewInstancePrototypeInstanceBySourceTemplate(sourceTemplate) Expect(err).ToNot(BeNil()) }) - It(`Invoke NewInstancePrototypeInstanceByVolume successfully`, func() { - var bootVolumeAttachment *vpcv1.VolumeAttachmentPrototypeInstanceByVolumeContext = nil - var primaryNetworkInterface *vpcv1.NetworkInterfacePrototype = nil - var zone vpcv1.ZoneIdentityIntf = nil - _, err := vpcService.NewInstancePrototypeInstanceByVolume(bootVolumeAttachment, primaryNetworkInterface, zone) - Expect(err).ToNot(BeNil()) - }) It(`Invoke NewInstanceTemplateIdentityByCRN successfully`, func() { crn := "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a" _model, err := vpcService.NewInstanceTemplateIdentityByCRN(crn) @@ -75987,13 +75987,6 @@ var _ = Describe(`VpcV1`, func() { _, err := vpcService.NewInstanceTemplatePrototypeInstanceBySourceTemplate(sourceTemplate) Expect(err).ToNot(BeNil()) }) - It(`Invoke NewInstanceTemplatePrototypeInstanceByVolume successfully`, func() { - var bootVolumeAttachment *vpcv1.VolumeAttachmentPrototypeInstanceByVolumeContext = nil - var primaryNetworkInterface *vpcv1.NetworkInterfacePrototype = nil - var zone vpcv1.ZoneIdentityIntf = nil - _, err := vpcService.NewInstanceTemplatePrototypeInstanceByVolume(bootVolumeAttachment, primaryNetworkInterface, zone) - Expect(err).ToNot(BeNil()) - }) It(`Invoke NewKeyIdentityByCRN successfully`, func() { crn := "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803" _model, err := vpcService.NewKeyIdentityByCRN(crn) @@ -76018,6 +76011,12 @@ var _ = Describe(`VpcV1`, func() { Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) }) + It(`Invoke NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName successfully`, func() { + name := "bucket-27200-lwx4cfvcue" + _model, err := vpcService.NewLegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(name) + Expect(_model).ToNot(BeNil()) + Expect(err).To(BeNil()) + }) It(`Invoke NewLoadBalancerIdentityByCRN successfully`, func() { crn := "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727" _model, err := vpcService.NewLoadBalancerIdentityByCRN(crn) @@ -76492,12 +76491,6 @@ var _ = Describe(`VpcV1`, func() { _, err := vpcService.NewVPNGatewayPrototypeVPNGatewayRouteModePrototype(subnet) Expect(err).ToNot(BeNil()) }) - It(`Invoke NewVolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext successfully`, func() { - var profile vpcv1.VolumeProfileIdentityIntf = nil - var sourceSnapshot vpcv1.SnapshotIdentityIntf = nil - _, err := vpcService.NewVolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext(profile, sourceSnapshot) - Expect(err).ToNot(BeNil()) - }) It(`Invoke NewVolumeIdentityByCRN successfully`, func() { crn := "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5" _model, err := vpcService.NewVolumeIdentityByCRN(crn)