From 9505939f897df1097a85c9117011d277e1d23f84 Mon Sep 17 00:00:00 2001 From: Marco Suma Date: Wed, 22 Nov 2023 15:38:44 +0100 Subject: [PATCH] feat: adds fields to backup_compliance_policy. (#523) --- mongodbatlas/backup_compliance_policy.go | 2 ++ mongodbatlas/backup_compliance_policy_test.go | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/mongodbatlas/backup_compliance_policy.go b/mongodbatlas/backup_compliance_policy.go index 2cde32a31..255d0c098 100644 --- a/mongodbatlas/backup_compliance_policy.go +++ b/mongodbatlas/backup_compliance_policy.go @@ -42,6 +42,8 @@ var _ BackupCompliancePolicyService = &BackupCompliancePolicyServiceOp{} // BackupCompliancePolicy represents a backup compiance policy. type BackupCompliancePolicy struct { AuthorizedEmail string `json:"authorizedEmail,omitempty"` + AuthorizedUserFirstName string `json:"authorizedUserFirstName,omitempty"` + AuthorizedUserLastName string `json:"authorizedUserLastName,omitempty"` CopyProtectionEnabled *bool `json:"copyProtectionEnabled,omitempty"` EncryptionAtRestEnabled *bool `json:"encryptionAtRestEnabled,omitempty"` OnDemandPolicyItem PolicyItem `json:"onDemandPolicyItem,omitempty"` diff --git a/mongodbatlas/backup_compliance_policy_test.go b/mongodbatlas/backup_compliance_policy_test.go index 60893bbf9..c31c8296b 100644 --- a/mongodbatlas/backup_compliance_policy_test.go +++ b/mongodbatlas/backup_compliance_policy_test.go @@ -33,6 +33,8 @@ func TestBackupCompliancePolicy_Get(t *testing.T) { testMethod(t, r, http.MethodGet) fmt.Fprint(w, `{ "authorizedEmail": "user@example.com", + "authorizedUserFirstName": "first", + "authorizedUserLastName": "last", "copyProtectionEnabled": false, "encryptionAtRestEnabled": false, "onDemandPolicyItem": @@ -76,6 +78,8 @@ func TestBackupCompliancePolicy_Get(t *testing.T) { expected := &BackupCompliancePolicy{ AuthorizedEmail: "user@example.com", + AuthorizedUserFirstName: "first", + AuthorizedUserLastName: "last", CopyProtectionEnabled: pointer(false), EncryptionAtRestEnabled: pointer(false), ProjectID: "32b6e34b3d91647abb20e7b8", @@ -125,6 +129,8 @@ func TestBackupCompliancePolicy_Update(t *testing.T) { mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) { expected := map[string]interface{}{ "authorizedEmail": "user@example.com", + "authorizedUserFirstName": "first", + "authorizedUserLastName": "last", "copyProtectionEnabled": false, "encryptionAtRestEnabled": false, "updatedDate": "2019-08-24T14:15:22Z", @@ -170,6 +176,8 @@ func TestBackupCompliancePolicy_Update(t *testing.T) { fmt.Fprint(w, `{ "authorizedEmail": "user@example.com", + "authorizedUserFirstName": "first", + "authorizedUserLastName": "last", "copyProtectionEnabled": false, "encryptionAtRestEnabled": false, "onDemandPolicyItem": @@ -208,6 +216,8 @@ func TestBackupCompliancePolicy_Update(t *testing.T) { updateRequest := &BackupCompliancePolicy{ AuthorizedEmail: "user@example.com", + AuthorizedUserFirstName: "first", + AuthorizedUserLastName: "last", CopyProtectionEnabled: pointer(false), EncryptionAtRestEnabled: pointer(false), ProjectID: "32b6e34b3d91647abb20e7b8", @@ -248,6 +258,8 @@ func TestBackupCompliancePolicy_Update(t *testing.T) { expected := &BackupCompliancePolicy{ AuthorizedEmail: "user@example.com", + AuthorizedUserFirstName: "first", + AuthorizedUserLastName: "last", CopyProtectionEnabled: pointer(false), EncryptionAtRestEnabled: pointer(false), ProjectID: "32b6e34b3d91647abb20e7b8",