Method: Merge::Crm::AssociationType.validate_raw

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


136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/merge_ruby_client/crm/types/association_type.rb', line 136

def self.validate_raw(obj:)
  obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.remote_id&.is_a?(String) != false || raise("Passed value for field obj.remote_id is not the expected type, validation failed.")
  obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
  obj.modified_at&.is_a?(DateTime) != false || raise("Passed value for field obj.modified_at is not the expected type, validation failed.")
  obj.source_object_class&.is_a?(Hash) != false || raise("Passed value for field obj.source_object_class is not the expected type, validation failed.")
  obj.target_object_classes&.is_a?(Array) != false || raise("Passed value for field obj.target_object_classes is not the expected type, validation failed.")
  obj.remote_key_name&.is_a?(String) != false || raise("Passed value for field obj.remote_key_name is not the expected type, validation failed.")
  obj.display_name&.is_a?(String) != false || raise("Passed value for field obj.display_name is not the expected type, validation failed.")
  obj.cardinality&.is_a?(Merge::Crm::CardinalityEnum) != false || raise("Passed value for field obj.cardinality is not the expected type, validation failed.")
  obj.is_required&.is_a?(Boolean) != false || raise("Passed value for field obj.is_required is not the expected type, validation failed.")
end