ZCRMSDK 1.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (379) hide show
  1. checksums.yaml +4 -4
  2. data/src/ZCRMSDK.rb +362 -0
  3. data/src/com/zoho/api/authenticator/oauth_token.rb +217 -0
  4. data/src/com/zoho/api/authenticator/store/db_store.rb +149 -0
  5. data/src/com/zoho/api/authenticator/store/file_store.rb +165 -0
  6. data/src/com/zoho/api/authenticator/store/token_store.rb +26 -0
  7. data/src/com/zoho/api/authenticator/token.rb +10 -0
  8. data/src/com/zoho/api/logger/sdk_logger.rb +68 -0
  9. data/src/com/zoho/crm/api/attachments/action_handler.rb +10 -0
  10. data/src/com/zoho/crm/api/attachments/action_response.rb +10 -0
  11. data/src/com/zoho/crm/api/attachments/action_wrapper.rb +63 -0
  12. data/src/com/zoho/crm/api/attachments/api_exception.rb +125 -0
  13. data/src/com/zoho/crm/api/attachments/attachment.rb +367 -0
  14. data/src/com/zoho/crm/api/attachments/attachments_operations.rb +196 -0
  15. data/src/com/zoho/crm/api/attachments/file_body_wrapper.rb +64 -0
  16. data/src/com/zoho/crm/api/attachments/response_handler.rb +10 -0
  17. data/src/com/zoho/crm/api/attachments/response_wrapper.rb +83 -0
  18. data/src/com/zoho/crm/api/attachments/success_response.rb +121 -0
  19. data/src/com/zoho/crm/api/blue_print/action_response.rb +10 -0
  20. data/src/com/zoho/crm/api/blue_print/api_exception.rb +123 -0
  21. data/src/com/zoho/crm/api/blue_print/blue_print.rb +119 -0
  22. data/src/com/zoho/crm/api/blue_print/blue_print_operations.rb +67 -0
  23. data/src/com/zoho/crm/api/blue_print/body_wrapper.rb +61 -0
  24. data/src/com/zoho/crm/api/blue_print/next_transition.rb +80 -0
  25. data/src/com/zoho/crm/api/blue_print/process_info.rb +251 -0
  26. data/src/com/zoho/crm/api/blue_print/response_handler.rb +10 -0
  27. data/src/com/zoho/crm/api/blue_print/response_wrapper.rb +63 -0
  28. data/src/com/zoho/crm/api/blue_print/success_response.rb +121 -0
  29. data/src/com/zoho/crm/api/blue_print/transition.rb +253 -0
  30. data/src/com/zoho/crm/api/blue_print/validation_error.rb +80 -0
  31. data/src/com/zoho/crm/api/bulk_read/action_handler.rb +10 -0
  32. data/src/com/zoho/crm/api/bulk_read/action_response.rb +10 -0
  33. data/src/com/zoho/crm/api/bulk_read/action_wrapper.rb +82 -0
  34. data/src/com/zoho/crm/api/bulk_read/api_exception.rb +125 -0
  35. data/src/com/zoho/crm/api/bulk_read/bulk_read_operations.rb +74 -0
  36. data/src/com/zoho/crm/api/bulk_read/call_back.rb +81 -0
  37. data/src/com/zoho/crm/api/bulk_read/criteria.rb +135 -0
  38. data/src/com/zoho/crm/api/bulk_read/file_body_wrapper.rb +64 -0
  39. data/src/com/zoho/crm/api/bulk_read/job_detail.rb +196 -0
  40. data/src/com/zoho/crm/api/bulk_read/query.rb +137 -0
  41. data/src/com/zoho/crm/api/bulk_read/request_wrapper.rb +100 -0
  42. data/src/com/zoho/crm/api/bulk_read/response_handler.rb +10 -0
  43. data/src/com/zoho/crm/api/bulk_read/response_wrapper.rb +63 -0
  44. data/src/com/zoho/crm/api/bulk_read/result.rb +137 -0
  45. data/src/com/zoho/crm/api/bulk_read/success_response.rb +121 -0
  46. data/src/com/zoho/crm/api/bulk_write/action_response.rb +10 -0
  47. data/src/com/zoho/crm/api/bulk_write/api_exception.rb +239 -0
  48. data/src/com/zoho/crm/api/bulk_write/bulk_write_operations.rb +112 -0
  49. data/src/com/zoho/crm/api/bulk_write/bulk_write_response.rb +216 -0
  50. data/src/com/zoho/crm/api/bulk_write/call_back.rb +81 -0
  51. data/src/com/zoho/crm/api/bulk_write/field_mapping.rb +156 -0
  52. data/src/com/zoho/crm/api/bulk_write/file.rb +157 -0
  53. data/src/com/zoho/crm/api/bulk_write/file_body_wrapper.rb +64 -0
  54. data/src/com/zoho/crm/api/bulk_write/request_wrapper.rb +119 -0
  55. data/src/com/zoho/crm/api/bulk_write/resource.rb +195 -0
  56. data/src/com/zoho/crm/api/bulk_write/response_handler.rb +10 -0
  57. data/src/com/zoho/crm/api/bulk_write/response_wrapper.rb +10 -0
  58. data/src/com/zoho/crm/api/bulk_write/result.rb +61 -0
  59. data/src/com/zoho/crm/api/bulk_write/success_response.rb +121 -0
  60. data/src/com/zoho/crm/api/contact_roles/action_handler.rb +10 -0
  61. data/src/com/zoho/crm/api/contact_roles/action_response.rb +10 -0
  62. data/src/com/zoho/crm/api/contact_roles/action_wrapper.rb +63 -0
  63. data/src/com/zoho/crm/api/contact_roles/api_exception.rb +125 -0
  64. data/src/com/zoho/crm/api/contact_roles/body_wrapper.rb +61 -0
  65. data/src/com/zoho/crm/api/contact_roles/contact_role.rb +99 -0
  66. data/src/com/zoho/crm/api/contact_roles/contact_roles_operations.rb +161 -0
  67. data/src/com/zoho/crm/api/contact_roles/response_handler.rb +10 -0
  68. data/src/com/zoho/crm/api/contact_roles/response_wrapper.rb +63 -0
  69. data/src/com/zoho/crm/api/contact_roles/success_response.rb +121 -0
  70. data/src/com/zoho/crm/api/currencies/action_handler.rb +10 -0
  71. data/src/com/zoho/crm/api/currencies/action_response.rb +10 -0
  72. data/src/com/zoho/crm/api/currencies/action_wrapper.rb +63 -0
  73. data/src/com/zoho/crm/api/currencies/api_exception.rb +127 -0
  74. data/src/com/zoho/crm/api/currencies/base_currency_action_handler.rb +10 -0
  75. data/src/com/zoho/crm/api/currencies/base_currency_action_wrapper.rb +63 -0
  76. data/src/com/zoho/crm/api/currencies/base_currency_wrapper.rb +61 -0
  77. data/src/com/zoho/crm/api/currencies/body_wrapper.rb +61 -0
  78. data/src/com/zoho/crm/api/currencies/currencies_operations.rb +156 -0
  79. data/src/com/zoho/crm/api/currencies/currency.rb +290 -0
  80. data/src/com/zoho/crm/api/currencies/format.rb +100 -0
  81. data/src/com/zoho/crm/api/currencies/response_handler.rb +10 -0
  82. data/src/com/zoho/crm/api/currencies/response_wrapper.rb +63 -0
  83. data/src/com/zoho/crm/api/currencies/success_response.rb +121 -0
  84. data/src/com/zoho/crm/api/custom_views/api_exception.rb +121 -0
  85. data/src/com/zoho/crm/api/custom_views/criteria.rb +135 -0
  86. data/src/com/zoho/crm/api/custom_views/custom_view.rb +327 -0
  87. data/src/com/zoho/crm/api/custom_views/custom_views_operations.rb +75 -0
  88. data/src/com/zoho/crm/api/custom_views/info.rb +156 -0
  89. data/src/com/zoho/crm/api/custom_views/range.rb +80 -0
  90. data/src/com/zoho/crm/api/custom_views/response_handler.rb +10 -0
  91. data/src/com/zoho/crm/api/custom_views/response_wrapper.rb +82 -0
  92. data/src/com/zoho/crm/api/custom_views/shared_details.rb +118 -0
  93. data/src/com/zoho/crm/api/custom_views/translation.rb +118 -0
  94. data/src/com/zoho/crm/api/dc/au_datacenter.rb +18 -0
  95. data/src/com/zoho/crm/api/dc/cn_datacenter.rb +18 -0
  96. data/src/com/zoho/crm/api/dc/datacenter.rb +20 -0
  97. data/src/com/zoho/crm/api/dc/eu_datacenter.rb +18 -0
  98. data/src/com/zoho/crm/api/dc/in_datacenter.rb +18 -0
  99. data/src/com/zoho/crm/api/dc/us_datacenter.rb +18 -0
  100. data/src/com/zoho/crm/api/exception/sdk_exception.rb +47 -0
  101. data/src/com/zoho/crm/api/fields/api_exception.rb +121 -0
  102. data/src/com/zoho/crm/api/fields/association_details.rb +80 -0
  103. data/src/com/zoho/crm/api/fields/auto_number.rb +99 -0
  104. data/src/com/zoho/crm/api/fields/crypt.rb +156 -0
  105. data/src/com/zoho/crm/api/fields/currency.rb +80 -0
  106. data/src/com/zoho/crm/api/fields/field.rb +956 -0
  107. data/src/com/zoho/crm/api/fields/fields_operations.rb +71 -0
  108. data/src/com/zoho/crm/api/fields/formula.rb +80 -0
  109. data/src/com/zoho/crm/api/fields/lookup_field.rb +80 -0
  110. data/src/com/zoho/crm/api/fields/module.rb +157 -0
  111. data/src/com/zoho/crm/api/fields/multi_select_lookup.rb +156 -0
  112. data/src/com/zoho/crm/api/fields/pick_list_value.rb +175 -0
  113. data/src/com/zoho/crm/api/fields/private.rb +99 -0
  114. data/src/com/zoho/crm/api/fields/related_details.rb +137 -0
  115. data/src/com/zoho/crm/api/fields/response_handler.rb +10 -0
  116. data/src/com/zoho/crm/api/fields/response_wrapper.rb +63 -0
  117. data/src/com/zoho/crm/api/fields/tool_tip.rb +80 -0
  118. data/src/com/zoho/crm/api/fields/unique.rb +61 -0
  119. data/src/com/zoho/crm/api/fields/view_type.rb +118 -0
  120. data/src/com/zoho/crm/api/files/action_handler.rb +10 -0
  121. data/src/com/zoho/crm/api/files/action_response.rb +10 -0
  122. data/src/com/zoho/crm/api/files/action_wrapper.rb +63 -0
  123. data/src/com/zoho/crm/api/files/api_exception.rb +125 -0
  124. data/src/com/zoho/crm/api/files/body_wrapper.rb +62 -0
  125. data/src/com/zoho/crm/api/files/file_body_wrapper.rb +64 -0
  126. data/src/com/zoho/crm/api/files/file_operations.rb +75 -0
  127. data/src/com/zoho/crm/api/files/response_handler.rb +10 -0
  128. data/src/com/zoho/crm/api/files/success_response.rb +121 -0
  129. data/src/com/zoho/crm/api/header.rb +10 -0
  130. data/src/com/zoho/crm/api/header_map.rb +55 -0
  131. data/src/com/zoho/crm/api/initializer.rb +192 -0
  132. data/src/com/zoho/crm/api/layouts/api_exception.rb +121 -0
  133. data/src/com/zoho/crm/api/layouts/layout.rb +272 -0
  134. data/src/com/zoho/crm/api/layouts/layouts_operations.rb +61 -0
  135. data/src/com/zoho/crm/api/layouts/properties.rb +100 -0
  136. data/src/com/zoho/crm/api/layouts/response_handler.rb +10 -0
  137. data/src/com/zoho/crm/api/layouts/response_wrapper.rb +63 -0
  138. data/src/com/zoho/crm/api/layouts/section.rb +233 -0
  139. data/src/com/zoho/crm/api/modules/action_handler.rb +10 -0
  140. data/src/com/zoho/crm/api/modules/action_response.rb +10 -0
  141. data/src/com/zoho/crm/api/modules/action_wrapper.rb +63 -0
  142. data/src/com/zoho/crm/api/modules/api_exception.rb +125 -0
  143. data/src/com/zoho/crm/api/modules/argument.rb +80 -0
  144. data/src/com/zoho/crm/api/modules/body_wrapper.rb +61 -0
  145. data/src/com/zoho/crm/api/modules/module.rb +882 -0
  146. data/src/com/zoho/crm/api/modules/modules_operations.rb +111 -0
  147. data/src/com/zoho/crm/api/modules/related_list_properties.rb +99 -0
  148. data/src/com/zoho/crm/api/modules/response_handler.rb +10 -0
  149. data/src/com/zoho/crm/api/modules/response_wrapper.rb +63 -0
  150. data/src/com/zoho/crm/api/modules/success_response.rb +121 -0
  151. data/src/com/zoho/crm/api/modules/territory.rb +99 -0
  152. data/src/com/zoho/crm/api/notes/action_handler.rb +10 -0
  153. data/src/com/zoho/crm/api/notes/action_response.rb +10 -0
  154. data/src/com/zoho/crm/api/notes/action_wrapper.rb +63 -0
  155. data/src/com/zoho/crm/api/notes/api_exception.rb +125 -0
  156. data/src/com/zoho/crm/api/notes/body_wrapper.rb +61 -0
  157. data/src/com/zoho/crm/api/notes/info.rb +118 -0
  158. data/src/com/zoho/crm/api/notes/note.rb +349 -0
  159. data/src/com/zoho/crm/api/notes/notes_operations.rb +219 -0
  160. data/src/com/zoho/crm/api/notes/response_handler.rb +10 -0
  161. data/src/com/zoho/crm/api/notes/response_wrapper.rb +82 -0
  162. data/src/com/zoho/crm/api/notes/success_response.rb +121 -0
  163. data/src/com/zoho/crm/api/notification/action_handler.rb +10 -0
  164. data/src/com/zoho/crm/api/notification/action_response.rb +10 -0
  165. data/src/com/zoho/crm/api/notification/action_wrapper.rb +63 -0
  166. data/src/com/zoho/crm/api/notification/api_exception.rb +125 -0
  167. data/src/com/zoho/crm/api/notification/body_wrapper.rb +61 -0
  168. data/src/com/zoho/crm/api/notification/info.rb +118 -0
  169. data/src/com/zoho/crm/api/notification/notification.rb +251 -0
  170. data/src/com/zoho/crm/api/notification/notification_operations.rb +164 -0
  171. data/src/com/zoho/crm/api/notification/response_handler.rb +10 -0
  172. data/src/com/zoho/crm/api/notification/response_wrapper.rb +82 -0
  173. data/src/com/zoho/crm/api/notification/success_response.rb +121 -0
  174. data/src/com/zoho/crm/api/org/action_response.rb +10 -0
  175. data/src/com/zoho/crm/api/org/api_exception.rb +123 -0
  176. data/src/com/zoho/crm/api/org/file_body_wrapper.rb +62 -0
  177. data/src/com/zoho/crm/api/org/license_details.rb +156 -0
  178. data/src/com/zoho/crm/api/org/org.rb +631 -0
  179. data/src/com/zoho/crm/api/org/org_operations.rb +49 -0
  180. data/src/com/zoho/crm/api/org/response_handler.rb +10 -0
  181. data/src/com/zoho/crm/api/org/response_wrapper.rb +63 -0
  182. data/src/com/zoho/crm/api/org/success_response.rb +121 -0
  183. data/src/com/zoho/crm/api/param.rb +10 -0
  184. data/src/com/zoho/crm/api/parameter_map.rb +54 -0
  185. data/src/com/zoho/crm/api/profiles/api_exception.rb +121 -0
  186. data/src/com/zoho/crm/api/profiles/category.rb +99 -0
  187. data/src/com/zoho/crm/api/profiles/permission_detail.rb +137 -0
  188. data/src/com/zoho/crm/api/profiles/profile.rb +290 -0
  189. data/src/com/zoho/crm/api/profiles/profiles_operations.rb +61 -0
  190. data/src/com/zoho/crm/api/profiles/response_handler.rb +10 -0
  191. data/src/com/zoho/crm/api/profiles/response_wrapper.rb +63 -0
  192. data/src/com/zoho/crm/api/profiles/section.rb +80 -0
  193. data/src/com/zoho/crm/api/query/api_exception.rb +121 -0
  194. data/src/com/zoho/crm/api/query/body_wrapper.rb +61 -0
  195. data/src/com/zoho/crm/api/query/query_operations.rb +35 -0
  196. data/src/com/zoho/crm/api/query/response_handler.rb +10 -0
  197. data/src/com/zoho/crm/api/query/response_wrapper.rb +84 -0
  198. data/src/com/zoho/crm/api/record/action_handler.rb +10 -0
  199. data/src/com/zoho/crm/api/record/action_response.rb +10 -0
  200. data/src/com/zoho/crm/api/record/action_wrapper.rb +63 -0
  201. data/src/com/zoho/crm/api/record/api_exception.rb +143 -0
  202. data/src/com/zoho/crm/api/record/body_wrapper.rb +156 -0
  203. data/src/com/zoho/crm/api/record/carry_over_tags.rb +99 -0
  204. data/src/com/zoho/crm/api/record/comment.rb +118 -0
  205. data/src/com/zoho/crm/api/record/consent.rb +185 -0
  206. data/src/com/zoho/crm/api/record/convert_action_handler.rb +10 -0
  207. data/src/com/zoho/crm/api/record/convert_action_response.rb +10 -0
  208. data/src/com/zoho/crm/api/record/convert_action_wrapper.rb +63 -0
  209. data/src/com/zoho/crm/api/record/convert_body_wrapper.rb +61 -0
  210. data/src/com/zoho/crm/api/record/criteria.rb +135 -0
  211. data/src/com/zoho/crm/api/record/deleted_record.rb +157 -0
  212. data/src/com/zoho/crm/api/record/deleted_records_handler.rb +10 -0
  213. data/src/com/zoho/crm/api/record/deleted_records_wrapper.rb +82 -0
  214. data/src/com/zoho/crm/api/record/download_handler.rb +10 -0
  215. data/src/com/zoho/crm/api/record/field.rb +2109 -0
  216. data/src/com/zoho/crm/api/record/file_body_wrapper.rb +66 -0
  217. data/src/com/zoho/crm/api/record/file_details.rb +327 -0
  218. data/src/com/zoho/crm/api/record/file_handler.rb +10 -0
  219. data/src/com/zoho/crm/api/record/info.rb +118 -0
  220. data/src/com/zoho/crm/api/record/inventory_line_items.rb +235 -0
  221. data/src/com/zoho/crm/api/record/lead_converter.rb +194 -0
  222. data/src/com/zoho/crm/api/record/line_item_product.rb +65 -0
  223. data/src/com/zoho/crm/api/record/line_tax.rb +118 -0
  224. data/src/com/zoho/crm/api/record/mass_update.rb +140 -0
  225. data/src/com/zoho/crm/api/record/mass_update_action_handler.rb +10 -0
  226. data/src/com/zoho/crm/api/record/mass_update_action_response.rb +10 -0
  227. data/src/com/zoho/crm/api/record/mass_update_action_wrapper.rb +63 -0
  228. data/src/com/zoho/crm/api/record/mass_update_body_wrapper.rb +156 -0
  229. data/src/com/zoho/crm/api/record/mass_update_response.rb +10 -0
  230. data/src/com/zoho/crm/api/record/mass_update_response_handler.rb +10 -0
  231. data/src/com/zoho/crm/api/record/mass_update_response_wrapper.rb +63 -0
  232. data/src/com/zoho/crm/api/record/mass_update_success_response.rb +121 -0
  233. data/src/com/zoho/crm/api/record/options.rb +10 -0
  234. data/src/com/zoho/crm/api/record/participants.rb +116 -0
  235. data/src/com/zoho/crm/api/record/pricing_details.rb +65 -0
  236. data/src/com/zoho/crm/api/record/record.rb +192 -0
  237. data/src/com/zoho/crm/api/record/record_operations.rb +757 -0
  238. data/src/com/zoho/crm/api/record/recurring_activity.rb +61 -0
  239. data/src/com/zoho/crm/api/record/remind_at.rb +61 -0
  240. data/src/com/zoho/crm/api/record/reminder.rb +80 -0
  241. data/src/com/zoho/crm/api/record/response_handler.rb +10 -0
  242. data/src/com/zoho/crm/api/record/response_wrapper.rb +82 -0
  243. data/src/com/zoho/crm/api/record/success_response.rb +161 -0
  244. data/src/com/zoho/crm/api/record/successful_convert.rb +101 -0
  245. data/src/com/zoho/crm/api/record/territory.rb +80 -0
  246. data/src/com/zoho/crm/api/related_lists/api_exception.rb +121 -0
  247. data/src/com/zoho/crm/api/related_lists/related_list.rb +251 -0
  248. data/src/com/zoho/crm/api/related_lists/related_lists_operations.rb +61 -0
  249. data/src/com/zoho/crm/api/related_lists/response_handler.rb +10 -0
  250. data/src/com/zoho/crm/api/related_lists/response_wrapper.rb +63 -0
  251. data/src/com/zoho/crm/api/related_records/action_handler.rb +10 -0
  252. data/src/com/zoho/crm/api/related_records/action_response.rb +10 -0
  253. data/src/com/zoho/crm/api/related_records/action_wrapper.rb +63 -0
  254. data/src/com/zoho/crm/api/related_records/api_exception.rb +125 -0
  255. data/src/com/zoho/crm/api/related_records/body_wrapper.rb +62 -0
  256. data/src/com/zoho/crm/api/related_records/file_body_wrapper.rb +64 -0
  257. data/src/com/zoho/crm/api/related_records/related_records_operations.rb +263 -0
  258. data/src/com/zoho/crm/api/related_records/response_handler.rb +10 -0
  259. data/src/com/zoho/crm/api/related_records/response_wrapper.rb +84 -0
  260. data/src/com/zoho/crm/api/related_records/success_response.rb +121 -0
  261. data/src/com/zoho/crm/api/request_proxy.rb +16 -0
  262. data/src/com/zoho/crm/api/roles/api_exception.rb +121 -0
  263. data/src/com/zoho/crm/api/roles/response_handler.rb +10 -0
  264. data/src/com/zoho/crm/api/roles/response_wrapper.rb +63 -0
  265. data/src/com/zoho/crm/api/roles/role.rb +195 -0
  266. data/src/com/zoho/crm/api/roles/roles_operations.rb +47 -0
  267. data/src/com/zoho/crm/api/sdk_config.rb +78 -0
  268. data/src/com/zoho/crm/api/share_records/action_handler.rb +10 -0
  269. data/src/com/zoho/crm/api/share_records/action_response.rb +10 -0
  270. data/src/com/zoho/crm/api/share_records/action_wrapper.rb +63 -0
  271. data/src/com/zoho/crm/api/share_records/api_exception.rb +129 -0
  272. data/src/com/zoho/crm/api/share_records/body_wrapper.rb +61 -0
  273. data/src/com/zoho/crm/api/share_records/delete_action_handler.rb +10 -0
  274. data/src/com/zoho/crm/api/share_records/delete_action_response.rb +10 -0
  275. data/src/com/zoho/crm/api/share_records/delete_action_wrapper.rb +63 -0
  276. data/src/com/zoho/crm/api/share_records/response_handler.rb +10 -0
  277. data/src/com/zoho/crm/api/share_records/response_wrapper.rb +83 -0
  278. data/src/com/zoho/crm/api/share_records/share_record.rb +157 -0
  279. data/src/com/zoho/crm/api/share_records/share_records_operations.rb +128 -0
  280. data/src/com/zoho/crm/api/share_records/shared_through.rb +100 -0
  281. data/src/com/zoho/crm/api/share_records/success_response.rb +123 -0
  282. data/src/com/zoho/crm/api/tags/action_handler.rb +10 -0
  283. data/src/com/zoho/crm/api/tags/action_response.rb +10 -0
  284. data/src/com/zoho/crm/api/tags/action_wrapper.rb +63 -0
  285. data/src/com/zoho/crm/api/tags/api_exception.rb +131 -0
  286. data/src/com/zoho/crm/api/tags/body_wrapper.rb +61 -0
  287. data/src/com/zoho/crm/api/tags/conflict_wrapper.rb +61 -0
  288. data/src/com/zoho/crm/api/tags/count_handler.rb +10 -0
  289. data/src/com/zoho/crm/api/tags/count_wrapper.rb +63 -0
  290. data/src/com/zoho/crm/api/tags/info.rb +80 -0
  291. data/src/com/zoho/crm/api/tags/merge_wrapper.rb +61 -0
  292. data/src/com/zoho/crm/api/tags/record_action_handler.rb +10 -0
  293. data/src/com/zoho/crm/api/tags/record_action_response.rb +10 -0
  294. data/src/com/zoho/crm/api/tags/record_action_wrapper.rb +120 -0
  295. data/src/com/zoho/crm/api/tags/response_handler.rb +10 -0
  296. data/src/com/zoho/crm/api/tags/response_wrapper.rb +82 -0
  297. data/src/com/zoho/crm/api/tags/success_response.rb +123 -0
  298. data/src/com/zoho/crm/api/tags/tag.rb +157 -0
  299. data/src/com/zoho/crm/api/tags/tags_operations.rb +387 -0
  300. data/src/com/zoho/crm/api/taxes/action_handler.rb +10 -0
  301. data/src/com/zoho/crm/api/taxes/action_response.rb +10 -0
  302. data/src/com/zoho/crm/api/taxes/action_wrapper.rb +63 -0
  303. data/src/com/zoho/crm/api/taxes/api_exception.rb +125 -0
  304. data/src/com/zoho/crm/api/taxes/body_wrapper.rb +61 -0
  305. data/src/com/zoho/crm/api/taxes/preference.rb +80 -0
  306. data/src/com/zoho/crm/api/taxes/response_handler.rb +10 -0
  307. data/src/com/zoho/crm/api/taxes/response_wrapper.rb +82 -0
  308. data/src/com/zoho/crm/api/taxes/success_response.rb +121 -0
  309. data/src/com/zoho/crm/api/taxes/tax.rb +137 -0
  310. data/src/com/zoho/crm/api/taxes/taxes_operations.rb +136 -0
  311. data/src/com/zoho/crm/api/territories/api_exception.rb +121 -0
  312. data/src/com/zoho/crm/api/territories/response_handler.rb +10 -0
  313. data/src/com/zoho/crm/api/territories/response_wrapper.rb +63 -0
  314. data/src/com/zoho/crm/api/territories/territories_operations.rb +47 -0
  315. data/src/com/zoho/crm/api/territories/territory.rb +234 -0
  316. data/src/com/zoho/crm/api/user_signature.rb +27 -0
  317. data/src/com/zoho/crm/api/users/action_handler.rb +10 -0
  318. data/src/com/zoho/crm/api/users/action_response.rb +10 -0
  319. data/src/com/zoho/crm/api/users/action_wrapper.rb +63 -0
  320. data/src/com/zoho/crm/api/users/api_exception.rb +125 -0
  321. data/src/com/zoho/crm/api/users/body_wrapper.rb +61 -0
  322. data/src/com/zoho/crm/api/users/customize_info.rb +156 -0
  323. data/src/com/zoho/crm/api/users/info.rb +118 -0
  324. data/src/com/zoho/crm/api/users/request_wrapper.rb +61 -0
  325. data/src/com/zoho/crm/api/users/response_handler.rb +10 -0
  326. data/src/com/zoho/crm/api/users/response_wrapper.rb +82 -0
  327. data/src/com/zoho/crm/api/users/shift.rb +80 -0
  328. data/src/com/zoho/crm/api/users/success_response.rb +121 -0
  329. data/src/com/zoho/crm/api/users/tab_theme.rb +80 -0
  330. data/src/com/zoho/crm/api/users/territory.rb +99 -0
  331. data/src/com/zoho/crm/api/users/theme.rb +156 -0
  332. data/src/com/zoho/crm/api/users/user.rb +696 -0
  333. data/src/com/zoho/crm/api/users/users_operations.rb +181 -0
  334. data/src/com/zoho/crm/api/util/api_http_connector.rb +112 -0
  335. data/src/com/zoho/crm/api/util/api_response.rb +16 -0
  336. data/src/com/zoho/crm/api/util/choice.rb +9 -0
  337. data/src/com/zoho/crm/api/util/common_api_handler.rb +236 -0
  338. data/src/com/zoho/crm/api/util/constants.rb +536 -0
  339. data/src/com/zoho/crm/api/util/converter.rb +213 -0
  340. data/src/com/zoho/crm/api/util/data_type_converter.rb +162 -0
  341. data/src/com/zoho/crm/api/util/downloader.rb +83 -0
  342. data/src/com/zoho/crm/api/util/form_data_converter.rb +168 -0
  343. data/src/com/zoho/crm/api/util/header_param_validator.rb +55 -0
  344. data/src/com/zoho/crm/api/util/json_converter.rb +726 -0
  345. data/src/com/zoho/crm/api/util/model.rb +5 -0
  346. data/src/com/zoho/crm/api/util/module_fields_handler.rb +78 -0
  347. data/src/com/zoho/crm/api/util/stream_wrapper.rb +37 -0
  348. data/src/com/zoho/crm/api/util/utility.rb +743 -0
  349. data/src/com/zoho/crm/api/variable_groups/api_exception.rb +121 -0
  350. data/src/com/zoho/crm/api/variable_groups/response_handler.rb +10 -0
  351. data/src/com/zoho/crm/api/variable_groups/response_wrapper.rb +63 -0
  352. data/src/com/zoho/crm/api/variable_groups/variable_group.rb +137 -0
  353. data/src/com/zoho/crm/api/variable_groups/variable_groups_operations.rb +66 -0
  354. data/src/com/zoho/crm/api/variables/action_handler.rb +10 -0
  355. data/src/com/zoho/crm/api/variables/action_response.rb +10 -0
  356. data/src/com/zoho/crm/api/variables/action_wrapper.rb +63 -0
  357. data/src/com/zoho/crm/api/variables/api_exception.rb +125 -0
  358. data/src/com/zoho/crm/api/variables/body_wrapper.rb +61 -0
  359. data/src/com/zoho/crm/api/variables/response_handler.rb +10 -0
  360. data/src/com/zoho/crm/api/variables/response_wrapper.rb +63 -0
  361. data/src/com/zoho/crm/api/variables/success_response.rb +121 -0
  362. data/src/com/zoho/crm/api/variables/variable.rb +173 -0
  363. data/src/com/zoho/crm/api/variables/variables_operations.rb +241 -0
  364. data/src/resources/JSONDetails.json +1 -0
  365. data/src/version.rb +3 -0
  366. metadata +395 -45
  367. data/lib/ZCRMSDK.rb +0 -14
  368. data/lib/ZCRMSDK/handler.rb +0 -3290
  369. data/lib/ZCRMSDK/oauth_client.rb +0 -253
  370. data/lib/ZCRMSDK/oauth_utility.rb +0 -161
  371. data/lib/ZCRMSDK/operations.rb +0 -1091
  372. data/lib/ZCRMSDK/org.rb +0 -174
  373. data/lib/ZCRMSDK/persistence.rb +0 -129
  374. data/lib/ZCRMSDK/request.rb +0 -83
  375. data/lib/ZCRMSDK/response.rb +0 -216
  376. data/lib/ZCRMSDK/restclient.rb +0 -65
  377. data/lib/ZCRMSDK/test.rb +0 -5746
  378. data/lib/ZCRMSDK/utility.rb +0 -309
  379. data/lib/ZCRMSDK/version.rb +0 -5
@@ -0,0 +1,149 @@
1
+ require 'mysql2'
2
+ require_relative 'token_store'
3
+ require_relative '../oauth_token'
4
+ require_relative '../../../crm/api/util/constants'
5
+
6
+ module Store
7
+ # This class stores the user token details to the MySQL DataBase.
8
+ class DBStore < TokenStore
9
+ attr_accessor :user_name, :password, :port_number, :host, :database_name
10
+
11
+ # Creates an DBStore class instance with the specified parameters.
12
+ # @param host [string] A String containing the DataBase host name.
13
+ # @param database_name A String containing the DataBase name.
14
+ # @param user_name A String containing the DataBase user name.
15
+ # @param password A String containing the DataBase password.
16
+ # @param port_number A String containing the DataBase port number.
17
+ def initialize(host = nil, database_name = nil, user_name = nil, password = nil, port_number = nil)
18
+ @host = host.nil? ? Constants::MYSQL_HOST : host
19
+
20
+ @database_name = database_name.nil? ? Constants::MYSQL_DATABASE_NAME : database_name
21
+
22
+ @user_name = user_name.nil? ? Constants::MYSQL_USER_NAME : user_name
23
+
24
+ @password = password.nil? ? '' : password
25
+
26
+ @port_number = port_number.nil? ? Constants::MYSQL_PORT_NUMBER : port_number
27
+ end
28
+
29
+ def get_token(user, token)
30
+ con = Mysql2::Client.new(host: @host, username: @user_name, password: @password, database: @database_name, port: @port_number)
31
+
32
+ query = construct_db_query(user.email, token, false)
33
+
34
+ rs = con.query(query)
35
+
36
+ con.close
37
+
38
+ rs.each do |row|
39
+ oauthtoken = token
40
+
41
+ oauthtoken.access_token = row[Constants::ACCESS_TOKEN]
42
+
43
+ oauthtoken.expires_in = row[Constants::EXPIRY_TIME]
44
+
45
+ oauthtoken.refresh_token = row[Constants::REFRESH_TOKEN]
46
+
47
+ return oauthtoken
48
+ end
49
+ nil
50
+ rescue Mysql2::Error => e
51
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::GET_TOKEN_DB_ERROR, nil, e)
52
+ end
53
+
54
+ def save_token(user, token)
55
+ con = Mysql2::Client.new(host: @host, username: @user_name, password: @password, database: @database_name, port: @port_number)
56
+ if token.is_a? Authenticator::OAuthToken
57
+ query = "insert into oauthtoken(user_mail,client_id,refresh_token,access_token,grant_token,expiry_time) values ('#{user.email}','#{token.client_id}','#{token.refresh_token}','#{token.access_token}','#{token.grant_token}','#{token.expires_in}')"
58
+ token.user_mail = user.email
59
+ delete_token(token)
60
+ con.query(query)
61
+ end
62
+
63
+ con.close
64
+ rescue Mysql2::Error => e
65
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::SAVE_TOKEN_DB_ERROR, nil, e)
66
+ end
67
+
68
+ def delete_token(token)
69
+ con = Mysql2::Client.new(host: @host, username: @user_name, password: @password, database: @database_name, port: @port_number)
70
+ if token.is_a? Authenticator::OAuthToken
71
+ query = construct_db_query(token.user_mail, token, true)
72
+
73
+ con.query(query)
74
+ end
75
+
76
+ con.close
77
+ rescue Mysql2::Error => e
78
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::DELETE_TOKEN_DB_ERROR, nil, e)
79
+ end
80
+
81
+ def delete_tokens
82
+ con = Mysql2::Client.new(host: @host, username: @user_name, password: @password, database: @database_name, port: @port_number)
83
+
84
+ query = 'delete from oauthtoken'
85
+
86
+ con.query(query)
87
+
88
+ con.close
89
+ rescue Mysql2::Error => e
90
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::DELETE_TOKENS_DB_ERROR, nil, e)
91
+ end
92
+
93
+ def get_tokens
94
+ tokens = []
95
+ con = Mysql2::Client.new(host: @host, username: @user_name, password: @password, database: @database_name, port: @port_number)
96
+
97
+ query = 'select * from oauthtoken;'
98
+
99
+ rs = con.query(query)
100
+
101
+ con.close
102
+
103
+ rs.each do |row|
104
+ token_type = nil
105
+ token_value = nil
106
+ if !row[Constants::GRANT_TOKEN].nil? && row[Constants::GRANT_TOKEN].length.positive?
107
+ token_type = TokenType::GRANT
108
+ token_value = row[Constants::GRANT_TOKEN]
109
+ else
110
+ token_type = TokenType::REFRESH
111
+ token_value = row[Constants::REFRESH_TOKEN]
112
+ end
113
+
114
+ oauthtoken = Authenticator::OAuthToken.new(row[Constants::CLIENT_ID], nil, token_value, token_type)
115
+
116
+ oauthtoken.id = row[Constants::ID]
117
+
118
+ oauthtoken.user_mail = row[Constants::USER_MAIL]
119
+
120
+ oauthtoken.access_token = row[Constants::ACCESS_TOKEN]
121
+
122
+ oauthtoken.expires_in = row[Constants::EXPIRY_TIME]
123
+
124
+ oauthtoken.refresh_token = row[Constants::REFRESH_TOKEN]
125
+
126
+ tokens.push(oauthtoken)
127
+ end
128
+ tokens
129
+ rescue Mysql2::Error => e
130
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::GET_TOKENS_DB_ERROR, nil, e)
131
+ end
132
+
133
+ def construct_db_query(email, token, is_delete)
134
+ raise SDKException.new(Constants::USER_MAIL_NULL_ERROR, Constants::USER_MAIL_NULL_ERROR_MESSAGE) if email.nil?
135
+
136
+ query = is_delete ? 'delete from ' : 'select * from '
137
+
138
+ query += 'oauthtoken ' + "where user_mail='#{email}' and client_id='#{token.client_id}' and "
139
+
140
+ query += if token.grant_token.nil?
141
+ "refresh_token='#{token.refresh_token}'"
142
+ else
143
+ "grant_token='#{token.grant_token}'"
144
+ end
145
+
146
+ query
147
+ end
148
+ end
149
+ end
@@ -0,0 +1,165 @@
1
+ require 'csv'
2
+
3
+ require_relative 'token_store'
4
+ require_relative '../../../crm/api/util/constants'
5
+
6
+ module Store
7
+ # This class stores the user token details to the file.
8
+ class FileStore < TokenStore
9
+ attr_accessor :file_path
10
+
11
+ # Creates an FileStore class instance with the specified parameters.
12
+ # @param filePath A String containing the absolute file path to store tokens.
13
+ # @raise Exception
14
+ def initialize(file_path)
15
+ @file_path = file_path
16
+
17
+ unless File.exist? @file_path
18
+ File.new(@file_path, 'w')
19
+ @csv_file = CSV.open(@file_path, 'a', write_headers: true, headers: [Constants::USER_MAIL, Constants::CLIENT_ID, Constants::REFRESH_TOKEN, Constants::ACCESS_TOKEN, Constants::GRANT_TOKEN, Constants::EXPIRY_TIME])
20
+ end
21
+ @csv_file = CSV.open(@file_path, 'a')
22
+ end
23
+
24
+ def get_token(user, token)
25
+ if token.is_a? Authenticator::OAuthToken
26
+ file_contents = CSV.read(@file_path)
27
+
28
+ grant_token = token.grant_token
29
+
30
+ refresh_token = token.refresh_token
31
+
32
+ client_id = token.client_id
33
+
34
+ user_email = user.email
35
+
36
+ if user_email.nil?
37
+ raise SDKException.new(Constants::USER_MAIL_NULL_ERROR, Constants::USER_MAIL_NULL_ERROR_MESSAGE)
38
+ end
39
+
40
+ file_contents.each do |row|
41
+ token_check = grant_token.nil? ? refresh_token == row[2] : grant_token == row[4]
42
+
43
+ if (row[0] == user_email) && (row[1] == client_id) && token_check
44
+ token.refresh_token = row[2]
45
+
46
+ token.access_token = row[3]
47
+
48
+ token.expires_in = row[5]
49
+ return token
50
+ end
51
+ end
52
+ end
53
+ nil
54
+ rescue StandardError => e
55
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::GET_TOKEN_FILE_ERROR, nil, e)
56
+ end
57
+
58
+ def get_tokens
59
+ tokens = []
60
+ file_contents = CSV.table(@file_path)
61
+ file_contents.each do |row|
62
+ unless row == @csv_file.header_row?
63
+ token_type = nil
64
+ token_value = nil
65
+ if !row[4].nil? && row[4].length.positive?
66
+ token_type = TokenType::GRANT
67
+ token_value = row[4]
68
+ else
69
+ token_type = TokenType::REFRESH
70
+ token_value = row[2]
71
+ end
72
+
73
+ token = Authenticator::OAuthToken.new(row[1], nil, token_value, token_type)
74
+
75
+ token.user_mail = row[0]
76
+
77
+ token.refresh_token = row[2]
78
+
79
+ token.access_token = row[3]
80
+
81
+ token.expires_in = row[5]
82
+
83
+ tokens.push(token)
84
+ end
85
+ end
86
+
87
+ tokens
88
+ rescue StandardError => e
89
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::GET_TOKENS_FILE_ERROR, nil, e)
90
+ end
91
+
92
+ def save_token(user, token)
93
+ if token.is_a? Authenticator::OAuthToken
94
+
95
+ token.user_mail = user.email
96
+ delete_token(token)
97
+ values_list = []
98
+
99
+ values_list.push(user.email)
100
+
101
+ values_list.push(token.client_id)
102
+
103
+ values_list.push(token.refresh_token)
104
+
105
+ values_list.push(token.access_token)
106
+
107
+ values_list.push(token.grant_token)
108
+
109
+ values_list.push(token.expires_in)
110
+ end
111
+ @csv_file = CSV.open(@file_path, 'a') if @csv_file.closed?
112
+ @csv_file << values_list
113
+ rescue StandardError => e
114
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::SAVE_TOKEN_FILE_ERROR, nil, e)
115
+ ensure
116
+ @csv_file.close
117
+ end
118
+
119
+ def delete_token(token)
120
+ if token.is_a? Authenticator::OAuthToken
121
+ grant_token = token.grant_token
122
+
123
+ refresh_token = token.refresh_token
124
+
125
+ client_id = token.client_id
126
+
127
+ user_email = token.user_mail
128
+
129
+ if user_email.nil?
130
+ raise SDKException.new(Constants::USER_MAIL_NULL_ERROR, Constants::USER_MAIL_NULL_ERROR_MESSAGE)
131
+ end
132
+
133
+ table = CSV.table(@file_path)
134
+
135
+ table.delete_if do |row|
136
+ unless row == @csv_file.header_row?
137
+ token_check = grant_token.nil? ? refresh_token == row[:refresh_token] : grant_token == row[:grant_token]
138
+
139
+ row[:user_mail] == user_email and row[:client_id] == client_id and token_check
140
+ end
141
+ end
142
+
143
+ File.open(@file_path, 'w') do |f|
144
+ f.write(table.to_csv)
145
+ end
146
+ end
147
+ rescue StandardError => e
148
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::DELETE_TOKEN_FILE_ERROR, nil, e)
149
+ end
150
+
151
+ def delete_tokens
152
+ table = CSV.table(@file_path)
153
+
154
+ table.delete_if do |row|
155
+ true unless row == @csv_file.header_row?
156
+ end
157
+
158
+ File.open(@file_path, 'w') do |f|
159
+ f.write(table.to_csv)
160
+ end
161
+ rescue StandardError => e
162
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::DELETE_TOKENS_FILE_ERROR, nil, e)
163
+ end
164
+ end
165
+ end
@@ -0,0 +1,26 @@
1
+ module Store
2
+ class TokenStore
3
+ # This method is used to get the user token details.
4
+ # @param user A UserSignature class instance.
5
+ # @param token A Token class instance.
6
+ # @return A Token class instance representing the user token details.
7
+ # @raise SDKException
8
+ def get_token(user, token); end
9
+
10
+ def get_tokens; end
11
+
12
+ # This method is used to store the user token details.
13
+ # @param user A UserSignature class instance.
14
+ # @param token A Token class instance.
15
+ # @raise SDKException
16
+ def save_token(user, token); end
17
+
18
+ # This method is used to delete the user token details.
19
+ # @param user A User class instance.
20
+ # @param token A Token class instance.
21
+ # @raise SDKException
22
+ def delete_token(token); end
23
+
24
+ def delete_tokens; end
25
+ end
26
+ end
@@ -0,0 +1,10 @@
1
+ module Authenticator
2
+ class Token
3
+ # This method to set authentication token to APIHTTPConnector instance.
4
+ # @param connector A APIHTTPConnector class instance.
5
+ # @raise SDKException
6
+ def authenticate(url_connection); end
7
+
8
+ def remove; end
9
+ end
10
+ end
@@ -0,0 +1,68 @@
1
+ require 'webrick/log'
2
+ require 'webrick/accesslog'
3
+ require 'logger'
4
+
5
+ module SDKLog
6
+ class Log
7
+ attr_accessor :level, :path
8
+ def initialize(level, path)
9
+ @level = level
10
+ @path = path
11
+ end
12
+
13
+ def self.initialize(level, path)
14
+ Log.new(level, path)
15
+ end
16
+ end
17
+
18
+ class SDKLogger
19
+ @@path = nil
20
+ @@level = nil
21
+ @@log_levels_precedence = { 'FATAL' => 1,'SEVERE' => 1, 'ERROR' => 2, 'WARN' => 3, 'INFO' => 4, 'ALL' => 5,'DEBUG' => 5 ,'OFF' => 5}
22
+ @@logger = nil
23
+
24
+ def self.initialize(log)
25
+ if(log.level != Levels::OFF) && !log.path.nil? && log.path.length > 0
26
+ File.new(log.path, 'w') unless File.exist? log.path if log.path != nil
27
+ sdk_logger = WEBrick::BasicLog.new(log.path, @@log_levels_precedence[log.level])
28
+ elsif !log.level.nil? and log.level == Levels::OFF
29
+ sdk_logger = WEBrick::BasicLog.new(nil, @@log_levels_precedence[log.level])
30
+ end
31
+ @@logger = sdk_logger
32
+ rescue StandardError => e
33
+ raise SDKException.new(nil, Constants::SDK_LOGGER_INITIALIZE, nil, e)
34
+ end
35
+
36
+ def self.info(message)
37
+ @@logger&.info(Time.new.to_s + ' ' + message)
38
+ end
39
+
40
+ def self.error(message, exception = nil)
41
+ unless exception.nil?
42
+ exception.to_s
43
+ message = message + exception.to_s + exception.backtrace.join("\n")
44
+ end
45
+ @@logger&.error(Time.new.to_s + ' ' + message)
46
+ end
47
+
48
+ def self.warn(message)
49
+ @@logger&.warn(Time.new.to_s + ' ' + message)
50
+ end
51
+
52
+ def self.severe(message, exception = nil)
53
+ message = message + exception.to_s + exception.backtrace.join("\n") unless exception.nil?
54
+ @@logger&.fatal(Time.new.to_s + ' ' + message)
55
+ end
56
+ end
57
+ end
58
+
59
+ module Levels
60
+ SEVERE = 'SEVERE'
61
+ INFO = 'INFO'
62
+ WARNING = 'WARNING'
63
+ ERROR = 'ERROR'
64
+ DEBUG = 'DEBUG'
65
+ ALL = 'ALL'
66
+ OFF = 'OFF'
67
+ FATAL = 'FATAL'
68
+ end
@@ -0,0 +1,10 @@
1
+ module Attachments
2
+ module ActionHandler
3
+
4
+ # Creates an instance of ActionHandler
5
+ def initialize
6
+ end
7
+
8
+
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module Attachments
2
+ module ActionResponse
3
+
4
+ # Creates an instance of ActionResponse
5
+ def initialize
6
+ end
7
+
8
+
9
+ end
10
+ end