Class: SmplkitGeneratedClient::Audit::Event
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- SmplkitGeneratedClient::Audit::Event
- Defined in:
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb
Overview
Public-facing event resource. Attribute set on POST /api/v1/events: - action (required) - resource_type (required) - resource_id (required) - occurred_at (optional; defaults to “created_at“) - snapshot (optional) - data (optional; defaults to “{}“) Attribute set on GET responses includes everything above plus the server-populated fields: “created_at“, “actor_type“, “actor_id“, “actor_label“, “idempotency_key“.
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#actor_id ⇒ Object
Returns the value of attribute actor_id.
-
#actor_label ⇒ Object
Returns the value of attribute actor_label.
-
#actor_type ⇒ Object
Returns the value of attribute actor_type.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#data ⇒ Object
Returns the value of attribute data.
-
#do_not_forward ⇒ Object
When true, this event is recorded normally but is not forwarded to any configured SIEM forwarder.
-
#idempotency_key ⇒ Object
Returns the value of attribute idempotency_key.
-
#occurred_at ⇒ Object
Returns the value of attribute occurred_at.
-
#resource_id ⇒ Object
Returns the value of attribute resource_id.
-
#resource_type ⇒ Object
Returns the value of attribute resource_type.
-
#snapshot ⇒ Object
Returns the value of attribute snapshot.
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 = {}) ⇒ Event
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 = {}) ⇒ Event
Initializes the object
105 106 107 108 109 110 111 112 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 177 178 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 105 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::Event` 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::Event`. 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?(:'action') self.action = attributes[:'action'] else self.action = nil end if attributes.key?(:'resource_type') self.resource_type = attributes[:'resource_type'] else self.resource_type = nil end if attributes.key?(:'resource_id') self.resource_id = attributes[:'resource_id'] else self.resource_id = nil end if attributes.key?(:'occurred_at') self.occurred_at = attributes[:'occurred_at'] end if attributes.key?(:'snapshot') if (value = attributes[:'snapshot']).is_a?(Hash) self.snapshot = value end end if attributes.key?(:'data') if (value = attributes[:'data']).is_a?(Hash) self.data = value end end if attributes.key?(:'do_not_forward') self.do_not_forward = attributes[:'do_not_forward'] else self.do_not_forward = false end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end if attributes.key?(:'actor_type') self.actor_type = attributes[:'actor_type'] end if attributes.key?(:'actor_id') self.actor_id = attributes[:'actor_id'] end if attributes.key?(:'actor_label') self.actor_label = attributes[:'actor_label'] end if attributes.key?(:'idempotency_key') self.idempotency_key = attributes[:'idempotency_key'] end end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
19 20 21 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 19 def action @action end |
#actor_id ⇒ Object
Returns the value of attribute actor_id.
38 39 40 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 38 def actor_id @actor_id end |
#actor_label ⇒ Object
Returns the value of attribute actor_label.
40 41 42 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 40 def actor_label @actor_label end |
#actor_type ⇒ Object
Returns the value of attribute actor_type.
36 37 38 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 36 def actor_type @actor_type end |
#created_at ⇒ Object
Returns the value of attribute created_at.
34 35 36 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 34 def created_at @created_at end |
#data ⇒ Object
Returns the value of attribute data.
29 30 31 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 29 def data @data end |
#do_not_forward ⇒ Object
When true, this event is recorded normally but is not forwarded to any configured SIEM forwarder. A forwarder_delivery row with status=skipped_do_not_forward is recorded for each enabled forwarder so the skip is visible in the delivery log.
32 33 34 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 32 def do_not_forward @do_not_forward end |
#idempotency_key ⇒ Object
Returns the value of attribute idempotency_key.
42 43 44 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 42 def idempotency_key @idempotency_key end |
#occurred_at ⇒ Object
Returns the value of attribute occurred_at.
25 26 27 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 25 def occurred_at @occurred_at end |
#resource_id ⇒ Object
Returns the value of attribute resource_id.
23 24 25 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 23 def resource_id @resource_id end |
#resource_type ⇒ Object
Returns the value of attribute resource_type.
21 22 23 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 21 def resource_type @resource_type end |
#snapshot ⇒ Object
Returns the value of attribute snapshot.
27 28 29 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 27 def snapshot @snapshot end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
63 64 65 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 63 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
68 69 70 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 68 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 45 def self.attribute_map { :'action' => :'action', :'resource_type' => :'resource_type', :'resource_id' => :'resource_id', :'occurred_at' => :'occurred_at', :'snapshot' => :'snapshot', :'data' => :'data', :'do_not_forward' => :'do_not_forward', :'created_at' => :'created_at', :'actor_type' => :'actor_type', :'actor_id' => :'actor_id', :'actor_label' => :'actor_label', :'idempotency_key' => :'idempotency_key' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 301 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
91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 91 def self.openapi_nullable Set.new([ :'occurred_at', :'snapshot', :'created_at', :'actor_type', :'actor_id', :'actor_label', :'idempotency_key' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 73 def self.openapi_types { :'action' => :'String', :'resource_type' => :'String', :'resource_id' => :'String', :'occurred_at' => :'Time', :'snapshot' => :'Hash<String, Object>', :'data' => :'Hash<String, Object>', :'do_not_forward' => :'Boolean', :'created_at' => :'Time', :'actor_type' => :'String', :'actor_id' => :'String', :'actor_label' => :'String', :'idempotency_key' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 269 def ==(o) return true if self.equal?(o) self.class == o.class && action == o.action && resource_type == o.resource_type && resource_id == o.resource_id && occurred_at == o.occurred_at && snapshot == o.snapshot && data == o.data && do_not_forward == o.do_not_forward && created_at == o.created_at && actor_type == o.actor_type && actor_id == o.actor_id && actor_label == o.actor_label && idempotency_key == o.idempotency_key end |
#eql?(o) ⇒ Boolean
288 289 290 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 288 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
294 295 296 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 294 def hash [action, resource_type, resource_id, occurred_at, snapshot, data, do_not_forward, created_at, actor_type, actor_id, actor_label, idempotency_key].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 182 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @action.nil? invalid_properties.push('invalid value for "action", action cannot be nil.') end if @action.to_s.length < 1 invalid_properties.push('invalid value for "action", the character length must be greater than or equal to 1.') end if @resource_type.nil? invalid_properties.push('invalid value for "resource_type", resource_type cannot be nil.') end if @resource_type.to_s.length < 1 invalid_properties.push('invalid value for "resource_type", the character length must be greater than or equal to 1.') end if @resource_id.nil? invalid_properties.push('invalid value for "resource_id", resource_id cannot be nil.') end if @resource_id.to_s.length < 1 invalid_properties.push('invalid value for "resource_id", the character length must be greater than or equal to 1.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
323 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 323 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
214 215 216 217 218 219 220 221 222 223 |
# File 'lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb', line 214 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @action.nil? return false if @action.to_s.length < 1 return false if @resource_type.nil? return false if @resource_type.to_s.length < 1 return false if @resource_id.nil? return false if @resource_id.to_s.length < 1 true end |