Skip to content

Commit 5aa846e

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit eaa0782 of spec repo (#116)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 935c04d commit 5aa846e

File tree

9 files changed

+270
-15
lines changed

9 files changed

+270
-15
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.4.1.dev6",
7-
"regenerated": "2021-04-29 15:11:24.012870",
8-
"spec_repo_commit": "9d22381"
7+
"regenerated": "2021-05-05 16:33:53.040244",
8+
"spec_repo_commit": "eaa0782"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev6",
12-
"regenerated": "2021-04-29 15:11:29.505057",
13-
"spec_repo_commit": "9d22381"
12+
"regenerated": "2021-05-05 16:33:58.716911",
13+
"spec_repo_commit": "eaa0782"
1414
}
1515
}
1616
}

packages/datadog-api-client-v1/.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ models/SLOListResponse.ts
301301
models/SLOListResponseMetadata.ts
302302
models/SLOListResponseMetadataPage.ts
303303
models/SLOResponse.ts
304+
models/SLOResponseData.ts
304305
models/SLOThreshold.ts
305306
models/SLOTimeframe.ts
306307
models/SLOType.ts

packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ export class ServiceLevelObjectivesApiRequestFactory extends BaseAPIRequestFacto
234234
* Get a service level objective object.
235235
* Get an SLO's details
236236
* @param sloId The ID of the service level objective object.
237+
* @param withConfiguredAlertIds Get the IDs of SLO monitors that reference this SLO.
237238
*/
238-
public async getSLO(sloId: string, options?: Configuration): Promise<RequestContext> {
239+
public async getSLO(sloId: string, withConfiguredAlertIds?: boolean, options?: Configuration): Promise<RequestContext> {
239240
let config = options || this.configuration;
240241

241242
// verify required parameter 'sloId' is not null or undefined
@@ -244,6 +245,7 @@ export class ServiceLevelObjectivesApiRequestFactory extends BaseAPIRequestFacto
244245
}
245246

246247

248+
247249
// Path Params
248250
const localVarPath = '/api/v1/slo/{slo_id}'
249251
.replace('{' + 'slo_id' + '}', encodeURIComponent(String(sloId)));
@@ -254,6 +256,9 @@ export class ServiceLevelObjectivesApiRequestFactory extends BaseAPIRequestFacto
254256
requestContext.setHttpConfig(config.httpConfig);
255257

256258
// Query Params
259+
if (withConfiguredAlertIds !== undefined) {
260+
requestContext.setQueryParam("with_configured_alert_ids", ObjectSerializer.serialize(withConfiguredAlertIds, "boolean", ""));
261+
}
257262

258263
// Header Params
259264

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ import { SLOListResponse } from './SLOListResponse';
263263
import { SLOListResponseMetadata } from './SLOListResponseMetadata';
264264
import { SLOListResponseMetadataPage } from './SLOListResponseMetadataPage';
265265
import { SLOResponse } from './SLOResponse';
266+
import { SLOResponseData } from './SLOResponseData';
266267
import { SLOThreshold } from './SLOThreshold';
267268
import { SLOTimeframe } from './SLOTimeframe';
268269
import { SLOType } from './SLOType';
@@ -877,6 +878,7 @@ let typeMap: {[index: string]: any} = {
877878
"SLOListResponseMetadata": SLOListResponseMetadata,
878879
"SLOListResponseMetadataPage": SLOListResponseMetadataPage,
879880
"SLOResponse": SLOResponse,
881+
"SLOResponseData": SLOResponseData,
880882
"SLOThreshold": SLOThreshold,
881883
"SLOWidgetDefinition": SLOWidgetDefinition,
882884
"ScatterPlotRequest": ScatterPlotRequest,

packages/datadog-api-client-v1/models/SLOResponse.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Do not edit the class manually.
99
*/
1010

11-
import { ServiceLevelObjective } from './ServiceLevelObjective';
11+
import { SLOResponseData } from './SLOResponseData';
1212
import { HttpFile } from '../http/http';
1313
import { ObjectSerializer } from './ObjectSerializer';
1414

@@ -17,7 +17,7 @@ import { ObjectSerializer } from './ObjectSerializer';
1717
*/
1818

1919
export class SLOResponse {
20-
'data'?: ServiceLevelObjective;
20+
'data'?: SLOResponseData;
2121
/**
2222
* An array of error messages. Each endpoint documents how/whether this field is used.
2323
*/
@@ -28,7 +28,7 @@ export class SLOResponse {
2828
static readonly attributeTypeMap: {[key: string]: {baseName: string, type: string, format: string}} = {
2929
"data": {
3030
"baseName": "data",
31-
"type": "ServiceLevelObjective",
31+
"type": "SLOResponseData",
3232
"format": ""
3333
},
3434
"errors": {
@@ -44,7 +44,7 @@ export class SLOResponse {
4444
static deserialize(data: {[key: string]: any}): SLOResponse {
4545
let res = new SLOResponse();
4646

47-
res.data = ObjectSerializer.deserialize(data.data, "ServiceLevelObjective", "")
47+
res.data = ObjectSerializer.deserialize(data.data, "SLOResponseData", "")
4848

4949
res.errors = ObjectSerializer.deserialize(data.errors, "Array<string>", "")
5050

@@ -60,7 +60,7 @@ export class SLOResponse {
6060
throw new TypeError(`${key} attribute not in schema`);
6161
}
6262
}
63-
res.data = ObjectSerializer.serialize(data.data, "ServiceLevelObjective", "")
63+
res.data = ObjectSerializer.serialize(data.data, "SLOResponseData", "")
6464

6565
res.errors = ObjectSerializer.serialize(data.errors, "Array<string>", "")
6666

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*
6+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7+
* https://openapi-generator.tech
8+
* Do not edit the class manually.
9+
*/
10+
11+
import { Creator } from './Creator';
12+
import { SLOThreshold } from './SLOThreshold';
13+
import { SLOType } from './SLOType';
14+
import { ServiceLevelObjectiveQuery } from './ServiceLevelObjectiveQuery';
15+
import { HttpFile } from '../http/http';
16+
import { ObjectSerializer } from './ObjectSerializer';
17+
18+
/**
19+
* A service level objective object includes a service level indicator, thresholds for one or more timeframes, and metadata (`name`, `description`, `tags`, etc.).
20+
*/
21+
22+
export class SLOResponseData {
23+
/**
24+
* A list of SLO monitors IDs that reference this SLO. This field is returned only when `with_configured_alert_ids` parameter is true in query.
25+
*/
26+
'configuredAlertIds'?: Array<number>;
27+
/**
28+
* Creation timestamp (UNIX time in seconds) Always included in service level objective responses.
29+
*/
30+
'createdAt'?: number;
31+
'creator'?: Creator;
32+
/**
33+
* A user-defined description of the service level objective. Always included in service level objective responses (but may be `null`). Optional in create/update requests.
34+
*/
35+
'description'?: string;
36+
/**
37+
* A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one.
38+
*/
39+
'groups'?: Array<string>;
40+
/**
41+
* A unique identifier for the service level objective object. Always included in service level objective responses.
42+
*/
43+
'id'?: string;
44+
/**
45+
* Modification timestamp (UNIX time in seconds) Always included in service level objective responses.
46+
*/
47+
'modifiedAt'?: number;
48+
/**
49+
* A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**.
50+
*/
51+
'monitorIds'?: Array<number>;
52+
/**
53+
* The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field).
54+
*/
55+
'monitorTags'?: Array<string>;
56+
/**
57+
* The name of the service level objective object.
58+
*/
59+
'name'?: string;
60+
'query'?: ServiceLevelObjectiveQuery;
61+
/**
62+
* A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests.
63+
*/
64+
'tags'?: Array<string>;
65+
/**
66+
* The thresholds (timeframes and associated targets) for this service level objective object.
67+
*/
68+
'thresholds'?: Array<SLOThreshold>;
69+
'type'?: SLOType;
70+
71+
static readonly discriminator: string | undefined = undefined;
72+
73+
static readonly attributeTypeMap: {[key: string]: {baseName: string, type: string, format: string}} = {
74+
"configuredAlertIds": {
75+
"baseName": "configured_alert_ids",
76+
"type": "Array<number>",
77+
"format": "int64"
78+
},
79+
"createdAt": {
80+
"baseName": "created_at",
81+
"type": "number",
82+
"format": "int64"
83+
},
84+
"creator": {
85+
"baseName": "creator",
86+
"type": "Creator",
87+
"format": ""
88+
},
89+
"description": {
90+
"baseName": "description",
91+
"type": "string",
92+
"format": ""
93+
},
94+
"groups": {
95+
"baseName": "groups",
96+
"type": "Array<string>",
97+
"format": ""
98+
},
99+
"id": {
100+
"baseName": "id",
101+
"type": "string",
102+
"format": ""
103+
},
104+
"modifiedAt": {
105+
"baseName": "modified_at",
106+
"type": "number",
107+
"format": "int64"
108+
},
109+
"monitorIds": {
110+
"baseName": "monitor_ids",
111+
"type": "Array<number>",
112+
"format": "int64"
113+
},
114+
"monitorTags": {
115+
"baseName": "monitor_tags",
116+
"type": "Array<string>",
117+
"format": ""
118+
},
119+
"name": {
120+
"baseName": "name",
121+
"type": "string",
122+
"format": ""
123+
},
124+
"query": {
125+
"baseName": "query",
126+
"type": "ServiceLevelObjectiveQuery",
127+
"format": ""
128+
},
129+
"tags": {
130+
"baseName": "tags",
131+
"type": "Array<string>",
132+
"format": ""
133+
},
134+
"thresholds": {
135+
"baseName": "thresholds",
136+
"type": "Array<SLOThreshold>",
137+
"format": ""
138+
},
139+
"type": {
140+
"baseName": "type",
141+
"type": "SLOType",
142+
"format": ""
143+
} };
144+
145+
static getAttributeTypeMap() {
146+
return SLOResponseData.attributeTypeMap;
147+
}
148+
149+
static deserialize(data: {[key: string]: any}): SLOResponseData {
150+
let res = new SLOResponseData();
151+
152+
res.configuredAlertIds = ObjectSerializer.deserialize(data.configured_alert_ids, "Array<number>", "int64")
153+
154+
res.createdAt = ObjectSerializer.deserialize(data.created_at, "number", "int64")
155+
156+
res.creator = ObjectSerializer.deserialize(data.creator, "Creator", "")
157+
158+
res.description = ObjectSerializer.deserialize(data.description, "string", "")
159+
160+
res.groups = ObjectSerializer.deserialize(data.groups, "Array<string>", "")
161+
162+
res.id = ObjectSerializer.deserialize(data.id, "string", "")
163+
164+
res.modifiedAt = ObjectSerializer.deserialize(data.modified_at, "number", "int64")
165+
166+
res.monitorIds = ObjectSerializer.deserialize(data.monitor_ids, "Array<number>", "int64")
167+
168+
res.monitorTags = ObjectSerializer.deserialize(data.monitor_tags, "Array<string>", "")
169+
170+
res.name = ObjectSerializer.deserialize(data.name, "string", "")
171+
172+
res.query = ObjectSerializer.deserialize(data.query, "ServiceLevelObjectiveQuery", "")
173+
174+
res.tags = ObjectSerializer.deserialize(data.tags, "Array<string>", "")
175+
176+
res.thresholds = ObjectSerializer.deserialize(data.thresholds, "Array<SLOThreshold>", "")
177+
178+
if (['metric', 'monitor', undefined].includes(data.type)) {
179+
res.type = data.type;
180+
} else {
181+
throw TypeError(`invalid enum value ${ data.type } for type`);
182+
}
183+
184+
185+
return res;
186+
}
187+
188+
static serialize(data: SLOResponseData): {[key: string]: any} {
189+
let attributeTypes = SLOResponseData.getAttributeTypeMap();
190+
let res: {[index: string]: any} = {};
191+
for (let [key, value] of Object.entries(data)) {
192+
if (!(key in attributeTypes)) {
193+
throw new TypeError(`${key} attribute not in schema`);
194+
}
195+
}
196+
res.configured_alert_ids = ObjectSerializer.serialize(data.configuredAlertIds, "Array<number>", "int64")
197+
198+
res.created_at = ObjectSerializer.serialize(data.createdAt, "number", "int64")
199+
200+
res.creator = ObjectSerializer.serialize(data.creator, "Creator", "")
201+
202+
res.description = ObjectSerializer.serialize(data.description, "string", "")
203+
204+
res.groups = ObjectSerializer.serialize(data.groups, "Array<string>", "")
205+
206+
res.id = ObjectSerializer.serialize(data.id, "string", "")
207+
208+
res.modified_at = ObjectSerializer.serialize(data.modifiedAt, "number", "int64")
209+
210+
res.monitor_ids = ObjectSerializer.serialize(data.monitorIds, "Array<number>", "int64")
211+
212+
res.monitor_tags = ObjectSerializer.serialize(data.monitorTags, "Array<string>", "")
213+
214+
res.name = ObjectSerializer.serialize(data.name, "string", "")
215+
216+
res.query = ObjectSerializer.serialize(data.query, "ServiceLevelObjectiveQuery", "")
217+
218+
res.tags = ObjectSerializer.serialize(data.tags, "Array<string>", "")
219+
220+
res.thresholds = ObjectSerializer.serialize(data.thresholds, "Array<SLOThreshold>", "")
221+
222+
if (['metric', 'monitor', undefined].includes(data.type)) {
223+
res.type = data.type;
224+
} else {
225+
throw TypeError(`invalid enum value ${ data.type } for type`);
226+
}
227+
228+
return res
229+
}
230+
231+
public constructor() {
232+
}
233+
}
234+
235+
236+

packages/datadog-api-client-v1/types/ObjectParamAPI.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ import { SLOListResponse } from '../models/SLOListResponse';
267267
import { SLOListResponseMetadata } from '../models/SLOListResponseMetadata';
268268
import { SLOListResponseMetadataPage } from '../models/SLOListResponseMetadataPage';
269269
import { SLOResponse } from '../models/SLOResponse';
270+
import { SLOResponseData } from '../models/SLOResponseData';
270271
import { SLOThreshold } from '../models/SLOThreshold';
271272
import { SLOTimeframe } from '../models/SLOTimeframe';
272273
import { SLOType } from '../models/SLOType';
@@ -2889,6 +2890,12 @@ export interface ServiceLevelObjectivesApiGetSLORequest {
28892890
* @memberof ServiceLevelObjectivesApigetSLO
28902891
*/
28912892
sloId: string
2893+
/**
2894+
* Get the IDs of SLO monitors that reference this SLO.
2895+
* @type boolean
2896+
* @memberof ServiceLevelObjectivesApigetSLO
2897+
*/
2898+
withConfiguredAlertIds?: boolean
28922899
}
28932900

28942901
export interface ServiceLevelObjectivesApiGetSLOHistoryRequest {
@@ -3009,7 +3016,7 @@ export class ObjectServiceLevelObjectivesApi {
30093016
* @param param the request object
30103017
*/
30113018
public getSLO(param: ServiceLevelObjectivesApiGetSLORequest, options?: Configuration): Promise<SLOResponse> {
3012-
return this.api.getSLO(param.sloId, options).toPromise();
3019+
return this.api.getSLO(param.sloId, param.withConfiguredAlertIds, options).toPromise();
30133020
}
30143021

30153022
/**

0 commit comments

Comments
 (0)