Skip to content

Commit f39b58b

Browse files
committed
Accept integers for Widget.Params.Count and .Start
1 parent 935d100 commit f39b58b

File tree

4 files changed

+43
-10
lines changed

4 files changed

+43
-10
lines changed

datadog-accessors.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5873,7 +5873,7 @@ func (o *Options) SetTimeoutH(v int) {
58735873
}
58745874

58755875
// GetCount returns the Count field if non-nil, zero value otherwise.
5876-
func (p *Params) GetCount() string {
5876+
func (p *Params) GetCount() StrintD {
58775877
if p == nil || p.Count == nil {
58785878
return ""
58795879
}
@@ -5882,7 +5882,7 @@ func (p *Params) GetCount() string {
58825882

58835883
// GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise
58845884
// and a boolean to check if the value has been set.
5885-
func (p *Params) GetCountOk() (string, bool) {
5885+
func (p *Params) GetCountOk() (StrintD, bool) {
58865886
if p == nil || p.Count == nil {
58875887
return "", false
58885888
}
@@ -5899,7 +5899,7 @@ func (p *Params) HasCount() bool {
58995899
}
59005900

59015901
// SetCount allocates a new p.Count and returns the pointer to it.
5902-
func (p *Params) SetCount(v string) {
5902+
func (p *Params) SetCount(v StrintD) {
59035903
p.Count = &v
59045904
}
59055905

@@ -5935,7 +5935,7 @@ func (p *Params) SetSort(v string) {
59355935
}
59365936

59375937
// GetStart returns the Start field if non-nil, zero value otherwise.
5938-
func (p *Params) GetStart() string {
5938+
func (p *Params) GetStart() StrintD {
59395939
if p == nil || p.Start == nil {
59405940
return ""
59415941
}
@@ -5944,7 +5944,7 @@ func (p *Params) GetStart() string {
59445944

59455945
// GetStartOk returns a tuple with the Start field if it's non-nil, zero value otherwise
59465946
// and a boolean to check if the value has been set.
5947-
func (p *Params) GetStartOk() (string, bool) {
5947+
func (p *Params) GetStartOk() (StrintD, bool) {
59485948
if p == nil || p.Start == nil {
59495949
return "", false
59505950
}
@@ -5961,7 +5961,7 @@ func (p *Params) HasStart() bool {
59615961
}
59625962

59635963
// SetStart allocates a new p.Start and returns the pointer to it.
5964-
func (p *Params) SetStart(v string) {
5964+
func (p *Params) SetStart(v StrintD) {
59655965
p.Start = &v
59665966
}
59675967

screen_widgets.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ type Widget struct {
187187
}
188188

189189
type Params struct {
190-
Sort *string `json:"sort,omitempty"`
191-
Text *string `json:"text,omitempty"`
192-
Count *string `json:"count,omitempty"`
193-
Start *string `json:"start,omitempty"`
190+
Sort *string `json:"sort,omitempty"`
191+
Text *string `json:"text,omitempty"`
192+
Count *StrintD `json:"count,omitempty"`
193+
Start *StrintD `json:"start,omitempty"`
194194
}
195195

196196
type Rule struct {

screenboards_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,24 @@ func TestGetScreenboard(t *testing.T) {
5757
ReadOnly: Bool(false),
5858
},
5959
},
60+
{
61+
file: "screenboard_response_manage_status",
62+
want: &Screenboard{
63+
Id: Int(6336),
64+
Title: String("dogapi manage_status test"),
65+
Widgets: []Widget{
66+
{
67+
Type: String("manage_status"),
68+
Params: &Params{
69+
Sort: String("status,asc"),
70+
Text: String(`scope:"priority:important" muted:false`),
71+
Count: Strint("50"),
72+
Start: Strint("0"),
73+
},
74+
},
75+
},
76+
},
77+
},
6078
}
6179
for _, tt := range tests {
6280
t.Run(tt.file, func(t *testing.T) {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"board_title": "dogapi manage_status test",
3+
"id": 6336,
4+
"widgets": [
5+
{
6+
"params": {
7+
"sort": "status,asc",
8+
"text": "scope:\"priority:important\" muted:false",
9+
"count": 50,
10+
"start": 0
11+
},
12+
"type": "manage_status"
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)