Class: Gusto::PaidHolidaysSchema
- Inherits:
-
Object
- Object
- Gusto::PaidHolidaysSchema
- Defined in:
- lib/fern_gusto/types/paid_holidays_schema.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#end_date ⇒ String
readonly
The holiday’s end date (YYYY-MM-DD).
-
#holiday_key ⇒ String
readonly
The holiday’s identifier.
-
#holiday_name ⇒ String
readonly
The holiday’s official name.
-
#start_date ⇒ String
readonly
The holiday’s start date (YYYY-MM-DD).
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(holiday_key: OMIT, holiday_name: OMIT, start_date: OMIT, end_date: OMIT, additional_properties: nil) ⇒ Gusto::PaidHolidaysSchema constructor
- #to_json ⇒ String
Constructor Details
#initialize(holiday_key: OMIT, holiday_name: OMIT, start_date: OMIT, end_date: OMIT, additional_properties: nil) ⇒ Gusto::PaidHolidaysSchema
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/fern_gusto/types/paid_holidays_schema.rb', line 29 def initialize(holiday_key: OMIT, holiday_name: OMIT, start_date: OMIT, end_date: OMIT, additional_properties: nil) @holiday_key = holiday_key if holiday_key != OMIT @holiday_name = holiday_name if holiday_name != OMIT @start_date = start_date if start_date != OMIT @end_date = end_date if end_date != OMIT @additional_properties = additional_properties @_field_set = { "holiday_key": holiday_key, "holiday_name": holiday_name, "start_date": start_date, "end_date": end_date }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/fern_gusto/types/paid_holidays_schema.rb', line 16 def additional_properties @additional_properties end |
#end_date ⇒ String (readonly)
Returns the holiday’s end date (YYYY-MM-DD).
14 15 16 |
# File 'lib/fern_gusto/types/paid_holidays_schema.rb', line 14 def end_date @end_date end |
#holiday_key ⇒ String (readonly)
Returns the holiday’s identifier.
8 9 10 |
# File 'lib/fern_gusto/types/paid_holidays_schema.rb', line 8 def holiday_key @holiday_key end |
#holiday_name ⇒ String (readonly)
Returns the holiday’s official name.
10 11 12 |
# File 'lib/fern_gusto/types/paid_holidays_schema.rb', line 10 def holiday_name @holiday_name end |
#start_date ⇒ String (readonly)
Returns the holiday’s start date (YYYY-MM-DD).
12 13 14 |
# File 'lib/fern_gusto/types/paid_holidays_schema.rb', line 12 def start_date @start_date end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::PaidHolidaysSchema
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/fern_gusto/types/paid_holidays_schema.rb', line 43 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) holiday_key = parsed_json["holiday_key"] holiday_name = parsed_json["holiday_name"] start_date = parsed_json["start_date"] end_date = parsed_json["end_date"] new( holiday_key: holiday_key, holiday_name: holiday_name, start_date: start_date, end_date: end_date, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
70 71 72 73 74 75 |
# File 'lib/fern_gusto/types/paid_holidays_schema.rb', line 70 def self.validate_raw(obj:) obj.holiday_key&.is_a?(String) != false || raise("Passed value for field obj.holiday_key is not the expected type, validation failed.") obj.holiday_name&.is_a?(String) != false || raise("Passed value for field obj.holiday_name is not the expected type, validation failed.") obj.start_date&.is_a?(String) != false || raise("Passed value for field obj.start_date is not the expected type, validation failed.") obj.end_date&.is_a?(String) != false || raise("Passed value for field obj.end_date is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
61 62 63 |
# File 'lib/fern_gusto/types/paid_holidays_schema.rb', line 61 def to_json @_field_set&.to_json end |