Class: Samsara::Types::OrganizationInfoCarrierSettings
- Inherits:
-
Object
- Object
- Samsara::Types::OrganizationInfoCarrierSettings
- Defined in:
- lib/samsara_api/types/organization_info_carrier_settings.rb
Overview
Carrier for a given organization.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#carrier_name ⇒ String
readonly
Carrier for a given organization.
-
#dot_number ⇒ Long
readonly
Carrier US DOT Number for the organization.
-
#main_office_address ⇒ String
readonly
Main office address for a given organization.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::OrganizationInfoCarrierSettings
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(carrier_name: OMIT, dot_number: OMIT, main_office_address: OMIT, additional_properties: nil) ⇒ Samsara::Types::OrganizationInfoCarrierSettings constructor
- #to_json ⇒ String
Constructor Details
#initialize(carrier_name: OMIT, dot_number: OMIT, main_office_address: OMIT, additional_properties: nil) ⇒ Samsara::Types::OrganizationInfoCarrierSettings
28 29 30 31 32 33 34 35 36 |
# File 'lib/samsara_api/types/organization_info_carrier_settings.rb', line 28 def initialize(carrier_name: OMIT, dot_number: OMIT, main_office_address: OMIT, additional_properties: nil) @carrier_name = carrier_name if carrier_name != OMIT @dot_number = dot_number if dot_number != OMIT @main_office_address = main_office_address if main_office_address != OMIT @additional_properties = additional_properties @_field_set = { "carrierName": carrier_name, "dotNumber": dot_number, "mainOfficeAddress": main_office_address }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/samsara_api/types/organization_info_carrier_settings.rb', line 16 def additional_properties @additional_properties end |
#carrier_name ⇒ String (readonly)
Returns Carrier for a given organization.
10 11 12 |
# File 'lib/samsara_api/types/organization_info_carrier_settings.rb', line 10 def carrier_name @carrier_name end |
#dot_number ⇒ Long (readonly)
Returns Carrier US DOT Number for the organization.
12 13 14 |
# File 'lib/samsara_api/types/organization_info_carrier_settings.rb', line 12 def dot_number @dot_number end |
#main_office_address ⇒ String (readonly)
Returns Main office address for a given organization.
14 15 16 |
# File 'lib/samsara_api/types/organization_info_carrier_settings.rb', line 14 def main_office_address @main_office_address end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::OrganizationInfoCarrierSettings
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/samsara_api/types/organization_info_carrier_settings.rb', line 41 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) carrier_name = parsed_json["carrierName"] dot_number = parsed_json["dotNumber"] main_office_address = parsed_json["mainOfficeAddress"] new( carrier_name: carrier_name, dot_number: dot_number, main_office_address: main_office_address, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
66 67 68 69 70 |
# File 'lib/samsara_api/types/organization_info_carrier_settings.rb', line 66 def self.validate_raw(obj:) obj.carrier_name&.is_a?(String) != false || raise("Passed value for field obj.carrier_name is not the expected type, validation failed.") obj.dot_number&.is_a?(Long) != false || raise("Passed value for field obj.dot_number is not the expected type, validation failed.") obj.main_office_address&.is_a?(String) != false || raise("Passed value for field obj.main_office_address is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
57 58 59 |
# File 'lib/samsara_api/types/organization_info_carrier_settings.rb', line 57 def to_json @_field_set&.to_json end |