Class: Samsara::Types::WorkflowGeofenceEventResponseObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::WorkflowGeofenceEventResponseObjectResponseBody
- Defined in:
- lib/samsara_api/types/workflow_geofence_event_response_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.
- #address ⇒ Samsara::Types::WorkflowAddressEventWithGeofenceObjectResponseBody readonly
- #fuel_volume ⇒ Samsara::Types::FuelVolumeResponseBody readonly
- #vehicle ⇒ Samsara::Types::VehicleWithGatewayTinyResponseResponseBody readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::WorkflowGeofenceEventResponseObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(address: OMIT, fuel_volume: OMIT, vehicle: OMIT, additional_properties: nil) ⇒ Samsara::Types::WorkflowGeofenceEventResponseObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(address: OMIT, fuel_volume: OMIT, vehicle: OMIT, additional_properties: nil) ⇒ Samsara::Types::WorkflowGeofenceEventResponseObjectResponseBody
30 31 32 33 34 35 36 37 38 |
# File 'lib/samsara_api/types/workflow_geofence_event_response_object_response_body.rb', line 30 def initialize(address: OMIT, fuel_volume: OMIT, vehicle: OMIT, additional_properties: nil) @address = address if address != OMIT @fuel_volume = fuel_volume if fuel_volume != OMIT @vehicle = vehicle if vehicle != OMIT @additional_properties = additional_properties @_field_set = { "address": address, "fuelVolume": fuel_volume, "vehicle": vehicle }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/samsara_api/types/workflow_geofence_event_response_object_response_body.rb', line 18 def additional_properties @additional_properties end |
#address ⇒ Samsara::Types::WorkflowAddressEventWithGeofenceObjectResponseBody (readonly)
12 13 14 |
# File 'lib/samsara_api/types/workflow_geofence_event_response_object_response_body.rb', line 12 def address @address end |
#fuel_volume ⇒ Samsara::Types::FuelVolumeResponseBody (readonly)
14 15 16 |
# File 'lib/samsara_api/types/workflow_geofence_event_response_object_response_body.rb', line 14 def fuel_volume @fuel_volume end |
#vehicle ⇒ Samsara::Types::VehicleWithGatewayTinyResponseResponseBody (readonly)
16 17 18 |
# File 'lib/samsara_api/types/workflow_geofence_event_response_object_response_body.rb', line 16 def vehicle @vehicle end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::WorkflowGeofenceEventResponseObjectResponseBody
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/samsara_api/types/workflow_geofence_event_response_object_response_body.rb', line 44 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["address"].nil? address = parsed_json["address"].to_json address = Samsara::Types::WorkflowAddressEventWithGeofenceObjectResponseBody.from_json(json_object: address) else address = nil end unless parsed_json["fuelVolume"].nil? fuel_volume = parsed_json["fuelVolume"].to_json fuel_volume = Samsara::Types::FuelVolumeResponseBody.from_json(json_object: fuel_volume) else fuel_volume = nil end unless parsed_json["vehicle"].nil? vehicle = parsed_json["vehicle"].to_json vehicle = Samsara::Types::VehicleWithGatewayTinyResponseResponseBody.from_json(json_object: vehicle) else vehicle = nil end new( address: address, fuel_volume: fuel_volume, vehicle: vehicle, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
85 86 87 88 89 |
# File 'lib/samsara_api/types/workflow_geofence_event_response_object_response_body.rb', line 85 def self.validate_raw(obj:) obj.address.nil? || Samsara::Types::WorkflowAddressEventWithGeofenceObjectResponseBody.validate_raw(obj: obj.address) obj.fuel_volume.nil? || Samsara::Types::FuelVolumeResponseBody.validate_raw(obj: obj.fuel_volume) obj.vehicle.nil? || Samsara::Types::VehicleWithGatewayTinyResponseResponseBody.validate_raw(obj: obj.vehicle) end |
Instance Method Details
#to_json ⇒ String
76 77 78 |
# File 'lib/samsara_api/types/workflow_geofence_event_response_object_response_body.rb', line 76 def to_json @_field_set&.to_json end |