Class: Samsara::Types::TachographDriverFile
- Inherits:
-
Object
- Object
- Samsara::Types::TachographDriverFile
- Defined in:
- lib/samsara_api/types/tachograph_driver_file.rb
Overview
Tachograph driver file
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#card_number ⇒ String
readonly
Tachograph card number associated with the file.
-
#created_at_time ⇒ Object
readonly
files manually uploaded via Samsara UI).
-
#id ⇒ String
readonly
ID of the file.
-
#url ⇒ Object
readonly
multiple times and expires after an hour.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(card_number: OMIT, created_at_time: OMIT, id: OMIT, url: OMIT, additional_properties: nil) ⇒ Samsara::Types::TachographDriverFile constructor
- #to_json ⇒ String
Constructor Details
#initialize(card_number: OMIT, created_at_time: OMIT, id: OMIT, url: OMIT, additional_properties: nil) ⇒ Samsara::Types::TachographDriverFile
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/samsara_api/types/tachograph_driver_file.rb', line 37 def initialize(card_number: OMIT, created_at_time: OMIT, id: OMIT, url: OMIT, additional_properties: nil) @card_number = card_number if card_number != OMIT @created_at_time = created_at_time if created_at_time != OMIT @id = id if id != OMIT @url = url if url != OMIT @additional_properties = additional_properties @_field_set = { "cardNumber": card_number, "createdAtTime": created_at_time, "id": id, "url": url }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/samsara_api/types/tachograph_driver_file.rb', line 21 def additional_properties @additional_properties end |
#card_number ⇒ String (readonly)
Returns Tachograph card number associated with the file.
10 11 12 |
# File 'lib/samsara_api/types/tachograph_driver_file.rb', line 10 def card_number @card_number end |
#created_at_time ⇒ Object (readonly)
files manually uploaded via Samsara UI).
14 15 16 |
# File 'lib/samsara_api/types/tachograph_driver_file.rb', line 14 def created_at_time @created_at_time end |
#id ⇒ String (readonly)
Returns ID of the file.
16 17 18 |
# File 'lib/samsara_api/types/tachograph_driver_file.rb', line 16 def id @id end |
#url ⇒ Object (readonly)
multiple times and expires after an hour.
19 20 21 |
# File 'lib/samsara_api/types/tachograph_driver_file.rb', line 19 def url @url end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::TachographDriverFile
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/samsara_api/types/tachograph_driver_file.rb', line 51 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) card_number = parsed_json["cardNumber"] created_at_time = parsed_json["createdAtTime"] id = parsed_json["id"] url = parsed_json["url"] new( card_number: card_number, created_at_time: created_at_time, id: id, url: url, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
78 79 80 81 82 83 |
# File 'lib/samsara_api/types/tachograph_driver_file.rb', line 78 def self.validate_raw(obj:) obj.card_number&.is_a?(String) != false || raise("Passed value for field obj.card_number is not the expected type, validation failed.") obj.created_at_time&.is_a?(String) != false || raise("Passed value for field obj.created_at_time is not the expected type, validation failed.") obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.url&.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
69 70 71 |
# File 'lib/samsara_api/types/tachograph_driver_file.rb', line 69 def to_json @_field_set&.to_json end |