Class: Gusto::TimeOffActivity

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • policy_uuid (String) (defaults to: OMIT)

    unique identifier of a time off policy

  • time_off_type (Gusto::TimeOffActivityTimeOffType) (defaults to: OMIT)

    Type of the time off activity

  • policy_name (String) (defaults to: OMIT)

    The name of the time off policy for this activity

  • event_type (String) (defaults to: OMIT)

    The type of the time off event/activity

  • event_description (String) (defaults to: OMIT)

    A description for the time off event/activity

  • effective_time (String) (defaults to: OMIT)

    The datetime of the time off activity

  • balance (String) (defaults to: OMIT)

    The time off balance at the time of the activity

  • balance_change (String) (defaults to: OMIT)

    The amount the time off balance changed as a result of the activity

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#balanceString (readonly)

Returns The time off balance at the time of the activity.

Returns:

  • (String)

    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_changeString (readonly)

Returns The amount the time off balance changed as a result of the activity.

Returns:

  • (String)

    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_timeString (readonly)

Returns The datetime of the time off activity.

Returns:

  • (String)

    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_descriptionString (readonly)

Returns A description for the time off event/activity.

Returns:

  • (String)

    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_typeString (readonly)

Returns The type of the time off event/activity.

Returns:

  • (String)

    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_nameString (readonly)

Returns The name of the time off policy for this activity.

Returns:

  • (String)

    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_uuidString (readonly)

Returns unique identifier of a time off policy.

Returns:

  • (String)

    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_typeGusto::TimeOffActivityTimeOffType (readonly)

Returns Type of the time off activity.

Returns:



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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (String)


87
88
89
# File 'lib/fern_gusto/types/time_off_activity.rb', line 87

def to_json
  @_field_set&.to_json
end