Class: Samsara::Types::DriverEldRuleset
- Inherits:
-
Object
- Object
- Samsara::Types::DriverEldRuleset
- Defined in:
- lib/samsara_api/types/driver_eld_ruleset.rb
Overview
An ELD ruleset for a driver.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #break_ ⇒ Samsara::Types::DriverEldRulesetRestBreak readonly
- #cycle ⇒ Samsara::Types::DriverEldRulesetCycle readonly
- #jurisdiction ⇒ String readonly
- #restart ⇒ Samsara::Types::DriverEldRulesetRestart readonly
- #shift ⇒ Samsara::Types::DriverEldRulesetShift readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(break_: OMIT, cycle: OMIT, jurisdiction: OMIT, restart: OMIT, shift: OMIT, additional_properties: nil) ⇒ Samsara::Types::DriverEldRuleset constructor
- #to_json ⇒ String
Constructor Details
#initialize(break_: OMIT, cycle: OMIT, jurisdiction: OMIT, restart: OMIT, shift: OMIT, additional_properties: nil) ⇒ Samsara::Types::DriverEldRuleset
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/samsara_api/types/driver_eld_ruleset.rb', line 38 def initialize(break_: OMIT, cycle: OMIT, jurisdiction: OMIT, restart: OMIT, shift: OMIT, additional_properties: nil) @break_ = break_ if break_ != OMIT @cycle = cycle if cycle != OMIT @jurisdiction = jurisdiction if jurisdiction != OMIT @restart = restart if restart != OMIT @shift = shift if shift != OMIT @additional_properties = additional_properties @_field_set = { "break": break_, "cycle": cycle, "jurisdiction": jurisdiction, "restart": restart, "shift": shift }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
24 25 26 |
# File 'lib/samsara_api/types/driver_eld_ruleset.rb', line 24 def additional_properties @additional_properties end |
#break_ ⇒ Samsara::Types::DriverEldRulesetRestBreak (readonly)
14 15 16 |
# File 'lib/samsara_api/types/driver_eld_ruleset.rb', line 14 def break_ @break_ end |
#cycle ⇒ Samsara::Types::DriverEldRulesetCycle (readonly)
16 17 18 |
# File 'lib/samsara_api/types/driver_eld_ruleset.rb', line 16 def cycle @cycle end |
#jurisdiction ⇒ String (readonly)
18 19 20 |
# File 'lib/samsara_api/types/driver_eld_ruleset.rb', line 18 def jurisdiction @jurisdiction end |
#restart ⇒ Samsara::Types::DriverEldRulesetRestart (readonly)
20 21 22 |
# File 'lib/samsara_api/types/driver_eld_ruleset.rb', line 20 def restart @restart end |
#shift ⇒ Samsara::Types::DriverEldRulesetShift (readonly)
22 23 24 |
# File 'lib/samsara_api/types/driver_eld_ruleset.rb', line 22 def shift @shift end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::DriverEldRuleset
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/samsara_api/types/driver_eld_ruleset.rb', line 53 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) break_ = parsed_json["break"] cycle = parsed_json["cycle"] jurisdiction = parsed_json["jurisdiction"] restart = parsed_json["restart"] shift = parsed_json["shift"] new( break_: break_, cycle: cycle, jurisdiction: jurisdiction, restart: restart, shift: shift, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
82 83 84 85 86 87 88 |
# File 'lib/samsara_api/types/driver_eld_ruleset.rb', line 82 def self.validate_raw(obj:) obj.break_&.is_a?(Samsara::Types::DriverEldRulesetRestBreak) != false || raise("Passed value for field obj.break_ is not the expected type, validation failed.") obj.cycle&.is_a?(Samsara::Types::DriverEldRulesetCycle) != false || raise("Passed value for field obj.cycle is not the expected type, validation failed.") obj.jurisdiction&.is_a?(String) != false || raise("Passed value for field obj.jurisdiction is not the expected type, validation failed.") obj.restart&.is_a?(Samsara::Types::DriverEldRulesetRestart) != false || raise("Passed value for field obj.restart is not the expected type, validation failed.") obj.shift&.is_a?(Samsara::Types::DriverEldRulesetShift) != false || raise("Passed value for field obj.shift is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
73 74 75 |
# File 'lib/samsara_api/types/driver_eld_ruleset.rb', line 73 def to_json @_field_set&.to_json end |