Skip to content

Commit

Permalink
Regenerate client from commit 8cd82dea of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Oct 5, 2023
1 parent 04ab383 commit 449e9f0
Show file tree
Hide file tree
Showing 17 changed files with 1,152 additions and 121 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2023-10-05 15:54:32.105134",
"spec_repo_commit": "432a5a71"
"regenerated": "2023-10-05 19:20:42.799898",
"spec_repo_commit": "8cd82dea"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-10-05 15:54:32.119953",
"spec_repo_commit": "432a5a71"
"regenerated": "2023-10-05 19:20:42.813424",
"spec_repo_commit": "8cd82dea"
}
}
}
148 changes: 136 additions & 12 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10596,18 +10596,7 @@ components:
example: Powerpack for ABC
type: string
group_widget:
additionalProperties: {}
description: Templated group of dashboard widgets for the powerpack.
example:
layout_type: ordered
tags:
- tag:foo1
type: group
widgets:
- definition:
content: example
type: note
type: object
$ref: '#/components/schemas/PowerpackGroupWidget'
name:
description: Name of the powerpack.
example: Sample Powerpack
Expand Down Expand Up @@ -10649,6 +10638,141 @@ components:
example: powerpack
type: string
type: object
PowerpackGroupWidget:
description: Powerpack group widget definition object.
properties:
definition:
$ref: '#/components/schemas/PowerpackGroupWidgetDefinition'
layout:
$ref: '#/components/schemas/PowerpackGroupWidgetLayout'
required:
- definition
type: object
PowerpackGroupWidgetDefinition:
description: Powerpack group widget object.
properties:
layout_type:
description: Layout type of widgets.
example: ordered
type: string
show_title:
description: Boolean indicating whether powerpack group title should be
visible or not.
example: true
type: boolean
title:
description: Name for the group widget.
example: Sample Powerpack
type: string
type:
description: Type of widget, must be group.
example: group
type: string
widgets:
description: Widgets inside the powerpack.
example:
- definition:
content: example
type: note
layout:
height: 5
width: 10
x: 0
y: 0
items:
$ref: '#/components/schemas/PowerpackInnerWidgets'
type: array
required:
- widgets
- layout_type
- type
type: object
PowerpackGroupWidgetLayout:
description: Powerpack group widget layout.
properties:
height:
description: The height of the widget. Should be a non-negative integer.
example: 0
format: int64
minimum: 0
type: integer
width:
description: The width of the widget. Should be a non-negative integer.
example: 0
format: int64
minimum: 0
type: integer
x:
description: The position of the widget on the x (horizontal) axis. Should
be a non-negative integer.
example: 0
format: int64
minimum: 0
type: integer
y:
description: The position of the widget on the y (vertical) axis. Should
be a non-negative integer.
example: 0
format: int64
minimum: 0
type: integer
required:
- x
- y
- width
- height
type: object
PowerpackInnerWidgetLayout:
description: Powerpack inner widget layout.
properties:
height:
description: The height of the widget. Should be a non-negative integer.
example: 0
format: int64
minimum: 0
type: integer
width:
description: The width of the widget. Should be a non-negative integer.
example: 0
format: int64
minimum: 0
type: integer
x:
description: The position of the widget on the x (horizontal) axis. Should
be a non-negative integer.
example: 0
format: int64
minimum: 0
type: integer
y:
description: The position of the widget on the y (vertical) axis. Should
be a non-negative integer.
example: 0
format: int64
minimum: 0
type: integer
required:
- x
- y
- width
- height
type: object
PowerpackInnerWidgets:
description: Powerpack group widget definition of individual widgets.
properties:
definition:
additionalProperties: {}
description: Information about widget.
example:
definition:
content: example
type: note
type: object
layout:
$ref: '#/components/schemas/PowerpackInnerWidgetLayout'
required:
- definition
type: object
PowerpackRelationships:
description: Powerpack relationship object.
properties:
Expand Down
25 changes: 17 additions & 8 deletions api/datadogV2/model_powerpack_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
type PowerpackAttributes struct {
// Description of this powerpack.
Description *string `json:"description,omitempty"`
// Templated group of dashboard widgets for the powerpack.
GroupWidget map[string]interface{} `json:"group_widget"`
// Powerpack group widget definition object.
GroupWidget PowerpackGroupWidget `json:"group_widget"`
// Name of the powerpack.
Name string `json:"name"`
// List of tags to identify this powerpack.
Expand All @@ -33,7 +33,7 @@ type PowerpackAttributes struct {
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewPowerpackAttributes(groupWidget map[string]interface{}, name string) *PowerpackAttributes {
func NewPowerpackAttributes(groupWidget PowerpackGroupWidget, name string) *PowerpackAttributes {
this := PowerpackAttributes{}
this.GroupWidget = groupWidget
this.Name = name
Expand Down Expand Up @@ -77,25 +77,25 @@ func (o *PowerpackAttributes) SetDescription(v string) {
}

// GetGroupWidget returns the GroupWidget field value.
func (o *PowerpackAttributes) GetGroupWidget() map[string]interface{} {
func (o *PowerpackAttributes) GetGroupWidget() PowerpackGroupWidget {
if o == nil {
var ret map[string]interface{}
var ret PowerpackGroupWidget
return ret
}
return o.GroupWidget
}

// GetGroupWidgetOk returns a tuple with the GroupWidget field value
// and a boolean to check if the value has been set.
func (o *PowerpackAttributes) GetGroupWidgetOk() (*map[string]interface{}, bool) {
func (o *PowerpackAttributes) GetGroupWidgetOk() (*PowerpackGroupWidget, bool) {
if o == nil {
return nil, false
}
return &o.GroupWidget, true
}

// SetGroupWidget sets field value.
func (o *PowerpackAttributes) SetGroupWidget(v map[string]interface{}) {
func (o *PowerpackAttributes) SetGroupWidget(v PowerpackGroupWidget) {
o.GroupWidget = v
}

Expand Down Expand Up @@ -206,7 +206,7 @@ func (o PowerpackAttributes) MarshalJSON() ([]byte, error) {
func (o *PowerpackAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Description *string `json:"description,omitempty"`
GroupWidget *map[string]interface{} `json:"group_widget"`
GroupWidget *PowerpackGroupWidget `json:"group_widget"`
Name *string `json:"name"`
Tags []string `json:"tags,omitempty"`
TemplateVariables []PowerpackTemplateVariable `json:"template_variables,omitempty"`
Expand All @@ -226,7 +226,12 @@ func (o *PowerpackAttributes) UnmarshalJSON(bytes []byte) (err error) {
} else {
return err
}

hasInvalidField := false
o.Description = all.Description
if all.GroupWidget.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.GroupWidget = *all.GroupWidget
o.Name = *all.Name
o.Tags = all.Tags
Expand All @@ -236,5 +241,9 @@ func (o *PowerpackAttributes) UnmarshalJSON(bytes []byte) (err error) {
o.AdditionalProperties = additionalProperties
}

if hasInvalidField {
return json.Unmarshal(bytes, &o.UnparsedObject)
}

return nil
}
Loading

0 comments on commit 449e9f0

Please sign in to comment.