Class: Falcon::ItautomationScheduledTask

Inherits:
Object
  • Object
show all
Defined in:
lib/crimson-falcon/models/itautomation_scheduled_task.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ItautomationScheduledTask

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



172
173
174
175
176
177
178
179
180
181
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 172

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::ItautomationScheduledTask` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Falcon::ItautomationScheduledTask`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'created_by')
    self.created_by = attributes[:'created_by']
  end

  if attributes.key?(:'created_time')
    self.created_time = attributes[:'created_time']
  end

  if attributes.key?(:'discover_new_hosts')
    self.discover_new_hosts = attributes[:'discover_new_hosts']
  end

  if attributes.key?(:'discover_offline_hosts')
    self.discover_offline_hosts = attributes[:'discover_offline_hosts']
  end

  if attributes.key?(:'distribute')
    self.distribute = attributes[:'distribute']
  end

  if attributes.key?(:'execution_args')
    if (value = attributes[:'execution_args']).is_a?(Hash)
      self.execution_args = value
    end
  end

  if attributes.key?(:'expiration_interval')
    self.expiration_interval = attributes[:'expiration_interval']
  end

  if attributes.key?(:'groups')
    if (value = attributes[:'groups']).is_a?(Array)
      self.groups = value
    end
  end

  if attributes.key?(:'guardrails')
    self.guardrails = attributes[:'guardrails']
  end

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'is_active')
    self.is_active = attributes[:'is_active']
  end

  if attributes.key?(:'is_preset')
    self.is_preset = attributes[:'is_preset']
  end

  if attributes.key?(:'last_run')
    self.last_run = attributes[:'last_run']
  end

  if attributes.key?(:'modified_by')
    self.modified_by = attributes[:'modified_by']
  end

  if attributes.key?(:'modified_time')
    self.modified_time = attributes[:'modified_time']
  end

  if attributes.key?(:'next_run_time')
    self.next_run_time = attributes[:'next_run_time']
  end

  if attributes.key?(:'schedule')
    self.schedule = attributes[:'schedule']
  end

  if attributes.key?(:'schedule_name')
    self.schedule_name = attributes[:'schedule_name']
  end

  if attributes.key?(:'target')
    self.target = attributes[:'target']
  end

  if attributes.key?(:'task_id')
    self.task_id = attributes[:'task_id']
  end

  if attributes.key?(:'task_name')
    self.task_name = attributes[:'task_name']
  end

  if attributes.key?(:'task_type')
    self.task_type = attributes[:'task_type']
  end

  if attributes.key?(:'trigger_condition')
    if (value = attributes[:'trigger_condition']).is_a?(Array)
      self.trigger_condition = value
    end
  end
end

Instance Attribute Details

#created_byObject

Username of the user who created the scheduled task. Example: john.doe@example.com



35
36
37
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 35

def created_by
  @created_by
end

#created_timeObject

Timestamp when the scheduled task was created. Example: 2023-05-01T10:00:00Z



38
39
40
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 38

def created_time
  @created_time
end

#discover_new_hostsObject

Whether to discover new hosts for the scheduled task. Example: true



41
42
43
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 41

def discover_new_hosts
  @discover_new_hosts
end

#discover_offline_hostsObject

Whether to discover offline hosts for the scheduled task. Example: true



44
45
46
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 44

def discover_offline_hosts
  @discover_offline_hosts
end

#distributeObject

Whether to distribute the scheduled task. Example: true



47
48
49
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 47

def distribute
  @distribute
end

#execution_argsObject

Additional arguments for the scheduled task



50
51
52
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 50

def execution_args
  @execution_args
end

#expiration_intervalObject

Duration for which the task stays active. Once expired, new and offline hosts won’t be targeted. Example: 1m



53
54
55
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 53

def expiration_interval
  @expiration_interval
end

#groupsObject

Group memberships of the task



56
57
58
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 56

def groups
  @groups
end

#guardrailsObject

Returns the value of attribute guardrails.



58
59
60
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 58

def guardrails
  @guardrails
end

#idObject

Unique identifier of the scheduled task. Example: st_123456789



61
62
63
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 61

def id
  @id
end

#is_activeObject

Whether the scheduled task is active. Example: true



64
65
66
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 64

def is_active
  @is_active
end

#is_presetObject

Whether this is a preset scheduled task. Example: true



67
68
69
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 67

def is_preset
  @is_preset
end

#last_runObject

Timestamp of the last execution of this scheduled task. Example: 2023-05-01T15:30:00Z



70
71
72
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 70

def last_run
  @last_run
end

#modified_byObject

Username of the user who last modified the scheduled task. Example: jane.smith@example.com



73
74
75
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 73

def modified_by
  @modified_by
end

#modified_timeObject

Timestamp when the scheduled task was last modified. Example: 2023-05-02T14:30:00Z



76
77
78
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 76

def modified_time
  @modified_time
end

#next_run_timeObject

Timestamp of the next scheduled execution of this task. Example: 2023-05-02T15:30:00Z



79
80
81
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 79

def next_run_time
  @next_run_time
end

#scheduleObject

Returns the value of attribute schedule.



81
82
83
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 81

def schedule
  @schedule
end

#schedule_nameObject

Custom name for the scheduled task. Example: Weekly Security Scan



84
85
86
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 84

def schedule_name
  @schedule_name
end

#targetObject

Filter expression to select target hosts. Example: hostname:prod



87
88
89
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 87

def target
  @target
end

#task_idObject

Unique identifier of the associated task. Example: f64b95555ef54ea682619ce880d267cc



90
91
92
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 90

def task_id
  @task_id
end

#task_nameObject

Name of the associated task. Example: Daily System Scan



93
94
95
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 93

def task_name
  @task_name
end

#task_typeObject

Type of the associated task. Example: scan



96
97
98
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 96

def task_type
  @task_type
end

#trigger_conditionObject

Conditions that trigger remediation actions



99
100
101
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 99

def trigger_condition
  @trigger_condition
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



131
132
133
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 131

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 102

def self.attribute_map
  {
    :'created_by' => :'created_by',
    :'created_time' => :'created_time',
    :'discover_new_hosts' => :'discover_new_hosts',
    :'discover_offline_hosts' => :'discover_offline_hosts',
    :'distribute' => :'distribute',
    :'execution_args' => :'execution_args',
    :'expiration_interval' => :'expiration_interval',
    :'groups' => :'groups',
    :'guardrails' => :'guardrails',
    :'id' => :'id',
    :'is_active' => :'is_active',
    :'is_preset' => :'is_preset',
    :'last_run' => :'last_run',
    :'modified_by' => :'modified_by',
    :'modified_time' => :'modified_time',
    :'next_run_time' => :'next_run_time',
    :'schedule' => :'schedule',
    :'schedule_name' => :'schedule_name',
    :'target' => :'target',
    :'task_id' => :'task_id',
    :'task_name' => :'task_name',
    :'task_type' => :'task_type',
    :'trigger_condition' => :'trigger_condition'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



397
398
399
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 397

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



165
166
167
168
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 165

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 136

def self.openapi_types
  {
    :'created_by' => :'String',
    :'created_time' => :'Time',
    :'discover_new_hosts' => :'Boolean',
    :'discover_offline_hosts' => :'Boolean',
    :'distribute' => :'Boolean',
    :'execution_args' => :'Hash<String, String>',
    :'expiration_interval' => :'String',
    :'groups' => :'Array<FalconforitapiGroupMembership>',
    :'guardrails' => :'FalconforitapiGuardrails',
    :'id' => :'String',
    :'is_active' => :'Boolean',
    :'is_preset' => :'Boolean',
    :'last_run' => :'Time',
    :'modified_by' => :'String',
    :'modified_time' => :'Time',
    :'next_run_time' => :'Time',
    :'schedule' => :'FalconforitapiSchedule',
    :'schedule_name' => :'String',
    :'target' => :'String',
    :'task_id' => :'String',
    :'task_name' => :'String',
    :'task_type' => :'String',
    :'trigger_condition' => :'Array<FalconforitapiConditionGroup>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 354

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      created_by == o.created_by &&
      created_time == o.created_time &&
      discover_new_hosts == o.discover_new_hosts &&
      discover_offline_hosts == o.discover_offline_hosts &&
      distribute == o.distribute &&
      execution_args == o.execution_args &&
      expiration_interval == o.expiration_interval &&
      groups == o.groups &&
      guardrails == o.guardrails &&
      id == o.id &&
      is_active == o.is_active &&
      is_preset == o.is_preset &&
      last_run == o.last_run &&
      modified_by == o.modified_by &&
      modified_time == o.modified_time &&
      next_run_time == o.next_run_time &&
      schedule == o.schedule &&
      schedule_name == o.schedule_name &&
      target == o.target &&
      task_id == o.task_id &&
      task_name == o.task_name &&
      task_type == o.task_type &&
      trigger_condition == o.trigger_condition
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 428

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Falcon.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



499
500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 499

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 404

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{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[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


384
385
386
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 384

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



390
391
392
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 390

def hash
  [created_by, created_time, discover_new_hosts, discover_offline_hosts, distribute, execution_args, expiration_interval, groups, guardrails, id, is_active, is_preset, last_run, modified_by, modified_time, next_run_time, schedule, schedule_name, target, task_id, task_name, task_type, trigger_condition].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 286

def list_invalid_properties
  invalid_properties = Array.new
  if @created_by.nil?
    invalid_properties.push('invalid value for "created_by", created_by cannot be nil.')
  end

  if @created_time.nil?
    invalid_properties.push('invalid value for "created_time", created_time cannot be nil.')
  end

  if @groups.nil?
    invalid_properties.push('invalid value for "groups", groups cannot be nil.')
  end

  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @is_active.nil?
    invalid_properties.push('invalid value for "is_active", is_active cannot be nil.')
  end

  if @is_preset.nil?
    invalid_properties.push('invalid value for "is_preset", is_preset cannot be nil.')
  end

  if @schedule.nil?
    invalid_properties.push('invalid value for "schedule", schedule cannot be nil.')
  end

  if @target.nil?
    invalid_properties.push('invalid value for "target", target cannot be nil.')
  end

  if @task_id.nil?
    invalid_properties.push('invalid value for "task_id", task_id cannot be nil.')
  end

  if @task_name.nil?
    invalid_properties.push('invalid value for "task_name", task_name cannot be nil.')
  end

  if @task_type.nil?
    invalid_properties.push('invalid value for "task_type", task_type cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



475
476
477
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 475

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 481

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



469
470
471
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 469

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/crimson-falcon/models/itautomation_scheduled_task.rb', line 337

def valid?
  return false if @created_by.nil?
  return false if @created_time.nil?
  return false if @groups.nil?
  return false if @id.nil?
  return false if @is_active.nil?
  return false if @is_preset.nil?
  return false if @schedule.nil?
  return false if @target.nil?
  return false if @task_id.nil?
  return false if @task_name.nil?
  return false if @task_type.nil?
  true
end