Class: Gusto::NotificationResourcesItem

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/types/notification_resources_item.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entity_type:, entity_uuid:, reference_type: OMIT, reference_uuid: OMIT, additional_properties: nil) ⇒ Gusto::NotificationResourcesItem

Parameters:

  • reference_uuid (String) (defaults to: OMIT)

    Optional. Unique identifier of the reference.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



37
38
39
40
41
42
43
44
45
46
# File 'lib/fern_gusto/types/notification_resources_item.rb', line 37

def initialize(entity_type:, entity_uuid:, reference_type: OMIT, reference_uuid: OMIT, additional_properties: nil)
  @entity_type = entity_type
  @entity_uuid = entity_uuid
  @reference_type = reference_type if reference_type != OMIT
  @reference_uuid = reference_uuid if reference_uuid != OMIT
  @additional_properties = additional_properties
  @_field_set = { "entity_type": entity_type, "entity_uuid": entity_uuid, "reference_type": reference_type, "reference_uuid": reference_uuid }.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



20
21
22
# File 'lib/fern_gusto/types/notification_resources_item.rb', line 20

def additional_properties
  @additional_properties
end

#entity_typeObject (readonly)

“BankAccount”, “Payroll”, “ContractorPayment”, “RecoveryCase”, or “Signatory”



9
10
11
# File 'lib/fern_gusto/types/notification_resources_item.rb', line 9

def entity_type
  @entity_type
end

#entity_uuidString (readonly)

Returns Unique identifier of the entity.

Returns:

  • (String)

    Unique identifier of the entity



11
12
13
# File 'lib/fern_gusto/types/notification_resources_item.rb', line 11

def entity_uuid
  @entity_uuid
end

#reference_typeObject (readonly)

account belongs.



16
17
18
# File 'lib/fern_gusto/types/notification_resources_item.rb', line 16

def reference_type
  @reference_type
end

#reference_uuidString (readonly)

Returns Optional. Unique identifier of the reference.

Returns:

  • (String)

    Optional. Unique identifier of the reference.



18
19
20
# File 'lib/fern_gusto/types/notification_resources_item.rb', line 18

def reference_uuid
  @reference_uuid
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::NotificationResourcesItem

Parameters:

  • json_object (String)

Returns:



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/fern_gusto/types/notification_resources_item.rb', line 51

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  entity_type = parsed_json["entity_type"]
  entity_uuid = parsed_json["entity_uuid"]
  reference_type = parsed_json["reference_type"]
  reference_uuid = parsed_json["reference_uuid"]
  new(
    entity_type: entity_type,
    entity_uuid: entity_uuid,
    reference_type: reference_type,
    reference_uuid: reference_uuid,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


78
79
80
81
82
83
# File 'lib/fern_gusto/types/notification_resources_item.rb', line 78

def self.validate_raw(obj:)
  obj.entity_type.is_a?(String) != false || raise("Passed value for field obj.entity_type is not the expected type, validation failed.")
  obj.entity_uuid.is_a?(String) != false || raise("Passed value for field obj.entity_uuid is not the expected type, validation failed.")
  obj.reference_type&.is_a?(String) != false || raise("Passed value for field obj.reference_type is not the expected type, validation failed.")
  obj.reference_uuid&.is_a?(String) != false || raise("Passed value for field obj.reference_uuid is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


69
70
71
# File 'lib/fern_gusto/types/notification_resources_item.rb', line 69

def to_json
  @_field_set&.to_json
end