zendesk_api 3.1.2 → 4.0.0.pre.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4804fd37b3a0cca8014505335c2f5ab6177a678a1dd429b56cb012804f65ea31
4
- data.tar.gz: d7db1542be1bf6913dfe2340c3d6a1b4742386e9571f91a249a5e1edb44e8edc
3
+ metadata.gz: '0803fe00f30628a98bab5d0fbee4a63abd7e03adf5228aeb39c063fdd1c94836'
4
+ data.tar.gz: da85cd280c76b87f2ab6068e8f3d379b4f45c922d1ad8f82ffa4ec1877a34969
5
5
  SHA512:
6
- metadata.gz: 10372ee1b741eab42e07127dd81c355d5b2e3707627b2e6d8aa86f9cd01c2c100860d1467935b37d202ee3bd9df98bef8379b6312c770fc736180bc96e25d085
7
- data.tar.gz: 4190bc1b3a8e798302df52f5544da095e3f758783b6a9ebf0191ef2fe44a019939746a29b9200208bf1664aee57816a30cd93d1e2b11903bec2112146e4a1415
6
+ metadata.gz: ab2b864baf7fa4d916c2cab9bf27f470f226e45857b09f52a4648a97256ad2eccae2cca48cb52a9aea455329333f34bf4a5e889d951f679dd7157cf7642a034f
7
+ data.tar.gz: c6f9ff945f9f825ffa6483ab1ef521b4ef20b8377541f28a4fa8efa718eb52f49d08665c226a4673bf60325f2a57048ad8cfc769a8ea723e4641753dd6208290
@@ -32,8 +32,6 @@ module ZendeskAPI
32
32
  attr_reader :config
33
33
  # @return [Array] Custom response callbacks
34
34
  attr_reader :callbacks
35
- # @return [Hash] Memoized account data
36
- attr_reader :account_data
37
35
 
38
36
  # Handles resources such as 'tickets'. Any options are passed to the underlying collection, except reload which disregards
39
37
  # memoization and creates a new Collection instance.
@@ -97,7 +95,6 @@ module ZendeskAPI
97
95
 
98
96
  @callbacks = []
99
97
  @resource_cache = {}
100
- @account_data = {}
101
98
 
102
99
  check_url
103
100
  check_instrumentation
@@ -156,11 +153,6 @@ module ZendeskAPI
156
153
  end
157
154
  end
158
155
 
159
- def refresh_custom_fields_metadata
160
- account_data[:custom_fields] ||= {}
161
- ticket_fields.each { |field| account_data[:custom_fields][field.title] = field.id }
162
- end
163
-
164
156
  protected
165
157
 
166
158
  # Called by {#connection} to build a connection. Can be overwritten in a
@@ -76,14 +76,6 @@ module ZendeskAPI
76
76
  @attributes.clear_changes unless new_record?
77
77
  end
78
78
 
79
- def account_data
80
- @client.account_data
81
- end
82
-
83
- def refresh_custom_fields_metadata
84
- @client.refresh_custom_fields_metadata
85
- end
86
-
87
79
  # Passes the method onto the attributes hash.
88
80
  # If the attributes are nested (e.g. { :tickets => { :id => 1 } }), passes the method onto the nested hash.
89
81
  def method_missing(*args, &)
@@ -354,12 +354,8 @@ module ZendeskAPI
354
354
  # Try and find the root key
355
355
  @on = (attributes.keys.map(&:to_s) - %w[association options]).first
356
356
 
357
- # Namespaced settings (e.g. "lotus", "admin_center") nest their values in a
358
- # Hash, which we hoist up to be the root attributes. Some settings are
359
- # top-level scalars or arrays (e.g. "shared_views_order",
360
- # "agent_home_pinned_views") - leave those under @on rather than merging,
361
- # which would raise "no implicit conversion of Array into Hash".
362
- attributes.merge!(attributes.delete(@on)) if attributes[@on].is_a?(Hash)
357
+ # Make what's inside that key the root attributes
358
+ attributes.merge!(attributes.delete(@on))
363
359
 
364
360
  super
365
361
  end
@@ -550,43 +546,6 @@ module ZendeskAPI
550
546
 
551
547
  has_many :incidents, class: Ticket
552
548
 
553
- class CustomFieldAccessor
554
- def initialize(ticket)
555
- @ticket = ticket
556
- end
557
-
558
- def [](field_name)
559
- find_by_name(field_name)["value"]
560
- end
561
-
562
- def []=(field_name, value)
563
- find_by_name(field_name)["value"] = value
564
- end
565
-
566
- private
567
-
568
- def find_by_name(field_name)
569
- @ticket.refresh_custom_fields_metadata unless @ticket.account_data.has_key?(:custom_fields)
570
-
571
- custom_field_id = @ticket.account_data[:custom_fields][field_name]
572
- raise ArgumentError, "No custom field named '#{field_name}' found in field definitions" if custom_field_id.nil?
573
-
574
- custom_field = @ticket.custom_fields.find { |cf| cf["id"] == custom_field_id }
575
- raise ArgumentError, "No custom field with id #{custom_field_id} found. Field name: '#{field_name}'" if custom_field.nil?
576
-
577
- custom_field
578
- end
579
- end
580
-
581
- # Returns a custom field accessor that supports bracket notation.
582
- # Usage:
583
- # ticket.custom_field["field name"] # get
584
- # ticket.custom_field["field name"] = "value" # set
585
- # You need to call `save!` on a ticket after changing a custom field value.
586
- def custom_field
587
- @custom_field_accessor ||= CustomFieldAccessor.new(self)
588
- end
589
-
590
549
  # Gets a incremental export of tickets from the start_time until now.
591
550
  # @param [Client] client The {Client} object to be used
592
551
  # @param [Integer] start_time The start_time parameter
@@ -1,3 +1,3 @@
1
1
  module ZendeskAPI
2
- VERSION = "3.1.2"
2
+ VERSION = "4.0.0.pre.1"
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: 3.1.2
4
+ version: 4.0.0.pre.1
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: 2026-07-23 00:00:00.000000000 Z
12
+ date: 2025-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -163,9 +163,9 @@ licenses:
163
163
  - Apache-2.0
164
164
  metadata:
165
165
  bug_tracker_uri: https://github.com/zendesk/zendesk_api_client_rb/issues
166
- changelog_uri: https://github.com/zendesk/zendesk_api_client_rb/blob/v3.1.2/CHANGELOG.md
167
- documentation_uri: https://www.rubydoc.info/gems/zendesk_api/3.1.2
168
- source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v3.1.2
166
+ changelog_uri: https://github.com/zendesk/zendesk_api_client_rb/blob/v4.0.0.pre.1/CHANGELOG.md
167
+ documentation_uri: https://www.rubydoc.info/gems/zendesk_api/4.0.0.pre.1
168
+ source_code_uri: https://github.com/zendesk/zendesk_api_client_rb/tree/v4.0.0.pre.1
169
169
  wiki_uri: https://github.com/zendesk/zendesk_api_client_rb/wiki
170
170
  rubygems_mfa_required: 'true'
171
171
  post_install_message:
@@ -176,14 +176,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - ">="
178
178
  - !ruby/object:Gem::Version
179
- version: '3.2'
179
+ version: '3.1'
180
180
  required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  requirements:
182
182
  - - ">="
183
183
  - !ruby/object:Gem::Version
184
184
  version: 1.3.6
185
185
  requirements: []
186
- rubygems_version: 3.4.19
186
+ rubygems_version: 3.3.27
187
187
  signing_key:
188
188
  specification_version: 4
189
189
  summary: Zendesk REST API Client