Skip to content

Commit 58e0df4

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

File tree

8 files changed

+634
-3
lines changed

8 files changed

+634
-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:

src/main/java/com/datadog/api/client/v1/api/MonitorsApi.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,7 @@ public CompletableFuture<ApiResponse<DeletedMonitor>> deleteMonitorWithHttpInfoA
863863
public static class GetMonitorOptionalParameters {
864864
private String groupStates;
865865
private Boolean withDowntimes;
866+
private Boolean withAssets;
866867

867868
/**
868869
* Set groupStates.
@@ -888,6 +889,18 @@ public GetMonitorOptionalParameters withDowntimes(Boolean withDowntimes) {
888889
this.withDowntimes = withDowntimes;
889890
return this;
890891
}
892+
893+
/**
894+
* Set withAssets.
895+
*
896+
* @param withAssets If this argument is set to true, then the returned data includes all assets
897+
* tied to this monitor. (optional)
898+
* @return GetMonitorOptionalParameters
899+
*/
900+
public GetMonitorOptionalParameters withAssets(Boolean withAssets) {
901+
this.withAssets = withAssets;
902+
return this;
903+
}
891904
}
892905

893906
/**
@@ -981,6 +994,7 @@ public ApiResponse<Monitor> getMonitorWithHttpInfo(
981994
}
982995
String groupStates = parameters.groupStates;
983996
Boolean withDowntimes = parameters.withDowntimes;
997+
Boolean withAssets = parameters.withAssets;
984998
// create path and map variables
985999
String localVarPath =
9861000
"/api/v1/monitor/{monitor_id}"
@@ -991,6 +1005,7 @@ public ApiResponse<Monitor> getMonitorWithHttpInfo(
9911005

9921006
localVarQueryParams.addAll(apiClient.parameterToPairs("", "group_states", groupStates));
9931007
localVarQueryParams.addAll(apiClient.parameterToPairs("", "with_downtimes", withDowntimes));
1008+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "with_assets", withAssets));
9941009

9951010
Invocation.Builder builder =
9961011
apiClient.createBuilder(
@@ -1035,6 +1050,7 @@ public CompletableFuture<ApiResponse<Monitor>> getMonitorWithHttpInfoAsync(
10351050
}
10361051
String groupStates = parameters.groupStates;
10371052
Boolean withDowntimes = parameters.withDowntimes;
1053+
Boolean withAssets = parameters.withAssets;
10381054
// create path and map variables
10391055
String localVarPath =
10401056
"/api/v1/monitor/{monitor_id}"
@@ -1045,6 +1061,7 @@ public CompletableFuture<ApiResponse<Monitor>> getMonitorWithHttpInfoAsync(
10451061

10461062
localVarQueryParams.addAll(apiClient.parameterToPairs("", "group_states", groupStates));
10471063
localVarQueryParams.addAll(apiClient.parameterToPairs("", "with_downtimes", withDowntimes));
1064+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "with_assets", withAssets));
10481065

10491066
Invocation.Builder builder;
10501067
try {

src/main/java/com/datadog/api/client/v1/model/Monitor.java

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
/** Object describing a monitor. */
2525
@JsonPropertyOrder({
26+
Monitor.JSON_PROPERTY_ASSETS,
2627
Monitor.JSON_PROPERTY_CREATED,
2728
Monitor.JSON_PROPERTY_CREATOR,
2829
Monitor.JSON_PROPERTY_DELETED,
@@ -46,6 +47,9 @@
4647
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
4748
public class Monitor {
4849
@JsonIgnore public boolean unparsed = false;
50+
public static final String JSON_PROPERTY_ASSETS = "assets";
51+
private List<MonitorAsset> assets = null;
52+
4953
public static final String JSON_PROPERTY_CREATED = "created";
5054
private OffsetDateTime created;
5155

@@ -111,6 +115,40 @@ public Monitor(
111115
this.unparsed |= !type.isValid();
112116
}
113117

118+
public Monitor assets(List<MonitorAsset> assets) {
119+
this.assets = assets;
120+
for (MonitorAsset item : assets) {
121+
this.unparsed |= item.unparsed;
122+
}
123+
return this;
124+
}
125+
126+
public Monitor addAssetsItem(MonitorAsset assetsItem) {
127+
if (this.assets == null) {
128+
this.assets = new ArrayList<>();
129+
}
130+
this.assets.add(assetsItem);
131+
this.unparsed |= assetsItem.unparsed;
132+
return this;
133+
}
134+
135+
/**
136+
* The list of monitor assets tied to a monitor which represents key links for users to help take
137+
* actions on monitor alerts (ex. runbooks)
138+
*
139+
* @return assets
140+
*/
141+
@jakarta.annotation.Nullable
142+
@JsonProperty(JSON_PROPERTY_ASSETS)
143+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
144+
public List<MonitorAsset> getAssets() {
145+
return assets;
146+
}
147+
148+
public void setAssets(List<MonitorAsset> assets) {
149+
this.assets = assets;
150+
}
151+
114152
/**
115153
* Timestamp of the monitor creation.
116154
*
@@ -560,7 +598,8 @@ public boolean equals(Object o) {
560598
return false;
561599
}
562600
Monitor monitor = (Monitor) o;
563-
return Objects.equals(this.created, monitor.created)
601+
return Objects.equals(this.assets, monitor.assets)
602+
&& Objects.equals(this.created, monitor.created)
564603
&& Objects.equals(this.creator, monitor.creator)
565604
&& Objects.equals(this.deleted, monitor.deleted)
566605
&& Objects.equals(this.draftStatus, monitor.draftStatus)
@@ -584,6 +623,7 @@ public boolean equals(Object o) {
584623
@Override
585624
public int hashCode() {
586625
return Objects.hash(
626+
assets,
587627
created,
588628
creator,
589629
deleted,
@@ -609,6 +649,7 @@ public int hashCode() {
609649
public String toString() {
610650
StringBuilder sb = new StringBuilder();
611651
sb.append("class Monitor {\n");
652+
sb.append(" assets: ").append(toIndentedString(assets)).append("\n");
612653
sb.append(" created: ").append(toIndentedString(created)).append("\n");
613654
sb.append(" creator: ").append(toIndentedString(creator)).append("\n");
614655
sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n");

0 commit comments

Comments
 (0)