Class: Updox::Models::AppointmentStatus
- Inherits:
-
Model
- Object
- Hashie::Trash
- Model
- Updox::Models::AppointmentStatus
show all
- Defined in:
- lib/updox/models/appointment_status.rb
Constant Summary
collapse
- LIST_ENDPOINT =
'/AppointmentStatusesGetByIds'.freeze
- LIST_TYPE =
'appointmentStatuses'
- LIST_NAME =
'statuses'
Constants inherited
from Model
Model::ITEM_TYPE
Class Method Summary
collapse
Methods inherited from Model
#error_message, exists?, from_response, request, #response_code, #response_message, #successful?, sync
Class Method Details
.find(appointment_id, account_id:, cached_query: nil) ⇒ Object
18
19
20
21
22
|
# File 'lib/updox/models/appointment_status.rb', line 18
def self.find(appointment_id, account_id: , cached_query: nil)
obj = cached_query || self.query([appointment_id], account_id: account_id)
obj.statuses.find {|status| appointment_id.to_s == status.external_appointment_id.to_s }
end
|
.query(appointment_ids, account_id:, active_only: false) ⇒ Object
24
25
26
|
# File 'lib/updox/models/appointment_status.rb', line 24
def self.query(appointment_ids, account_id: , active_only: false)
request(endpoint: LIST_ENDPOINT, body: { appointmentIds: appointment_ids }, auth: {accountId: account_id}, required_auths: Updox::Models::Auth::AUTH_ACCT)
end
|