class ZendeskAPI::AgentAvailability

client.agent_availabilities.fetch client.agent_availabilities.find 20401208368 both return consistently - ZendeskAPI::AgentAvailability

Public Class Methods

find(client, id) click to toggle source
# File lib/zendesk_api/resources.rb, line 42
def self.find(client, id)
  attributes = client.connection.get("#{resource_path}/#{id}").body.fetch(model_key, {})
  new(client, attributes)
end
model_key() click to toggle source
# File lib/zendesk_api/resources.rb, line 33
def self.model_key
  "data"
end
new(client, attributes = {}) click to toggle source
Calls superclass method ZendeskAPI::Data::new
# File lib/zendesk_api/resources.rb, line 37
def initialize(client, attributes = {})
  nested_attributes = attributes.delete('attributes')
  super(client, attributes.merge(nested_attributes))
end

Public Instance Methods

channels() click to toggle source
# File lib/zendesk_api/resources.rb, line 60
def channels
  @channels ||= begin
    channel_attributes_array = @client.connection.get(attributes['links']['self']).body.fetch('included')
    channel_attributes_array.map do |channel_attributes|
      nested_attributes = channel_attributes.delete('attributes')
      Channel.new(@client, channel_attributes.merge(nested_attributes))
    end
  end
end