Skip to content

Commit d9cf3b2

Browse files
committed
add agent availability object
1 parent 36f5a13 commit d9cf3b2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/zendesk_api/resources.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ class Locale < ReadResource; end
1616

1717
class CustomRole < DataResource; end
1818

19+
# client.agent_availabilities.fetch
20+
# client.agent_availabilities.find 20401208368
21+
# both return consistently - ZendeskAPI::AgentAvailability
22+
class AgentAvailability < DataResource
23+
def self.model_key
24+
"data"
25+
end
26+
27+
def self.find(client, id, *args)
28+
attributes = client.connection.get("#{resource_path}/#{id}").body.fetch(model_key, {})
29+
new(client, attributes)
30+
end
31+
end
32+
1933
class Role < DataResource
2034
def to_param
2135
name

0 commit comments

Comments
 (0)