Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58413,6 +58413,47 @@ paths:
description: Returns a list of all monitor notification rules.
operationId: GetMonitorNotificationRules
parameters:
- description: The page to start paginating from. If `page` is not specified,
the argument defaults to the first page.
in: query
name: page
required: false
schema:
format: int32
maximum: 1000000
minimum: 0
type: integer
- description: The number of rules to return per page. If `per_page` is not
specified, the argument defaults to 100.
in: query
name: per_page
required: false
schema:
format: int32
maximum: 1000
minimum: 1
type: integer
- description: 'String for sort order, composed of field and sort order separated
by a colon, for example `name:asc`. Supported sort directions: `asc`, `desc`.
Supported fields: `name`, `created_at`.'
in: query
name: sort
required: false
schema:
type: string
- description: 'JSON-encoded filter object. Supported keys:

* `text`: Free-text query matched against rule name, tags, and recipients.

* `tags`: Array of strings. Return rules that have any of these tags.

* `recipients`: Array of strings. Return rules that have any of these recipients.'
example: '{"text":"error","tags":["env:prod","team:my-team"],"recipients":["slack-monitor-app","[email protected]"]}'
in: query
name: filters
required: false
schema:
type: string
- description: 'Comma-separated list of resource paths for related resources
to include in the response. Supported resource

Expand Down
16 changes: 16 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6122,6 +6122,22 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
"operationResponseType": "IntakePayloadAccepted",
},
"v2.GetMonitorNotificationRules": {
"page": {
"type": "number",
"format": "int32",
},
"perPage": {
"type": "number",
"format": "int32",
},
"sort": {
"type": "string",
"format": "",
},
"filters": {
"type": "string",
"format": "",
},
"include": {
"type": "string",
"format": "",
Expand Down
64 changes: 63 additions & 1 deletion packages/datadog-api-client-v2/apis/MonitorsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory {
}

public async getMonitorNotificationRules(
page?: number,
perPage?: number,
sort?: string,
filters?: string,
include?: string,
_options?: Configuration
): Promise<RequestContext> {
Expand All @@ -367,6 +371,34 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory {
requestContext.setHttpConfig(_config.httpConfig);

// Query Params
if (page !== undefined) {
requestContext.setQueryParam(
"page",
ObjectSerializer.serialize(page, "number", "int32"),
""
);
}
if (perPage !== undefined) {
requestContext.setQueryParam(
"per_page",
ObjectSerializer.serialize(perPage, "number", "int32"),
""
);
}
if (sort !== undefined) {
requestContext.setQueryParam(
"sort",
ObjectSerializer.serialize(sort, "string", ""),
""
);
}
if (filters !== undefined) {
requestContext.setQueryParam(
"filters",
ObjectSerializer.serialize(filters, "string", ""),
""
);
}
if (include !== undefined) {
requestContext.setQueryParam(
"include",
Expand Down Expand Up @@ -1836,6 +1868,29 @@ export interface MonitorsApiGetMonitorNotificationRuleRequest {
}

export interface MonitorsApiGetMonitorNotificationRulesRequest {
/**
* The page to start paginating from. If `page` is not specified, the argument defaults to the first page.
* @type number
*/
page?: number;
/**
* The number of rules to return per page. If `per_page` is not specified, the argument defaults to 100.
* @type number
*/
perPage?: number;
/**
* String for sort order, composed of field and sort order separated by a colon, for example `name:asc`. Supported sort directions: `asc`, `desc`. Supported fields: `name`, `created_at`.
* @type string
*/
sort?: string;
/**
* JSON-encoded filter object. Supported keys:
* * `text`: Free-text query matched against rule name, tags, and recipients.
* * `tags`: Array of strings. Return rules that have any of these tags.
* * `recipients`: Array of strings. Return rules that have any of these recipients.
* @type string
*/
filters?: string;
/**
* Comma-separated list of resource paths for related resources to include in the response. Supported resource
* path is `created_by`.
Expand Down Expand Up @@ -2120,7 +2175,14 @@ export class MonitorsApi {
options?: Configuration
): Promise<MonitorNotificationRuleListResponse> {
const requestContextPromise =
this.requestFactory.getMonitorNotificationRules(param.include, options);
this.requestFactory.getMonitorNotificationRules(
param.page,
param.perPage,
param.sort,
param.filters,
param.include,
options
);
return requestContextPromise.then((requestContext) => {
return this.configuration.httpApi
.send(requestContext)
Expand Down