zendesk_api 1.3.5 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/.yardopts +0 -2
  4. data/Gemfile +4 -30
  5. data/Gemfile.lock +38 -80
  6. data/Rakefile +0 -5
  7. data/lib/zendesk_api/actions.rb +3 -2
  8. data/lib/zendesk_api/client.rb +4 -1
  9. data/lib/zendesk_api/collection.rb +4 -0
  10. data/lib/zendesk_api/configuration.rb +2 -0
  11. data/lib/zendesk_api/middleware/request/upload.rb +1 -1
  12. data/lib/zendesk_api/middleware/request/url_based_access_token.rb +26 -0
  13. data/lib/zendesk_api/resources.rb +25 -1
  14. data/lib/zendesk_api/version.rb +1 -1
  15. data/spec/core/client_spec.rb +1 -0
  16. data/spec/core/middleware/request/upload_spec.rb +26 -27
  17. data/spec/core/spec_helper.rb +27 -1
  18. data/spec/live/user_spec.rb +4 -2
  19. data/spec/live/user_view_spec.rb +16 -0
  20. data/spec/live/voice/phone_number_spec.rb +2 -0
  21. data/zendesk_api.gemspec +1 -4
  22. metadata +9 -191
  23. data/Procfile +0 -1
  24. data/bin/zendesk +0 -27
  25. data/config.ru +0 -6
  26. data/config/mongoid.yml +0 -81
  27. data/config/newrelic.yml +0 -255
  28. data/lib/zendesk_api/console/base.rb +0 -12
  29. data/lib/zendesk_api/console/console.rb +0 -144
  30. data/lib/zendesk_api/console/extensions.rb +0 -202
  31. data/lib/zendesk_api/console/options.rb +0 -41
  32. data/lib/zendesk_api/server/base.rb +0 -123
  33. data/lib/zendesk_api/server/docs/account_settings.md +0 -191
  34. data/lib/zendesk_api/server/docs/activity_stream.md +0 -121
  35. data/lib/zendesk_api/server/docs/attachments.md +0 -142
  36. data/lib/zendesk_api/server/docs/autocomplete.md +0 -29
  37. data/lib/zendesk_api/server/docs/automations.md +0 -256
  38. data/lib/zendesk_api/server/docs/categories.md +0 -193
  39. data/lib/zendesk_api/server/docs/changes_roadmap.md +0 -286
  40. data/lib/zendesk_api/server/docs/custom_roles.md +0 -88
  41. data/lib/zendesk_api/server/docs/forum_subscriptions.md +0 -139
  42. data/lib/zendesk_api/server/docs/forums.md +0 -229
  43. data/lib/zendesk_api/server/docs/group_memberships.md +0 -229
  44. data/lib/zendesk_api/server/docs/groups.md +0 -212
  45. data/lib/zendesk_api/server/docs/introduction.md +0 -165
  46. data/lib/zendesk_api/server/docs/job_statuses.md +0 -86
  47. data/lib/zendesk_api/server/docs/locales.md +0 -124
  48. data/lib/zendesk_api/server/docs/macros.md +0 -289
  49. data/lib/zendesk_api/server/docs/organizations.md +0 -271
  50. data/lib/zendesk_api/server/docs/problems.md +0 -117
  51. data/lib/zendesk_api/server/docs/requests.md +0 -274
  52. data/lib/zendesk_api/server/docs/satisfaction_ratings.md +0 -172
  53. data/lib/zendesk_api/server/docs/search.md +0 -106
  54. data/lib/zendesk_api/server/docs/sharing_agreements.md +0 -57
  55. data/lib/zendesk_api/server/docs/side_loading.md +0 -125
  56. data/lib/zendesk_api/server/docs/suspended_tickets.md +0 -184
  57. data/lib/zendesk_api/server/docs/tags.md +0 -145
  58. data/lib/zendesk_api/server/docs/ticket_audits.md +0 -688
  59. data/lib/zendesk_api/server/docs/ticket_export.md +0 -121
  60. data/lib/zendesk_api/server/docs/ticket_fields.md +0 -277
  61. data/lib/zendesk_api/server/docs/ticket_import.md +0 -65
  62. data/lib/zendesk_api/server/docs/ticket_metrics.md +0 -125
  63. data/lib/zendesk_api/server/docs/tickets.md +0 -696
  64. data/lib/zendesk_api/server/docs/topic_comments.md +0 -221
  65. data/lib/zendesk_api/server/docs/topic_subscriptions.md +0 -140
  66. data/lib/zendesk_api/server/docs/topic_votes.md +0 -153
  67. data/lib/zendesk_api/server/docs/topics.md +0 -335
  68. data/lib/zendesk_api/server/docs/triggers.md +0 -264
  69. data/lib/zendesk_api/server/docs/user_identities.md +0 -279
  70. data/lib/zendesk_api/server/docs/users.md +0 -455
  71. data/lib/zendesk_api/server/docs/views.md +0 -644
  72. data/lib/zendesk_api/server/helper.rb +0 -110
  73. data/lib/zendesk_api/server/html_renderer.rb +0 -98
  74. data/lib/zendesk_api/server/models/user_request.rb +0 -16
  75. data/lib/zendesk_api/server/models/zlib_json.rb +0 -13
  76. data/lib/zendesk_api/server/public/config.rb +0 -26
  77. data/lib/zendesk_api/server/public/doc/ZendeskAPI.html +0 -131
  78. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ability.html +0 -592
  79. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Activity.html +0 -979
  80. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Attachment.html +0 -658
  81. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Automation.html +0 -805
  82. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Bookmark.html +0 -606
  83. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CRMData.html +0 -592
  84. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CRMDataStatus.html +0 -592
  85. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Category.html +0 -825
  86. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Client.html +0 -1226
  87. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Collection.html +0 -2606
  88. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Configuration.html +0 -1302
  89. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Create.html +0 -392
  90. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Create/ClassMethods.html +0 -283
  91. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CreateResource.html +0 -878
  92. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CustomRole.html +0 -592
  93. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Data.html +0 -1406
  94. data/lib/zendesk_api/server/public/doc/ZendeskAPI/DataResource.html +0 -823
  95. data/lib/zendesk_api/server/public/doc/ZendeskAPI/DeleteResource.html +0 -815
  96. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Destroy.html +0 -357
  97. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Destroy/ClassMethod.html +0 -295
  98. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error.html +0 -115
  99. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error/ClientError.html +0 -127
  100. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error/NetworkError.html +0 -127
  101. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error/RecordInvalid.html +0 -371
  102. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error/RecordNotFound.html +0 -127
  103. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Forum.html +0 -1559
  104. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ForumSubscription.html +0 -979
  105. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Group.html +0 -606
  106. data/lib/zendesk_api/server/public/doc/ZendeskAPI/GroupMembership.html +0 -979
  107. data/lib/zendesk_api/server/public/doc/ZendeskAPI/JobStatus.html +0 -598
  108. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Locale.html +0 -598
  109. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Macro.html +0 -805
  110. data/lib/zendesk_api/server/public/doc/ZendeskAPI/MobileDevice.html +0 -724
  111. data/lib/zendesk_api/server/public/doc/ZendeskAPI/OAuthClient.html +0 -606
  112. data/lib/zendesk_api/server/public/doc/ZendeskAPI/OAuthToken.html +0 -810
  113. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Organization.html +0 -1379
  114. data/lib/zendesk_api/server/public/doc/ZendeskAPI/OrganizationField.html +0 -606
  115. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Read.html +0 -341
  116. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ReadResource.html +0 -797
  117. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Request.html +0 -1189
  118. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Request/Comment.html +0 -993
  119. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Resource.html +0 -1263
  120. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Role.html +0 -592
  121. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Rule.html +0 -610
  122. data/lib/zendesk_api/server/public/doc/ZendeskAPI/RuleExecution.html +0 -679
  123. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SatisfactionRating.html +0 -1327
  124. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Save.html +0 -494
  125. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Search.html +0 -411
  126. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Search/Result.html +0 -462
  127. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Setting.html +0 -742
  128. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SharingAgreement.html +0 -598
  129. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SingularResource.html +0 -610
  130. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SuspendedTicket.html +0 -911
  131. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket.html +0 -3094
  132. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Audit.html +0 -787
  133. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Comment.html +0 -1039
  134. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Tag.html +0 -606
  135. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TicketField.html +0 -606
  136. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TicketMetric.html +0 -782
  137. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic.html +0 -1449
  138. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic/TopicComment.html +0 -1122
  139. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic/TopicVote.html +0 -983
  140. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TopicComment.html +0 -1039
  141. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TopicSubscription.html +0 -979
  142. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Trigger.html +0 -805
  143. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Update.html +0 -392
  144. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Update/ClassMethod.html +0 -287
  145. data/lib/zendesk_api/server/public/doc/ZendeskAPI/UpdateResource.html +0 -878
  146. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Upload.html +0 -1176
  147. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User.html +0 -3974
  148. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User/Identity.html +0 -926
  149. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User/TopicComment.html +0 -656
  150. data/lib/zendesk_api/server/public/doc/ZendeskAPI/UserField.html +0 -606
  151. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Verbs.html +0 -332
  152. data/lib/zendesk_api/server/public/doc/ZendeskAPI/View.html +0 -1650
  153. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ViewCount.html +0 -592
  154. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ViewRow.html +0 -1744
  155. data/lib/zendesk_api/server/public/doc/_index.html +0 -799
  156. data/lib/zendesk_api/server/public/doc/class_list.html +0 -53
  157. data/lib/zendesk_api/server/public/doc/css/common.css +0 -1
  158. data/lib/zendesk_api/server/public/doc/css/full_list.css +0 -57
  159. data/lib/zendesk_api/server/public/doc/css/style.css +0 -338
  160. data/lib/zendesk_api/server/public/doc/file.Readme.html +0 -137
  161. data/lib/zendesk_api/server/public/doc/file_list.html +0 -55
  162. data/lib/zendesk_api/server/public/doc/frames.html +0 -28
  163. data/lib/zendesk_api/server/public/doc/index.html +0 -137
  164. data/lib/zendesk_api/server/public/doc/js/app.js +0 -214
  165. data/lib/zendesk_api/server/public/doc/js/full_list.js +0 -173
  166. data/lib/zendesk_api/server/public/doc/js/jquery.js +0 -4
  167. data/lib/zendesk_api/server/public/doc/method_list.html +0 -2332
  168. data/lib/zendesk_api/server/public/doc/top-level-namespace.html +0 -112
  169. data/lib/zendesk_api/server/public/favicon.ico +0 -0
  170. data/lib/zendesk_api/server/public/images/glyphicons-halflings-white.png +0 -0
  171. data/lib/zendesk_api/server/public/images/glyphicons-halflings.png +0 -0
  172. data/lib/zendesk_api/server/public/images/spinner.gif +0 -0
  173. data/lib/zendesk_api/server/public/images/zendesk_developers_bg.png +0 -0
  174. data/lib/zendesk_api/server/public/images/zendesk_developers_header.png +0 -0
  175. data/lib/zendesk_api/server/public/javascripts/application.js +0 -186
  176. data/lib/zendesk_api/server/public/javascripts/bootstrap-alert.js +0 -90
  177. data/lib/zendesk_api/server/public/javascripts/bootstrap-button.js +0 -96
  178. data/lib/zendesk_api/server/public/javascripts/bootstrap-carousel.js +0 -169
  179. data/lib/zendesk_api/server/public/javascripts/bootstrap-collapse.js +0 -157
  180. data/lib/zendesk_api/server/public/javascripts/bootstrap-dropdown.js +0 -100
  181. data/lib/zendesk_api/server/public/javascripts/bootstrap-modal.js +0 -218
  182. data/lib/zendesk_api/server/public/javascripts/bootstrap-popover.js +0 -98
  183. data/lib/zendesk_api/server/public/javascripts/bootstrap-scrollspy.js +0 -151
  184. data/lib/zendesk_api/server/public/javascripts/bootstrap-tab.js +0 -135
  185. data/lib/zendesk_api/server/public/javascripts/bootstrap-tooltip.js +0 -275
  186. data/lib/zendesk_api/server/public/javascripts/bootstrap-transition.js +0 -61
  187. data/lib/zendesk_api/server/public/javascripts/bootstrap-typeahead.js +0 -285
  188. data/lib/zendesk_api/server/public/sass/screen.scss +0 -102
  189. data/lib/zendesk_api/server/public/sass/styles.scss +0 -5
  190. data/lib/zendesk_api/server/public/stylesheets/developer.screen.css +0 -836
  191. data/lib/zendesk_api/server/public/stylesheets/screen.css +0 -129
  192. data/lib/zendesk_api/server/public/stylesheets/styles.css +0 -6208
  193. data/lib/zendesk_api/server/templates/footer.haml +0 -13
  194. data/lib/zendesk_api/server/templates/header.haml +0 -20
  195. data/lib/zendesk_api/server/templates/index.haml +0 -68
  196. data/lib/zendesk_api/server/templates/layout.haml +0 -44
  197. data/lib/zendesk_api/server/templates/param.haml +0 -4
  198. data/lib/zendesk_api/server/templates/search.haml +0 -23
  199. data/lib/zendesk_api/server/templates/sidebar.haml +0 -7
  200. data/spec/server/app_spec.rb +0 -140
  201. data/spec/server/helper_spec.rb +0 -97
  202. data/spec/server/html_renderer_spec.rb +0 -130
  203. data/spec/server/spec_helper.rb +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a38c30bb79c695637d397682d18f4bcad759e04a
4
- data.tar.gz: 7a9c3754599b4326995b7b7567561f57b1ff3cce
3
+ metadata.gz: a8b73e0b2eea3b49827b9c51e491844b3b1c8aaa
4
+ data.tar.gz: 2fc0ef98f91e5e7b72233f60cd486975b099f830
5
5
  SHA512:
6
- metadata.gz: a6599cae801cf71f177e2b6110d6200a8dc623eae347bcea7341c0afdc1fd5c4e6686311645aeabe15ecffc6dc7ae0ee1503941571ef70321da5a4f7c69dc387
7
- data.tar.gz: 63d41052bf169196d521f833295e5b6fd46a2f5253e53fa314133bc65e4502ff29ce7c2534854a92928f89acf2b5e6877953825fdd3ce545e2f81adca60aebee
6
+ metadata.gz: 7914bfee9601f839db64cd49a025f27f693ba0ffee305db7e259494da1664f8837c56e1434738b2be972283ebdf381b9dc11bd227d334faaa32d4d8cff18c89a
7
+ data.tar.gz: 6a847c4d6996077966632fd9d07cf2568c93180246d2561707b61b617dca9161e0833d8baf402eaa82b8c62bedcd8359f4cd2b6c0bbc57f7b6019c69442c9d4f
data/.travis.yml CHANGED
@@ -2,7 +2,7 @@ rvm:
2
2
  - ree
3
3
  - 1.9.3
4
4
  - 2.0.0
5
- - 2.1.0
5
+ - 2.1.1
6
6
  - jruby
7
- bundler_args: --without=server console
7
+ before_install: gem i bundler
8
8
  cache: bundler
data/.yardopts CHANGED
@@ -5,8 +5,6 @@
5
5
  --embed-mixins
6
6
  --load ./util/resource_handler.rb
7
7
  --load ./util/verb_handler.rb
8
- --exclude lib/zendesk_api/console
9
- --exclude lib/zendesk_api/server
10
8
  -r Readme.md
11
9
  lib/**/*.rb
12
10
  -
data/Gemfile CHANGED
@@ -1,39 +1,13 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # gem "bundler", "~> 1.2.0"
4
- # ruby "1.9.3"
5
-
6
3
  gem "simplecov", :platforms => :ruby_19, :group => :test
7
4
  gem "jruby-openssl", :platforms => :jruby
8
5
 
9
- group :server do
10
- gem "thin"
11
-
12
- gem "rack-ssl-enforcer"
13
-
14
- gem "sinatra"
15
- gem "sinatra-contrib"
16
-
17
- gem "haml"
18
-
19
- gem "compass"
20
- gem "bootstrap-sass"
21
-
22
- gem "coderay"
23
- gem "coderay_bash"
6
+ group :test do
7
+ gem "json", :platform => :ruby_18
24
8
 
25
- gem "redcarpet"
26
-
27
- gem "mongoid"
28
- gem "database_cleaner"
29
-
30
- gem "newrelic_rpm"
9
+ # only used for uploads testing
10
+ gem "actionpack", "~> 3.2"
31
11
  end
32
12
 
33
- group :console do
34
- gem "ripl"
35
- end
36
-
37
- gem "json", :group => :test, :platform => :ruby_18
38
-
39
13
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zendesk_api (1.3.5)
4
+ zendesk_api (1.3.7)
5
5
  faraday (~> 0.9)
6
6
  hashie (>= 1.2)
7
7
  inflection
@@ -12,127 +12,85 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activemodel (3.2.16)
16
- activesupport (= 3.2.16)
15
+ actionpack (3.2.18)
16
+ activemodel (= 3.2.18)
17
+ activesupport (= 3.2.18)
17
18
  builder (~> 3.0.0)
18
- activesupport (3.2.16)
19
+ erubis (~> 2.7.0)
20
+ journey (~> 1.0.4)
21
+ rack (~> 1.4.5)
22
+ rack-cache (~> 1.2)
23
+ rack-test (~> 0.6.1)
24
+ sprockets (~> 2.2.1)
25
+ activemodel (3.2.18)
26
+ activesupport (= 3.2.18)
27
+ builder (~> 3.0.0)
28
+ activesupport (3.2.18)
19
29
  i18n (~> 0.6, >= 0.6.4)
20
30
  multi_json (~> 1.0)
21
- addressable (2.3.5)
22
- backports (3.5.0)
23
- bond (0.4.3)
24
- bootstrap-sass (3.1.0.2)
25
- sass (~> 3.2)
31
+ addressable (2.3.6)
26
32
  builder (3.0.4)
27
33
  bump (0.5.0)
28
- chunky_png (1.3.0)
29
- coderay (1.1.0)
30
- coderay_bash (1.0.5)
31
- coderay (>= 1.0)
32
- compass (0.12.2)
33
- chunky_png (~> 1.2)
34
- fssm (>= 0.2.7)
35
- sass (~> 3.1)
36
34
  crack (0.4.2)
37
35
  safe_yaml (~> 1.0.0)
38
- daemons (1.1.9)
39
- database_cleaner (1.2.0)
40
36
  diff-lcs (1.2.5)
41
37
  docile (1.1.3)
42
- eventmachine (1.0.3)
38
+ erubis (2.7.0)
43
39
  faraday (0.9.0)
44
40
  multipart-post (>= 1.2, < 3)
45
- fssm (0.2.10)
46
- haml (4.0.5)
47
- tilt
48
- hashie (2.1.0)
41
+ hashie (2.1.1)
42
+ hike (1.2.3)
49
43
  i18n (0.6.9)
50
44
  inflection (1.0.0)
45
+ journey (1.0.4)
51
46
  json (1.8.1)
52
47
  mime-types (1.25.1)
53
- mongoid (3.1.6)
54
- activemodel (~> 3.2)
55
- moped (~> 1.4)
56
- origin (~> 1.0)
57
- tzinfo (~> 0.3.29)
58
- moped (1.5.2)
59
- multi_json (1.8.4)
48
+ multi_json (1.10.0)
60
49
  multipart-post (2.0.0)
61
- newrelic_rpm (3.7.2.192)
62
- origin (1.1.0)
63
- rack (1.5.2)
64
- rack-protection (1.5.2)
65
- rack
66
- rack-ssl-enforcer (0.2.6)
50
+ rack (1.4.5)
51
+ rack-cache (1.2)
52
+ rack (>= 0.4)
67
53
  rack-test (0.6.2)
68
54
  rack (>= 1.0)
69
- rake (10.1.1)
70
- redcarpet (3.0.0)
71
- ripl (0.7.0)
72
- bond (~> 0.4.2)
55
+ rake (10.3.2)
73
56
  rspec (2.14.1)
74
57
  rspec-core (~> 2.14.0)
75
58
  rspec-expectations (~> 2.14.0)
76
59
  rspec-mocks (~> 2.14.0)
77
- rspec-core (2.14.7)
60
+ rspec-core (2.14.8)
78
61
  rspec-expectations (2.14.5)
79
62
  diff-lcs (>= 1.1.3, < 2.0)
80
- rspec-mocks (2.14.5)
81
- safe_yaml (1.0.1)
82
- sass (3.2.14)
63
+ rspec-mocks (2.14.6)
64
+ safe_yaml (1.0.3)
83
65
  simplecov (0.8.2)
84
66
  docile (~> 1.1.0)
85
67
  multi_json
86
68
  simplecov-html (~> 0.8.0)
87
69
  simplecov-html (0.8.0)
88
- sinatra (1.4.4)
89
- rack (~> 1.4)
90
- rack-protection (~> 1.4)
91
- tilt (~> 1.3, >= 1.3.4)
92
- sinatra-contrib (1.4.2)
93
- backports (>= 2.0)
94
- multi_json
95
- rack-protection
96
- rack-test
97
- sinatra (~> 1.4.0)
98
- tilt (~> 1.3)
99
- thin (1.6.1)
100
- daemons (>= 1.0.9)
101
- eventmachine (>= 1.0.0)
102
- rack (>= 1.0.0)
70
+ sprockets (2.2.2)
71
+ hike (~> 1.2)
72
+ multi_json (~> 1.0)
73
+ rack (~> 1.0)
74
+ tilt (~> 1.1, != 1.3.0)
103
75
  tilt (1.4.1)
104
- tzinfo (0.3.38)
105
- vcr (2.8.0)
106
- webmock (1.9.3)
107
- addressable (>= 2.2.7)
76
+ vcr (2.9.0)
77
+ webmock (1.18.0)
78
+ addressable (>= 2.3.6)
108
79
  crack (>= 0.3.2)
109
- yard (0.8.7.3)
80
+ yard (0.8.7.4)
110
81
 
111
82
  PLATFORMS
112
83
  ruby
113
84
 
114
85
  DEPENDENCIES
115
- bootstrap-sass
86
+ actionpack (~> 3.2)
116
87
  bump
117
- coderay
118
- coderay_bash
119
- compass
120
- database_cleaner
121
- haml
122
88
  jruby-openssl
123
89
  json
124
- mongoid
125
- newrelic_rpm
126
- rack-ssl-enforcer
127
90
  rake
128
- redcarpet
129
- ripl
130
91
  rspec
131
92
  simplecov
132
- sinatra
133
- sinatra-contrib
134
- thin
135
93
  vcr
136
- webmock (~> 1.9.0)
94
+ webmock
137
95
  yard
138
96
  zendesk_api!
data/Rakefile CHANGED
@@ -13,11 +13,6 @@ if defined?(RSpec)
13
13
  t.pattern = "spec/core/**/*_spec.rb"
14
14
  end
15
15
 
16
- desc "Run server specs"
17
- RSpec::Core::RakeTask.new("spec:server") do |t|
18
- t.pattern = "spec/server/**/*_spec.rb"
19
- end
20
-
21
16
  desc "Run live specs"
22
17
  RSpec::Core::RakeTask.new("spec:live") do |t|
23
18
  t.pattern = "spec/live/**/*_spec.rb"
@@ -55,6 +55,7 @@ module ZendeskAPI
55
55
  def save_associations
56
56
  self.class.associations.each do |association_data|
57
57
  association_name = association_data[:name]
58
+
58
59
  next unless send("#{association_name}_used?") && association = send(association_name)
59
60
 
60
61
  inline_creation = association_data[:inline] == :create && new_record?
@@ -64,8 +65,8 @@ module ZendeskAPI
64
65
  self.send("#{association_name}=", association) # set id/ids columns
65
66
  end
66
67
 
67
- if (association_data[:inline] == true || inline_creation) && association.changed?
68
- attributes[association_name] = (association.is_a?(Collection) ? association.map(&:to_param) : association.to_param)
68
+ if (association_data[:inline] == true || inline_creation) && changed
69
+ attributes[association_name] = association.to_param
69
70
  end
70
71
  end
71
72
  end
@@ -9,6 +9,7 @@ require 'zendesk_api/middleware/request/etag_cache'
9
9
  require 'zendesk_api/middleware/request/retry'
10
10
  require 'zendesk_api/middleware/request/upload'
11
11
  require 'zendesk_api/middleware/request/encode_json'
12
+ require 'zendesk_api/middleware/request/url_based_access_token'
12
13
  require 'zendesk_api/middleware/response/callback'
13
14
  require 'zendesk_api/middleware/response/deflate'
14
15
  require 'zendesk_api/middleware/response/gzip'
@@ -145,8 +146,10 @@ module ZendeskAPI
145
146
  end
146
147
 
147
148
  # request
148
- if config.access_token
149
+ if config.access_token && !config.url_based_access_token
149
150
  builder.authorization("Bearer", config.access_token)
151
+ elsif config.access_token
152
+ builder.use ZendeskAPI::Middleware::Request::UrlBasedAccessToken, config.access_token
150
153
  else
151
154
  builder.use Faraday::Request::BasicAuthentication, config.username, config.password
152
155
  end
@@ -288,6 +288,10 @@ module ZendeskAPI
288
288
 
289
289
  alias :to_str :to_s
290
290
 
291
+ def to_param
292
+ map(&:to_param)
293
+ end
294
+
291
295
  private
292
296
 
293
297
  def set_page_and_count(body)
@@ -31,6 +31,8 @@ module ZendeskAPI
31
31
  # @return [String] OAuth2 access_token
32
32
  attr_accessor :access_token
33
33
 
34
+ attr_accessor :url_based_access_token
35
+
34
36
  # Use this cache instead of default ZendeskAPI::LRUCache.new
35
37
  # - must respond to read/write/fetch e.g. ActiveSupport::Cache::MemoryStore.new)
36
38
  # - pass false to disable caching
@@ -58,7 +58,7 @@ module ZendeskAPI
58
58
  File.basename(path)
59
59
  end
60
60
 
61
- hash[:uploaded_data] = Faraday::UploadIO.new(path, mime_type)
61
+ hash[:uploaded_data] = Faraday::UploadIO.new(path, mime_type, hash[:filename])
62
62
  end
63
63
  end
64
64
 
@@ -0,0 +1,26 @@
1
+ module ZendeskAPI
2
+ # @private
3
+ module Middleware
4
+ # @private
5
+ module Request
6
+ class UrlBasedAccessToken < Faraday::Middleware
7
+ def initialize(app, token)
8
+ super(app)
9
+ @token = token
10
+ end
11
+
12
+ def call(env)
13
+ if env[:url].query
14
+ env[:url].query += '&'
15
+ else
16
+ env[:url].query = ''
17
+ end
18
+
19
+ env[:url].query += "access_token=#{@token}"
20
+
21
+ @app.call(env)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -289,6 +289,7 @@ module ZendeskAPI
289
289
  has_many Comment
290
290
 
291
291
  has Organization
292
+ has Group
292
293
  has :requester, :class => User
293
294
  end
294
295
 
@@ -334,7 +335,13 @@ module ZendeskAPI
334
335
  has :requester, :class => User, :inline => :create
335
336
  has :submitter, :class => User
336
337
  has :assignee, :class => User
337
- has_many :collaborators, :class => User, :inline => true
338
+
339
+ has_many :collaborators, :class => User, :inline => true, :extend => (Module.new do
340
+ def to_param
341
+ map(&:id)
342
+ end
343
+ end)
344
+
338
345
  has_many Audit
339
346
  has :metrics, :class => TicketMetric
340
347
  has Group
@@ -388,6 +395,13 @@ module ZendeskAPI
388
395
  put :recover
389
396
  end
390
397
 
398
+ class UserViewRow < DataResource
399
+ has User
400
+ def self.model_key
401
+ "rows"
402
+ end
403
+ end
404
+
391
405
  class ViewRow < DataResource
392
406
  has Ticket
393
407
 
@@ -466,6 +480,12 @@ module ZendeskAPI
466
480
  end
467
481
  end
468
482
 
483
+ class UserView < Rule
484
+ def self.preview(client, options = {})
485
+ Collection.new(client, UserViewRow, options.merge!(:path => "user_views/preview", :verb => :post))
486
+ end
487
+ end
488
+
469
489
  class GroupMembership < Resource
470
490
  has User
471
491
  has Group
@@ -578,6 +598,10 @@ module ZendeskAPI
578
598
  namespace "channels/voice"
579
599
  end
580
600
 
601
+ class CertificationAddress < Resource
602
+ namespace "channels/voice"
603
+ end
604
+
581
605
  class Greeting < Resource
582
606
  namespace "channels/voice"
583
607
  end
@@ -1,3 +1,3 @@
1
1
  module ZendeskAPI
2
- VERSION = "1.3.5"
2
+ VERSION = "1.3.7"
3
3
  end
@@ -240,6 +240,7 @@ describe ZendeskAPI::Client do
240
240
  end
241
241
 
242
242
  it "manages namespace correctly" do
243
+ client.certification_addresses.path.should match(/channels\/voice\/certification_addresses/)
243
244
  client.phone_numbers.path.should match(/channels\/voice\/phone_numbers/)
244
245
  client.greetings.path.should match(/channels\/voice\/greetings/)
245
246
  client.greeting_categories.path.should match(/channels\/voice\/greeting_categories/)
@@ -1,5 +1,6 @@
1
1
  require 'core/spec_helper'
2
2
  require 'tempfile'
3
+ require 'action_dispatch'
3
4
 
4
5
  describe ZendeskAPI::Middleware::Request::Upload do
5
6
  subject { ZendeskAPI::Middleware::Request::Upload.new(lambda {|env| env}) }
@@ -45,41 +46,39 @@ describe ZendeskAPI::Middleware::Request::Upload do
45
46
  end
46
47
  end
47
48
 
48
- begin
49
- require 'action_dispatch'
50
- rescue LoadError
51
- warn "Could not load ActionDispatch; not running ActionDispatch::Http::UploadedFile tests"
52
- end
49
+ context "with an ActionDispatch::Http::UploadedFile" do
50
+ before(:each) do
51
+ @upload = ActionDispatch::Http::UploadedFile.new(:filename => "hello.jpg", :tempfile => Tempfile.new(['hello', '.jpg']))
52
+ @env = subject.call(:body => { :file => @upload })
53
+ end
53
54
 
54
- if defined?(ActionDispatch)
55
- class String
56
- def encoding_aware?; false; end
55
+ it "should convert file string to UploadIO" do
56
+ @env[:body][:uploaded_data].should be_instance_of(Faraday::UploadIO)
57
57
  end
58
58
 
59
- context "with an ActionDispatch::Http::UploadedFile" do
60
- before(:each) do
61
- @upload = ActionDispatch::Http::UploadedFile.new(:filename => "hello.jpg", :tempfile => Tempfile.new(File.basename(filename)))
62
- @env = subject.call(:body => { :file => @upload })
63
- end
59
+ it "should remove file string" do
60
+ @env[:body][:file].should be_nil
61
+ end
64
62
 
65
- it "should convert file string to UploadIO" do
66
- @env[:body][:uploaded_data].should be_instance_of(Faraday::UploadIO)
67
- end
63
+ it "should add filename if none exist" do
64
+ @env[:body][:filename].should == "hello.jpg"
65
+ end
68
66
 
69
- it "should remove file string" do
70
- @env[:body][:file].should be_nil
71
- end
67
+ it "should use the content type of the tempfile" do
68
+ @env[:body][:uploaded_data].content_type.should == "image/jpeg"
69
+ end
72
70
 
73
- it "should add filename if none exist" do
74
- @env[:body][:filename].should == "hello"
71
+ context "when path does not resolve a mime_type" do
72
+ it "should pass correct filename to Faraday::UploadIO" do
73
+ @env[:body][:filename].should == "hello.jpg"
74
+ @env[:body][:uploaded_data].original_filename.should == @env[:body][:filename]
75
75
  end
76
76
 
77
- context "when path does not resolve a mime_type" do
78
- it "should use the content_type of ActionDispatch::Http::UploadedFile " do
79
- @upload.tempfile.path = "XXX"
80
- @env = subject.call(:body => { :file => @upload })
81
- @env[:body][:uploaded_data][:content_type].should == "image/jpeg"
82
- end
77
+ it "should use the content_type of ActionDispatch::Http::UploadedFile " do
78
+ @upload.content_type = 'application/random'
79
+
80
+ env = subject.call(:body => { :file => @upload })
81
+ env[:body][:uploaded_data].content_type.should == 'application/random'
83
82
  end
84
83
  end
85
84
  end