Class: Samsara::Types::WorkflowGeofenceResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::WorkflowGeofenceResponseBody
- Defined in:
- lib/samsara_api/types/workflow_geofence_response_body.rb
Overview
circle or a polygon, but not both.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #circle ⇒ Samsara::Types::WorkflowCircleResponseBody readonly
- #polygon ⇒ Samsara::Types::WorkflowPolygonResponseBody readonly
- #settings ⇒ Samsara::Types::SettingsResponseBody readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(circle: OMIT, polygon: OMIT, settings: OMIT, additional_properties: nil) ⇒ Samsara::Types::WorkflowGeofenceResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(circle: OMIT, polygon: OMIT, settings: OMIT, additional_properties: nil) ⇒ Samsara::Types::WorkflowGeofenceResponseBody
32 33 34 35 36 37 38 39 40 |
# File 'lib/samsara_api/types/workflow_geofence_response_body.rb', line 32 def initialize(circle: OMIT, polygon: OMIT, settings: OMIT, additional_properties: nil) @circle = circle if circle != OMIT @polygon = polygon if polygon != OMIT @settings = settings if settings != OMIT @additional_properties = additional_properties @_field_set = { "circle": circle, "polygon": polygon, "settings": settings }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/samsara_api/types/workflow_geofence_response_body.rb', line 20 def additional_properties @additional_properties end |
#circle ⇒ Samsara::Types::WorkflowCircleResponseBody (readonly)
14 15 16 |
# File 'lib/samsara_api/types/workflow_geofence_response_body.rb', line 14 def circle @circle end |
#polygon ⇒ Samsara::Types::WorkflowPolygonResponseBody (readonly)
16 17 18 |
# File 'lib/samsara_api/types/workflow_geofence_response_body.rb', line 16 def polygon @polygon end |
#settings ⇒ Samsara::Types::SettingsResponseBody (readonly)
18 19 20 |
# File 'lib/samsara_api/types/workflow_geofence_response_body.rb', line 18 def settings @settings end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::WorkflowGeofenceResponseBody
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 72 |
# File 'lib/samsara_api/types/workflow_geofence_response_body.rb', line 45 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["circle"].nil? circle = parsed_json["circle"].to_json circle = Samsara::Types::WorkflowCircleResponseBody.from_json(json_object: circle) else circle = nil end unless parsed_json["polygon"].nil? polygon = parsed_json["polygon"].to_json polygon = Samsara::Types::WorkflowPolygonResponseBody.from_json(json_object: polygon) else polygon = nil end unless parsed_json["settings"].nil? settings = parsed_json["settings"].to_json settings = Samsara::Types::SettingsResponseBody.from_json(json_object: settings) else settings = nil end new( circle: circle, polygon: polygon, settings: settings, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
85 86 87 88 89 |
# File 'lib/samsara_api/types/workflow_geofence_response_body.rb', line 85 def self.validate_raw(obj:) obj.circle.nil? || Samsara::Types::WorkflowCircleResponseBody.validate_raw(obj: obj.circle) obj.polygon.nil? || Samsara::Types::WorkflowPolygonResponseBody.validate_raw(obj: obj.polygon) obj.settings.nil? || Samsara::Types::SettingsResponseBody.validate_raw(obj: obj.settings) end |
Instance Method Details
#to_json ⇒ String
76 77 78 |
# File 'lib/samsara_api/types/workflow_geofence_response_body.rb', line 76 def to_json @_field_set&.to_json end |