Class: Samsara::Types::WorkflowCircleResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::WorkflowCircleResponseBody
- Defined in:
- lib/samsara_api/types/workflow_circle_response_body.rb
Overview
is a circle.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#latitude ⇒ Float
readonly
Latitude of the address.
-
#longitude ⇒ Object
readonly
provided.
-
#radius_meters ⇒ Long
readonly
The radius of the circular geofence in meters.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(latitude: OMIT, longitude: OMIT, radius_meters:, additional_properties: nil) ⇒ Samsara::Types::WorkflowCircleResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(latitude: OMIT, longitude: OMIT, radius_meters:, additional_properties: nil) ⇒ Samsara::Types::WorkflowCircleResponseBody
31 32 33 34 35 36 37 38 39 |
# File 'lib/samsara_api/types/workflow_circle_response_body.rb', line 31 def initialize(latitude: OMIT, longitude: OMIT, radius_meters:, additional_properties: nil) @latitude = latitude if latitude != OMIT @longitude = longitude if longitude != OMIT @radius_meters = radius_meters @additional_properties = additional_properties @_field_set = { "latitude": latitude, "longitude": longitude, "radiusMeters": radius_meters }.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_circle_response_body.rb', line 18 def additional_properties @additional_properties end |
#latitude ⇒ Float (readonly)
Returns Latitude of the address. Will be geocoded from formattedAddress if not provided.
11 12 13 |
# File 'lib/samsara_api/types/workflow_circle_response_body.rb', line 11 def latitude @latitude end |
#longitude ⇒ Object (readonly)
provided.
14 15 16 |
# File 'lib/samsara_api/types/workflow_circle_response_body.rb', line 14 def longitude @longitude end |
#radius_meters ⇒ Long (readonly)
Returns The radius of the circular geofence in meters.
16 17 18 |
# File 'lib/samsara_api/types/workflow_circle_response_body.rb', line 16 def radius_meters @radius_meters end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::WorkflowCircleResponseBody
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/samsara_api/types/workflow_circle_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) latitude = parsed_json["latitude"] longitude = parsed_json["longitude"] radius_meters = parsed_json["radiusMeters"] new( latitude: latitude, longitude: longitude, radius_meters: radius_meters, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
69 70 71 72 73 |
# File 'lib/samsara_api/types/workflow_circle_response_body.rb', line 69 def self.validate_raw(obj:) obj.latitude&.is_a?(Float) != false || raise("Passed value for field obj.latitude is not the expected type, validation failed.") obj.longitude&.is_a?(Float) != false || raise("Passed value for field obj.longitude is not the expected type, validation failed.") obj.radius_meters.is_a?(Long) != false || raise("Passed value for field obj.radius_meters is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
60 61 62 |
# File 'lib/samsara_api/types/workflow_circle_response_body.rb', line 60 def to_json @_field_set&.to_json end |