zendesk_api 1.29.0 → 1.30.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: 592ae735c6f79aa698f4edcd7328c5774dcffc06c00e2f28b85027586f98a48c
4
- data.tar.gz: a86e4f2d88eb2b6a05082ba5bd343942dc645af19dcfbd75d00c1ccf1e8d08fe
3
+ metadata.gz: 793f89bec6ccc7c03d9fe870346da6f50dc0dd8cde3b46aca5b37cc6504adb3a
4
+ data.tar.gz: a03de27f833f3d9395bd44f574e70f8c3d9c6e10a06f4b89f71c2e393c0ea1a8
5
5
  SHA512:
6
- metadata.gz: b4563b95cd57c46662876c012fcabcee71b35d39d77d93f7e36fe629f46187c001e8c817c06004fb7617c5c1c9191f0c0c8bc40662e15d550cc7721c89341822
7
- data.tar.gz: 21ebc067a097717124234eae951a8f7d8e003076e6af8958404b2e26dc0b5b08acdb3c26f1792380441802aee21f23632850338e81bb6657948990d4ddfe5aba
6
+ metadata.gz: e4426a2dfad01605c661fbe4f71312e86bc444479dc4c293876273c5003169d32774e79b55e2f7c67b54a7cbb48ce0feb32887484f02f73da536c366dc8ac5c7
7
+ data.tar.gz: f561f3b726990c014aeaa095c21f6065063100bf033c3ce1fafaaa8fa062240dbe068960d9482cab632579e8890986e24db205bdcf40f1034468d94db37b7864
@@ -40,6 +40,11 @@ module ZendeskAPI
40
40
  method = method.to_s
41
41
  options = args.last.is_a?(Hash) ? args.pop : {}
42
42
 
43
+ unless config.use_resource_cache
44
+ raise "Resource for #{method} does not exist" unless method_as_class(method)
45
+ return ZendeskAPI::Collection.new(self, method_as_class(method), options)
46
+ end
47
+
43
48
  @resource_cache[method] ||= { :class => nil, :cache => ZendeskAPI::LRUCache.new }
44
49
  if !options.delete(:reload) && (cached = @resource_cache[method][:cache].read(options.hash))
45
50
  cached
@@ -42,8 +42,12 @@ module ZendeskAPI
42
42
  # @return [ZendeskAPI::LRUCache]
43
43
  attr_accessor :cache
44
44
 
45
+ # @return [Boolean] Whether to use resource_cache or not
46
+ attr_accessor :use_resource_cache
47
+
45
48
  def initialize
46
49
  @client_options = {}
50
+ @use_resource_cache = true
47
51
 
48
52
  self.cache = ZendeskAPI::LRUCache.new(1000)
49
53
  end
@@ -10,6 +10,8 @@ module ZendeskAPI
10
10
 
11
11
  # @internal Begin actual Resource definitions
12
12
 
13
+ class RecipientAddress < Resource; end
14
+
13
15
  class Locale < ReadResource; end
14
16
 
15
17
  class CustomRole < DataResource; end
@@ -1,3 +1,3 @@
1
1
  module ZendeskAPI
2
- VERSION = "1.29.0"
2
+ VERSION = "1.30.0"
3
3
  end
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: 1.29.0
4
+ version: 1.30.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: 2021-04-15 00:00:00.000000000 Z
12
+ date: 2021-06-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -143,9 +143,9 @@ licenses:
143
143
  - Apache-2.0
144
144
  metadata:
145
145
  bug_tracker_uri: https://github.com/zendesk/zendesk_api_client_rb/issues
146
- changelog_uri: https://github.com/zendesk/zendesk_api_client_rb/blob/v1.29.0/CHANGELOG.md
147
- documentation_uri: https://www.rubydoc.info/gems/zendesk_api/1.29.0
148
- source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v1.29.0
146
+ changelog_uri: https://github.com/zendesk/zendesk_api_client_rb/blob/v1.30.0/CHANGELOG.md
147
+ documentation_uri: https://www.rubydoc.info/gems/zendesk_api/1.30.0
148
+ source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v1.30.0
149
149
  wiki_uri: https://github.com/zendesk/zendesk_api_client_rb/wiki
150
150
  post_install_message:
151
151
  rdoc_options: []