Class: Samsara::Types::BarcodeValueObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::BarcodeValueObjectResponseBody
- Defined in:
- lib/samsara_api/types/barcode_value_object_response_body.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#barcode_type ⇒ String
readonly
The barcode type that was scanned.
-
#barcode_value ⇒ String
readonly
The captured barcode value.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::BarcodeValueObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(barcode_type: OMIT, barcode_value: OMIT, additional_properties: nil) ⇒ Samsara::Types::BarcodeValueObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(barcode_type: OMIT, barcode_value: OMIT, additional_properties: nil) ⇒ Samsara::Types::BarcodeValueObjectResponseBody
24 25 26 27 28 29 30 31 |
# File 'lib/samsara_api/types/barcode_value_object_response_body.rb', line 24 def initialize(barcode_type: OMIT, barcode_value: OMIT, additional_properties: nil) = if != OMIT = if != OMIT @additional_properties = additional_properties @_field_set = { "barcodeType": , "barcodeValue": }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
13 14 15 |
# File 'lib/samsara_api/types/barcode_value_object_response_body.rb', line 13 def additional_properties @additional_properties end |
#barcode_type ⇒ String (readonly)
Returns The barcode type that was scanned.
9 10 11 |
# File 'lib/samsara_api/types/barcode_value_object_response_body.rb', line 9 def end |
#barcode_value ⇒ String (readonly)
Returns The captured barcode value.
11 12 13 |
# File 'lib/samsara_api/types/barcode_value_object_response_body.rb', line 11 def end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::BarcodeValueObjectResponseBody
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/samsara_api/types/barcode_value_object_response_body.rb', line 36 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) = parsed_json["barcodeType"] = parsed_json["barcodeValue"] new( barcode_type: , barcode_value: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
59 60 61 62 |
# File 'lib/samsara_api/types/barcode_value_object_response_body.rb', line 59 def self.validate_raw(obj:) obj.&.is_a?(String) != false || raise("Passed value for field obj.barcode_type is not the expected type, validation failed.") obj.&.is_a?(String) != false || raise("Passed value for field obj.barcode_value is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
50 51 52 |
# File 'lib/samsara_api/types/barcode_value_object_response_body.rb', line 50 def to_json @_field_set&.to_json end |