Class: Gusto::PayrollBlockersErrorErrorsItem

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_key: OMIT, category: OMIT, message: OMIT, metadata: OMIT, additional_properties: nil) ⇒ Gusto::PayrollBlockersErrorErrorsItem

Parameters:

  • error_key (String) (defaults to: OMIT)

    The string “base”

  • category (String) (defaults to: OMIT)

    The string “payroll_blocker”

  • message (String) (defaults to: OMIT)

    Human readable description of the payroll blocker

  • metadata (Gusto::PayrollBlockersErrorErrorsItemMetadata) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



30
31
32
33
34
35
36
37
38
39
# File 'lib/fern_gusto/types/payroll_blockers_error_errors_item.rb', line 30

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



17
18
19
# File 'lib/fern_gusto/types/payroll_blockers_error_errors_item.rb', line 17

def additional_properties
  @additional_properties
end

#categoryString (readonly)

Returns The string “payroll_blocker”.

Returns:

  • (String)

    The string “payroll_blocker”



11
12
13
# File 'lib/fern_gusto/types/payroll_blockers_error_errors_item.rb', line 11

def category
  @category
end

#error_keyString (readonly)

Returns The string “base”.

Returns:

  • (String)

    The string “base”



9
10
11
# File 'lib/fern_gusto/types/payroll_blockers_error_errors_item.rb', line 9

def error_key
  @error_key
end

#messageString (readonly)

Returns Human readable description of the payroll blocker.

Returns:

  • (String)

    Human readable description of the payroll blocker



13
14
15
# File 'lib/fern_gusto/types/payroll_blockers_error_errors_item.rb', line 13

def message
  @message
end

#metadataGusto::PayrollBlockersErrorErrorsItemMetadata (readonly)



15
16
17
# File 'lib/fern_gusto/types/payroll_blockers_error_errors_item.rb', line 15

def 
  @metadata
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PayrollBlockersErrorErrorsItem

Parameters:

  • json_object (String)

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/fern_gusto/types/payroll_blockers_error_errors_item.rb', line 44

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  error_key = parsed_json["error_key"]
  category = parsed_json["category"]
  message = parsed_json["message"]
  unless parsed_json["metadata"].nil?
     = parsed_json["metadata"].to_json
     = Gusto::PayrollBlockersErrorErrorsItemMetadata.from_json(json_object: )
  else
     = nil
  end
  new(
    error_key: error_key,
    category: category,
    message: message,
    metadata: ,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


76
77
78
79
80
81
# File 'lib/fern_gusto/types/payroll_blockers_error_errors_item.rb', line 76

def self.validate_raw(obj:)
  obj.error_key&.is_a?(String) != false || raise("Passed value for field obj.error_key is not the expected type, validation failed.")
  obj.category&.is_a?(String) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
  obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
  obj..nil? || Gusto::PayrollBlockersErrorErrorsItemMetadata.validate_raw(obj: obj.)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


67
68
69
# File 'lib/fern_gusto/types/payroll_blockers_error_errors_item.rb', line 67

def to_json
  @_field_set&.to_json
end