Class: Gusto::NotificationResourcesItem
- Inherits:
-
Object
- Object
- Gusto::NotificationResourcesItem
- Defined in:
- lib/fern_gusto/types/notification_resources_item.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#entity_type ⇒ Object
readonly
“BankAccount”, “Payroll”, “ContractorPayment”, “RecoveryCase”, or “Signatory”.
-
#entity_uuid ⇒ String
readonly
Unique identifier of the entity.
-
#reference_type ⇒ Object
readonly
account belongs.
-
#reference_uuid ⇒ String
readonly
Optional.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(entity_type:, entity_uuid:, reference_type: OMIT, reference_uuid: OMIT, additional_properties: nil) ⇒ Gusto::NotificationResourcesItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(entity_type:, entity_uuid:, reference_type: OMIT, reference_uuid: OMIT, additional_properties: nil) ⇒ Gusto::NotificationResourcesItem
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_properties ⇒ OpenStruct (readonly)
Returns 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_type ⇒ Object (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_uuid ⇒ String (readonly)
Returns 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_type ⇒ Object (readonly)
account belongs.
16 17 18 |
# File 'lib/fern_gusto/types/notification_resources_item.rb', line 16 def reference_type @reference_type end |
#reference_uuid ⇒ String (readonly)
Returns 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
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
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_json ⇒ String
69 70 71 |
# File 'lib/fern_gusto/types/notification_resources_item.rb', line 69 def to_json @_field_set&.to_json end |