Method: Merge::Crm::NoteOpportunity.validate_raw

Defined in:
lib/merge_ruby_client/crm/types/note_opportunity.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)


41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/merge_ruby_client/crm/types/note_opportunity.rb', line 41

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::Crm::Opportunity.validate_raw(obj: obj)
  rescue StandardError
    # noop
  end
  raise("Passed value matched no type within the union, validation failed.")
end