@@ -647,7 +647,9 @@ func TestSubscription_Get(t *testing.T) {
647647 }, actual )
648648}
649649
650- func TestSubscription_Get_PublicEndpointAccess (t * testing.T ) {
650+ // TestSubscription_Get_OptionalFields tests that optional fields like publicEndpointAccess,
651+ // persistentStorageEncryptionType, and deletionGracePeriod are properly unmarshaled from the API response
652+ func TestSubscription_Get_OptionalFields (t * testing.T ) {
651653 s := httptest .NewServer (testServer ("apiKey" , "secret" , getRequest (t , "/subscriptions/98766" , `{
652654 "id": 2,
653655 "name": "Get-test-public-endpoint",
@@ -657,6 +659,8 @@ func TestSubscription_Get_PublicEndpointAccess(t *testing.T) {
657659 "memoryStorage": "ram",
658660 "storageEncryption": false,
659661 "publicEndpointAccess": false,
662+ "persistentStorageEncryptionType": "customer-managed-key",
663+ "deletionGracePeriod": "15-minutes",
660664 "numberOfDatabases": 1,
661665 "cloudDetails": [
662666 {
@@ -696,15 +700,17 @@ func TestSubscription_Get_PublicEndpointAccess(t *testing.T) {
696700 require .NoError (t , err )
697701
698702 assert .Equal (t , & subscriptions.Subscription {
699- ID : redis .Int (2 ),
700- Name : redis .String ("Get-test-public-endpoint" ),
701- Status : redis .String ("active" ),
702- PaymentMethod : redis .String ("credit-card" ),
703- PaymentMethodID : redis .Int (2 ),
704- MemoryStorage : redis .String ("ram" ),
705- StorageEncryption : redis .Bool (false ),
706- PublicEndpointAccess : redis .Bool (false ),
707- NumberOfDatabases : redis .Int (1 ),
703+ ID : redis .Int (2 ),
704+ Name : redis .String ("Get-test-public-endpoint" ),
705+ Status : redis .String ("active" ),
706+ PaymentMethod : redis .String ("credit-card" ),
707+ PaymentMethodID : redis .Int (2 ),
708+ MemoryStorage : redis .String ("ram" ),
709+ StorageEncryption : redis .Bool (false ),
710+ PublicEndpointAccess : redis .Bool (false ),
711+ PersistentStorageEncryptionType : redis .String ("customer-managed-key" ),
712+ DeletionGracePeriod : redis .String ("15-minutes" ),
713+ NumberOfDatabases : redis .Int (1 ),
708714 CloudDetails : []* subscriptions.CloudDetail {
709715 {
710716 Provider : redis .String ("AWS" ),
0 commit comments