zendesk_api 1.35.0 → 1.37.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zendesk_api/client.rb +1 -1
- data/lib/zendesk_api/collection.rb +0 -2
- data/lib/zendesk_api/resource.rb +10 -3
- data/lib/zendesk_api/resources.rb +32 -0
- data/lib/zendesk_api/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c5a2ced45e0201f6f9a45e5b8f7cf6951ca92c15ce893283c2289d0b260dc77
|
4
|
+
data.tar.gz: 31fa7566865e7191f49dadf6a5e01573264f4fc62ddfd4f635f8f7edd4be9ab2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1b355c67c8126f69f32ff6cd24d03b81b75eec27a0a72044383d0e06a871ba5bd18778119523a013725162048393d7a6bf58f075013e852303255b78bccb73f
|
7
|
+
data.tar.gz: 78ecdd8fd4d2fd889df06aea1ac98df7c68e6f89378f1358594b30853b23b3179f304ee4d87a781bda0047bc1970b8c28dfd147907d74223e28ffceb1676d1b1
|
data/lib/zendesk_api/client.rb
CHANGED
@@ -165,7 +165,7 @@ module ZendeskAPI
|
|
165
165
|
|
166
166
|
# request
|
167
167
|
if config.access_token && !config.url_based_access_token
|
168
|
-
builder.authorization
|
168
|
+
builder.request(:authorization, "Bearer", config.access_token)
|
169
169
|
elsif config.access_token
|
170
170
|
builder.use ZendeskAPI::Middleware::Request::UrlBasedAccessToken, config.access_token
|
171
171
|
else
|
data/lib/zendesk_api/resource.rb
CHANGED
@@ -5,6 +5,7 @@ require 'zendesk_api/association'
|
|
5
5
|
require 'zendesk_api/associations'
|
6
6
|
require 'zendesk_api/verbs'
|
7
7
|
|
8
|
+
# See docs: https://developer.zendesk.com/api-reference/
|
8
9
|
module ZendeskAPI
|
9
10
|
# Represents an abstract resource that only holds data.
|
10
11
|
class Data
|
@@ -145,10 +146,16 @@ module ZendeskAPI
|
|
145
146
|
|
146
147
|
alias :to_param :attributes
|
147
148
|
|
149
|
+
def attributes_for_save
|
150
|
+
{ self.class.singular_resource_name.to_sym => attribute_changes }
|
151
|
+
end
|
152
|
+
|
148
153
|
private
|
149
154
|
|
150
|
-
|
151
|
-
|
155
|
+
# Send only the changes, for example, if the "status" attriubte
|
156
|
+
# goes from "new" to "new", we don't need to send anything
|
157
|
+
def attribute_changes
|
158
|
+
attributes.changes
|
152
159
|
end
|
153
160
|
end
|
154
161
|
|
@@ -189,7 +196,7 @@ module ZendeskAPI
|
|
189
196
|
|
190
197
|
class SingularResource < Resource
|
191
198
|
def attributes_for_save
|
192
|
-
{ self.class.resource_name.to_sym =>
|
199
|
+
{ self.class.resource_name.to_sym => attribute_changes }
|
193
200
|
end
|
194
201
|
end
|
195
202
|
|
@@ -6,6 +6,7 @@ module ZendeskAPI
|
|
6
6
|
class UserRelated < DataResource; end
|
7
7
|
class Category < Resource; end
|
8
8
|
class OrganizationSubscription < ReadResource; end
|
9
|
+
class CustomStatus < Resource; end
|
9
10
|
|
10
11
|
# @internal Begin actual Resource definitions
|
11
12
|
|
@@ -190,8 +191,10 @@ module ZendeskAPI
|
|
190
191
|
|
191
192
|
class Section < Resource
|
192
193
|
end
|
194
|
+
class Translation < Resource; end
|
193
195
|
|
194
196
|
has_many Section
|
197
|
+
has_many Translation
|
195
198
|
end
|
196
199
|
|
197
200
|
class Section < ReadResource
|
@@ -203,9 +206,14 @@ module ZendeskAPI
|
|
203
206
|
|
204
207
|
has Category
|
205
208
|
|
209
|
+
class Vote < Resource; end
|
210
|
+
class Translation < Resource; end
|
206
211
|
class Article < Resource
|
212
|
+
has_many Vote
|
213
|
+
has_many Translation
|
207
214
|
end
|
208
215
|
|
216
|
+
has_many Translation
|
209
217
|
has_many Article
|
210
218
|
end
|
211
219
|
|
@@ -215,6 +223,11 @@ module ZendeskAPI
|
|
215
223
|
"help_center/articles"
|
216
224
|
end
|
217
225
|
end
|
226
|
+
|
227
|
+
class Vote < Resource; end
|
228
|
+
has_many Vote
|
229
|
+
class Translation < Resource; end
|
230
|
+
has_many Translation
|
218
231
|
end
|
219
232
|
|
220
233
|
class TopicSubscription < Resource
|
@@ -277,6 +290,18 @@ module ZendeskAPI
|
|
277
290
|
has Group
|
278
291
|
end
|
279
292
|
|
293
|
+
class Interval < Resource; end
|
294
|
+
|
295
|
+
class Schedule < Resource
|
296
|
+
has_many Interval
|
297
|
+
|
298
|
+
class << self
|
299
|
+
def resource_path
|
300
|
+
"business_hours/schedules"
|
301
|
+
end
|
302
|
+
end
|
303
|
+
end
|
304
|
+
|
280
305
|
class Request < Resource
|
281
306
|
class Comment < DataResource
|
282
307
|
include Save
|
@@ -341,6 +366,13 @@ module ZendeskAPI
|
|
341
366
|
extend UpdateMany
|
342
367
|
extend DestroyMany
|
343
368
|
|
369
|
+
# Unlike other attributes, "comment" is not a property of the ticket,
|
370
|
+
# but is used as a "comment on save", so it should be kept unchanged,
|
371
|
+
# See https://github.com/zendesk/zendesk_api_client_rb/issues/321
|
372
|
+
def attribute_changes
|
373
|
+
attributes.changes.merge("comment" => attributes["comment"])
|
374
|
+
end
|
375
|
+
|
344
376
|
class Audit < DataResource
|
345
377
|
class Event < Data
|
346
378
|
has :author, :class => User
|
data/lib/zendesk_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.37.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Davidovitz
|
8
8
|
- Michael Grosser
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-09-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -144,11 +144,11 @@ licenses:
|
|
144
144
|
- Apache-2.0
|
145
145
|
metadata:
|
146
146
|
bug_tracker_uri: https://github.com/zendesk/zendesk_api_client_rb/issues
|
147
|
-
changelog_uri: https://github.com/zendesk/zendesk_api_client_rb/blob/v1.
|
148
|
-
documentation_uri: https://www.rubydoc.info/gems/zendesk_api/1.
|
149
|
-
source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v1.
|
147
|
+
changelog_uri: https://github.com/zendesk/zendesk_api_client_rb/blob/v1.37.0/CHANGELOG.md
|
148
|
+
documentation_uri: https://www.rubydoc.info/gems/zendesk_api/1.37.0
|
149
|
+
source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v1.37.0
|
150
150
|
wiki_uri: https://github.com/zendesk/zendesk_api_client_rb/wiki
|
151
|
-
post_install_message:
|
151
|
+
post_install_message:
|
152
152
|
rdoc_options: []
|
153
153
|
require_paths:
|
154
154
|
- lib
|
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: 1.3.6
|
165
165
|
requirements: []
|
166
166
|
rubygems_version: 3.0.3
|
167
|
-
signing_key:
|
167
|
+
signing_key:
|
168
168
|
specification_version: 4
|
169
169
|
summary: Zendesk REST API Client
|
170
170
|
test_files: []
|