Class: Gusto::ExternalPayrolls::ExternalPayrollMetadata
- Inherits:
-
Object
- Object
- Gusto::ExternalPayrolls::ExternalPayrollMetadata
- Defined in:
- lib/fern_gusto/external_payrolls/types/external_payroll_metadata.rb
Overview
Stores metadata of the external payroll.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#deletable ⇒ Boolean
readonly
Determines if the external payroll can be deleted.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::ExternalPayrolls::ExternalPayrollMetadata
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(deletable: OMIT, additional_properties: nil) ⇒ Gusto::ExternalPayrolls::ExternalPayrollMetadata constructor
- #to_json ⇒ String
Constructor Details
#initialize(deletable: OMIT, additional_properties: nil) ⇒ Gusto::ExternalPayrolls::ExternalPayrollMetadata
22 23 24 25 26 27 28 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_metadata.rb', line 22 def initialize(deletable: OMIT, additional_properties: nil) @deletable = deletable if deletable != OMIT @additional_properties = additional_properties @_field_set = { "deletable": deletable }.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/external_payrolls/types/external_payroll_metadata.rb', line 12 def additional_properties @additional_properties end |
#deletable ⇒ Boolean (readonly)
Returns Determines if the external payroll can be deleted.
10 11 12 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_metadata.rb', line 10 def deletable @deletable end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::ExternalPayrolls::ExternalPayrollMetadata
33 34 35 36 37 38 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_metadata.rb', line 33 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) deletable = parsed_json["deletable"] new(deletable: deletable, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
51 52 53 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_metadata.rb', line 51 def self.validate_raw(obj:) obj.deletable&.is_a?(Boolean) != false || raise("Passed value for field obj.deletable is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
42 43 44 |
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_metadata.rb', line 42 def to_json @_field_set&.to_json end |