Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds fields to backup_compliance_policy. #523

Merged
merged 1 commit into from
Nov 22, 2023
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
2 changes: 2 additions & 0 deletions mongodbatlas/backup_compliance_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
12 changes: 12 additions & 0 deletions mongodbatlas/backup_compliance_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ func TestBackupCompliancePolicy_Get(t *testing.T) {
testMethod(t, r, http.MethodGet)
fmt.Fprint(w, `{
"authorizedEmail": "[email protected]",
"authorizedUserFirstName": "first",
"authorizedUserLastName": "last",
"copyProtectionEnabled": false,
"encryptionAtRestEnabled": false,
"onDemandPolicyItem":
Expand Down Expand Up @@ -76,6 +78,8 @@ func TestBackupCompliancePolicy_Get(t *testing.T) {

expected := &BackupCompliancePolicy{
AuthorizedEmail: "[email protected]",
AuthorizedUserFirstName: "first",
AuthorizedUserLastName: "last",
CopyProtectionEnabled: pointer(false),
EncryptionAtRestEnabled: pointer(false),
ProjectID: "32b6e34b3d91647abb20e7b8",
Expand Down Expand Up @@ -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": "[email protected]",
"authorizedUserFirstName": "first",
"authorizedUserLastName": "last",
"copyProtectionEnabled": false,
"encryptionAtRestEnabled": false,
"updatedDate": "2019-08-24T14:15:22Z",
Expand Down Expand Up @@ -170,6 +176,8 @@ func TestBackupCompliancePolicy_Update(t *testing.T) {

fmt.Fprint(w, `{
"authorizedEmail": "[email protected]",
"authorizedUserFirstName": "first",
"authorizedUserLastName": "last",
"copyProtectionEnabled": false,
"encryptionAtRestEnabled": false,
"onDemandPolicyItem":
Expand Down Expand Up @@ -208,6 +216,8 @@ func TestBackupCompliancePolicy_Update(t *testing.T) {

updateRequest := &BackupCompliancePolicy{
AuthorizedEmail: "[email protected]",
AuthorizedUserFirstName: "first",
AuthorizedUserLastName: "last",
CopyProtectionEnabled: pointer(false),
EncryptionAtRestEnabled: pointer(false),
ProjectID: "32b6e34b3d91647abb20e7b8",
Expand Down Expand Up @@ -248,6 +258,8 @@ func TestBackupCompliancePolicy_Update(t *testing.T) {

expected := &BackupCompliancePolicy{
AuthorizedEmail: "[email protected]",
AuthorizedUserFirstName: "first",
AuthorizedUserLastName: "last",
CopyProtectionEnabled: pointer(false),
EncryptionAtRestEnabled: pointer(false),
ProjectID: "32b6e34b3d91647abb20e7b8",
Expand Down