ZCRMSDK 2.0.0 → 3.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/src/ZCRMSDK.rb +84 -1
  3. data/src/com/zoho/api/authenticator/oauth_token.rb +87 -31
  4. data/src/com/zoho/api/authenticator/store/db_store.rb +48 -28
  5. data/src/com/zoho/api/authenticator/store/file_store.rb +69 -21
  6. data/src/com/zoho/api/authenticator/store/token_store.rb +7 -0
  7. data/src/com/zoho/api/logger/sdk_logger.rb +18 -9
  8. data/src/com/zoho/crm/api/assignment_rules/api_exception.rb +121 -0
  9. data/src/com/zoho/crm/api/assignment_rules/assignment_rule.rb +215 -0
  10. data/src/com/zoho/crm/api/assignment_rules/assignment_rules_operations.rb +61 -0
  11. data/src/com/zoho/crm/api/assignment_rules/default_user.rb +80 -0
  12. data/src/com/zoho/crm/api/assignment_rules/response_handler.rb +10 -0
  13. data/src/com/zoho/crm/api/assignment_rules/response_wrapper.rb +63 -0
  14. data/src/com/zoho/crm/api/attachments/attachment.rb +4 -4
  15. data/src/com/zoho/crm/api/attachments/attachments_operations.rb +6 -6
  16. data/src/com/zoho/crm/api/blue_print/blue_print_operations.rb +2 -2
  17. data/src/com/zoho/crm/api/blue_print/escalation.rb +80 -0
  18. data/src/com/zoho/crm/api/blue_print/field.rb +1107 -0
  19. data/src/com/zoho/crm/api/blue_print/next_transition.rb +38 -0
  20. data/src/com/zoho/crm/api/blue_print/process_info.rb +4 -4
  21. data/src/com/zoho/crm/api/blue_print/transition.rb +19 -1
  22. data/src/com/zoho/crm/api/blue_print/validation_error.rb +57 -0
  23. data/src/com/zoho/crm/api/bulk_read/bulk_read_operations.rb +3 -3
  24. data/src/com/zoho/crm/api/bulk_read/criteria.rb +20 -0
  25. data/src/com/zoho/crm/api/bulk_read/query.rb +5 -4
  26. data/src/com/zoho/crm/api/bulk_write/bulk_write_operations.rb +3 -3
  27. data/src/com/zoho/crm/api/bulk_write/resource.rb +24 -4
  28. data/src/com/zoho/crm/api/contact_roles/contact_roles_operations.rb +7 -7
  29. data/src/com/zoho/crm/api/currencies/currencies_operations.rb +7 -7
  30. data/src/com/zoho/crm/api/custom_views/criteria.rb +5 -4
  31. data/src/com/zoho/crm/api/custom_views/custom_view.rb +100 -41
  32. data/src/com/zoho/crm/api/custom_views/custom_views_operations.rb +2 -2
  33. data/src/com/zoho/crm/api/custom_views/{shared_details.rb → shared_to.rb} +2 -2
  34. data/src/com/zoho/crm/api/dc/au_datacenter.rb +3 -3
  35. data/src/com/zoho/crm/api/dc/cn_datacenter.rb +3 -3
  36. data/src/com/zoho/crm/api/dc/datacenter.rb +3 -2
  37. data/src/com/zoho/crm/api/dc/eu_datacenter.rb +3 -3
  38. data/src/com/zoho/crm/api/dc/in_datacenter.rb +3 -3
  39. data/src/com/zoho/crm/api/dc/us_datacenter.rb +3 -3
  40. data/src/com/zoho/crm/api/email_templates/api_exception.rb +121 -0
  41. data/src/com/zoho/crm/api/email_templates/attachment.rb +118 -0
  42. data/src/com/zoho/crm/api/email_templates/email_template.rb +390 -0
  43. data/src/com/zoho/crm/api/email_templates/email_templates_operations.rb +61 -0
  44. data/src/com/zoho/crm/api/email_templates/response_handler.rb +10 -0
  45. data/src/com/zoho/crm/api/email_templates/response_wrapper.rb +83 -0
  46. data/src/com/zoho/crm/api/field_attachments/api_exception.rb +121 -0
  47. data/src/com/zoho/crm/api/field_attachments/body_wrapper.rb +62 -0
  48. data/src/com/zoho/crm/api/field_attachments/field_attachments_operations.rb +52 -0
  49. data/src/com/zoho/crm/api/field_attachments/file_body_wrapper.rb +64 -0
  50. data/src/com/zoho/crm/api/field_attachments/response_handler.rb +10 -0
  51. data/src/com/zoho/crm/api/fields/external.rb +99 -0
  52. data/src/com/zoho/crm/api/fields/field.rb +192 -38
  53. data/src/com/zoho/crm/api/fields/fields_operations.rb +2 -2
  54. data/src/com/zoho/crm/api/fields/history_tracking.rb +80 -0
  55. data/src/com/zoho/crm/api/fields/maps.rb +80 -0
  56. data/src/com/zoho/crm/api/fields/multi_select_lookup.rb +19 -0
  57. data/src/com/zoho/crm/api/fields/multi_user_lookup.rb +175 -0
  58. data/src/com/zoho/crm/api/fields/pick_list_value.rb +19 -0
  59. data/src/com/zoho/crm/api/fields/related_details.rb +19 -0
  60. data/src/com/zoho/crm/api/files/file_operations.rb +2 -2
  61. data/src/com/zoho/crm/api/initializer.rb +41 -16
  62. data/src/com/zoho/crm/api/inventory_templates/api_exception.rb +121 -0
  63. data/src/com/zoho/crm/api/inventory_templates/inventory_template.rb +352 -0
  64. data/src/com/zoho/crm/api/inventory_templates/inventory_templates_operations.rb +82 -0
  65. data/src/com/zoho/crm/api/inventory_templates/response_handler.rb +10 -0
  66. data/src/com/zoho/crm/api/inventory_templates/response_wrapper.rb +83 -0
  67. data/src/com/zoho/crm/api/layouts/layout.rb +38 -0
  68. data/src/com/zoho/crm/api/layouts/layouts_operations.rb +2 -2
  69. data/src/com/zoho/crm/api/layouts/section.rb +19 -0
  70. data/src/com/zoho/crm/api/modules/module.rb +57 -0
  71. data/src/com/zoho/crm/api/modules/modules_operations.rb +4 -4
  72. data/src/com/zoho/crm/api/notes/notes_operations.rb +7 -7
  73. data/src/com/zoho/crm/api/notification/notification_operations.rb +6 -6
  74. data/src/com/zoho/crm/api/org/org_operations.rb +2 -2
  75. data/src/com/zoho/crm/api/pipeline/action_handler.rb +10 -0
  76. data/src/com/zoho/crm/api/pipeline/action_response.rb +10 -0
  77. data/src/com/zoho/crm/api/pipeline/action_wrapper.rb +63 -0
  78. data/src/com/zoho/crm/api/pipeline/api_exception.rb +129 -0
  79. data/src/com/zoho/crm/api/pipeline/body_wrapper.rb +61 -0
  80. data/src/com/zoho/crm/api/pipeline/forecast_category.rb +80 -0
  81. data/src/com/zoho/crm/api/pipeline/pick_list_value.rb +175 -0
  82. data/src/com/zoho/crm/api/pipeline/pipeline.rb +213 -0
  83. data/src/com/zoho/crm/api/pipeline/pipeline_operations.rb +165 -0
  84. data/src/com/zoho/crm/api/pipeline/response_handler.rb +10 -0
  85. data/src/com/zoho/crm/api/pipeline/response_wrapper.rb +63 -0
  86. data/src/com/zoho/crm/api/pipeline/stage.rb +80 -0
  87. data/src/com/zoho/crm/api/pipeline/success_response.rb +123 -0
  88. data/src/com/zoho/crm/api/pipeline/transfer_action_handler.rb +10 -0
  89. data/src/com/zoho/crm/api/pipeline/transfer_action_response.rb +10 -0
  90. data/src/com/zoho/crm/api/pipeline/transfer_action_wrapper.rb +63 -0
  91. data/src/com/zoho/crm/api/pipeline/transfer_and_delete_wrapper.rb +61 -0
  92. data/src/com/zoho/crm/api/pipeline/transfer_pipe_line.rb +80 -0
  93. data/src/com/zoho/crm/api/profiles/default_view.rb +99 -0
  94. data/src/com/zoho/crm/api/profiles/profile.rb +57 -0
  95. data/src/com/zoho/crm/api/profiles/profiles_operations.rb +2 -2
  96. data/src/com/zoho/crm/api/query/query_operations.rb +1 -1
  97. data/src/com/zoho/crm/api/record/api_exception.rb +2 -0
  98. data/src/com/zoho/crm/api/record/body_wrapper.rb +0 -19
  99. data/src/com/zoho/crm/api/record/count_handler.rb +10 -0
  100. data/src/com/zoho/crm/api/record/count_wrapper.rb +63 -0
  101. data/src/com/zoho/crm/api/record/field.rb +1 -0
  102. data/src/com/zoho/crm/api/record/image_upload.rb +213 -0
  103. data/src/com/zoho/crm/api/record/inventory_line_items.rb +56 -39
  104. data/src/com/zoho/crm/api/record/mass_update_body_wrapper.rb +4 -4
  105. data/src/com/zoho/crm/api/record/mass_update_territory.rb +80 -0
  106. data/src/com/zoho/crm/api/record/multi_select_lookup.rb +99 -0
  107. data/src/com/zoho/crm/api/record/multi_select_picklist.rb +80 -0
  108. data/src/com/zoho/crm/api/record/price_book.rb +31 -0
  109. data/src/com/zoho/crm/api/record/record_operations.rb +196 -26
  110. data/src/com/zoho/crm/api/record/tax.rb +80 -0
  111. data/src/com/zoho/crm/api/record/territory.rb +70 -12
  112. data/src/com/zoho/crm/api/record/widget.rb +80 -0
  113. data/src/com/zoho/crm/api/record/wizard.rb +80 -0
  114. data/src/com/zoho/crm/api/related_lists/related_lists_operations.rb +2 -2
  115. data/src/com/zoho/crm/api/related_records/related_records_operations.rb +6 -6
  116. data/src/com/zoho/crm/api/request_proxy.rb +3 -4
  117. data/src/com/zoho/crm/api/roles/roles_operations.rb +2 -2
  118. data/src/com/zoho/crm/api/sdk_config.rb +2 -68
  119. data/src/com/zoho/crm/api/send_mail/action_handler.rb +10 -0
  120. data/src/com/zoho/crm/api/send_mail/action_response.rb +10 -0
  121. data/src/com/zoho/crm/api/send_mail/action_wrapper.rb +63 -0
  122. data/src/com/zoho/crm/api/send_mail/api_exception.rb +125 -0
  123. data/src/com/zoho/crm/api/send_mail/body_wrapper.rb +61 -0
  124. data/src/com/zoho/crm/api/send_mail/data_subject_request.rb +80 -0
  125. data/src/com/zoho/crm/api/send_mail/inventory_details.rb +100 -0
  126. data/src/com/zoho/crm/api/send_mail/mail.rb +423 -0
  127. data/src/com/zoho/crm/api/send_mail/response_handler.rb +10 -0
  128. data/src/com/zoho/crm/api/send_mail/response_wrapper.rb +63 -0
  129. data/src/com/zoho/crm/api/send_mail/send_mail_operations.rb +61 -0
  130. data/src/com/zoho/crm/api/send_mail/success_response.rb +121 -0
  131. data/src/com/zoho/crm/api/send_mail/template.rb +10 -0
  132. data/src/com/zoho/crm/api/send_mail/user_address.rb +137 -0
  133. data/src/com/zoho/crm/api/share_records/share_records_operations.rb +4 -4
  134. data/src/com/zoho/crm/api/tags/tag.rb +19 -0
  135. data/src/com/zoho/crm/api/tags/tags_operations.rb +11 -11
  136. data/src/com/zoho/crm/api/taxes/taxes_operations.rb +6 -6
  137. data/src/com/zoho/crm/api/territories/response_wrapper.rb +20 -0
  138. data/src/com/zoho/crm/api/territories/territories_operations.rb +2 -2
  139. data/src/com/zoho/crm/api/territories/territory.rb +61 -23
  140. data/src/com/zoho/crm/api/users/users_operations.rb +6 -6
  141. data/src/com/zoho/crm/api/util/api_http_connector.rb +5 -4
  142. data/src/com/zoho/crm/api/util/constants.rb +140 -13
  143. data/src/com/zoho/crm/api/util/converter.rb +21 -4
  144. data/src/com/zoho/crm/api/util/form_data_converter.rb +3 -14
  145. data/src/com/zoho/crm/api/util/utility.rb +226 -70
  146. data/src/com/zoho/crm/api/variable_groups/variable_groups_operations.rb +3 -3
  147. data/src/com/zoho/crm/api/variables/variables_operations.rb +9 -9
  148. data/src/com/zoho/crm/api/wizards/api_exception.rb +121 -0
  149. data/src/com/zoho/crm/api/wizards/button.rb +214 -0
  150. data/src/com/zoho/crm/api/wizards/chart_data.rb +118 -0
  151. data/src/com/zoho/crm/api/wizards/connection.rb +80 -0
  152. data/src/com/zoho/crm/api/wizards/container.rb +119 -0
  153. data/src/com/zoho/crm/api/wizards/node.rb +118 -0
  154. data/src/com/zoho/crm/api/wizards/response_handler.rb +10 -0
  155. data/src/com/zoho/crm/api/wizards/response_wrapper.rb +63 -0
  156. data/src/com/zoho/crm/api/wizards/screen.rb +99 -0
  157. data/src/com/zoho/crm/api/wizards/segment.rb +176 -0
  158. data/src/com/zoho/crm/api/wizards/wizard.rb +273 -0
  159. data/src/com/zoho/crm/api/wizards/wizards_operations.rb +61 -0
  160. data/src/resources/JSONDetails.json +1 -1
  161. data/src/version.rb +1 -1
  162. metadata +88 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a38c39eb99cb58ada6a20fbd961d0ba4437c69ce8d3fbbafb247cc896282a92
4
- data.tar.gz: c30037cc4b76ac7515e47a94284f19bea6913254ba07e370217518e8e2139e80
3
+ metadata.gz: 8904af6d2578e6476199b3d332c31aa201ba71b09a0696e530cc15d1ab48b5e0
4
+ data.tar.gz: 9ea0df2ce8f9db7f4c4223be625b4e0eb7f404074e5bef02754e387ef29e1e24
5
5
  SHA512:
6
- metadata.gz: 18c11a8ddaca2c07259aa42ad6a7f3c98de99fc349e602d19e1a69639c71c5689cd595362dec568858ceed6c96e3228a1b93a96ee08c8dd197a85a3553b9b721
7
- data.tar.gz: a4ad7f6c41faa4180d75f280d2acf7a69bfa519dfb9f832503dc4692437fdcd4ef367edaafcd5044c24f7f0119dca3855b856cf7e3113cd4bbb1efec05d26b0a
6
+ metadata.gz: 3cbe40f9c9b7df36198203bf82e4b0f8252cb27e68cf888823ef8e59a2ab00fa518bf19a3080b1631783cbaa23951a29dd006eb4b81133727d9dfc2100941465
7
+ data.tar.gz: b55ab1856d5a12d99ce5bf785f053ce6e44dd7cc5e9a7557dceba4b1a7a9066311e5667ff4b3d275456a3ab511be602207ea037f40050431f0dd3190527c417b
data/src/ZCRMSDK.rb CHANGED
@@ -1,5 +1,23 @@
1
1
  require 'version.rb'
2
2
  require 'com/zoho/crm/api/request_proxy.rb'
3
+ require 'com/zoho/crm/api/pipeline/transfer_action_handler.rb'
4
+ require 'com/zoho/crm/api/pipeline/stage.rb'
5
+ require 'com/zoho/crm/api/pipeline/transfer_action_response.rb'
6
+ require 'com/zoho/crm/api/pipeline/body_wrapper.rb'
7
+ require 'com/zoho/crm/api/pipeline/transfer_action_wrapper.rb'
8
+ require 'com/zoho/crm/api/pipeline/pipeline.rb'
9
+ require 'com/zoho/crm/api/pipeline/action_handler.rb'
10
+ require 'com/zoho/crm/api/pipeline/pipeline_operations.rb'
11
+ require 'com/zoho/crm/api/pipeline/transfer_and_delete_wrapper.rb'
12
+ require 'com/zoho/crm/api/pipeline/pick_list_value.rb'
13
+ require 'com/zoho/crm/api/pipeline/action_wrapper.rb'
14
+ require 'com/zoho/crm/api/pipeline/forecast_category.rb'
15
+ require 'com/zoho/crm/api/pipeline/transfer_pipe_line.rb'
16
+ require 'com/zoho/crm/api/pipeline/response_wrapper.rb'
17
+ require 'com/zoho/crm/api/pipeline/api_exception.rb'
18
+ require 'com/zoho/crm/api/pipeline/success_response.rb'
19
+ require 'com/zoho/crm/api/pipeline/action_response.rb'
20
+ require 'com/zoho/crm/api/pipeline/response_handler.rb'
3
21
  require 'com/zoho/crm/api/currencies/body_wrapper.rb'
4
22
  require 'com/zoho/crm/api/currencies/currencies_operations.rb'
5
23
  require 'com/zoho/crm/api/currencies/currency.rb'
@@ -35,17 +53,23 @@ require 'com/zoho/crm/api/record/participants.rb'
35
53
  require 'com/zoho/crm/api/record/remind_at.rb'
36
54
  require 'com/zoho/crm/api/record/carry_over_tags.rb'
37
55
  require 'com/zoho/crm/api/record/record.rb'
56
+ require 'com/zoho/crm/api/record/wizard.rb'
38
57
  require 'com/zoho/crm/api/record/convert_body_wrapper.rb'
58
+ require 'com/zoho/crm/api/record/price_book.rb'
39
59
  require 'com/zoho/crm/api/record/file_details.rb'
40
60
  require 'com/zoho/crm/api/record/action_wrapper.rb'
41
61
  require 'com/zoho/crm/api/record/deleted_records_handler.rb'
42
62
  require 'com/zoho/crm/api/record/convert_action_handler.rb'
63
+ require 'com/zoho/crm/api/record/mass_update_territory.rb'
64
+ require 'com/zoho/crm/api/record/multi_select_lookup.rb'
65
+ require 'com/zoho/crm/api/record/multi_select_picklist.rb'
43
66
  require 'com/zoho/crm/api/record/mass_update.rb'
44
67
  require 'com/zoho/crm/api/record/mass_update_action_response.rb'
45
68
  require 'com/zoho/crm/api/record/deleted_record.rb'
46
69
  require 'com/zoho/crm/api/record/convert_action_wrapper.rb'
47
70
  require 'com/zoho/crm/api/record/territory.rb'
48
71
  require 'com/zoho/crm/api/record/mass_update_response.rb'
72
+ require 'com/zoho/crm/api/record/widget.rb'
49
73
  require 'com/zoho/crm/api/record/mass_update_body_wrapper.rb'
50
74
  require 'com/zoho/crm/api/record/mass_update_success_response.rb'
51
75
  require 'com/zoho/crm/api/record/response_wrapper.rb'
@@ -55,18 +79,27 @@ require 'com/zoho/crm/api/record/comment.rb'
55
79
  require 'com/zoho/crm/api/record/file_handler.rb'
56
80
  require 'com/zoho/crm/api/record/api_exception.rb'
57
81
  require 'com/zoho/crm/api/record/mass_update_response_handler.rb'
82
+ require 'com/zoho/crm/api/record/count_handler.rb'
58
83
  require 'com/zoho/crm/api/record/options.rb'
59
84
  require 'com/zoho/crm/api/record/field.rb'
60
85
  require 'com/zoho/crm/api/record/recurring_activity.rb'
86
+ require 'com/zoho/crm/api/record/tax.rb'
87
+ require 'com/zoho/crm/api/record/image_upload.rb'
61
88
  require 'com/zoho/crm/api/record/criteria.rb'
62
89
  require 'com/zoho/crm/api/record/mass_update_response_wrapper.rb'
63
90
  require 'com/zoho/crm/api/record/success_response.rb'
91
+ require 'com/zoho/crm/api/record/count_wrapper.rb'
64
92
  require 'com/zoho/crm/api/record/action_response.rb'
65
93
  require 'com/zoho/crm/api/record/pricing_details.rb'
66
94
  require 'com/zoho/crm/api/record/response_handler.rb'
67
95
  require 'com/zoho/crm/api/record/successful_convert.rb'
68
96
  require 'com/zoho/crm/api/record/line_item_product.rb'
69
97
  require 'com/zoho/crm/api/record/mass_update_action_wrapper.rb'
98
+ require 'com/zoho/crm/api/field_attachments/body_wrapper.rb'
99
+ require 'com/zoho/crm/api/field_attachments/file_body_wrapper.rb'
100
+ require 'com/zoho/crm/api/field_attachments/api_exception.rb'
101
+ require 'com/zoho/crm/api/field_attachments/response_handler.rb'
102
+ require 'com/zoho/crm/api/field_attachments/field_attachments_operations.rb'
70
103
  require 'com/zoho/crm/api/sdk_config.rb'
71
104
  require 'com/zoho/crm/api/util/api_http_connector.rb'
72
105
  require 'com/zoho/crm/api/util/form_data_converter.rb'
@@ -108,18 +141,31 @@ require 'com/zoho/crm/api/org/success_response.rb'
108
141
  require 'com/zoho/crm/api/org/action_response.rb'
109
142
  require 'com/zoho/crm/api/org/response_handler.rb'
110
143
  require 'com/zoho/crm/api/org/org.rb'
144
+ require 'com/zoho/crm/api/inventory_templates/inventory_templates_operations.rb'
145
+ require 'com/zoho/crm/api/inventory_templates/inventory_template.rb'
146
+ require 'com/zoho/crm/api/inventory_templates/response_wrapper.rb'
147
+ require 'com/zoho/crm/api/inventory_templates/api_exception.rb'
148
+ require 'com/zoho/crm/api/inventory_templates/response_handler.rb'
111
149
  require 'com/zoho/crm/api/blue_print/body_wrapper.rb'
112
150
  require 'com/zoho/crm/api/blue_print/next_transition.rb'
113
151
  require 'com/zoho/crm/api/blue_print/blue_print_operations.rb'
114
152
  require 'com/zoho/crm/api/blue_print/process_info.rb'
115
153
  require 'com/zoho/crm/api/blue_print/blue_print.rb'
154
+ require 'com/zoho/crm/api/blue_print/escalation.rb'
116
155
  require 'com/zoho/crm/api/blue_print/transition.rb'
117
156
  require 'com/zoho/crm/api/blue_print/response_wrapper.rb'
118
157
  require 'com/zoho/crm/api/blue_print/api_exception.rb'
119
158
  require 'com/zoho/crm/api/blue_print/validation_error.rb'
159
+ require 'com/zoho/crm/api/blue_print/field.rb'
120
160
  require 'com/zoho/crm/api/blue_print/success_response.rb'
121
161
  require 'com/zoho/crm/api/blue_print/action_response.rb'
122
162
  require 'com/zoho/crm/api/blue_print/response_handler.rb'
163
+ require 'com/zoho/crm/api/email_templates/email_template.rb'
164
+ require 'com/zoho/crm/api/email_templates/attachment.rb'
165
+ require 'com/zoho/crm/api/email_templates/response_wrapper.rb'
166
+ require 'com/zoho/crm/api/email_templates/email_templates_operations.rb'
167
+ require 'com/zoho/crm/api/email_templates/api_exception.rb'
168
+ require 'com/zoho/crm/api/email_templates/response_handler.rb'
123
169
  require 'com/zoho/crm/api/related_records/body_wrapper.rb'
124
170
  require 'com/zoho/crm/api/related_records/action_handler.rb'
125
171
  require 'com/zoho/crm/api/related_records/related_records_operations.rb'
@@ -157,8 +203,8 @@ require 'com/zoho/crm/api/tags/action_response.rb'
157
203
  require 'com/zoho/crm/api/tags/merge_wrapper.rb'
158
204
  require 'com/zoho/crm/api/tags/response_handler.rb'
159
205
  require 'com/zoho/crm/api/header_map.rb'
206
+ require 'com/zoho/crm/api/custom_views/shared_to.rb'
160
207
  require 'com/zoho/crm/api/custom_views/info.rb'
161
- require 'com/zoho/crm/api/custom_views/shared_details.rb'
162
208
  require 'com/zoho/crm/api/custom_views/translation.rb'
163
209
  require 'com/zoho/crm/api/custom_views/custom_view.rb'
164
210
  require 'com/zoho/crm/api/custom_views/range.rb'
@@ -259,6 +305,12 @@ require 'com/zoho/crm/api/dc/au_datacenter.rb'
259
305
  require 'com/zoho/crm/api/dc/cn_datacenter.rb'
260
306
  require 'com/zoho/crm/api/dc/us_datacenter.rb'
261
307
  require 'com/zoho/crm/api/dc/datacenter.rb'
308
+ require 'com/zoho/crm/api/assignment_rules/assignment_rules_operations.rb'
309
+ require 'com/zoho/crm/api/assignment_rules/assignment_rule.rb'
310
+ require 'com/zoho/crm/api/assignment_rules/response_wrapper.rb'
311
+ require 'com/zoho/crm/api/assignment_rules/api_exception.rb'
312
+ require 'com/zoho/crm/api/assignment_rules/default_user.rb'
313
+ require 'com/zoho/crm/api/assignment_rules/response_handler.rb'
262
314
  require 'com/zoho/crm/api/files/file_operations.rb'
263
315
  require 'com/zoho/crm/api/files/body_wrapper.rb'
264
316
  require 'com/zoho/crm/api/files/action_handler.rb'
@@ -285,10 +337,12 @@ require 'com/zoho/crm/api/bulk_write/response_handler.rb'
285
337
  require 'com/zoho/crm/api/fields/private.rb'
286
338
  require 'com/zoho/crm/api/fields/association_details.rb'
287
339
  require 'com/zoho/crm/api/fields/module.rb'
340
+ require 'com/zoho/crm/api/fields/external.rb'
288
341
  require 'com/zoho/crm/api/fields/currency.rb'
289
342
  require 'com/zoho/crm/api/fields/pick_list_value.rb'
290
343
  require 'com/zoho/crm/api/fields/view_type.rb'
291
344
  require 'com/zoho/crm/api/fields/lookup_field.rb'
345
+ require 'com/zoho/crm/api/fields/multi_user_lookup.rb'
292
346
  require 'com/zoho/crm/api/fields/multi_select_lookup.rb'
293
347
  require 'com/zoho/crm/api/fields/auto_number.rb'
294
348
  require 'com/zoho/crm/api/fields/unique.rb'
@@ -301,9 +355,12 @@ require 'com/zoho/crm/api/fields/field.rb'
301
355
  require 'com/zoho/crm/api/fields/crypt.rb'
302
356
  require 'com/zoho/crm/api/fields/tool_tip.rb'
303
357
  require 'com/zoho/crm/api/fields/response_handler.rb'
358
+ require 'com/zoho/crm/api/fields/history_tracking.rb'
359
+ require 'com/zoho/crm/api/fields/maps.rb'
304
360
  require 'com/zoho/crm/api/parameter_map.rb'
305
361
  require 'com/zoho/crm/api/profiles/category.rb'
306
362
  require 'com/zoho/crm/api/profiles/permission_detail.rb'
363
+ require 'com/zoho/crm/api/profiles/default_view.rb'
307
364
  require 'com/zoho/crm/api/profiles/section.rb'
308
365
  require 'com/zoho/crm/api/profiles/profile.rb'
309
366
  require 'com/zoho/crm/api/profiles/response_wrapper.rb'
@@ -324,6 +381,32 @@ require 'com/zoho/crm/api/share_records/api_exception.rb'
324
381
  require 'com/zoho/crm/api/share_records/success_response.rb'
325
382
  require 'com/zoho/crm/api/share_records/action_response.rb'
326
383
  require 'com/zoho/crm/api/share_records/response_handler.rb'
384
+ require 'com/zoho/crm/api/send_mail/body_wrapper.rb'
385
+ require 'com/zoho/crm/api/send_mail/action_handler.rb'
386
+ require 'com/zoho/crm/api/send_mail/user_address.rb'
387
+ require 'com/zoho/crm/api/send_mail/inventory_details.rb'
388
+ require 'com/zoho/crm/api/send_mail/template.rb'
389
+ require 'com/zoho/crm/api/send_mail/action_wrapper.rb'
390
+ require 'com/zoho/crm/api/send_mail/data_subject_request.rb'
391
+ require 'com/zoho/crm/api/send_mail/send_mail_operations.rb'
392
+ require 'com/zoho/crm/api/send_mail/response_wrapper.rb'
393
+ require 'com/zoho/crm/api/send_mail/api_exception.rb'
394
+ require 'com/zoho/crm/api/send_mail/success_response.rb'
395
+ require 'com/zoho/crm/api/send_mail/mail.rb'
396
+ require 'com/zoho/crm/api/send_mail/action_response.rb'
397
+ require 'com/zoho/crm/api/send_mail/response_handler.rb'
398
+ require 'com/zoho/crm/api/wizards/node.rb'
399
+ require 'com/zoho/crm/api/wizards/segment.rb'
400
+ require 'com/zoho/crm/api/wizards/chart_data.rb'
401
+ require 'com/zoho/crm/api/wizards/wizard.rb'
402
+ require 'com/zoho/crm/api/wizards/connection.rb'
403
+ require 'com/zoho/crm/api/wizards/container.rb'
404
+ require 'com/zoho/crm/api/wizards/button.rb'
405
+ require 'com/zoho/crm/api/wizards/wizards_operations.rb'
406
+ require 'com/zoho/crm/api/wizards/response_wrapper.rb'
407
+ require 'com/zoho/crm/api/wizards/api_exception.rb'
408
+ require 'com/zoho/crm/api/wizards/screen.rb'
409
+ require 'com/zoho/crm/api/wizards/response_handler.rb'
327
410
  require 'com/zoho/crm/api/query/body_wrapper.rb'
328
411
  require 'com/zoho/crm/api/query/response_wrapper.rb'
329
412
  require 'com/zoho/crm/api/query/query_operations.rb'
@@ -11,19 +11,20 @@ require_relative '../../crm/api/exception/sdk_exception'
11
11
  module Authenticator
12
12
  # This class gets and refreshes the tokens based on the expiry time.
13
13
  class OAuthToken < Token
14
+ attr_reader :client_id , :client_secret ,:redirect_url ,:grant_token
15
+ attr_accessor :refresh_token, :access_token ,:user_mail ,:id ,:expires_in
14
16
  @@sync_lock = Monitor.new
15
17
 
16
- attr_accessor :client_id, :client_secret, :redirect_url, :grant_token, :refresh_token, :access_token, :expires_in, :user_mail, :id
17
-
18
18
  # Creates an OAuthToken class instance with the specified parameters.
19
19
  # @param client_id [string] A String containing the OAuth client id.
20
20
  # @param client_secret [string] A String containing the OAuth client secret.
21
+ # @param grant_token [string] A String containing the grant token.
22
+ # @param refresh_token [string] A String containing the refresh token.
21
23
  # @param redirect_url [string] A String containing the OAuth redirect URL.
22
- # @param token [string] A String containing the REFRESH/GRANT token.
23
- # @param type A TokenType module variable containing the type of given token.
24
- def initialize(client_id, client_secret, token, type, redirect_url = nil)
25
- error = {}
26
-
24
+ # @param id [string] A String containing ID
25
+
26
+ def initialize(client_id:, client_secret:, grant_token: nil, refresh_token: nil, redirect_url: nil,id: nil)
27
+ error ={}
27
28
  unless client_id.is_a?(String)
28
29
  error[Constants::ERROR_HASH_FIELD] = Constants::CLIENT_ID
29
30
 
@@ -35,7 +36,7 @@ module Authenticator
35
36
 
36
37
  end
37
38
 
38
- unless client_secret.nil? || client_secret.is_a?(String)
39
+ unless client_secret.is_a?(String)
39
40
  error[Constants::ERROR_HASH_FIELD] = Constants::CLIENT_SECRET
40
41
 
41
42
  error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
@@ -46,8 +47,30 @@ module Authenticator
46
47
 
47
48
  end
48
49
 
49
- unless token.is_a?(String)
50
- error[Constants::ERROR_HASH_FIELD] = Constants::TOKEN
50
+ if !grant_token.nil? && !grant_token.is_a?(String)
51
+ error[Constants::ERROR_HASH_FIELD] = Constants::GRANT_TOKEN
52
+
53
+ error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
54
+
55
+ error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
56
+
57
+ raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
58
+
59
+ end
60
+
61
+ if !refresh_token.nil? && !refresh_token.is_a?(String)
62
+ error[Constants::ERROR_HASH_FIELD] = Constants::REFRESH_TOKEN
63
+
64
+ error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
65
+
66
+ error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
67
+
68
+ raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
69
+
70
+ end
71
+
72
+ if !redirect_url.nil? && !redirect_url.is_a?(String)
73
+ error[Constants::ERROR_HASH_FIELD] = Constants::REDIRECT_URL
51
74
 
52
75
  error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
53
76
 
@@ -57,7 +80,18 @@ module Authenticator
57
80
 
58
81
  end
59
82
 
60
- unless TokenType::REFRESH.to_s.equal?(TokenType.const_get(type.to_s)) || TokenType::GRANT.to_s.equal?(TokenType.const_get(type.to_s))
83
+ if !id.nil? && !id.is_a?(String)
84
+ error[Constants::ERROR_HASH_FIELD] = Constants::ID
85
+
86
+ error[Constants::ERROR_HASH_EXPECTED_TYPE] = String
87
+
88
+ error[Constants::ERROR_HASH_CLASS] = OAuthToken.class
89
+
90
+ raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
91
+
92
+ end
93
+
94
+ if grant_token.nil? && refresh_token.nil?
61
95
  error[Constants::ERROR_HASH_FIELD] = Constants::TYPE
62
96
 
63
97
  error[Constants::ERROR_HASH_EXPECTED_TYPE] = Constants::EXPECTED_TOKEN_TYPES
@@ -66,28 +100,39 @@ module Authenticator
66
100
 
67
101
  raise SDKException.new(Constants::INPUT_ERROR, nil, error, nil)
68
102
  end
69
-
70
103
  @client_id = client_id
71
104
 
72
105
  @client_secret = client_secret
73
106
 
74
107
  @redirect_url = redirect_url
75
108
 
76
- @refresh_token = (type == TokenType::REFRESH) ? token : nil
109
+ @refresh_token = refresh_token
77
110
 
78
- @grant_token = (type == TokenType::GRANT) ? token : nil
79
- end
111
+ @grant_token = grant_token
112
+
113
+ @access_token = nil
114
+
115
+ @expires_in = nil
80
116
 
117
+ @user_mail = nil
118
+
119
+ @id = id
120
+ end
121
+
81
122
  def authenticate(url_connection)
82
123
  @@sync_lock.synchronize do
83
124
  initializer = Initializer.get_initializer
84
125
  store = initializer.store
85
-
86
126
  user = initializer.user
87
127
 
88
- oauth_token = initializer.store.get_token(user, self)
128
+ oauth_token = nil
129
+ if !@id.nil?
130
+ oauth_token = initializer.store.get_token_by_id(@id, self)
131
+ else
132
+ oauth_token = initializer.store.get_token(user, self)
133
+ end
89
134
 
90
- token = nil
135
+ token = ""
91
136
 
92
137
  if oauth_token.nil?
93
138
  token = @refresh_token.nil? ? generate_access_token(user, store).access_token : refresh_access_token(user, store).access_token
@@ -115,8 +160,8 @@ module Authenticator
115
160
  json_body[Constants::CLIENT_ID] = @client_id
116
161
 
117
162
  json_body[Constants::CLIENT_SECRET] = @client_secret
118
-
119
- json_body[Constants::REDIRECT_URI] = @redirect_url
163
+
164
+ json_body[Constants::REDIRECT_URI] = @redirect_url if !@redirect_url.nil?
120
165
 
121
166
  json_body[Constants::GRANT_TYPE] = Constants::GRANT_TYPE_AUTH_CODE
122
167
 
@@ -125,7 +170,11 @@ module Authenticator
125
170
  response = get_response_from_server(json_body)
126
171
 
127
172
  begin
128
- store.save_token(user, parse_response(response))
173
+ parse_response(response)
174
+
175
+ generate_id()
176
+
177
+ store.save_token(user,self)
129
178
  rescue SDKException => e
130
179
  raise e
131
180
  rescue StandardError => e
@@ -141,7 +190,7 @@ module Authenticator
141
190
 
142
191
  json_body[Constants::CLIENT_SECRET] = @client_secret
143
192
 
144
- json_body[Constants::REDIRECT_URI] = @redirect_url
193
+ json_body[Constants::REDIRECT_URI] = @redirect_url if !@redirect_url.nil?
145
194
 
146
195
  json_body[Constants::GRANT_TYPE] = Constants::REFRESH_TOKEN
147
196
 
@@ -150,7 +199,11 @@ module Authenticator
150
199
  response = get_response_from_server(json_body)
151
200
 
152
201
  begin
153
- store.save_token(user, parse_response(response))
202
+ parse_response(response)
203
+
204
+ generate_id()
205
+
206
+ store.save_token(user,self)
154
207
  rescue SDKException => e
155
208
  raise e
156
209
  rescue StandardError => e
@@ -184,7 +237,7 @@ module Authenticator
184
237
  http.use_ssl = true
185
238
 
186
239
  request = Net::HTTP::Post.new(url.request_uri)
187
-
240
+ request.add_field(Constants::USER_AGENT_KEY, Constants::USER_AGENT)
188
241
  request.set_form(json_body, Constants::APPLICATION_FORM_URLENCODED)
189
242
 
190
243
  response = http.request(request)
@@ -207,11 +260,14 @@ module Authenticator
207
260
  def get_current_time_in_millis
208
261
  (Time.now.to_f * 1000).to_i
209
262
  end
210
- end
211
- end
212
263
 
213
- # This module contains different types of token.
214
- module TokenType
215
- GRANT = 'GRANT'.freeze
216
- REFRESH = 'REFRESH'.freeze
217
- end
264
+ def generate_id
265
+ id = ""
266
+ email = Initializer.get_initializer.user.email
267
+ environment = Initializer.get_initializer.environment.name
268
+ id = id + "ruby_" +email[0..email.index(Constants::AT) - 1] + Constants::UNDERSCORE
269
+ id = id + environment + Constants::UNDERSCORE + @refresh_token[@refresh_token.length-4..@refresh_token.length-1]
270
+ @id = id
271
+ end
272
+ end
273
+ end
@@ -6,24 +6,22 @@ require_relative '../../../crm/api/util/constants'
6
6
  module Store
7
7
  # This class stores the user token details to the MySQL DataBase.
8
8
  class DBStore < TokenStore
9
- attr_accessor :user_name, :password, :port_number, :host, :database_name
9
+ attr_reader :user_name, :password, :port_number, :host, :database_name, :table_name
10
10
 
11
11
  # Creates an DBStore class instance with the specified parameters.
12
12
  # @param host [string] A String containing the DataBase host name.
13
13
  # @param database_name A String containing the DataBase name.
14
+ # @param table_name A String containing the table name.
14
15
  # @param user_name A String containing the DataBase user name.
15
16
  # @param password A String containing the DataBase password.
16
17
  # @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
18
+ def initialize(host: Constants::MYSQL_HOST, database_name: Constants::MYSQL_DATABASE_NAME ,table_name: Constants::MYSQL_TABLE_NAME,user_name: Constants::MYSQL_USER_NAME,password: '',port_number: Constants::MYSQL_PORT_NUMBER )
19
+ @host = host
20
+ @database_name = database_name
21
+ @table_name = table_name
22
+ @user_name = user_name
23
+ @password = password
24
+ @port_number = port_number
27
25
  end
28
26
 
29
27
  def get_token(user, token)
@@ -36,7 +34,9 @@ module Store
36
34
  con.close
37
35
 
38
36
  rs.each do |row|
39
- oauthtoken = token
37
+ oauthtoken = Authenticator::OAuthToken.new(client_id: row[Constants::CLIENT_ID],client_secret: row[Constants::CLIENT_SECRET],grant_token: row[Constants::GRANT_TOKEN],refresh_token: row[Constants::REFRESH_TOKEN],redirect_url: row[Constants::REDIRECT_URL])
38
+
39
+ oauthtoken.id = row[Constants::ID]
40
40
 
41
41
  oauthtoken.access_token = row[Constants::ACCESS_TOKEN]
42
42
 
@@ -54,7 +54,7 @@ module Store
54
54
  def save_token(user, token)
55
55
  con = Mysql2::Client.new(host: @host, username: @user_name, password: @password, database: @database_name, port: @port_number)
56
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}')"
57
+ query = "insert into #{token.table_name}(id,user_mail,client_id,client_secret,refresh_token,access_token,grant_token,expiry_time,redirect_url) values ('#{token.id}','#{user.email}','#{token.client_id}','#{token.client_secret}','#{token.refresh_token}','#{token.access_token}','#{token.grant_token}','#{token.expires_in}','#{token.redirect_url}')"
58
58
  token.user_mail = user.email
59
59
  delete_token(token)
60
60
  con.query(query)
@@ -81,7 +81,7 @@ module Store
81
81
  def delete_tokens
82
82
  con = Mysql2::Client.new(host: @host, username: @user_name, password: @password, database: @database_name, port: @port_number)
83
83
 
84
- query = 'delete from oauthtoken'
84
+ query = "delete * from #{@table_name}"
85
85
 
86
86
  con.query(query)
87
87
 
@@ -94,24 +94,16 @@ module Store
94
94
  tokens = []
95
95
  con = Mysql2::Client.new(host: @host, username: @user_name, password: @password, database: @database_name, port: @port_number)
96
96
 
97
- query = 'select * from oauthtoken;'
97
+ query = "select * from #{@table_name}"
98
98
 
99
99
  rs = con.query(query)
100
100
 
101
101
  con.close
102
102
 
103
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
104
 
114
- oauthtoken = Authenticator::OAuthToken.new(row[Constants::CLIENT_ID], nil, token_value, token_type)
105
+
106
+ oauthtoken = Authenticator::OAuthToken.new(client_id: row[Constants::CLIENT_ID],client_secret: row[Constants::CLIENT_SECRET],grant_token: grant_token,refresh_token: row[Constants::REFRESH_TOKEN])
115
107
 
116
108
  oauthtoken.id = row[Constants::ID]
117
109
 
@@ -121,8 +113,6 @@ module Store
121
113
 
122
114
  oauthtoken.expires_in = row[Constants::EXPIRY_TIME]
123
115
 
124
- oauthtoken.refresh_token = row[Constants::REFRESH_TOKEN]
125
-
126
116
  tokens.push(oauthtoken)
127
117
  end
128
118
  tokens
@@ -135,7 +125,7 @@ module Store
135
125
 
136
126
  query = is_delete ? 'delete from ' : 'select * from '
137
127
 
138
- query += 'oauthtoken ' + "where user_mail='#{email}' and client_id='#{token.client_id}' and "
128
+ query += "#{@table_name} where user_mail='#{email}' and client_id='#{token.client_id}' and "
139
129
 
140
130
  query += if token.grant_token.nil?
141
131
  "refresh_token='#{token.refresh_token}'"
@@ -145,5 +135,35 @@ module Store
145
135
 
146
136
  query
147
137
  end
138
+ def get_token_by_id(id,token)
139
+ con = Mysql2::Client.new(host: @host, username: @user_name, password: @password, database: @database_name, port: @port_number)
140
+
141
+ if token.is_a? Authenticator::OAuthToken
142
+ query = "select * from #{@table_name} where id='#{id}'"
143
+
144
+ rs = con.query(query)
145
+
146
+ con.close
147
+
148
+ rs.each do |row|
149
+ if id == row[Constants::ID]
150
+ oauthtoken = Authenticator::OAuthToken.new(client_id: row[Constants::CLIENT_ID],client_secret: row[Constants::CLIENT_SECRET],grant_token: row[Constants::GRANT_TOKEN],refresh_token: row[Constants::REFRESH_TOKEN],redirect_url: row[Constants::REDIRECT_URL])
151
+
152
+ oauthtoken.id = row[Constants::ID]
153
+
154
+ oauthtoken.user_mail = row[Constants::USER_MAIL]
155
+
156
+ oauthtoken.access_token = row[Constants::ACCESS_TOKEN]
157
+
158
+ oauthtoken.expires_in = row[Constants::EXPIRY_TIME]
159
+
160
+ return oauthtoken
161
+ end
162
+ end
163
+ end
164
+ nil
165
+ rescue Mysql2::Error => e
166
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::GET_TOKEN_BY_ID_DB_ERROR, nil, e)
167
+ end
148
168
  end
149
169
  end