Skip to content

Commit fda60c1

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 335acc5 of spec repo
1 parent 06c10e9 commit fda60c1

4 files changed

Lines changed: 447 additions & 1 deletion

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,10 @@ components:
14431443
format: date-time
14441444
readOnly: true
14451445
type: string
1446+
default_timeframe:
1447+
allOf:
1448+
- $ref: "#/components/schemas/DashboardDefaultTimeframe"
1449+
description: The default timeframe applied when opening the dashboard. Set to `null` to clear the dashboard's default timeframe.
14461450
description:
14471451
description: Description of the dashboard.
14481452
nullable: true
@@ -1557,6 +1561,39 @@ components:
15571561
required:
15581562
- data
15591563
type: object
1564+
DashboardDefaultTimeframe:
1565+
description: The default timeframe applied when opening the dashboard.
1566+
nullable: true
1567+
properties:
1568+
from:
1569+
description: Start time in milliseconds since epoch. Required when `type` is `fixed`.
1570+
format: int64
1571+
type: integer
1572+
to:
1573+
description: End time in milliseconds since epoch. Required when `type` is `fixed`.
1574+
format: int64
1575+
type: integer
1576+
type:
1577+
$ref: "#/components/schemas/DashboardDefaultTimeframeType"
1578+
unit:
1579+
$ref: "#/components/schemas/WidgetLiveSpanUnit"
1580+
value:
1581+
description: Value of the live timeframe span. Required when `type` is `live`.
1582+
format: int64
1583+
type: integer
1584+
required:
1585+
- type
1586+
type: object
1587+
DashboardDefaultTimeframeType:
1588+
description: Type of timeframe.
1589+
enum:
1590+
- live
1591+
- fixed
1592+
example: live
1593+
type: string
1594+
x-enum-varnames:
1595+
- LIVE
1596+
- FIXED
15601597
DashboardDeleteResponse:
15611598
description: Response from the delete dashboard call.
15621599
properties:

api/datadogV1/model_dashboard.go

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ type Dashboard struct {
2020
AuthorName datadog.NullableString `json:"author_name,omitempty"`
2121
// Creation date of the dashboard.
2222
CreatedAt *time.Time `json:"created_at,omitempty"`
23+
// The default timeframe applied when opening the dashboard. Set to `null` to clear the dashboard's default timeframe.
24+
DefaultTimeframe *DashboardDefaultTimeframe `json:"default_timeframe,omitempty"`
2325
// Description of the dashboard.
2426
Description datadog.NullableString `json:"description,omitempty"`
2527
// ID of the dashboard.
@@ -175,6 +177,34 @@ func (o *Dashboard) SetCreatedAt(v time.Time) {
175177
o.CreatedAt = &v
176178
}
177179

180+
// GetDefaultTimeframe returns the DefaultTimeframe field value if set, zero value otherwise.
181+
func (o *Dashboard) GetDefaultTimeframe() DashboardDefaultTimeframe {
182+
if o == nil || o.DefaultTimeframe == nil {
183+
var ret DashboardDefaultTimeframe
184+
return ret
185+
}
186+
return *o.DefaultTimeframe
187+
}
188+
189+
// GetDefaultTimeframeOk returns a tuple with the DefaultTimeframe field value if set, nil otherwise
190+
// and a boolean to check if the value has been set.
191+
func (o *Dashboard) GetDefaultTimeframeOk() (*DashboardDefaultTimeframe, bool) {
192+
if o == nil || o.DefaultTimeframe == nil {
193+
return nil, false
194+
}
195+
return o.DefaultTimeframe, true
196+
}
197+
198+
// HasDefaultTimeframe returns a boolean if a field has been set.
199+
func (o *Dashboard) HasDefaultTimeframe() bool {
200+
return o != nil && o.DefaultTimeframe != nil
201+
}
202+
203+
// SetDefaultTimeframe gets a reference to the given DashboardDefaultTimeframe and assigns it to the DefaultTimeframe field.
204+
func (o *Dashboard) SetDefaultTimeframe(v DashboardDefaultTimeframe) {
205+
o.DefaultTimeframe = &v
206+
}
207+
178208
// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null).
179209
func (o *Dashboard) GetDescription() string {
180210
if o == nil || o.Description.Get() == nil {
@@ -638,6 +668,9 @@ func (o Dashboard) MarshalJSON() ([]byte, error) {
638668
toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00")
639669
}
640670
}
671+
if o.DefaultTimeframe != nil {
672+
toSerialize["default_timeframe"] = o.DefaultTimeframe
673+
}
641674
if o.Description.IsSet() {
642675
toSerialize["description"] = o.Description.Get()
643676
}
@@ -694,6 +727,7 @@ func (o *Dashboard) UnmarshalJSON(bytes []byte) (err error) {
694727
AuthorHandle *string `json:"author_handle,omitempty"`
695728
AuthorName datadog.NullableString `json:"author_name,omitempty"`
696729
CreatedAt *time.Time `json:"created_at,omitempty"`
730+
DefaultTimeframe *DashboardDefaultTimeframe `json:"default_timeframe,omitempty"`
697731
Description datadog.NullableString `json:"description,omitempty"`
698732
Id *string `json:"id,omitempty"`
699733
IsReadOnly *bool `json:"is_read_only,omitempty"`
@@ -724,7 +758,7 @@ func (o *Dashboard) UnmarshalJSON(bytes []byte) (err error) {
724758
}
725759
additionalProperties := make(map[string]interface{})
726760
if err = datadog.UnmarshalUseNumber(bytes, &additionalProperties); err == nil {
727-
datadog.DeleteKeys(additionalProperties, &[]string{"author_handle", "author_name", "created_at", "description", "id", "is_read_only", "layout_type", "modified_at", "notify_list", "reflow_type", "restricted_roles", "tabs", "tags", "template_variable_presets", "template_variables", "title", "url", "widgets"})
761+
datadog.DeleteKeys(additionalProperties, &[]string{"author_handle", "author_name", "created_at", "default_timeframe", "description", "id", "is_read_only", "layout_type", "modified_at", "notify_list", "reflow_type", "restricted_roles", "tabs", "tags", "template_variable_presets", "template_variables", "title", "url", "widgets"})
728762
} else {
729763
return err
730764
}
@@ -733,6 +767,10 @@ func (o *Dashboard) UnmarshalJSON(bytes []byte) (err error) {
733767
o.AuthorHandle = all.AuthorHandle
734768
o.AuthorName = all.AuthorName
735769
o.CreatedAt = all.CreatedAt
770+
if all.DefaultTimeframe != nil && all.DefaultTimeframe.UnparsedObject != nil && o.UnparsedObject == nil {
771+
hasInvalidField = true
772+
}
773+
o.DefaultTimeframe = all.DefaultTimeframe
736774
o.Description = all.Description
737775
o.Id = all.Id
738776
o.IsReadOnly = all.IsReadOnly

0 commit comments

Comments
 (0)