Class: Samsara::Types::VehicleStatsResponseEvChargingStatus

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

Overview

this field.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time:, value:, additional_properties: nil) ⇒ Samsara::Types::VehicleStatsResponseEvChargingStatus



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

def initialize(time:, value:, additional_properties: nil)
  @time = time
  @value = value
  @additional_properties = additional_properties
  @_field_set = { "time": time, "value": value }
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)



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

def additional_properties
  @additional_properties
end

#timeString (readonly)



11
12
13
# File 'lib/samsara_api/types/vehicle_stats_response_ev_charging_status.rb', line 11

def time
  @time
end

#valueObject (readonly)

charging - 2.



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

def value
  @value
end

Class Method Details

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



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/samsara_api/types/vehicle_stats_response_ev_charging_status.rb', line 42

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  time = parsed_json["time"]
  value = parsed_json["value"]
  new(
    time: time,
    value: value,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void



65
66
67
68
# File 'lib/samsara_api/types/vehicle_stats_response_ev_charging_status.rb', line 65

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

Instance Method Details

#to_jsonString



56
57
58
# File 'lib/samsara_api/types/vehicle_stats_response_ev_charging_status.rb', line 56

def to_json
  @_field_set&.to_json
end