Class: AutotaskRuby::ServiceCall
- Inherits:
-
Object
- Object
- AutotaskRuby::ServiceCall
- Defined in:
- lib/autotask_ruby/service_call.rb
Overview
Represents the Autotask Entity ServiceCall
Constant Summary collapse
- FIELDS =
%i[id AccountID StartDateTime EndDateTime Description Complete CreateDateTime LastModifiedDateTime Duration Status].freeze .each do |field| attr_accessor :"#{field.to_s.underscore}" end
Constants included from Constants
Constants::AUTOTASK_TIME_FORMAT
Instance Method Summary collapse
-
#account ⇒ Object
Returns the associated Account.
-
#resource ⇒ Object
Returns the associated Resource.
-
#resource_id ⇒ Object
Returns the associated ResourceID.
- #ticket ⇒ Object
Methods included from Query
Methods included from Entity
#build, #create, #field_set, #fields_to_xml, #format_field_to_xml, included, #initialize, #post_initialize, #to_bool, #to_date_time, #update
Methods included from Association
#belongs_to, #has_many, #has_one
Instance Method Details
#account ⇒ Object
Returns the associated Account
32 33 34 |
# File 'lib/autotask_ruby/service_call.rb', line 32 def account find('Account', account_id) end |
#resource ⇒ Object
Returns the associated Resource
27 28 29 |
# File 'lib/autotask_ruby/service_call.rb', line 27 def resource find('Resource', resource_id) end |
#resource_id ⇒ Object
Returns the associated ResourceID.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/autotask_ruby/service_call.rb', line 15 def resource_id service_call_ticket = find('ServiceCallTicket', 'ServiceCallId', id) unless service_call_ticket.nil? service_call_ticket_resource = find('ServiceCallTicketResource', 'ServiceCallTicketId', service_call_ticket.id) return service_call_ticket_resource.resource_id unless service_call_ticket_resource.nil? end nil end |
#ticket ⇒ Object
36 37 38 39 40 41 |
# File 'lib/autotask_ruby/service_call.rb', line 36 def ticket service_call_ticket = find('ServiceCallTicket', 'ServiceCallId', id) return find('Ticket', 'id', service_call_ticket.ticket_id) unless service_call_ticket.nil? nil end |