Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/).

## 0.43.0 (11th November 2025)

### Added:
* Added `PersistentStorageEncryptionType` and `DeletionGracePeriod` fields to `Subscription` model for customer-managed key support

## 0.42.0 (10th November 2025)

### Added:
Expand Down
2 changes: 2 additions & 0 deletions service/subscriptions/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ type Subscription struct {
StorageEncryption *bool `json:"storageEncryption,omitempty"`
NumberOfDatabases *int `json:"numberOfDatabases,omitempty"`
CloudDetails []*CloudDetail `json:"cloudDetails,omitempty"`
PersistentStorageEncryptionType *string `json:"persistentStorageEncryptionType,omitempty"`
DeletionGracePeriod *string `json:"deletionGracePeriod,omitempty"`
CustomerManagedKeyAccessDetails *CustomerManagedKeyAccessDetails `json:"customerManagedKeyAccessDetails,omitempty"`
PublicEndpointAccess *bool `json:"publicEndpointAccess,omitempty"`
}
Expand Down
26 changes: 16 additions & 10 deletions subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,9 @@ func TestSubscription_Get(t *testing.T) {
}, actual)
}

func TestSubscription_Get_PublicEndpointAccess(t *testing.T) {
// TestSubscription_Get_OptionalFields tests that optional fields like publicEndpointAccess,
// persistentStorageEncryptionType, and deletionGracePeriod are properly unmarshaled from the API response
func TestSubscription_Get_OptionalFields(t *testing.T) {
s := httptest.NewServer(testServer("apiKey", "secret", getRequest(t, "/subscriptions/98766", `{
"id": 2,
"name": "Get-test-public-endpoint",
Expand All @@ -657,6 +659,8 @@ func TestSubscription_Get_PublicEndpointAccess(t *testing.T) {
"memoryStorage": "ram",
"storageEncryption": false,
"publicEndpointAccess": false,
"persistentStorageEncryptionType": "customer-managed-key",
"deletionGracePeriod": "15-minutes",
"numberOfDatabases": 1,
"cloudDetails": [
{
Expand Down Expand Up @@ -696,15 +700,17 @@ func TestSubscription_Get_PublicEndpointAccess(t *testing.T) {
require.NoError(t, err)

assert.Equal(t, &subscriptions.Subscription{
ID: redis.Int(2),
Name: redis.String("Get-test-public-endpoint"),
Status: redis.String("active"),
PaymentMethod: redis.String("credit-card"),
PaymentMethodID: redis.Int(2),
MemoryStorage: redis.String("ram"),
StorageEncryption: redis.Bool(false),
PublicEndpointAccess: redis.Bool(false),
NumberOfDatabases: redis.Int(1),
ID: redis.Int(2),
Name: redis.String("Get-test-public-endpoint"),
Status: redis.String("active"),
PaymentMethod: redis.String("credit-card"),
PaymentMethodID: redis.Int(2),
MemoryStorage: redis.String("ram"),
StorageEncryption: redis.Bool(false),
PublicEndpointAccess: redis.Bool(false),
PersistentStorageEncryptionType: redis.String("customer-managed-key"),
DeletionGracePeriod: redis.String("15-minutes"),
NumberOfDatabases: redis.Int(1),
CloudDetails: []*subscriptions.CloudDetail{
{
Provider: redis.String("AWS"),
Expand Down