Class: Samsara::Types::AddressGeofenceSettings
- Inherits:
-
Object
- Object
- Samsara::Types::AddressGeofenceSettings
- Defined in:
- lib/samsara_api/types/address_geofence_settings.rb
Overview
Information about a geofence’s settings.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#show_addresses ⇒ Object
readonly
shown in reports instead of a geofence’s name.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(show_addresses: OMIT, additional_properties: nil) ⇒ Samsara::Types::AddressGeofenceSettings constructor
- #to_json ⇒ String
Constructor Details
#initialize(show_addresses: OMIT, additional_properties: nil) ⇒ Samsara::Types::AddressGeofenceSettings
24 25 26 27 28 29 30 |
# File 'lib/samsara_api/types/address_geofence_settings.rb', line 24 def initialize(show_addresses: OMIT, additional_properties: nil) @show_addresses = show_addresses if show_addresses != OMIT @additional_properties = additional_properties @_field_set = { "showAddresses": show_addresses }.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/address_geofence_settings.rb', line 13 def additional_properties @additional_properties end |
#show_addresses ⇒ Object (readonly)
shown in reports instead of a geofence’s name.
11 12 13 |
# File 'lib/samsara_api/types/address_geofence_settings.rb', line 11 def show_addresses @show_addresses end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::AddressGeofenceSettings
35 36 37 38 39 40 |
# File 'lib/samsara_api/types/address_geofence_settings.rb', line 35 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) show_addresses = parsed_json["showAddresses"] new(show_addresses: show_addresses, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
53 54 55 |
# File 'lib/samsara_api/types/address_geofence_settings.rb', line 53 def self.validate_raw(obj:) obj.show_addresses&.is_a?(Boolean) != false || raise("Passed value for field obj.show_addresses is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
44 45 46 |
# File 'lib/samsara_api/types/address_geofence_settings.rb', line 44 def to_json @_field_set&.to_json end |