Skip to content

Commit 77290cf

Browse files
authored
feat: added withDefaultAlertsSettings to Project struct (#265)
1 parent 7c40b35 commit 77290cf

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

mongodbatlas/projects.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,17 @@ var _ ProjectsService = &ProjectsServiceOp{}
6363

6464
// Project represents the structure of a project.
6565
type Project struct {
66-
ID string `json:"id,omitempty"`
67-
OrgID string `json:"orgId,omitempty"`
68-
Name string `json:"name,omitempty"`
69-
ClusterCount int `json:"clusterCount,omitempty"`
70-
Created string `json:"created,omitempty"`
71-
RegionUsageRestrictions string `json:"regionUsageRestrictions,omitempty"` // RegionUsageRestrictions for cloud.mongodbgov.com, valid values are GOV_REGIONS_ONLY, COMMERCIAL_FEDRAMP_REGIONS_ONLY, NONE
72-
Links []*Link `json:"links,omitempty"`
66+
ID string `json:"id,omitempty"`
67+
OrgID string `json:"orgId,omitempty"`
68+
Name string `json:"name,omitempty"`
69+
ClusterCount int `json:"clusterCount,omitempty"`
70+
Created string `json:"created,omitempty"`
71+
RegionUsageRestrictions string `json:"regionUsageRestrictions,omitempty"` // RegionUsageRestrictions for cloud.mongodbgov.com, valid values are GOV_REGIONS_ONLY, COMMERCIAL_FEDRAMP_REGIONS_ONLY, NONE
72+
Links []*Link `json:"links,omitempty"`
73+
WithDefaultAlertsSettings *bool `json:"withDefaultAlertsSettings,omitempty"`
7374
}
7475

75-
// Projects represents a array of project.
76+
// Projects represents an array of project.
7677
type Projects struct {
7778
Links []*Link `json:"links"`
7879
Results []*Project `json:"results"`
@@ -86,7 +87,7 @@ type Result struct {
8687
TeamID string `json:"teamId"`
8788
}
8889

89-
// ProjectTeam reperesents the kind of role that has the team.
90+
// ProjectTeam represents the kind of role that has the team.
9091
type ProjectTeam struct {
9192
TeamID string `json:"teamId,omitempty"`
9293
RoleNames []string `json:"roleNames,omitempty"`

mongodbatlas/projects_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"testing"
2121

2222
"github.com/go-test/deep"
23+
"github.com/openlyinc/pointy"
2324
)
2425

2526
func TestProject_GetAllProjects(t *testing.T) {
@@ -215,7 +216,8 @@ func TestProject_Create(t *testing.T) {
215216
"rel": "self"
216217
}],
217218
"name": "ProjectFoobar",
218-
"orgId": "5a0a1e7e0f2912c554080adc"
219+
"orgId": "5a0a1e7e0f2912c554080adc",
220+
"withDefaultAlertsSettings": true
219221
}`)
220222
})
221223

@@ -236,8 +238,9 @@ func TestProject_Create(t *testing.T) {
236238
Rel: "self",
237239
},
238240
},
239-
Name: "ProjectFoobar",
240-
OrgID: "5a0a1e7e0f2912c554080adc",
241+
Name: "ProjectFoobar",
242+
OrgID: "5a0a1e7e0f2912c554080adc",
243+
WithDefaultAlertsSettings: pointy.Bool(true),
241244
}
242245

243246
if diff := deep.Equal(project, expected); diff != nil {

0 commit comments

Comments
 (0)