Class: Gusto::PayrollBlocker
- Inherits:
-
Object
- Object
- Gusto::PayrollBlocker
- Defined in:
- lib/fern_gusto/types/payroll_blocker.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#key ⇒ String
readonly
The unique identifier of the reason.
-
#message ⇒ String
readonly
User-friendly message describing the payroll blocker.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(key: OMIT, message: OMIT, additional_properties: nil) ⇒ Gusto::PayrollBlocker constructor
- #to_json ⇒ String
Constructor Details
#initialize(key: OMIT, message: OMIT, additional_properties: nil) ⇒ Gusto::PayrollBlocker
23 24 25 26 27 28 29 30 |
# File 'lib/fern_gusto/types/payroll_blocker.rb', line 23 def initialize(key: OMIT, message: OMIT, additional_properties: nil) @key = key if key != OMIT @message = if != OMIT @additional_properties = additional_properties @_field_set = { "key": key, "message": }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
12 13 14 |
# File 'lib/fern_gusto/types/payroll_blocker.rb', line 12 def additional_properties @additional_properties end |
#key ⇒ String (readonly)
Returns The unique identifier of the reason.
8 9 10 |
# File 'lib/fern_gusto/types/payroll_blocker.rb', line 8 def key @key end |
#message ⇒ String (readonly)
Returns User-friendly message describing the payroll blocker.
10 11 12 |
# File 'lib/fern_gusto/types/payroll_blocker.rb', line 10 def @message end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::PayrollBlocker
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/fern_gusto/types/payroll_blocker.rb', line 35 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) key = parsed_json["key"] = parsed_json["message"] new( key: key, message: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
58 59 60 61 |
# File 'lib/fern_gusto/types/payroll_blocker.rb', line 58 def self.validate_raw(obj:) obj.key&.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.") obj.&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
49 50 51 |
# File 'lib/fern_gusto/types/payroll_blocker.rb', line 49 def to_json @_field_set&.to_json end |