diff --git a/CHANGELOG.md b/CHANGELOG.md index d232a27..280bee1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.12.0 (Jul 19th, 2024) + +FEATURES: + +* Adds support for new split monitoring permissions create_jobs, update_jobs and delete_jobs + ## 2.11.0 (May 23rd, 2024) FEATURES: diff --git a/rest/account_apikey_test.go b/rest/account_apikey_test.go index 386a3bf..a636f8e 100644 --- a/rest/account_apikey_test.go +++ b/rest/account_apikey_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gopkg.in/ns1/ns1-go.v2/rest/model/account" ) @@ -22,6 +23,10 @@ func TestCreateAPIKey(t *testing.T) { assert.Nil(t, k.Permissions.Security) assert.Nil(t, k.Permissions.DHCP) assert.Nil(t, k.Permissions.IPAM) + assert.False(t, k.Permissions.Monitoring.ManageJobs) + assert.False(t, k.Permissions.Monitoring.CreateJobs) + assert.False(t, k.Permissions.Monitoring.UpdateJobs) + assert.False(t, k.Permissions.Monitoring.DeleteJobs) _, err = w.Write(b) require.NoError(t, err) diff --git a/rest/account_team_test.go b/rest/account_team_test.go index 306b83a..1dfad94 100644 --- a/rest/account_team_test.go +++ b/rest/account_team_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gopkg.in/ns1/ns1-go.v2/rest/model/account" ) @@ -22,6 +23,10 @@ func TestCreateTeam(t *testing.T) { assert.Nil(t, tm.Permissions.Security) assert.Nil(t, tm.Permissions.DHCP) assert.Nil(t, tm.Permissions.IPAM) + assert.False(t, tm.Permissions.Monitoring.ManageJobs) + assert.False(t, tm.Permissions.Monitoring.CreateJobs) + assert.False(t, tm.Permissions.Monitoring.UpdateJobs) + assert.False(t, tm.Permissions.Monitoring.DeleteJobs) w.Write(b) })) diff --git a/rest/account_user_test.go b/rest/account_user_test.go index e6590de..7299122 100644 --- a/rest/account_user_test.go +++ b/rest/account_user_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gopkg.in/ns1/ns1-go.v2/rest/model/account" ) @@ -22,6 +23,10 @@ func TestCreateUser(t *testing.T) { assert.Nil(t, u.Permissions.Security) assert.Nil(t, u.Permissions.DHCP) assert.Nil(t, u.Permissions.IPAM) + assert.False(t, u.Permissions.Monitoring.ManageJobs) + assert.False(t, u.Permissions.Monitoring.CreateJobs) + assert.False(t, u.Permissions.Monitoring.UpdateJobs) + assert.False(t, u.Permissions.Monitoring.DeleteJobs) w.Write(b) })) diff --git a/rest/client.go b/rest/client.go index 0edf123..7757f11 100644 --- a/rest/client.go +++ b/rest/client.go @@ -13,7 +13,7 @@ import ( ) const ( - clientVersion = "2.11.0" + clientVersion = "2.12.0" defaultEndpoint = "https://api.nsone.net/v1/" defaultShouldFollowPagination = true diff --git a/rest/model/account/permissions.go b/rest/model/account/permissions.go index e43935b..55982f2 100644 --- a/rest/model/account/permissions.go +++ b/rest/model/account/permissions.go @@ -58,6 +58,9 @@ type PermissionsMonitoring struct { ManageLists bool `json:"manage_lists"` ManageJobs bool `json:"manage_jobs"` ViewJobs bool `json:"view_jobs"` + CreateJobs bool `json:"create_jobs"` + UpdateJobs bool `json:"update_jobs"` + DeleteJobs bool `json:"delete_jobs"` } // PermissionsDHCP wraps a User's "permissions.dhcp" attribute for DDI. diff --git a/rest/model/account/user_test.go b/rest/model/account/user_test.go index cfd8c0c..d64ad0b 100644 --- a/rest/model/account/user_test.go +++ b/rest/model/account/user_test.go @@ -142,6 +142,9 @@ func TestUnmarshalUsers(t *testing.T) { ManageLists: false, ManageJobs: false, ViewJobs: false, + CreateJobs: false, + UpdateJobs: false, + DeleteJobs: false, }, }, },