Class: Gusto::Employees::EmployeesGetCustomFieldsResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/employees/types/employees_get_custom_fields_response.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(custom_fields: OMIT, additional_properties: nil) ⇒ Gusto::Employees::EmployeesGetCustomFieldsResponse

Parameters:

  • custom_fields (Array<Gusto::CustomFields::EmployeeCustomField>) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



22
23
24
25
26
27
28
# File 'lib/fern_gusto/employees/types/employees_get_custom_fields_response.rb', line 22

def initialize(custom_fields: OMIT, additional_properties: nil)
  @custom_fields = custom_fields if custom_fields != OMIT
  @additional_properties = additional_properties
  @_field_set = { "custom_fields": custom_fields }.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



12
13
14
# File 'lib/fern_gusto/employees/types/employees_get_custom_fields_response.rb', line 12

def additional_properties
  @additional_properties
end

#custom_fieldsArray<Gusto::CustomFields::EmployeeCustomField> (readonly)



10
11
12
# File 'lib/fern_gusto/employees/types/employees_get_custom_fields_response.rb', line 10

def custom_fields
  @custom_fields
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::Employees::EmployeesGetCustomFieldsResponse

Parameters:

  • json_object (String)

Returns:



33
34
35
36
37
38
39
40
41
# File 'lib/fern_gusto/employees/types/employees_get_custom_fields_response.rb', line 33

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  custom_fields = parsed_json["custom_fields"]&.map do | item |
  item = item.to_json
  Gusto::CustomFields::EmployeeCustomField.from_json(json_object: item)
end
  new(custom_fields: custom_fields, additional_properties: struct)
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


54
55
56
# File 'lib/fern_gusto/employees/types/employees_get_custom_fields_response.rb', line 54

def self.validate_raw(obj:)
  obj.custom_fields&.is_a?(Array) != false || raise("Passed value for field obj.custom_fields is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


45
46
47
# File 'lib/fern_gusto/employees/types/employees_get_custom_fields_response.rb', line 45

def to_json
  @_field_set&.to_json
end