Class: Samsara::Types::OrganizationInfoCarrierSettings

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(carrier_name: OMIT, dot_number: OMIT, main_office_address: OMIT, additional_properties: nil) ⇒ Samsara::Types::OrganizationInfoCarrierSettings

Parameters:

  • carrier_name (String) (defaults to: OMIT)

    Carrier for a given organization.

  • dot_number (Long) (defaults to: OMIT)

    Carrier US DOT Number for the organization.

  • main_office_address (String) (defaults to: OMIT)

    Main office address for a given organization.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_nameString (readonly)

Returns Carrier for a given organization.

Returns:

  • (String)

    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_numberLong (readonly)

Returns Carrier US DOT Number for the organization.

Returns:

  • (Long)

    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_addressString (readonly)

Returns Main office address for a given organization.

Returns:

  • (String)

    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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (String)


57
58
59
# File 'lib/samsara_api/types/organization_info_carrier_settings.rb', line 57

def to_json
  @_field_set&.to_json
end