Skip to content

Commit

Permalink
make id optional
Browse files Browse the repository at this point in the history
  • Loading branch information
elenabushneva committed Dec 2, 2020
1 parent 4f470c6 commit 696e1f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rest/model/dhcp/scopegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type PingCheckConf struct {

// ScopeGroup wraps an NS1 /dhcp/scopegroup resource.
type ScopeGroup struct {
ID int `json:"id,omitempty"`
ID *int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
IDDHCPService *int `json:"dhcp_service_id,omitempty"`
DHCP4 SettingsV4 `json:"dhcpv4,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion rest/scopegroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ func TestDHCPScopeGroup(t *testing.T) {
defer mock.ClearTestCases()

enabled := true
id := 1
validSecs := 123
sg := &dhcp.ScopeGroup{
ID: 1,
ID: &id,
Name: "a",
DHCP4: dhcp.SettingsV4{
Settings: dhcp.Settings{
Expand Down

0 comments on commit 696e1f3

Please sign in to comment.