Class: SmplkitGeneratedClient::Audit::EventSearchRequest
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- SmplkitGeneratedClient::Audit::EventSearchRequest
- Defined in:
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb
Overview
Request body for “POST /api/v1/search/events“. Mirrors every column filter accepted by “GET /api/v1/events“ with identical semantics, and adds a top-level “filter“ field carrying a JSON Logic expression. When “filter“ is present the search is silently capped to the last 30 days by “occurred_at“; the expression is then evaluated in memory against each row that passes the column filters using the same “json-logic-qubit“ evaluator that runs in the forwarder pipeline (so search results match what would be forwarded). Filter-combination rules match “GET /api/v1/events“ exactly: - “filter“ must be accompanied by “filter“ — the index is keyed on the pair. - “filter“ must be accompanied by either “filter“ or “filter“ + “filter“ — substring matching has no index, so an unbounded substring scan is rejected.
Instance Attribute Summary collapse
-
#filter ⇒ Object
Optional JSON Logic expression evaluated against each row after column filters narrow the candidate set.
-
#filter_action ⇒ Object
Exact match on the event’s ‘action` field.
-
#filter_actor_id ⇒ Object
Exact match on the event’s ‘actor_id` field.
-
#filter_actor_type ⇒ Object
Exact match on the event’s ‘actor_type` field.
-
#filter_occurred_at ⇒ Object
Date range using interval notation, e.g.
-
#filter_resource_id ⇒ Object
Exact match on the event’s ‘resource_id` field.
-
#filter_resource_type ⇒ Object
Exact match on the event’s ‘resource_type` field.
-
#filter_search ⇒ Object
Case-insensitive substring match on ‘resource_id` or `description`.
-
#page_after ⇒ Object
Opaque cursor — pass the previous response’s ‘links.next` cursor verbatim to fetch the next page.
-
#page_size ⇒ Object
Maximum events to return.
-
#sort ⇒ Object
Sort field: ‘occurred_at` or `created_at`, optionally prefixed with `-` for descending order.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ EventSearchRequest
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ EventSearchRequest
Initializes the object
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 113 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::EventSearchRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::EventSearchRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'filter') if (value = attributes[:'filter']).is_a?(Hash) self.filter = value end end if attributes.key?(:'filter_action') self.filter_action = attributes[:'filter_action'] end if attributes.key?(:'filter_resource_type') self.filter_resource_type = attributes[:'filter_resource_type'] end if attributes.key?(:'filter_resource_id') self.filter_resource_id = attributes[:'filter_resource_id'] end if attributes.key?(:'filter_actor_type') self.filter_actor_type = attributes[:'filter_actor_type'] end if attributes.key?(:'filter_actor_id') self.filter_actor_id = attributes[:'filter_actor_id'] end if attributes.key?(:'filter_occurred_at') self.filter_occurred_at = attributes[:'filter_occurred_at'] end if attributes.key?(:'filter_search') self.filter_search = attributes[:'filter_search'] end if attributes.key?(:'page_size') self.page_size = attributes[:'page_size'] else self.page_size = 1000 end if attributes.key?(:'page_after') self.page_after = attributes[:'page_after'] end if attributes.key?(:'sort') self.sort = attributes[:'sort'] else self.sort = '-occurred_at' end end |
Instance Attribute Details
#filter ⇒ Object
Optional JSON Logic expression evaluated against each row after column filters narrow the candidate set. Null, absent, or an empty object disables JSON Logic filtering. When present, the search is silently capped to the last 30 days by ‘occurred_at` (intersected with any explicit `filter` the caller supplied).
20 21 22 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 20 def filter @filter end |
#filter_action ⇒ Object
Exact match on the event’s ‘action` field.
23 24 25 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 23 def filter_action @filter_action end |
#filter_actor_id ⇒ Object
Exact match on the event’s ‘actor_id` field.
35 36 37 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 35 def filter_actor_id @filter_actor_id end |
#filter_actor_type ⇒ Object
Exact match on the event’s ‘actor_type` field.
32 33 34 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 32 def filter_actor_type @filter_actor_type end |
#filter_occurred_at ⇒ Object
Date range using interval notation, e.g. ‘[2026-04-01T00:00:00Z,2026-04-15T00:00:00Z)`. Required by `filter` when the resource pair isn’t provided. When a JSON Logic ‘filter` is present, the effective range is intersected with the last 30 days.
38 39 40 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 38 def filter_occurred_at @filter_occurred_at end |
#filter_resource_id ⇒ Object
Exact match on the event’s ‘resource_id` field. Must be accompanied by `filter`.
29 30 31 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 29 def filter_resource_id @filter_resource_id end |
#filter_resource_type ⇒ Object
Exact match on the event’s ‘resource_type` field.
26 27 28 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 26 def filter_resource_type @filter_resource_type end |
#filter_search ⇒ Object
41 42 43 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 41 def filter_search @filter_search end |
#page_after ⇒ Object
Opaque cursor — pass the previous response’s ‘links.next` cursor verbatim to fetch the next page. Keep the same `sort` value across paginated requests.
47 48 49 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 47 def page_after @page_after end |
#page_size ⇒ Object
Maximum events to return. Range 1..1000, default 1000 — matches every other list / search endpoint on the platform. Set explicitly to a smaller value when the consumer is rendering results card-by-card.
44 45 46 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 44 def page_size @page_size end |
#sort ⇒ Object
Sort field: ‘occurred_at` or `created_at`, optionally prefixed with `-` for descending order. Default `-occurred_at` (newest first).
50 51 52 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 50 def sort @sort end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
70 71 72 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 70 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
75 76 77 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 75 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 53 def self.attribute_map { :'filter' => :'filter', :'filter_action' => :'filter[action]', :'filter_resource_type' => :'filter[resource_type]', :'filter_resource_id' => :'filter[resource_id]', :'filter_actor_type' => :'filter[actor_type]', :'filter_actor_id' => :'filter[actor_id]', :'filter_occurred_at' => :'filter[occurred_at]', :'filter_search' => :'filter[search]', :'page_size' => :'page[size]', :'page_after' => :'page[after]', :'sort' => :'sort' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 254 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 97 def self.openapi_nullable Set.new([ :'filter', :'filter_action', :'filter_resource_type', :'filter_resource_id', :'filter_actor_type', :'filter_actor_id', :'filter_occurred_at', :'filter_search', :'page_after', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 80 def self.openapi_types { :'filter' => :'Hash<String, Object>', :'filter_action' => :'String', :'filter_resource_type' => :'String', :'filter_resource_id' => :'String', :'filter_actor_type' => :'String', :'filter_actor_id' => :'String', :'filter_occurred_at' => :'String', :'filter_search' => :'String', :'page_size' => :'Integer', :'page_after' => :'String', :'sort' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 223 def ==(o) return true if self.equal?(o) self.class == o.class && filter == o.filter && filter_action == o.filter_action && filter_resource_type == o.filter_resource_type && filter_resource_id == o.filter_resource_id && filter_actor_type == o.filter_actor_type && filter_actor_id == o.filter_actor_id && filter_occurred_at == o.filter_occurred_at && filter_search == o.filter_search && page_size == o.page_size && page_after == o.page_after && sort == o.sort end |
#eql?(o) ⇒ Boolean
241 242 243 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 241 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
247 248 249 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 247 def hash [filter, filter_action, filter_resource_type, filter_resource_id, filter_actor_type, filter_actor_id, filter_occurred_at, filter_search, page_size, page_after, sort].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 180 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@page_size.nil? && @page_size > 1000 invalid_properties.push('invalid value for "page_size", must be smaller than or equal to 1000.') end if !@page_size.nil? && @page_size < 1 invalid_properties.push('invalid value for "page_size", must be greater than or equal to 1.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 276 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
196 197 198 199 200 201 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb', line 196 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@page_size.nil? && @page_size > 1000 return false if !@page_size.nil? && @page_size < 1 true end |