Class: Gusto::TimeOffActivity
- Inherits:
-
Object
- Object
- Gusto::TimeOffActivity
- Defined in:
- lib/fern_gusto/types/time_off_activity.rb
Overview
Representation of a Time Off Activity
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#balance ⇒ String
readonly
The time off balance at the time of the activity.
-
#balance_change ⇒ String
readonly
The amount the time off balance changed as a result of the activity.
-
#effective_time ⇒ String
readonly
The datetime of the time off activity.
-
#event_description ⇒ String
readonly
A description for the time off event/activity.
-
#event_type ⇒ String
readonly
The type of the time off event/activity.
-
#policy_name ⇒ String
readonly
The name of the time off policy for this activity.
-
#policy_uuid ⇒ String
readonly
Unique identifier of a time off policy.
-
#time_off_type ⇒ Gusto::TimeOffActivityTimeOffType
readonly
Type of the time off activity.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(policy_uuid: OMIT, time_off_type: OMIT, policy_name: OMIT, event_type: OMIT, event_description: OMIT, effective_time: OMIT, balance: OMIT, balance_change: OMIT, additional_properties: nil) ⇒ Gusto::TimeOffActivity constructor
- #to_json ⇒ String
Constructor Details
#initialize(policy_uuid: OMIT, time_off_type: OMIT, policy_name: OMIT, event_type: OMIT, event_description: OMIT, effective_time: OMIT, balance: OMIT, balance_change: OMIT, additional_properties: nil) ⇒ Gusto::TimeOffActivity
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 43 def initialize(policy_uuid: OMIT, time_off_type: OMIT, policy_name: OMIT, event_type: OMIT, event_description: OMIT, effective_time: OMIT, balance: OMIT, balance_change: OMIT, additional_properties: nil) @policy_uuid = policy_uuid if policy_uuid != OMIT @time_off_type = time_off_type if time_off_type != OMIT @policy_name = policy_name if policy_name != OMIT @event_type = event_type if event_type != OMIT @event_description = event_description if event_description != OMIT @effective_time = effective_time if effective_time != OMIT @balance = balance if balance != OMIT @balance_change = balance_change if balance_change != OMIT @additional_properties = additional_properties @_field_set = { "policy_uuid": policy_uuid, "time_off_type": time_off_type, "policy_name": policy_name, "event_type": event_type, "event_description": event_description, "effective_time": effective_time, "balance": balance, "balance_change": balance_change }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
26 27 28 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 26 def additional_properties @additional_properties end |
#balance ⇒ String (readonly)
Returns The time off balance at the time of the activity.
22 23 24 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 22 def balance @balance end |
#balance_change ⇒ String (readonly)
Returns The amount the time off balance changed as a result of the activity.
24 25 26 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 24 def balance_change @balance_change end |
#effective_time ⇒ String (readonly)
Returns The datetime of the time off activity.
20 21 22 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 20 def effective_time @effective_time end |
#event_description ⇒ String (readonly)
Returns A description for the time off event/activity.
18 19 20 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 18 def event_description @event_description end |
#event_type ⇒ String (readonly)
Returns The type of the time off event/activity.
16 17 18 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 16 def event_type @event_type end |
#policy_name ⇒ String (readonly)
Returns The name of the time off policy for this activity.
14 15 16 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 14 def policy_name @policy_name end |
#policy_uuid ⇒ String (readonly)
Returns unique identifier of a time off policy.
10 11 12 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 10 def policy_uuid @policy_uuid end |
#time_off_type ⇒ Gusto::TimeOffActivityTimeOffType (readonly)
Returns Type of the time off activity.
12 13 14 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 12 def time_off_type @time_off_type end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::TimeOffActivity
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 61 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) policy_uuid = parsed_json["policy_uuid"] time_off_type = parsed_json["time_off_type"] policy_name = parsed_json["policy_name"] event_type = parsed_json["event_type"] event_description = parsed_json["event_description"] effective_time = parsed_json["effective_time"] balance = parsed_json["balance"] balance_change = parsed_json["balance_change"] new( policy_uuid: policy_uuid, time_off_type: time_off_type, policy_name: policy_name, event_type: event_type, event_description: event_description, effective_time: effective_time, balance: balance, balance_change: balance_change, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
96 97 98 99 100 101 102 103 104 105 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 96 def self.validate_raw(obj:) obj.policy_uuid&.is_a?(String) != false || raise("Passed value for field obj.policy_uuid is not the expected type, validation failed.") obj.time_off_type&.is_a?(Gusto::TimeOffActivityTimeOffType) != false || raise("Passed value for field obj.time_off_type is not the expected type, validation failed.") obj.policy_name&.is_a?(String) != false || raise("Passed value for field obj.policy_name is not the expected type, validation failed.") obj.event_type&.is_a?(String) != false || raise("Passed value for field obj.event_type is not the expected type, validation failed.") obj.event_description&.is_a?(String) != false || raise("Passed value for field obj.event_description is not the expected type, validation failed.") obj.effective_time&.is_a?(String) != false || raise("Passed value for field obj.effective_time is not the expected type, validation failed.") obj.balance&.is_a?(String) != false || raise("Passed value for field obj.balance is not the expected type, validation failed.") obj.balance_change&.is_a?(String) != false || raise("Passed value for field obj.balance_change is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
87 88 89 |
# File 'lib/fern_gusto/types/time_off_activity.rb', line 87 def to_json @_field_set&.to_json end |