Class: Samsara::Types::VoiceCoachingSettingsObjectResponseBody

Inherits:
Object
  • Object
show all
Defined in:
lib/samsara_api/types/voice_coaching_settings_object_response_body.rb

Overview

unbuckled seat belts.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(events_to_coach: OMIT, is_enabled: OMIT, language: OMIT, speeding_threshold_mph: OMIT, additional_properties: nil) ⇒ Samsara::Types::VoiceCoachingSettingsObjectResponseBody

Parameters:

  • speeding_threshold_mph (Float) (defaults to: OMIT)

    Alert when speed is over this many miles per hour.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



38
39
40
41
42
43
44
45
46
47
# File 'lib/samsara_api/types/voice_coaching_settings_object_response_body.rb', line 38

def initialize(events_to_coach: OMIT, is_enabled: OMIT, language: OMIT, speeding_threshold_mph: OMIT, additional_properties: nil)
  @events_to_coach = events_to_coach if events_to_coach != OMIT
  @is_enabled = is_enabled if is_enabled != OMIT
  @language = language if language != OMIT
  @speeding_threshold_mph = speeding_threshold_mph if speeding_threshold_mph != OMIT
  @additional_properties = additional_properties
  @_field_set = { "eventsToCoach": events_to_coach, "isEnabled": is_enabled, "language": language, "speedingThresholdMph": speeding_threshold_mph }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



23
24
25
# File 'lib/samsara_api/types/voice_coaching_settings_object_response_body.rb', line 23

def additional_properties
  @additional_properties
end

#events_to_coachObject (readonly)

include harsh acceleration and harsh brake.



14
15
16
# File 'lib/samsara_api/types/voice_coaching_settings_object_response_body.rb', line 14

def events_to_coach
  @events_to_coach
end

#is_enabledBoolean (readonly)

Returns Indicates whether voice coaching is turned on.

Returns:

  • (Boolean)

    Indicates whether voice coaching is turned on.



16
17
18
# File 'lib/samsara_api/types/voice_coaching_settings_object_response_body.rb', line 16

def is_enabled
  @is_enabled
end

#languageObject (readonly)

‘english`, `spanish`, `dutch`, `englishUk`, `italian`, `french`, `german`



19
20
21
# File 'lib/samsara_api/types/voice_coaching_settings_object_response_body.rb', line 19

def language
  @language
end

#speeding_threshold_mphFloat (readonly)

Returns Alert when speed is over this many miles per hour.

Returns:

  • (Float)

    Alert when speed is over this many miles per hour.



21
22
23
# File 'lib/samsara_api/types/voice_coaching_settings_object_response_body.rb', line 21

def speeding_threshold_mph
  @speeding_threshold_mph
end

Class Method Details

.from_json(json_object:) ⇒ Samsara::Types::VoiceCoachingSettingsObjectResponseBody

Parameters:

  • json_object (String)

Returns:



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/samsara_api/types/voice_coaching_settings_object_response_body.rb', line 53

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  events_to_coach = parsed_json["eventsToCoach"]
  is_enabled = parsed_json["isEnabled"]
  language = parsed_json["language"]
  speeding_threshold_mph = parsed_json["speedingThresholdMph"]
  new(
    events_to_coach: events_to_coach,
    is_enabled: is_enabled,
    language: language,
    speeding_threshold_mph: speeding_threshold_mph,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


81
82
83
84
85
86
# File 'lib/samsara_api/types/voice_coaching_settings_object_response_body.rb', line 81

def self.validate_raw(obj:)
  obj.events_to_coach&.is_a?(Array) != false || raise("Passed value for field obj.events_to_coach is not the expected type, validation failed.")
  obj.is_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.is_enabled is not the expected type, validation failed.")
  obj.language&.is_a?(Samsara::Types::VoiceCoachingSettingsObjectResponseBodyLanguage) != false || raise("Passed value for field obj.language is not the expected type, validation failed.")
  obj.speeding_threshold_mph&.is_a?(Float) != false || raise("Passed value for field obj.speeding_threshold_mph is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


72
73
74
# File 'lib/samsara_api/types/voice_coaching_settings_object_response_body.rb', line 72

def to_json
  @_field_set&.to_json
end