diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ce80244d235..2f4dce9e3c2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41720,7 +41720,7 @@ components: type: string type: object Shift: - description: The definition of `Shift` object. + description: An on-call shift with its associated data and relationships. example: data: attributes: @@ -41751,7 +41751,7 @@ components: type: array type: object ShiftData: - description: The definition of `ShiftData` object. + description: Data for an on-call shift. properties: attributes: $ref: '#/components/schemas/ShiftDataAttributes' @@ -41766,7 +41766,7 @@ components: - type type: object ShiftDataAttributes: - description: The definition of `ShiftDataAttributes` object. + description: Attributes for an on-call shift. properties: end: description: The end time of the shift. @@ -41778,7 +41778,7 @@ components: type: string type: object ShiftDataRelationships: - description: The definition of `ShiftDataRelationships` object. + description: Relationships for an on-call shift. properties: user: $ref: '#/components/schemas/ShiftDataRelationshipsUser' @@ -41825,7 +41825,7 @@ components: x-enum-varnames: - SHIFTS ShiftIncluded: - description: The definition of `ShiftIncluded` object. + description: Included data for shift operations. oneOf: - $ref: '#/components/schemas/ScheduleUser' SimpleMonitorUserTemplate: @@ -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/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index d9db8df0b64..790fea3c338 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2153,6 +2153,10 @@ "body" => "MetricPayload", }, "v2.GetMonitorNotificationRules" => { + "page" => "Integer", + "per_page" => "Integer", + "sort" => "String", + "filters" => "String", "include" => "String", }, "v2.CreateMonitorNotificationRule" => { diff --git a/lib/datadog_api_client/v2/api/monitors_api.rb b/lib/datadog_api_client/v2/api/monitors_api.rb index 78f2f41cb5e..c89f588a3b1 100644 --- a/lib/datadog_api_client/v2/api/monitors_api.rb +++ b/lib/datadog_api_client/v2/api/monitors_api.rb @@ -576,6 +576,10 @@ def get_monitor_notification_rules(opts = {}) # Returns a list of all monitor notification rules. # # @param opts [Hash] the optional parameters + # @option opts [Integer] :page The page to start paginating from. If `page` is not specified, the argument defaults to the first page. + # @option opts [Integer] :per_page The number of rules to return per page. If `per_page` is not specified, the argument defaults to 100. + # @option opts [String] :sort 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`. + # @option opts [String] :filters 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. # @option opts [String] :include Comma-separated list of resource paths for related resources to include in the response. Supported resource path is `created_by`. # @return [Array<(MonitorNotificationRuleListResponse, Integer, Hash)>] MonitorNotificationRuleListResponse data, response status code and response headers def get_monitor_notification_rules_with_http_info(opts = {}) @@ -583,11 +587,27 @@ def get_monitor_notification_rules_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MonitorsAPI.get_monitor_notification_rules ...' end + if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 1000000 + fail ArgumentError, 'invalid value for "opts[:"page"]" when calling MonitorsAPI.get_monitor_notification_rules, must be smaller than or equal to 1000000.' + end + if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 + fail ArgumentError, 'invalid value for "opts[:"page"]" when calling MonitorsAPI.get_monitor_notification_rules, must be greater than or equal to 0.' + end + if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling MonitorsAPI.get_monitor_notification_rules, must be smaller than or equal to 1000.' + end + if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1 + fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling MonitorsAPI.get_monitor_notification_rules, must be greater than or equal to 1.' + end # resource path local_var_path = '/api/v2/monitor/notification_rule' # query parameters query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil? query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters diff --git a/lib/datadog_api_client/v2/models/shift.rb b/lib/datadog_api_client/v2/models/shift.rb index e5e47c24415..a6727cc58ad 100644 --- a/lib/datadog_api_client/v2/models/shift.rb +++ b/lib/datadog_api_client/v2/models/shift.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # The definition of `Shift` object. + # An on-call shift with its associated data and relationships. class Shift include BaseGenericModel - # The definition of `ShiftData` object. + # Data for an on-call shift. attr_accessor :data # The `Shift` `included`. diff --git a/lib/datadog_api_client/v2/models/shift_data.rb b/lib/datadog_api_client/v2/models/shift_data.rb index 67cbcaf2d48..be42bd0dd5c 100644 --- a/lib/datadog_api_client/v2/models/shift_data.rb +++ b/lib/datadog_api_client/v2/models/shift_data.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # The definition of `ShiftData` object. + # Data for an on-call shift. class ShiftData include BaseGenericModel - # The definition of `ShiftDataAttributes` object. + # Attributes for an on-call shift. attr_accessor :attributes # The `ShiftData` `id`. attr_accessor :id - # The definition of `ShiftDataRelationships` object. + # Relationships for an on-call shift. attr_accessor :relationships # Indicates that the resource is of type 'shifts'. diff --git a/lib/datadog_api_client/v2/models/shift_data_attributes.rb b/lib/datadog_api_client/v2/models/shift_data_attributes.rb index 6f317bfa94a..b3046d2f9c5 100644 --- a/lib/datadog_api_client/v2/models/shift_data_attributes.rb +++ b/lib/datadog_api_client/v2/models/shift_data_attributes.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # The definition of `ShiftDataAttributes` object. + # Attributes for an on-call shift. class ShiftDataAttributes include BaseGenericModel diff --git a/lib/datadog_api_client/v2/models/shift_data_relationships.rb b/lib/datadog_api_client/v2/models/shift_data_relationships.rb index 841d72d96b1..38fffbf2ac4 100644 --- a/lib/datadog_api_client/v2/models/shift_data_relationships.rb +++ b/lib/datadog_api_client/v2/models/shift_data_relationships.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # The definition of `ShiftDataRelationships` object. + # Relationships for an on-call shift. class ShiftDataRelationships include BaseGenericModel diff --git a/lib/datadog_api_client/v2/models/shift_included.rb b/lib/datadog_api_client/v2/models/shift_included.rb index 1fd4773db3e..4bcc963dc29 100644 --- a/lib/datadog_api_client/v2/models/shift_included.rb +++ b/lib/datadog_api_client/v2/models/shift_included.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # The definition of `ShiftIncluded` object. + # Included data for shift operations. module ShiftIncluded class << self include BaseOneOfModel