Method: Merge::Accounting::PaymentTrackingCategoriesItem.validate_raw

Defined in:
lib/merge_ruby_client/accounting/types/payment_tracking_categories_item.rb

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/merge_ruby_client/accounting/types/payment_tracking_categories_item.rb', line 40

def self.validate_raw(obj:)
  begin
    return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
  rescue StandardError
    # noop
  end
  begin
    return Merge::Accounting::TrackingCategory.validate_raw(obj: obj)
  rescue StandardError
    # noop
  end
  raise("Passed value matched no type within the union, validation failed.")
end