Class: Samsara::Types::IftaDetailJobArgsResponseBody

Inherits:
Object
  • Object
show all
Defined in:
lib/samsara_api/types/ifta_detail_job_args_response_body.rb

Overview

The arguments used to create this job.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(end_hour:, start_hour:, vehicle_ids:, additional_properties: nil) ⇒ Samsara::Types::IftaDetailJobArgsResponseBody



32
33
34
35
36
37
38
# File 'lib/samsara_api/types/ifta_detail_job_args_response_body.rb', line 32

def initialize(end_hour:, start_hour:, vehicle_ids:, additional_properties: nil)
  @end_hour = end_hour
  @start_hour = start_hour
  @vehicle_ids = vehicle_ids
  @additional_properties = additional_properties
  @_field_set = { "endHour": end_hour, "startHour": start_hour, "vehicleIds": vehicle_ids }
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)



18
19
20
# File 'lib/samsara_api/types/ifta_detail_job_args_response_body.rb', line 18

def additional_properties
  @additional_properties
end

#end_hourString (readonly)



10
11
12
# File 'lib/samsara_api/types/ifta_detail_job_args_response_body.rb', line 10

def end_hour
  @end_hour
end

#start_hourString (readonly)



12
13
14
# File 'lib/samsara_api/types/ifta_detail_job_args_response_body.rb', line 12

def start_hour
  @start_hour
end

#vehicle_idsObject (readonly)

provided).



16
17
18
# File 'lib/samsara_api/types/ifta_detail_job_args_response_body.rb', line 16

def vehicle_ids
  @vehicle_ids
end

Class Method Details

.from_json(json_object:) ⇒ Samsara::Types::IftaDetailJobArgsResponseBody



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/samsara_api/types/ifta_detail_job_args_response_body.rb', line 43

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  end_hour = parsed_json["endHour"]
  start_hour = parsed_json["startHour"]
  vehicle_ids = parsed_json["vehicleIds"]
  new(
    end_hour: end_hour,
    start_hour: start_hour,
    vehicle_ids: vehicle_ids,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void



68
69
70
71
72
# File 'lib/samsara_api/types/ifta_detail_job_args_response_body.rb', line 68

def self.validate_raw(obj:)
  obj.end_hour.is_a?(String) != false || raise("Passed value for field obj.end_hour is not the expected type, validation failed.")
  obj.start_hour.is_a?(String) != false || raise("Passed value for field obj.start_hour is not the expected type, validation failed.")
  obj.vehicle_ids.is_a?(Array) != false || raise("Passed value for field obj.vehicle_ids is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString



59
60
61
# File 'lib/samsara_api/types/ifta_detail_job_args_response_body.rb', line 59

def to_json
  @_field_set&.to_json
end