moduleQuickbooksmoduleModelclassTimeActivity<BaseModelXML_COLLECTION_NODE="TimeActivity"XML_NODE="TimeActivity"REST_RESOURCE='timeactivity'NAMEOF_OPTIONS=%w( Employee Vendor )xml_nameXML_NODExml_accessor:id,:from=>'Id'xml_accessor:sync_token,:from=>'SyncToken',:as=>Integerxml_accessor:meta_data,:from=>'MetaData',:as=>MetaDataxml_accessor:txn_date,:from=>'TxnDate'xml_accessor:name_of,:from=>'NameOf'xml_accessor:employee_ref,:from=>'EmployeeRef',:as=>BaseReferencexml_accessor:vendor_ref,:from=>'VendorRef',:as=>BaseReferencexml_accessor:customer_ref,:from=>'CustomerRef',:as=>BaseReferencexml_accessor:item_ref,:from=>'ItemRef',:as=>BaseReferencexml_accessor:class_ref,:from=>'ClassRef',:as=>BaseReferencexml_accessor:billable_status,:from=>'BillableStatus'xml_accessor:taxable,:from=>'Taxable'xml_accessor:hourly_rate,:from=>'HourlyRate'xml_accessor:minutes,:from=>'Minutes',:as=>Integerxml_accessor:hours,:from=>'Hours',:as=>Integerxml_accessor:break_minutes,:from=>'BreakMinutes',:as=>Integerxml_accessor:break_hours,:from=>'BreakHours',:as=>Integerxml_accessor:description,:from=>'Description'xml_accessor:attachable_ref,:from=>'AttachableRef',:as=>BaseReferencexml_accessor:department_ref,:from=>'DepartmentRef',:as=>BaseReferencexml_accessor:start_time,:from=>'StartTime',:as=>DateTimexml_accessor:end_time,:from=>'EndTime',:as=>DateTimexml_accessor:time_zone,:from=>'TimeZone'reference_setters# == Validationsvalidates_inclusion_of:name_of,:in=>NAMEOF_OPTIONSvalidate:existence_of_employee_ref,:if=>Proc.new{|ta|ta.name_of=="Employee"}validate:existence_of_vendor_ref,:if=>Proc.new{|ta|ta.name_of=="Vendor"}validates:description,length: {maximum: 4000}defexistence_of_employee_refifemployee_ref.nil?||(employee_ref&&employee_ref.value==0)errors.add(:employee_ref,"EmployeeRef is required and must be a non-zero value.")endenddefexistence_of_vendor_refifvendor_ref.nil?||(vendor_ref&&vendor_ref.value==0)errors.add(:vendor_ref,"VendorRef is required and must be a non-zero value.")endenddefvalid_for_update?ifsync_token.nil?errors.add(:sync_token,"Missing required attribute SyncToken for update")enderrors.empty?enddefvalid_for_create?valid?errors.empty?enddefvalid_for_deletion?returnfalseif(id.nil?||sync_token.nil?)id.to_i>0&&!sync_token.to_s.empty?&&sync_token.to_i>=0endendendend