Skip to content

Commit

Permalink
Release 2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
IBMalok authored and GitHub Enterprise committed Feb 6, 2024
1 parent 3e729c7 commit 0a426fb
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 13 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## 2.0.4

### Content

#### Defect Fixes

* Internal fixes and improvements

## 2.0.3

### Content
Expand Down
2 changes: 1 addition & 1 deletion v2/common/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
package common

// Version of the SDK
const Version = "2.0.3"
const Version = "2.0.4"
2 changes: 1 addition & 1 deletion v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/IBM/ibm-cos-sdk-go v1.10.1
github.com/go-openapi/strfmt v0.21.10
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.30.0
github.com/onsi/gomega v1.31.1
github.com/stretchr/testify v1.8.4
)

Expand Down
10 changes: 5 additions & 5 deletions v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-openapi/errors v0.21.0 h1:FhChC/duCnfoLj1gZ0BgaBmzhJC2SL/sJr8a2vAobSY=
github.com/go-openapi/errors v0.21.0/go.mod h1:jxNTMUxRCKj65yb/okJGEtahVd7uvWnuWfj53bse4ho=
github.com/go-openapi/strfmt v0.21.10 h1:JIsly3KXZB/Qf4UzvzJpg4OELH/0ASDQsyk//TTBDDk=
Expand Down Expand Up @@ -70,11 +70,11 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo=
github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
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=
Expand Down Expand Up @@ -164,7 +164,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
127 changes: 125 additions & 2 deletions v2/resourceconfigurationv1/resource_configuration_v1.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2022.
* (C) Copyright IBM Corp. 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 3.57.1-4c556507-20220928-143422
* IBM OpenAPI SDK Code Generator Version: 3.84.1-55f6d880-20240110-194020
*/

// Package resourceconfigurationv1 : Operations and models for the ResourceConfigurationV1 service
Expand Down Expand Up @@ -369,6 +369,9 @@ type Bucket struct {

// Maximum bytes for this bucket.
HardQuota *int64 `json:"hard_quota,omitempty"`

// Data structure holding protection management response.
ProtectionManagement *ProtectionManagementResponse `json:"protection_management,omitempty"`
}

// UnmarshalBucket unmarshals an instance of Bucket from the specified map of raw messages.
Expand Down Expand Up @@ -434,6 +437,10 @@ func UnmarshalBucket(m map[string]json.RawMessage, result interface{}) (err erro
if err != nil {
return
}
err = core.UnmarshalModel(m, "protection_management", &obj.ProtectionManagement, UnmarshalProtectionManagementResponse)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}
Expand All @@ -456,6 +463,9 @@ type BucketPatch struct {

// Maximum bytes for this bucket.
HardQuota *int64 `json:"hard_quota,omitempty"`

// Data structure holding protection management operations.
ProtectionManagement *ProtectionManagement `json:"protection_management,omitempty"`
}

// UnmarshalBucketPatch unmarshals an instance of BucketPatch from the specified map of raw messages.
Expand All @@ -477,6 +487,10 @@ func UnmarshalBucketPatch(m map[string]json.RawMessage, result interface{}) (err
if err != nil {
return
}
err = core.UnmarshalModel(m, "protection_management", &obj.ProtectionManagement, UnmarshalProtectionManagement)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}
Expand Down Expand Up @@ -575,6 +589,115 @@ func UnmarshalMetricsMonitoring(m map[string]json.RawMessage, result interface{}
return
}

// ProtectionManagement : Data structure holding protection management operations.
type ProtectionManagement struct {
// If set to `activate`, protection management action on the bucket is being activated.
RequestedState *string `json:"requested_state,omitempty"`

// This field is required when using requested_state\:`activate` and holds a JWT that is provided by the Cloud
// Operator. This should be the encoded JWT.
ProtectionManagementToken *string `json:"protection_management_token,omitempty"`
}

// Constants associated with the ProtectionManagement.RequestedState property.
// If set to `activate`, protection management action on the bucket is being activated.
const (
ProtectionManagement_RequestedState_Activate = "activate"
ProtectionManagement_RequestedState_Deactivate = "deactivate"
)

// UnmarshalProtectionManagement unmarshals an instance of ProtectionManagement from the specified map of raw messages.
func UnmarshalProtectionManagement(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(ProtectionManagement)
err = core.UnmarshalPrimitive(m, "requested_state", &obj.RequestedState)
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "protection_management_token", &obj.ProtectionManagementToken)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}

// ProtectionManagementResponse : Data structure holding protection management response.
type ProtectionManagementResponse struct {
// Indicates the X number of protection management tokens that have been applied to the bucket in its lifetime.
TokenAppliedCounter *string `json:"token_applied_counter,omitempty"`

// The 'protection management token list' holding a recent list of applied tokens. This list may contain a subset of
// all tokens applied to the bucket, as indicated by the counter.
TokenEntries []ProtectionManagementResponseTokenEntry `json:"token_entries,omitempty"`
}

// UnmarshalProtectionManagementResponse unmarshals an instance of ProtectionManagementResponse from the specified map of raw messages.
func UnmarshalProtectionManagementResponse(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(ProtectionManagementResponse)
err = core.UnmarshalPrimitive(m, "token_applied_counter", &obj.TokenAppliedCounter)
if err != nil {
return
}
err = core.UnmarshalModel(m, "token_entries", &obj.TokenEntries, UnmarshalProtectionManagementResponseTokenEntry)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}

// ProtectionManagementResponseTokenEntry : Data structure holding protection management token.
type ProtectionManagementResponseTokenEntry struct {
TokenID *string `json:"token_id,omitempty"`

TokenExpirationTime *string `json:"token_expiration_time,omitempty"`

TokenReferenceID *string `json:"token_reference_id,omitempty"`

AppliedTime *string `json:"applied_time,omitempty"`

InvalidatedTime *string `json:"invalidated_time,omitempty"`

ExpirationTime *string `json:"expiration_time,omitempty"`

ShortenRetentionFlag *bool `json:"shorten_retention_flag,omitempty"`
}

// UnmarshalProtectionManagementResponseTokenEntry unmarshals an instance of ProtectionManagementResponseTokenEntry from the specified map of raw messages.
func UnmarshalProtectionManagementResponseTokenEntry(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(ProtectionManagementResponseTokenEntry)
err = core.UnmarshalPrimitive(m, "token_id", &obj.TokenID)
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "token_expiration_time", &obj.TokenExpirationTime)
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "token_reference_id", &obj.TokenReferenceID)
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "applied_time", &obj.AppliedTime)
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "invalidated_time", &obj.InvalidatedTime)
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "expiration_time", &obj.ExpirationTime)
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "shorten_retention_flag", &obj.ShortenRetentionFlag)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}

// UpdateBucketConfigOptions : The UpdateBucketConfig options.
type UpdateBucketConfigOptions struct {
// Name of a bucket.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2022.
* (C) Copyright IBM Corp. 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
18 changes: 15 additions & 3 deletions v2/resourceconfigurationv1/resource_configuration_v1_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2022.
* (C) Copyright IBM Corp. 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -225,7 +225,7 @@ var _ = Describe(`ResourceConfigurationV1`, func() {
// Set mock response
res.Header().Set("Content-type", "application/json")
res.WriteHeader(200)
fmt.Fprintf(res, "%s", `{"name": "my-new-bucket", "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/3bf0d9003abfb5d29761c3e97696b71c:xxxxxxx-6c4f-4a62-a165-696756d63903:bucket:my-new-bucket", "service_instance_id": "d6f04d83-6c4f-4a62-a165-696756d63903", "service_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/3bf0d9003abfb5d29761c3e97696b71c:xxxxxxx-6c4f-4a62-a165-696756d63903::", "time_created": "2018-03-26T16:23:36.980Z", "time_updated": "2018-10-17T19:29:10.117Z", "object_count": 764265234, "bytes_used": 28198745752445145, "noncurrent_object_count": 764265234, "noncurrent_bytes_used": 844239234, "delete_marker_count": 827201, "firewall": {"allowed_ip": ["AllowedIp"], "denied_ip": ["DeniedIp"], "allowed_network_type": ["public"]}, "activity_tracking": {"read_data_events": false, "write_data_events": false, "activity_tracker_crn": "ActivityTrackerCrn"}, "metrics_monitoring": {"usage_metrics_enabled": false, "request_metrics_enabled": false, "metrics_monitoring_crn": "MetricsMonitoringCrn"}, "hard_quota": 28198745752445146}`)
fmt.Fprintf(res, "%s", `{"name": "my-new-bucket", "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/3bf0d9003abfb5d29761c3e97696b71c:xxxxxxx-6c4f-4a62-a165-696756d63903:bucket:my-new-bucket", "service_instance_id": "d6f04d83-6c4f-4a62-a165-696756d63903", "service_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/3bf0d9003abfb5d29761c3e97696b71c:xxxxxxx-6c4f-4a62-a165-696756d63903::", "time_created": "2018-03-26T16:23:36.980Z", "time_updated": "2018-10-17T19:29:10.117Z", "object_count": 764265234, "bytes_used": 28198745752445145, "noncurrent_object_count": 764265234, "noncurrent_bytes_used": 844239234, "delete_marker_count": 827201, "firewall": {"allowed_ip": ["AllowedIp"], "denied_ip": ["DeniedIp"], "allowed_network_type": ["public"]}, "activity_tracking": {"read_data_events": false, "write_data_events": false, "activity_tracker_crn": "ActivityTrackerCrn"}, "metrics_monitoring": {"usage_metrics_enabled": false, "request_metrics_enabled": false, "metrics_monitoring_crn": "MetricsMonitoringCrn"}, "hard_quota": 28198745752445146, "protection_management": {"token_applied_counter": "TokenAppliedCounter", "token_entries": [{"token_id": "TokenID", "token_expiration_time": "TokenExpirationTime", "token_reference_id": "TokenReferenceID", "applied_time": "AppliedTime", "invalidated_time": "InvalidatedTime", "expiration_time": "ExpirationTime", "shorten_retention_flag": true}]}}`)
}))
})
It(`Invoke GetBucketConfig successfully with retries`, func() {
Expand Down Expand Up @@ -279,7 +279,7 @@ var _ = Describe(`ResourceConfigurationV1`, func() {
// Set mock response
res.Header().Set("Content-type", "application/json")
res.WriteHeader(200)
fmt.Fprintf(res, "%s", `{"name": "my-new-bucket", "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/3bf0d9003abfb5d29761c3e97696b71c:xxxxxxx-6c4f-4a62-a165-696756d63903:bucket:my-new-bucket", "service_instance_id": "d6f04d83-6c4f-4a62-a165-696756d63903", "service_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/3bf0d9003abfb5d29761c3e97696b71c:xxxxxxx-6c4f-4a62-a165-696756d63903::", "time_created": "2018-03-26T16:23:36.980Z", "time_updated": "2018-10-17T19:29:10.117Z", "object_count": 764265234, "bytes_used": 28198745752445145, "noncurrent_object_count": 764265234, "noncurrent_bytes_used": 844239234, "delete_marker_count": 827201, "firewall": {"allowed_ip": ["AllowedIp"], "denied_ip": ["DeniedIp"], "allowed_network_type": ["public"]}, "activity_tracking": {"read_data_events": false, "write_data_events": false, "activity_tracker_crn": "ActivityTrackerCrn"}, "metrics_monitoring": {"usage_metrics_enabled": false, "request_metrics_enabled": false, "metrics_monitoring_crn": "MetricsMonitoringCrn"}, "hard_quota": 28198745752445146}`)
fmt.Fprintf(res, "%s", `{"name": "my-new-bucket", "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/3bf0d9003abfb5d29761c3e97696b71c:xxxxxxx-6c4f-4a62-a165-696756d63903:bucket:my-new-bucket", "service_instance_id": "d6f04d83-6c4f-4a62-a165-696756d63903", "service_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/3bf0d9003abfb5d29761c3e97696b71c:xxxxxxx-6c4f-4a62-a165-696756d63903::", "time_created": "2018-03-26T16:23:36.980Z", "time_updated": "2018-10-17T19:29:10.117Z", "object_count": 764265234, "bytes_used": 28198745752445145, "noncurrent_object_count": 764265234, "noncurrent_bytes_used": 844239234, "delete_marker_count": 827201, "firewall": {"allowed_ip": ["AllowedIp"], "denied_ip": ["DeniedIp"], "allowed_network_type": ["public"]}, "activity_tracking": {"read_data_events": false, "write_data_events": false, "activity_tracker_crn": "ActivityTrackerCrn"}, "metrics_monitoring": {"usage_metrics_enabled": false, "request_metrics_enabled": false, "metrics_monitoring_crn": "MetricsMonitoringCrn"}, "hard_quota": 28198745752445146, "protection_management": {"token_applied_counter": "TokenAppliedCounter", "token_entries": [{"token_id": "TokenID", "token_expiration_time": "TokenExpirationTime", "token_reference_id": "TokenReferenceID", "applied_time": "AppliedTime", "invalidated_time": "InvalidatedTime", "expiration_time": "ExpirationTime", "shorten_retention_flag": true}]}}`)
}))
})
It(`Invoke GetBucketConfig successfully`, func() {
Expand Down Expand Up @@ -438,12 +438,18 @@ var _ = Describe(`ResourceConfigurationV1`, func() {
metricsMonitoringModel.RequestMetricsEnabled = core.BoolPtr(false)
metricsMonitoringModel.MetricsMonitoringCrn = core.StringPtr("testString")

// Construct an instance of the ProtectionManagement model
protectionManagementModel := new(resourceconfigurationv1.ProtectionManagement)
protectionManagementModel.RequestedState = core.StringPtr("activate")
protectionManagementModel.ProtectionManagementToken = core.StringPtr("testString")

// Construct an instance of the BucketPatch model
bucketPatchModel := new(resourceconfigurationv1.BucketPatch)
bucketPatchModel.Firewall = firewallModel
bucketPatchModel.ActivityTracking = activityTrackingModel
bucketPatchModel.MetricsMonitoring = metricsMonitoringModel
bucketPatchModel.HardQuota = core.Int64Ptr(int64(28198745752445146))
bucketPatchModel.ProtectionManagement = protectionManagementModel
bucketPatchModelAsPatch, asPatchErr := bucketPatchModel.AsPatch()
Expect(asPatchErr).To(BeNil())

Expand Down Expand Up @@ -485,12 +491,18 @@ var _ = Describe(`ResourceConfigurationV1`, func() {
metricsMonitoringModel.RequestMetricsEnabled = core.BoolPtr(false)
metricsMonitoringModel.MetricsMonitoringCrn = core.StringPtr("testString")

// Construct an instance of the ProtectionManagement model
protectionManagementModel := new(resourceconfigurationv1.ProtectionManagement)
protectionManagementModel.RequestedState = core.StringPtr("activate")
protectionManagementModel.ProtectionManagementToken = core.StringPtr("testString")

// Construct an instance of the BucketPatch model
bucketPatchModel := new(resourceconfigurationv1.BucketPatch)
bucketPatchModel.Firewall = firewallModel
bucketPatchModel.ActivityTracking = activityTrackingModel
bucketPatchModel.MetricsMonitoring = metricsMonitoringModel
bucketPatchModel.HardQuota = core.Int64Ptr(int64(28198745752445146))
bucketPatchModel.ProtectionManagement = protectionManagementModel
bucketPatchModelAsPatch, asPatchErr := bucketPatchModel.AsPatch()
Expect(asPatchErr).To(BeNil())

Expand Down

0 comments on commit 0a426fb

Please sign in to comment.