Class: Samsara::Types::TachographDriverFileListWrapper
- Inherits:
-
Object
- Object
- Samsara::Types::TachographDriverFileListWrapper
- Defined in:
- lib/samsara_api/types/tachograph_driver_file_list_wrapper.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #driver ⇒ Samsara::Types::DriverTinyResponse readonly
- #files ⇒ Samsara::Types::TACHOGRAPH_DRIVER_FILE_LIST readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::TachographDriverFileListWrapper
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(driver: OMIT, files: OMIT, additional_properties: nil) ⇒ Samsara::Types::TachographDriverFileListWrapper constructor
- #to_json ⇒ String
Constructor Details
#initialize(driver: OMIT, files: OMIT, additional_properties: nil) ⇒ Samsara::Types::TachographDriverFileListWrapper
26 27 28 29 30 31 32 33 |
# File 'lib/samsara_api/types/tachograph_driver_file_list_wrapper.rb', line 26 def initialize(driver: OMIT, files: OMIT, additional_properties: nil) @driver = driver if driver != OMIT @files = files if files != OMIT @additional_properties = additional_properties @_field_set = { "driver": driver, "files": files }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/samsara_api/types/tachograph_driver_file_list_wrapper.rb', line 15 def additional_properties @additional_properties end |
#driver ⇒ Samsara::Types::DriverTinyResponse (readonly)
11 12 13 |
# File 'lib/samsara_api/types/tachograph_driver_file_list_wrapper.rb', line 11 def driver @driver end |
#files ⇒ Samsara::Types::TACHOGRAPH_DRIVER_FILE_LIST (readonly)
13 14 15 |
# File 'lib/samsara_api/types/tachograph_driver_file_list_wrapper.rb', line 13 def files @files end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::TachographDriverFileListWrapper
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/samsara_api/types/tachograph_driver_file_list_wrapper.rb', line 38 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["driver"].nil? driver = parsed_json["driver"].to_json driver = Samsara::Types::DriverTinyResponse.from_json(json_object: driver) else driver = nil end files = parsed_json["files"]&.map do | item | item = item.to_json Samsara::Types::TachographDriverFile.from_json(json_object: item) end new( driver: driver, files: files, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
69 70 71 72 |
# File 'lib/samsara_api/types/tachograph_driver_file_list_wrapper.rb', line 69 def self.validate_raw(obj:) obj.driver.nil? || Samsara::Types::DriverTinyResponse.validate_raw(obj: obj.driver) obj.files&.is_a?(Array) != false || raise("Passed value for field obj.files is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
60 61 62 |
# File 'lib/samsara_api/types/tachograph_driver_file_list_wrapper.rb', line 60 def to_json @_field_set&.to_json end |