diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index bb7c9c3507f5..2f4dce9e3c26 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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@example.com"]}' + 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 diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 1411b4ad4902..77c897ba63c2 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -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": "", diff --git a/packages/datadog-api-client-v2/apis/MonitorsApi.ts b/packages/datadog-api-client-v2/apis/MonitorsApi.ts index c6804f67591f..d7502f295b4f 100644 --- a/packages/datadog-api-client-v2/apis/MonitorsApi.ts +++ b/packages/datadog-api-client-v2/apis/MonitorsApi.ts @@ -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 { @@ -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", @@ -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`. @@ -2120,7 +2175,14 @@ export class MonitorsApi { options?: Configuration ): Promise { 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)