@@ -13,6 +13,8 @@ import (
1313
1414// Monitor Object describing a monitor.
1515type Monitor struct {
16+ // The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks).
17+ Assets []MonitorAsset `json:"assets,omitempty"`
1618 // Timestamp of the monitor creation.
1719 Created * time.Time `json:"created,omitempty"`
1820 // Object describing the creator of the shared element.
@@ -82,6 +84,34 @@ func NewMonitorWithDefaults() *Monitor {
8284 return & this
8385}
8486
87+ // GetAssets returns the Assets field value if set, zero value otherwise.
88+ func (o * Monitor ) GetAssets () []MonitorAsset {
89+ if o == nil || o .Assets == nil {
90+ var ret []MonitorAsset
91+ return ret
92+ }
93+ return o .Assets
94+ }
95+
96+ // GetAssetsOk returns a tuple with the Assets field value if set, nil otherwise
97+ // and a boolean to check if the value has been set.
98+ func (o * Monitor ) GetAssetsOk () (* []MonitorAsset , bool ) {
99+ if o == nil || o .Assets == nil {
100+ return nil , false
101+ }
102+ return & o .Assets , true
103+ }
104+
105+ // HasAssets returns a boolean if a field has been set.
106+ func (o * Monitor ) HasAssets () bool {
107+ return o != nil && o .Assets != nil
108+ }
109+
110+ // SetAssets gets a reference to the given []MonitorAsset and assigns it to the Assets field.
111+ func (o * Monitor ) SetAssets (v []MonitorAsset ) {
112+ o .Assets = v
113+ }
114+
85115// GetCreated returns the Created field value if set, zero value otherwise.
86116func (o * Monitor ) GetCreated () time.Time {
87117 if o == nil || o .Created == nil {
@@ -615,6 +645,9 @@ func (o Monitor) MarshalJSON() ([]byte, error) {
615645 if o .UnparsedObject != nil {
616646 return datadog .Marshal (o .UnparsedObject )
617647 }
648+ if o .Assets != nil {
649+ toSerialize ["assets" ] = o .Assets
650+ }
618651 if o .Created != nil {
619652 if o .Created .Nanosecond () == 0 {
620653 toSerialize ["created" ] = o .Created .Format ("2006-01-02T15:04:05Z07:00" )
@@ -683,6 +716,7 @@ func (o Monitor) MarshalJSON() ([]byte, error) {
683716// UnmarshalJSON deserializes the given payload.
684717func (o * Monitor ) UnmarshalJSON (bytes []byte ) (err error ) {
685718 all := struct {
719+ Assets []MonitorAsset `json:"assets,omitempty"`
686720 Created * time.Time `json:"created,omitempty"`
687721 Creator * Creator `json:"creator,omitempty"`
688722 Deleted datadog.NullableTime `json:"deleted,omitempty"`
@@ -713,12 +747,13 @@ func (o *Monitor) UnmarshalJSON(bytes []byte) (err error) {
713747 }
714748 additionalProperties := make (map [string ]interface {})
715749 if err = datadog .Unmarshal (bytes , & additionalProperties ); err == nil {
716- datadog .DeleteKeys (additionalProperties , & []string {"created" , "creator" , "deleted" , "draft_status" , "id" , "matching_downtimes" , "message" , "modified" , "multi" , "name" , "options" , "overall_state" , "priority" , "query" , "restricted_roles" , "state" , "tags" , "type" })
750+ datadog .DeleteKeys (additionalProperties , & []string {"assets" , " created" , "creator" , "deleted" , "draft_status" , "id" , "matching_downtimes" , "message" , "modified" , "multi" , "name" , "options" , "overall_state" , "priority" , "query" , "restricted_roles" , "state" , "tags" , "type" })
717751 } else {
718752 return err
719753 }
720754
721755 hasInvalidField := false
756+ o .Assets = all .Assets
722757 o .Created = all .Created
723758 if all .Creator != nil && all .Creator .UnparsedObject != nil && o .UnparsedObject == nil {
724759 hasInvalidField = true
0 commit comments