Skip to content

Commit

Permalink
Implemented feedback from @xvello
Browse files Browse the repository at this point in the history
  • Loading branch information
sendqueery committed Jan 6, 2020
1 parent eebaff0 commit eb7fef4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
33 changes: 32 additions & 1 deletion datadog-accessors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Please see the included LICENSE file for licensing information.
*
* Copyright 2019 by authors and contributors.
* Copyright 2020 by authors and contributors.
*/

package datadog
Expand Down Expand Up @@ -15173,6 +15173,37 @@ func (q *QueryTableRequest) SetProcessQuery(v WidgetProcessQuery) {
q.ProcessQuery = &v
}

// GetOffset returns the Offset field if non-nil, zero value otherwise.
func (q *QueryTime) GetOffset() int {
if q == nil || q.Offset == nil {
return 0
}
return *q.Offset
}

// GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (q *QueryTime) GetOffsetOk() (int, bool) {
if q == nil || q.Offset == nil {
return 0, false
}
return *q.Offset, true
}

// HasOffset returns a boolean if a field has been set.
func (q *QueryTime) HasOffset() bool {
if q != nil && q.Offset != nil {
return true
}

return false
}

// SetOffset allocates a new q.Offset and returns the pointer to it.
func (q *QueryTime) SetOffset(v int) {
q.Offset = &v
}

// GetTimeFrom returns the TimeFrom field if non-nil, zero value otherwise.
func (q *QueryTime) GetTimeFrom() string {
if q == nil || q.TimeFrom == nil {
Expand Down
3 changes: 2 additions & 1 deletion log_lists.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type QueryTime struct {
TimeFrom *string `json:"from"`
TimeTo *string `json:"to"`
TimeZone *string `json:"timezone,omitempty"`
Offset *int `json:"offset,omitempty"`
}

// LogsList represents the base API response returned by the list API
Expand Down Expand Up @@ -74,7 +75,7 @@ func (client *Client) GetLogsListPages(logsRequest *LogsListRequest) (logs []Log

response, err := client.GetLogsList(logsRequest)
if err != nil {
return response.Logs, err
return nil, err
}

logs = append(logs, response.Logs...)
Expand Down
2 changes: 2 additions & 0 deletions log_lists_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ func TestGetLogsListPages(t *testing.T) {
assert.Nil(err)
w.Write(response)
} else {
assert.Equal(*responseBody.StartAt, "BBBBBWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA")

response, err := ioutil.ReadFile("./tests/fixtures/logs/loglist_page_response.json")

assert.Nil(err)
Expand Down

0 comments on commit eb7fef4

Please sign in to comment.