Class: Falcon::ItautomationTaskExecutionHostStatus

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ItautomationTaskExecutionHostStatus

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::ItautomationTaskExecutionHostStatus` 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::ItautomationTaskExecutionHostStatus`. 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?(:'end_time')
    self.end_time = attributes[:'end_time']
  end

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#end_timeObject

Timestamp when execution completed on this host. Example: 2025-01-23T18:49:26.785778Z



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

def end_time
  @end_time
end

#host_idObject

Unique identifier of the target host. Example: fc0f24b0754c488fb2139334abe2c1a3



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

def host_id
  @host_id
end

#hostnameObject

Hostname of the target system. Example: I-93TM-PC2



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

def hostname
  @hostname
end

#it_automation_policyObject

Returns the value of attribute it_automation_policy.



43
44
45
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 43

def it_automation_policy
  @it_automation_policy
end

#platformObject

Operating system platform of the host. Example: Windows



46
47
48
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 46

def platform
  @platform
end

#reasonObject

Reason for the current status. Example: In progress



49
50
51
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 49

def reason
  @reason
end

#remote_response_policyObject

Returns the value of attribute remote_response_policy.



51
52
53
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 51

def remote_response_policy
  @remote_response_policy
end

#stageObject

Current execution stage for this host. Example: query



54
55
56
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 54

def stage
  @stage
end

#start_timeObject

Timestamp when execution started on this host. Example: 2025-01-23T18:11:20.148439Z



57
58
59
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 57

def start_time
  @start_time
end

#statusObject

Current status of the task execution on this host. Example: Running



60
61
62
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 60

def status
  @status
end

#task_execution_idObject

Unique identifier for this task execution. Example: f64b95555ef54ea682619ce880d267cc



63
64
65
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 63

def task_execution_id
  @task_execution_id
end

#total_resultsObject

Total number of results returned from this host



66
67
68
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 66

def total_results
  @total_results
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



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

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 69

def self.attribute_map
  {
    :'end_time' => :'end_time',
    :'host_id' => :'host_id',
    :'hostname' => :'hostname',
    :'it_automation_policy' => :'it_automation_policy',
    :'platform' => :'platform',
    :'reason' => :'reason',
    :'remote_response_policy' => :'remote_response_policy',
    :'stage' => :'stage',
    :'start_time' => :'start_time',
    :'status' => :'status',
    :'task_execution_id' => :'task_execution_id',
    :'total_results' => :'total_results'
  }
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



266
267
268
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 266

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

.openapi_nullableObject

List of attributes with nullable: true



110
111
112
113
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 110

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

.openapi_typesObject

Attribute type mapping.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 92

def self.openapi_types
  {
    :'end_time' => :'Time',
    :'host_id' => :'String',
    :'hostname' => :'String',
    :'it_automation_policy' => :'ItautomationPolicyStatus',
    :'platform' => :'String',
    :'reason' => :'String',
    :'remote_response_policy' => :'ItautomationPolicyStatus',
    :'stage' => :'String',
    :'start_time' => :'Time',
    :'status' => :'String',
    :'task_execution_id' => :'String',
    :'total_results' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 234

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      end_time == o.end_time &&
      host_id == o.host_id &&
      hostname == o.hostname &&
      it_automation_policy == o.it_automation_policy &&
      platform == o.platform &&
      reason == o.reason &&
      remote_response_policy == o.remote_response_policy &&
      stage == o.stage &&
      start_time == o.start_time &&
      status == o.status &&
      task_execution_id == o.task_execution_id &&
      total_results == o.total_results
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



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

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



368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 368

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



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 273

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


253
254
255
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 253

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



259
260
261
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 259

def hash
  [end_time, host_id, hostname, it_automation_policy, platform, reason, remote_response_policy, stage, start_time, status, task_execution_id, total_results].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

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

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

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

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

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

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

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

  if @task_execution_id.nil?
    invalid_properties.push('invalid value for "task_execution_id", task_execution_id 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



344
345
346
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 344

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



350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 350

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



338
339
340
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 338

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



220
221
222
223
224
225
226
227
228
229
230
# File 'lib/crimson-falcon/models/itautomation_task_execution_host_status.rb', line 220

def valid?
  return false if @end_time.nil?
  return false if @host_id.nil?
  return false if @hostname.nil?
  return false if @platform.nil?
  return false if @stage.nil?
  return false if @start_time.nil?
  return false if @status.nil?
  return false if @task_execution_id.nil?
  true
end