zendesk_api 1.35.0 → 1.36.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cb0a6ce03a083efc37a6f742e90e58955a411ce76c3bfffb78ad5fc61f336b6
4
- data.tar.gz: 10d25156b4961da61e2c1b7276ef5a8e4a17664c93d4a24e8f466ec9dc2e85b1
3
+ metadata.gz: 2cdeab11096a461873b1005a9ba2a51c249c574c743a98529d6b0e8ec110a2b5
4
+ data.tar.gz: d0a14003fa34b2b5e719911a7525530aec6d73675d532651517ac7eddb7c241a
5
5
  SHA512:
6
- metadata.gz: da965fc1a9d28cb7edafdb82a56a1e73b64930f7706ac32bc9980ee3da415e540362f036c8dd6101b7615ce3781e4cc9e5645780bd83c504c714c60879450dcc
7
- data.tar.gz: edbee03ff02ea28e78f88c9e1766d0cccbd0d59b068ae103f80d9c83f10cf734707e96a3341710131f93ffc346066f04a0e3d0200cc9def631cb984285086679
6
+ metadata.gz: d2b921604df568c16f2dafa908a349f90e52b8dafef9b409b2a4d94b6735ade3fa49243acac03aa8e76bbde74007e8ddde85e48f0bc90515e665746d442a73cb
7
+ data.tar.gz: bcb624be64595a6d5e31ed26dc4f0feff63c18788b2353a6f55888eeb438ab9a56bd62e1e63d198258a431c7ba3a2745e6cd3d514afb3ba8eb4d635cbdc40046
@@ -420,8 +420,6 @@ module ZendeskAPI
420
420
  @collection_path ||= [@resource]
421
421
  end
422
422
 
423
- ## Fetch
424
-
425
423
  def get_response(path)
426
424
  @error = nil
427
425
  @response = @client.connection.send(@verb || "get", path) do |req|
@@ -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
- def attributes_for_save
151
- { self.class.singular_resource_name.to_sym => attributes.changes }
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 => attributes.changes }
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
@@ -1,3 +1,3 @@
1
1
  module ZendeskAPI
2
- VERSION = "1.35.0"
2
+ VERSION = "1.36.0"
3
3
  end
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.35.0
4
+ version: 1.36.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-01-31 00:00:00.000000000 Z
12
+ date: 2022-05-17 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.35.0/CHANGELOG.md
148
- documentation_uri: https://www.rubydoc.info/gems/zendesk_api/1.35.0
149
- source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v1.35.0
147
+ changelog_uri: https://github.com/zendesk/zendesk_api_client_rb/blob/v1.36.0/CHANGELOG.md
148
+ documentation_uri: https://www.rubydoc.info/gems/zendesk_api/1.36.0
149
+ source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v1.36.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
@@ -163,8 +163,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  - !ruby/object:Gem::Version
164
164
  version: 1.3.6
165
165
  requirements: []
166
- rubygems_version: 3.0.3
167
- signing_key:
166
+ rubygems_version: 3.3.7
167
+ signing_key:
168
168
  specification_version: 4
169
169
  summary: Zendesk REST API Client
170
170
  test_files: []