zendesk_api 3.0.5 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/zendesk_api/resources.rb +52 -0
- data/lib/zendesk_api/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df2d68422fdea92cfac956254ddd2b382faf6e028bc7523c7211edcbdd12eb6e
|
4
|
+
data.tar.gz: a3fb793d37568e24dc458b4a015687f4d6b885547624736e83245c4cdb4073ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f54c0063c888c850a1fd8531499f1a18d1b34e659735c331b43a9e5996f1719fbc3326d6203ef26cb82b8d1143a15a109bdba238cf5d4c8dd4b33ff9c39eaff
|
7
|
+
data.tar.gz: a01bc6bcfdc1d0c3e7d738102802e4d17958f2c9a98003348491c9c45a18ccea6dced47d355f4c9464fbbc9c57d5df0c2993e54eca05c82c3ab4de6c4abd67d1
|
@@ -16,6 +16,58 @@ module ZendeskAPI
|
|
16
16
|
|
17
17
|
class CustomRole < DataResource; end
|
18
18
|
|
19
|
+
class WorkItem < Resource; end
|
20
|
+
|
21
|
+
class Channel < Resource
|
22
|
+
def work_items
|
23
|
+
@work_items ||= attributes.fetch('relationships', {}).fetch('work_items', {}).fetch('data', []).map do |work_item_attributes|
|
24
|
+
WorkItem.new(@client, work_item_attributes)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# client.agent_availabilities.fetch
|
30
|
+
# client.agent_availabilities.find 20401208368
|
31
|
+
# both return consistently - ZendeskAPI::AgentAvailability
|
32
|
+
class AgentAvailability < DataResource
|
33
|
+
def self.model_key
|
34
|
+
"data"
|
35
|
+
end
|
36
|
+
|
37
|
+
def initialize(client, attributes = {})
|
38
|
+
nested_attributes = attributes.delete('attributes')
|
39
|
+
super(client, attributes.merge(nested_attributes))
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.find(client, id)
|
43
|
+
attributes = client.connection.get("#{resource_path}/#{id}").body.fetch(model_key, {})
|
44
|
+
new(client, attributes)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Examples:
|
48
|
+
# ZendeskAPI::AgentAvailability.search(client, { channel_status: 'support:online' })
|
49
|
+
# ZendeskAPI::AgentAvailability.search(client, { agent_status_id: 1 })
|
50
|
+
# Just pass a hash that includes the key and value you want to search for, it gets turned into a query string
|
51
|
+
# on the format of filter[key]=value
|
52
|
+
# Returns a collection of AgentAvailability objects
|
53
|
+
def self.search(client, args_hash)
|
54
|
+
query_string = args_hash.map { |k, v| "filter[#{k}]=#{v}" }.join("&")
|
55
|
+
client.connection.get("#{resource_path}?#{query_string}").body.fetch(model_key, []).map do |attributes|
|
56
|
+
new(client, attributes)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def channels
|
61
|
+
@channels ||= begin
|
62
|
+
channel_attributes_array = @client.connection.get(attributes['links']['self']).body.fetch('included')
|
63
|
+
channel_attributes_array.map do |channel_attributes|
|
64
|
+
nested_attributes = channel_attributes.delete('attributes')
|
65
|
+
Channel.new(@client, channel_attributes.merge(nested_attributes))
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
19
71
|
class Role < DataResource
|
20
72
|
def to_param
|
21
73
|
name
|
data/lib/zendesk_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Davidovitz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -153,9 +153,9 @@ licenses:
|
|
153
153
|
- Apache-2.0
|
154
154
|
metadata:
|
155
155
|
bug_tracker_uri: https://github.com/zendesk/zendesk_api_client_rb/issues
|
156
|
-
changelog_uri: https://github.com/zendesk/zendesk_api_client_rb/blob/v3.0
|
157
|
-
documentation_uri: https://www.rubydoc.info/gems/zendesk_api/3.0
|
158
|
-
source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v3.0
|
156
|
+
changelog_uri: https://github.com/zendesk/zendesk_api_client_rb/blob/v3.1.0/CHANGELOG.md
|
157
|
+
documentation_uri: https://www.rubydoc.info/gems/zendesk_api/3.1.0
|
158
|
+
source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v3.1.0
|
159
159
|
wiki_uri: https://github.com/zendesk/zendesk_api_client_rb/wiki
|
160
160
|
post_install_message:
|
161
161
|
rdoc_options: []
|
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: 1.3.6
|
174
174
|
requirements: []
|
175
|
-
rubygems_version: 3.
|
175
|
+
rubygems_version: 3.5.11
|
176
176
|
signing_key:
|
177
177
|
specification_version: 4
|
178
178
|
summary: Zendesk REST API Client
|