Skip to content

Commit e34c43d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 08e3ec2 of spec repo
1 parent 9b3f2ec commit e34c43d

File tree

8 files changed

+615
-3
lines changed

8 files changed

+615
-3
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7255,6 +7255,12 @@ components:
72557255
Monitor:
72567256
description: Object describing a monitor.
72577257
properties:
7258+
assets:
7259+
description: The list of monitor assets tied to a monitor which represents
7260+
key links for users to help take actions on monitor alerts (ex. runbooks)
7261+
items:
7262+
$ref: '#/components/schemas/MonitorAsset'
7263+
type: array
72587264
created:
72597265
description: Timestamp of the monitor creation.
72607266
format: date-time
@@ -7338,6 +7344,65 @@ components:
73387344
- type
73397345
- query
73407346
type: object
7347+
MonitorAsset:
7348+
description: 'Represents key links tied to a monitor to help users take action
7349+
on alerts (Runbooks, Dashboards, Workflows)
7350+
7351+
This feature is in preview. The are only available to customers with the feature
7352+
enabled.'
7353+
properties:
7354+
category:
7355+
$ref: '#/components/schemas/MonitorAssetCategory'
7356+
name:
7357+
description: Name for the Monitor Assets.
7358+
example: Monitor Runbook
7359+
type: string
7360+
options:
7361+
description: Additional options that you can set on a monitor asset.
7362+
example:
7363+
hide_in_monitor_message: true
7364+
type: object
7365+
resource_key:
7366+
description: Represents the identifier of the internal datadog resource
7367+
that this asset represents. IDs in this field should be passed as strings.
7368+
example: '12345'
7369+
type: string
7370+
resource_type:
7371+
$ref: '#/components/schemas/MonitorAssetResourceType'
7372+
template_variables:
7373+
description: Allows you to parameterize the url for the monitor asset.
7374+
example:
7375+
env: prod
7376+
region: us-east-1
7377+
type: object
7378+
url:
7379+
description: Url Link for the asset.hide_in_monitor_message
7380+
example: https://app.datadoghq.com
7381+
type: string
7382+
required:
7383+
- name
7384+
- url
7385+
- category
7386+
type: object
7387+
MonitorAssetCategory:
7388+
description: Indicates the type of asset this entity represents on a monitor
7389+
enum:
7390+
- dashboard
7391+
- workflow
7392+
- runbook
7393+
example: dashboard
7394+
type: string
7395+
x-enum-varnames:
7396+
- DASHBOARD
7397+
- WORKFLOW
7398+
- RUNBOOK
7399+
MonitorAssetResourceType:
7400+
description: Type of internal datadog resource associated with a monitor asset
7401+
enum:
7402+
- notebook
7403+
type: string
7404+
x-enum-varnames:
7405+
- NOTEBOOK
73417406
MonitorDeviceID:
73427407
description: ID of the device the Synthetics monitor is running on. Same as
73437408
`SyntheticsDeviceID`.
@@ -8452,6 +8517,13 @@ components:
84528517
MonitorUpdateRequest:
84538518
description: Object describing a monitor update request.
84548519
properties:
8520+
assets:
8521+
description: The list of monitor assets tied to a monitor which represents
8522+
key links for users to help take actions on monitor alerts (ex. runbooks)
8523+
items:
8524+
$ref: '#/components/schemas/MonitorAsset'
8525+
nullable: true
8526+
type: array
84558527
created:
84568528
description: Timestamp of the monitor creation.
84578529
format: date-time
@@ -31529,6 +31601,13 @@ paths:
3152931601
required: false
3153031602
schema:
3153131603
type: boolean
31604+
- description: If this argument is set to true, then the returned data includes
31605+
all assets tied to this monitor.
31606+
in: query
31607+
name: with_assets
31608+
required: false
31609+
schema:
31610+
type: boolean
3153231611
responses:
3153331612
'200':
3153431613
content:

api/datadogV1/api_monitors.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ func (a *MonitorsApi) DeleteMonitor(ctx _context.Context, monitorId int64, o ...
512512
type GetMonitorOptionalParameters struct {
513513
GroupStates *string
514514
WithDowntimes *bool
515+
WithAssets *bool
515516
}
516517

517518
// NewGetMonitorOptionalParameters creates an empty struct for parameters.
@@ -532,6 +533,12 @@ func (r *GetMonitorOptionalParameters) WithWithDowntimes(withDowntimes bool) *Ge
532533
return r
533534
}
534535

536+
// WithWithAssets sets the corresponding parameter name and returns the struct.
537+
func (r *GetMonitorOptionalParameters) WithWithAssets(withAssets bool) *GetMonitorOptionalParameters {
538+
r.WithAssets = &withAssets
539+
return r
540+
}
541+
535542
// GetMonitor Get a monitor's details.
536543
// Get details about the specified monitor from your organization.
537544
func (a *MonitorsApi) GetMonitor(ctx _context.Context, monitorId int64, o ...GetMonitorOptionalParameters) (Monitor, *_nethttp.Response, error) {
@@ -566,6 +573,9 @@ func (a *MonitorsApi) GetMonitor(ctx _context.Context, monitorId int64, o ...Get
566573
if optionalParams.WithDowntimes != nil {
567574
localVarQueryParams.Add("with_downtimes", datadog.ParameterToString(*optionalParams.WithDowntimes, ""))
568575
}
576+
if optionalParams.WithAssets != nil {
577+
localVarQueryParams.Add("with_assets", datadog.ParameterToString(*optionalParams.WithAssets, ""))
578+
}
569579
localVarHeaderParams["Accept"] = "application/json"
570580

571581
if a.Client.Cfg.DelegatedTokenConfig != nil {

api/datadogV1/model_monitor.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313

1414
// Monitor Object describing a monitor.
1515
type Monitor struct {
16+
// The list of monitor assets tied to a monitor which represents key links for users to help take actions on monitor alerts (ex. 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.
86116
func (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.
684717
func (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

Comments
 (0)