@@ -18,6 +18,14 @@ type MonitorUpdateRequest struct {
1818 Creator * Creator `json:"creator,omitempty"`
1919 // Whether or not the monitor is deleted. (Always `null`)
2020 Deleted datadog.NullableTime `json:"deleted,omitempty"`
21+ // Indicates whether the monitor is in a draft or published state.
22+ //
23+ // `draft`: The monitor appears as Draft and does not send notifications.
24+ // `published`: The monitor is active and evaluates conditions and notify as configured.
25+ //
26+ // This field is in preview. The draft value is only available to customers with the feature enabled.
27+ //
28+ DraftStatus * MonitorDraftStatus `json:"draft_status,omitempty"`
2129 // ID of this monitor.
2230 Id * int64 `json:"id,omitempty"`
2331 // A message to include with notifications for this monitor.
@@ -55,6 +63,8 @@ type MonitorUpdateRequest struct {
5563// will change when the set of required properties is changed.
5664func NewMonitorUpdateRequest () * MonitorUpdateRequest {
5765 this := MonitorUpdateRequest {}
66+ var draftStatus MonitorDraftStatus = MONITORDRAFTSTATUS_PUBLISHED
67+ this .DraftStatus = & draftStatus
5868 return & this
5969}
6070
@@ -63,6 +73,8 @@ func NewMonitorUpdateRequest() *MonitorUpdateRequest {
6373// but it doesn't guarantee that properties required by API are set.
6474func NewMonitorUpdateRequestWithDefaults () * MonitorUpdateRequest {
6575 this := MonitorUpdateRequest {}
76+ var draftStatus MonitorDraftStatus = MONITORDRAFTSTATUS_PUBLISHED
77+ this .DraftStatus = & draftStatus
6678 return & this
6779}
6880
@@ -161,6 +173,34 @@ func (o *MonitorUpdateRequest) UnsetDeleted() {
161173 o .Deleted .Unset ()
162174}
163175
176+ // GetDraftStatus returns the DraftStatus field value if set, zero value otherwise.
177+ func (o * MonitorUpdateRequest ) GetDraftStatus () MonitorDraftStatus {
178+ if o == nil || o .DraftStatus == nil {
179+ var ret MonitorDraftStatus
180+ return ret
181+ }
182+ return * o .DraftStatus
183+ }
184+
185+ // GetDraftStatusOk returns a tuple with the DraftStatus field value if set, nil otherwise
186+ // and a boolean to check if the value has been set.
187+ func (o * MonitorUpdateRequest ) GetDraftStatusOk () (* MonitorDraftStatus , bool ) {
188+ if o == nil || o .DraftStatus == nil {
189+ return nil , false
190+ }
191+ return o .DraftStatus , true
192+ }
193+
194+ // HasDraftStatus returns a boolean if a field has been set.
195+ func (o * MonitorUpdateRequest ) HasDraftStatus () bool {
196+ return o != nil && o .DraftStatus != nil
197+ }
198+
199+ // SetDraftStatus gets a reference to the given MonitorDraftStatus and assigns it to the DraftStatus field.
200+ func (o * MonitorUpdateRequest ) SetDraftStatus (v MonitorDraftStatus ) {
201+ o .DraftStatus = & v
202+ }
203+
164204// GetId returns the Id field value if set, zero value otherwise.
165205func (o * MonitorUpdateRequest ) GetId () int64 {
166206 if o == nil || o .Id == nil {
@@ -566,6 +606,9 @@ func (o MonitorUpdateRequest) MarshalJSON() ([]byte, error) {
566606 if o .Deleted .IsSet () {
567607 toSerialize ["deleted" ] = o .Deleted .Get ()
568608 }
609+ if o .DraftStatus != nil {
610+ toSerialize ["draft_status" ] = o .DraftStatus
611+ }
569612 if o .Id != nil {
570613 toSerialize ["id" ] = o .Id
571614 }
@@ -622,6 +665,7 @@ func (o *MonitorUpdateRequest) UnmarshalJSON(bytes []byte) (err error) {
622665 Created * time.Time `json:"created,omitempty"`
623666 Creator * Creator `json:"creator,omitempty"`
624667 Deleted datadog.NullableTime `json:"deleted,omitempty"`
668+ DraftStatus * MonitorDraftStatus `json:"draft_status,omitempty"`
625669 Id * int64 `json:"id,omitempty"`
626670 Message * string `json:"message,omitempty"`
627671 Modified * time.Time `json:"modified,omitempty"`
@@ -641,7 +685,7 @@ func (o *MonitorUpdateRequest) UnmarshalJSON(bytes []byte) (err error) {
641685 }
642686 additionalProperties := make (map [string ]interface {})
643687 if err = datadog .Unmarshal (bytes , & additionalProperties ); err == nil {
644- datadog .DeleteKeys (additionalProperties , & []string {"created" , "creator" , "deleted" , "id" , "message" , "modified" , "multi" , "name" , "options" , "overall_state" , "priority" , "query" , "restricted_roles" , "state" , "tags" , "type" })
688+ datadog .DeleteKeys (additionalProperties , & []string {"created" , "creator" , "deleted" , "draft_status" , " id" , "message" , "modified" , "multi" , "name" , "options" , "overall_state" , "priority" , "query" , "restricted_roles" , "state" , "tags" , "type" })
645689 } else {
646690 return err
647691 }
@@ -653,6 +697,11 @@ func (o *MonitorUpdateRequest) UnmarshalJSON(bytes []byte) (err error) {
653697 }
654698 o .Creator = all .Creator
655699 o .Deleted = all .Deleted
700+ if all .DraftStatus != nil && ! all .DraftStatus .IsValid () {
701+ hasInvalidField = true
702+ } else {
703+ o .DraftStatus = all .DraftStatus
704+ }
656705 o .Id = all .Id
657706 o .Message = all .Message
658707 o .Modified = all .Modified
0 commit comments