ZCRMSDK 2.1.0 → 3.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) 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 +19 -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 +40 -15
  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 +201 -111
  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 +8 -36
  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 -5
  142. data/src/com/zoho/crm/api/util/common_api_handler.rb +0 -1
  143. data/src/com/zoho/crm/api/util/constants.rb +140 -13
  144. data/src/com/zoho/crm/api/util/converter.rb +21 -4
  145. data/src/com/zoho/crm/api/util/form_data_converter.rb +3 -15
  146. data/src/com/zoho/crm/api/util/utility.rb +226 -86
  147. data/src/com/zoho/crm/api/variable_groups/variable_groups_operations.rb +3 -3
  148. data/src/com/zoho/crm/api/variables/variables_operations.rb +9 -9
  149. data/src/com/zoho/crm/api/wizards/api_exception.rb +121 -0
  150. data/src/com/zoho/crm/api/wizards/button.rb +214 -0
  151. data/src/com/zoho/crm/api/wizards/chart_data.rb +118 -0
  152. data/src/com/zoho/crm/api/wizards/connection.rb +80 -0
  153. data/src/com/zoho/crm/api/wizards/container.rb +119 -0
  154. data/src/com/zoho/crm/api/wizards/node.rb +118 -0
  155. data/src/com/zoho/crm/api/wizards/response_handler.rb +10 -0
  156. data/src/com/zoho/crm/api/wizards/response_wrapper.rb +63 -0
  157. data/src/com/zoho/crm/api/wizards/screen.rb +99 -0
  158. data/src/com/zoho/crm/api/wizards/segment.rb +176 -0
  159. data/src/com/zoho/crm/api/wizards/wizard.rb +273 -0
  160. data/src/com/zoho/crm/api/wizards/wizards_operations.rb +61 -0
  161. data/src/resources/JSONDetails.json +1 -1
  162. data/src/version.rb +1 -1
  163. metadata +88 -5
@@ -22,7 +22,7 @@ module Tags
22
22
  end
23
23
  handler_instance = Handler::CommonAPIHandler.new
24
24
  api_path = ''
25
- api_path = api_path + '/crm/v2/settings/tags'
25
+ api_path = api_path + '/crm/v2.1/settings/tags'
26
26
  handler_instance.api_path = api_path
27
27
  handler_instance.http_method = Constants::REQUEST_METHOD_GET
28
28
  handler_instance.category_method = 'READ'
@@ -45,7 +45,7 @@ module Tags
45
45
  end
46
46
  handler_instance = Handler::CommonAPIHandler.new
47
47
  api_path = ''
48
- api_path = api_path + '/crm/v2/settings/tags'
48
+ api_path = api_path + '/crm/v2.1/settings/tags'
49
49
  handler_instance.api_path = api_path
50
50
  handler_instance.http_method = Constants::REQUEST_METHOD_POST
51
51
  handler_instance.category_method = 'CREATE'
@@ -71,7 +71,7 @@ module Tags
71
71
  end
72
72
  handler_instance = Handler::CommonAPIHandler.new
73
73
  api_path = ''
74
- api_path = api_path + '/crm/v2/settings/tags'
74
+ api_path = api_path + '/crm/v2.1/settings/tags'
75
75
  handler_instance.api_path = api_path
76
76
  handler_instance.http_method = Constants::REQUEST_METHOD_PUT
77
77
  handler_instance.category_method = 'UPDATE'
@@ -101,7 +101,7 @@ module Tags
101
101
  end
102
102
  handler_instance = Handler::CommonAPIHandler.new
103
103
  api_path = ''
104
- api_path = api_path + '/crm/v2/settings/tags/'
104
+ api_path = api_path + '/crm/v2.1/settings/tags/'
105
105
  api_path = api_path + id.to_s
106
106
  handler_instance.api_path = api_path
107
107
  handler_instance.http_method = Constants::REQUEST_METHOD_PUT
@@ -123,7 +123,7 @@ module Tags
123
123
  end
124
124
  handler_instance = Handler::CommonAPIHandler.new
125
125
  api_path = ''
126
- api_path = api_path + '/crm/v2/settings/tags/'
126
+ api_path = api_path + '/crm/v2.1/settings/tags/'
127
127
  api_path = api_path + id.to_s
128
128
  handler_instance.api_path = api_path
129
129
  handler_instance.http_method = Constants::REQUEST_METHOD_DELETE
@@ -146,7 +146,7 @@ module Tags
146
146
  end
147
147
  handler_instance = Handler::CommonAPIHandler.new
148
148
  api_path = ''
149
- api_path = api_path + '/crm/v2/settings/tags/'
149
+ api_path = api_path + '/crm/v2.1/settings/tags/'
150
150
  api_path = api_path + id.to_s
151
151
  api_path = api_path + '/actions/merge'
152
152
  handler_instance.api_path = api_path
@@ -177,7 +177,7 @@ module Tags
177
177
  end
178
178
  handler_instance = Handler::CommonAPIHandler.new
179
179
  api_path = ''
180
- api_path = api_path + '/crm/v2/'
180
+ api_path = api_path + '/crm/v2.1/'
181
181
  api_path = api_path + module_api_name.to_s
182
182
  api_path = api_path + '/'
183
183
  api_path = api_path + record_id.to_s
@@ -209,7 +209,7 @@ module Tags
209
209
  end
210
210
  handler_instance = Handler::CommonAPIHandler.new
211
211
  api_path = ''
212
- api_path = api_path + '/crm/v2/'
212
+ api_path = api_path + '/crm/v2.1/'
213
213
  api_path = api_path + module_api_name.to_s
214
214
  api_path = api_path + '/'
215
215
  api_path = api_path + record_id.to_s
@@ -237,7 +237,7 @@ module Tags
237
237
  end
238
238
  handler_instance = Handler::CommonAPIHandler.new
239
239
  api_path = ''
240
- api_path = api_path + '/crm/v2/'
240
+ api_path = api_path + '/crm/v2.1/'
241
241
  api_path = api_path + module_api_name.to_s
242
242
  api_path = api_path + '/actions/add_tags'
243
243
  handler_instance.api_path = api_path
@@ -263,7 +263,7 @@ module Tags
263
263
  end
264
264
  handler_instance = Handler::CommonAPIHandler.new
265
265
  api_path = ''
266
- api_path = api_path + '/crm/v2/'
266
+ api_path = api_path + '/crm/v2.1/'
267
267
  api_path = api_path + module_api_name.to_s
268
268
  api_path = api_path + '/actions/remove_tags'
269
269
  handler_instance.api_path = api_path
@@ -289,7 +289,7 @@ module Tags
289
289
  end
290
290
  handler_instance = Handler::CommonAPIHandler.new
291
291
  api_path = ''
292
- api_path = api_path + '/crm/v2/settings/tags/'
292
+ api_path = api_path + '/crm/v2.1/settings/tags/'
293
293
  api_path = api_path + id.to_s
294
294
  api_path = api_path + '/actions/records_count'
295
295
  handler_instance.api_path = api_path
@@ -18,7 +18,7 @@ module Taxes
18
18
  def get_taxes
19
19
  handler_instance = Handler::CommonAPIHandler.new
20
20
  api_path = ''
21
- api_path = api_path + '/crm/v2/org/taxes'
21
+ api_path = api_path + '/crm/v2.1/org/taxes'
22
22
  handler_instance.api_path = api_path
23
23
  handler_instance.http_method = Constants::REQUEST_METHOD_GET
24
24
  handler_instance.category_method = 'READ'
@@ -36,7 +36,7 @@ module Taxes
36
36
  end
37
37
  handler_instance = Handler::CommonAPIHandler.new
38
38
  api_path = ''
39
- api_path = api_path + '/crm/v2/org/taxes'
39
+ api_path = api_path + '/crm/v2.1/org/taxes'
40
40
  handler_instance.api_path = api_path
41
41
  handler_instance.http_method = Constants::REQUEST_METHOD_POST
42
42
  handler_instance.category_method = 'CREATE'
@@ -57,7 +57,7 @@ module Taxes
57
57
  end
58
58
  handler_instance = Handler::CommonAPIHandler.new
59
59
  api_path = ''
60
- api_path = api_path + '/crm/v2/org/taxes'
60
+ api_path = api_path + '/crm/v2.1/org/taxes'
61
61
  handler_instance.api_path = api_path
62
62
  handler_instance.http_method = Constants::REQUEST_METHOD_PUT
63
63
  handler_instance.category_method = 'UPDATE'
@@ -78,7 +78,7 @@ module Taxes
78
78
  end
79
79
  handler_instance = Handler::CommonAPIHandler.new
80
80
  api_path = ''
81
- api_path = api_path + '/crm/v2/org/taxes'
81
+ api_path = api_path + '/crm/v2.1/org/taxes'
82
82
  handler_instance.api_path = api_path
83
83
  handler_instance.http_method = Constants::REQUEST_METHOD_DELETE
84
84
  handler_instance.category_method = Constants::REQUEST_METHOD_DELETE
@@ -97,7 +97,7 @@ module Taxes
97
97
  end
98
98
  handler_instance = Handler::CommonAPIHandler.new
99
99
  api_path = ''
100
- api_path = api_path + '/crm/v2/org/taxes/'
100
+ api_path = api_path + '/crm/v2.1/org/taxes/'
101
101
  api_path = api_path + id.to_s
102
102
  handler_instance.api_path = api_path
103
103
  handler_instance.http_method = Constants::REQUEST_METHOD_GET
@@ -116,7 +116,7 @@ module Taxes
116
116
  end
117
117
  handler_instance = Handler::CommonAPIHandler.new
118
118
  api_path = ''
119
- api_path = api_path + '/crm/v2/org/taxes/'
119
+ api_path = api_path + '/crm/v2.1/org/taxes/'
120
120
  api_path = api_path + id.to_s
121
121
  handler_instance.api_path = api_path
122
122
  handler_instance.http_method = Constants::REQUEST_METHOD_DELETE
@@ -1,3 +1,4 @@
1
+ require_relative '../record/info'
1
2
  require_relative '../util/model'
2
3
 
3
4
  module Territories
@@ -9,6 +10,7 @@ module Territories
9
10
  # Creates an instance of ResponseWrapper
10
11
  def initialize
11
12
  @territories = nil
13
+ @info = nil
12
14
  @key_modified = Hash.new
13
15
  end
14
16
 
@@ -30,6 +32,24 @@ module Territories
30
32
  @key_modified['territories'] = 1
31
33
  end
32
34
 
35
+ # The method to get the info
36
+ # @return An instance of Record::Info
37
+
38
+ def info
39
+ @info
40
+ end
41
+
42
+ # The method to set the value to info
43
+ # @param info [Record::Info] An instance of Record::Info
44
+
45
+ def info=(info)
46
+ if info!=nil and !info.is_a? Record::Info
47
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: info EXPECTED TYPE: Info', nil, nil)
48
+ end
49
+ @info = info
50
+ @key_modified['info'] = 1
51
+ end
52
+
33
53
  # The method to check if the user has modified the given key
34
54
  # @param key [String] A String
35
55
  # @return A Integer value
@@ -16,7 +16,7 @@ module Territories
16
16
  def get_territories
17
17
  handler_instance = Handler::CommonAPIHandler.new
18
18
  api_path = ''
19
- api_path = api_path + '/crm/v2/settings/territories'
19
+ api_path = api_path + '/crm/v2.1/settings/territories'
20
20
  handler_instance.api_path = api_path
21
21
  handler_instance.http_method = Constants::REQUEST_METHOD_GET
22
22
  handler_instance.category_method = 'READ'
@@ -34,7 +34,7 @@ module Territories
34
34
  end
35
35
  handler_instance = Handler::CommonAPIHandler.new
36
36
  api_path = ''
37
- api_path = api_path + '/crm/v2/settings/territories/'
37
+ api_path = api_path + '/crm/v2.1/settings/territories/'
38
38
  api_path = api_path + id.to_s
39
39
  handler_instance.api_path = api_path
40
40
  handler_instance.http_method = Constants::REQUEST_METHOD_GET
@@ -11,13 +11,15 @@ module Territories
11
11
  @created_time = nil
12
12
  @modified_time = nil
13
13
  @manager = nil
14
- @parent_id = nil
15
- @criteria = nil
14
+ @account_rule_criteria = nil
15
+ @deal_rule_criteria = nil
16
16
  @name = nil
17
17
  @modified_by = nil
18
18
  @description = nil
19
19
  @id = nil
20
20
  @created_by = nil
21
+ @reporting_to = nil
22
+ @permission_type = nil
21
23
  @key_modified = Hash.new
22
24
  end
23
25
 
@@ -75,40 +77,40 @@ module Territories
75
77
  @key_modified['manager'] = 1
76
78
  end
77
79
 
78
- # The method to get the parent_id
79
- # @return A String value
80
+ # The method to get the account_rule_criteria
81
+ # @return An instance of CustomViews::Criteria
80
82
 
81
- def parent_id
82
- @parent_id
83
+ def account_rule_criteria
84
+ @account_rule_criteria
83
85
  end
84
86
 
85
- # The method to set the value to parent_id
86
- # @param parent_id [String] A String
87
+ # The method to set the value to account_rule_criteria
88
+ # @param account_rule_criteria [CustomViews::Criteria] An instance of CustomViews::Criteria
87
89
 
88
- def parent_id=(parent_id)
89
- if parent_id!=nil and !parent_id.is_a? String
90
- raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: parent_id EXPECTED TYPE: String', nil, nil)
90
+ def account_rule_criteria=(account_rule_criteria)
91
+ if account_rule_criteria!=nil and !account_rule_criteria.is_a? CustomViews::Criteria
92
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: account_rule_criteria EXPECTED TYPE: Criteria', nil, nil)
91
93
  end
92
- @parent_id = parent_id
93
- @key_modified['parent_id'] = 1
94
+ @account_rule_criteria = account_rule_criteria
95
+ @key_modified['account_rule_criteria'] = 1
94
96
  end
95
97
 
96
- # The method to get the criteria
98
+ # The method to get the deal_rule_criteria
97
99
  # @return An instance of CustomViews::Criteria
98
100
 
99
- def criteria
100
- @criteria
101
+ def deal_rule_criteria
102
+ @deal_rule_criteria
101
103
  end
102
104
 
103
- # The method to set the value to criteria
104
- # @param criteria [CustomViews::Criteria] An instance of CustomViews::Criteria
105
+ # The method to set the value to deal_rule_criteria
106
+ # @param deal_rule_criteria [CustomViews::Criteria] An instance of CustomViews::Criteria
105
107
 
106
- def criteria=(criteria)
107
- if criteria!=nil and !criteria.is_a? CustomViews::Criteria
108
- raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: criteria EXPECTED TYPE: Criteria', nil, nil)
108
+ def deal_rule_criteria=(deal_rule_criteria)
109
+ if deal_rule_criteria!=nil and !deal_rule_criteria.is_a? CustomViews::Criteria
110
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: deal_rule_criteria EXPECTED TYPE: Criteria', nil, nil)
109
111
  end
110
- @criteria = criteria
111
- @key_modified['criteria'] = 1
112
+ @deal_rule_criteria = deal_rule_criteria
113
+ @key_modified['deal_rule_criteria'] = 1
112
114
  end
113
115
 
114
116
  # The method to get the name
@@ -201,6 +203,42 @@ module Territories
201
203
  @key_modified['created_by'] = 1
202
204
  end
203
205
 
206
+ # The method to get the reporting_to
207
+ # @return An instance of Territory
208
+
209
+ def reporting_to
210
+ @reporting_to
211
+ end
212
+
213
+ # The method to set the value to reporting_to
214
+ # @param reporting_to [Territory] An instance of Territory
215
+
216
+ def reporting_to=(reporting_to)
217
+ if reporting_to!=nil and !reporting_to.is_a? Territory
218
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: reporting_to EXPECTED TYPE: Territory', nil, nil)
219
+ end
220
+ @reporting_to = reporting_to
221
+ @key_modified['reporting_to'] = 1
222
+ end
223
+
224
+ # The method to get the permission_type
225
+ # @return A String value
226
+
227
+ def permission_type
228
+ @permission_type
229
+ end
230
+
231
+ # The method to set the value to permission_type
232
+ # @param permission_type [String] A String
233
+
234
+ def permission_type=(permission_type)
235
+ if permission_type!=nil and !permission_type.is_a? String
236
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: permission_type EXPECTED TYPE: String', nil, nil)
237
+ end
238
+ @permission_type = permission_type
239
+ @key_modified['permission_type'] = 1
240
+ end
241
+
204
242
  # The method to check if the user has modified the given key
205
243
  # @param key [String] A String
206
244
  # @return A Integer value
@@ -28,7 +28,7 @@ module Users
28
28
  end
29
29
  handler_instance = Handler::CommonAPIHandler.new
30
30
  api_path = ''
31
- api_path = api_path + '/crm/v2/users'
31
+ api_path = api_path + '/crm/v2.1/users'
32
32
  handler_instance.api_path = api_path
33
33
  handler_instance.http_method = Constants::REQUEST_METHOD_GET
34
34
  handler_instance.category_method = 'READ'
@@ -48,7 +48,7 @@ module Users
48
48
  end
49
49
  handler_instance = Handler::CommonAPIHandler.new
50
50
  api_path = ''
51
- api_path = api_path + '/crm/v2/users'
51
+ api_path = api_path + '/crm/v2.1/users'
52
52
  handler_instance.api_path = api_path
53
53
  handler_instance.http_method = Constants::REQUEST_METHOD_POST
54
54
  handler_instance.category_method = 'CREATE'
@@ -69,7 +69,7 @@ module Users
69
69
  end
70
70
  handler_instance = Handler::CommonAPIHandler.new
71
71
  api_path = ''
72
- api_path = api_path + '/crm/v2/users'
72
+ api_path = api_path + '/crm/v2.1/users'
73
73
  handler_instance.api_path = api_path
74
74
  handler_instance.http_method = Constants::REQUEST_METHOD_PUT
75
75
  handler_instance.category_method = 'UPDATE'
@@ -94,7 +94,7 @@ module Users
94
94
  end
95
95
  handler_instance = Handler::CommonAPIHandler.new
96
96
  api_path = ''
97
- api_path = api_path + '/crm/v2/users/'
97
+ api_path = api_path + '/crm/v2.1/users/'
98
98
  api_path = api_path + id.to_s
99
99
  handler_instance.api_path = api_path
100
100
  handler_instance.http_method = Constants::REQUEST_METHOD_GET
@@ -118,7 +118,7 @@ module Users
118
118
  end
119
119
  handler_instance = Handler::CommonAPIHandler.new
120
120
  api_path = ''
121
- api_path = api_path + '/crm/v2/users/'
121
+ api_path = api_path + '/crm/v2.1/users/'
122
122
  api_path = api_path + id.to_s
123
123
  handler_instance.api_path = api_path
124
124
  handler_instance.http_method = Constants::REQUEST_METHOD_PUT
@@ -139,7 +139,7 @@ module Users
139
139
  end
140
140
  handler_instance = Handler::CommonAPIHandler.new
141
141
  api_path = ''
142
- api_path = api_path + '/crm/v2/users/'
142
+ api_path = api_path + '/crm/v2.1/users/'
143
143
  api_path = api_path + id.to_s
144
144
  handler_instance.api_path = api_path
145
145
  handler_instance.http_method = Constants::REQUEST_METHOD_DELETE
@@ -24,7 +24,7 @@ module Util
24
24
  end
25
25
 
26
26
  def set_content_type_header
27
- Constants::SET_TO_CONTENT_TYPE.each do |content_type|
27
+ Constants::SET_CONTENT_TYPE_HEADER.each do |content_type|
28
28
  if @url.include? content_type
29
29
  @headers[Constants::CONTENT_TYPE] = @content_type
30
30
  break
@@ -49,7 +49,6 @@ module Util
49
49
  http = nil
50
50
  initializer = Initializer.get_initializer
51
51
  request_proxy = initializer.request_proxy
52
-
53
52
  if request_proxy.nil?
54
53
  http = Net::HTTP.new(url.host, url.port)
55
54
  else
@@ -102,11 +101,12 @@ module Util
102
101
  end
103
102
 
104
103
  def proxy_log(request_proxy)
104
+ proxy_log = Constants::PROXY_SETTINGS + Constants::PROXY_HOST + request_proxy.host + " , "
105
+ proxy_log += Constants::PROXY_PORT + request_proxy.port.to_s
105
106
  if request_proxy.user_name.nil?
106
- 'Proxy settings - Host : ' + request_proxy.host + ' , Port : ' + request_proxy.port.to_s
107
- else
108
- 'Proxy settings - Host : ' + request_proxy.host + ' , Port : ' + request_proxy.port.to_s + ' , Proxy User : ' + request_proxy.user_name
107
+ proxy_log += " , " + Constants::PROXY_USER + request_proxy.user_name
109
108
  end
109
+ proxy_log
110
110
  end
111
111
  end
112
112
  end
@@ -88,7 +88,6 @@ module Handler
88
88
  converter_instance = nil
89
89
 
90
90
  if !@content_type.nil? && (Constants::IS_GENERATE_REQUEST_BODY.include? http_method)
91
-
92
91
  request = nil
93
92
 
94
93
  begin
@@ -26,6 +26,8 @@ class Constants
26
26
 
27
27
  RESPONSECODE_BAD_REQUEST = 400
28
28
 
29
+ JSON_DETAILS_ERROR = "ERROR IN READING JSONDETAILS FILE"
30
+
29
31
  RESPONSECODE_AUTHORIZATION_ERROR = 401
30
32
 
31
33
  RESPONSECODE_FORBIDDEN = 403
@@ -94,15 +96,81 @@ class Constants
94
96
 
95
97
  HTTP = 'http'
96
98
 
99
+ KEY_VS_INVENTORY_MODULE = {
100
+ "Quoted_Items"=>"quotes",
101
+
102
+ "Invoiced_Items" => "invoices",
103
+
104
+ "Purchase_Items" => "purchase_orders",
105
+
106
+ "Ordered_Items" => "sales_orders"
107
+
108
+ }
109
+ DEFAULT_MODULENAME_VS_APINAME = {
110
+
111
+ "leads" => "Leads",
112
+
113
+ "contacts" => "Contacts",
114
+
115
+ "accounts" => "Accounts",
116
+
117
+ "deals" => "Deals",
118
+
119
+ "tasks" => "Tasks",
120
+
121
+ "events" => "Events",
122
+
123
+ "activities" => "Activities",
124
+
125
+ "calls" => "Calls",
126
+
127
+ "products" => "Products",
128
+
129
+ "quotes" => "Quotes",
130
+
131
+ "sales_orders" => "Sales_Orders",
132
+
133
+ "purchase_orders" => "Purchase_Orders",
134
+
135
+ "invoices" => "Invoices",
136
+
137
+ "campaigns" => "Campaigns",
138
+
139
+ "vendors" => "Vendors",
140
+
141
+ "price_books" => "Price_Books",
142
+
143
+ "cases" => "Cases",
144
+
145
+ "solutions" => "Solutions",
146
+
147
+ "visits" => "Visits",
148
+
149
+ "approvals" => "Approvals",
150
+
151
+ "notes" => "Notes",
152
+
153
+ "attachments" => "Attachments",
154
+
155
+ "actions_performed" => "Actions_Performed",
156
+
157
+ }
158
+
159
+ USER_AGENT = "Mozilla/5.0"
160
+
161
+ USER_AGENT_KEY = "user-agent"
162
+
97
163
  CONTENT_API_URL = 'content.zohoapis.com'
98
164
 
99
165
  INVALID_URL_ERROR = 'Invalid URI Error'
100
166
 
101
167
  ZOHO_SDK = 'X-ZOHO-SDK'
102
168
 
103
- SDK_VERSION = '2.1.0'
169
+ SDK_VERSION = '3.0.0-beta'
104
170
 
105
- SET_TO_CONTENT_TYPE = ['/crm/bulk/v2/read', '/crm/bulk/v2/write']
171
+ SET_CONTENT_TYPE_HEADER = ['/crm/bulk/v2.1/read', '/crm/bulk/v2.1/write']
172
+
173
+ RESOURCE_PATH_INVALID_ERROR_MESSAGE = "Resource Path MUST be a valid directory."
106
174
 
107
175
  IS_GENERATE_REQUEST_BODY =[REQUEST_METHOD_POST,REQUEST_METHOD_PUT,REQUEST_METHOD_PATCH]
108
176
 
@@ -112,9 +180,9 @@ class Constants
112
180
 
113
181
  CRM = "crm"
114
182
 
115
- API_VERSION = "v2"
183
+ API_VERSION = "v2.1"
116
184
 
117
- PHOTO_SUPPORTED_MODULES = ["leads", "contacts", "accounts", "products", "vendors"]
185
+ PHOTO_SUPPORTED_MODULES = ["Leads", "Contacts", "Accounts", "Products", "Vendors", "Deals", "Cases", "Solutions"]
118
186
 
119
187
  PARAMETER_NULL_ERROR = 'NULL PARAMETER ERROR'
120
188
 
@@ -168,6 +236,16 @@ class Constants
168
236
 
169
237
  EXPIRY_TIME = 'expiry_time'
170
238
 
239
+ PROXY_SETTINGS = "Proxy settings - "
240
+
241
+ PROXY_HOST = "Host: "
242
+
243
+ PROXY_PORT = "Port: "
244
+
245
+ PROXY_USER = "User: "
246
+
247
+ PROXY_DOMAIN = "Domain: "
248
+
171
249
  USER_MAIL_NULL_ERROR = 'USER MAIL NULL ERROR'
172
250
 
173
251
  USER_MAIL_NULL_ERROR_MESSAGE = 'User Mail MUST NOT be null. Use setUserMail() to set value.'
@@ -178,6 +256,10 @@ class Constants
178
256
 
179
257
  GET_TOKEN_DB_ERROR = 'Exception in get_token - DBStore:'
180
258
 
259
+ GET_TOKEN_BY_ID_DB_ERROR = "Exception in getTokenById - DBStore : Given ID is invalid"
260
+
261
+ GET_TOKEN_BY_ID_FILE_ERROR = "Exception in getTokenById - FileStore : Given ID is invalid"
262
+
181
263
  GET_TOKENS_DB_ERROR = 'Exception in get_tokens - DBStore:'
182
264
 
183
265
  DELETE_TOKEN_DB_ERROR = 'Exception in delete_token - DBStore:'
@@ -188,6 +270,8 @@ class Constants
188
270
 
189
271
  GET_TOKEN_FILE_ERROR = 'Exception in get_token - FileStore:'
190
272
 
273
+ LOGGER_INITIALIZATION_ERROR = "Exception in Logger Initialization : "
274
+
191
275
  REFRESH_SINGLE_MODULE_FIELDS_ERROR = 'Exception in refreshing fields of module : '
192
276
 
193
277
  REFRESH_ALL_MODULE_FIELDS_ERROR = 'Exception in refreshing fields of all modules : '
@@ -214,8 +298,6 @@ class Constants
214
298
 
215
299
  DELETE_TOKENS_FILE_ERROR = 'Exception in delete_tokens - FileStore:'
216
300
 
217
- SDK_LOGGER_INITIALIZE = 'Exception in Logger Initialization'
218
-
219
301
  DELETE_MODULE_FROM_FIELDFILE_ERROR = 'Exception in deleting module from Fields file'
220
302
 
221
303
  DELETE_FIELD_FILE_ERROR = 'Exception in deleting Current User Fields file'
@@ -230,7 +312,25 @@ class Constants
230
312
 
231
313
  GIVEN_VALUE = "given-value"
232
314
 
233
- PHOTO_UPLOAD_ERROR_MESSAGE = "The given module is not supported in API.";
315
+ MULTI_SELECT_LOOKUP = "multiselectlookup"
316
+
317
+ MULTI_USER_LOOKUP = "multiuserlookup"
318
+
319
+ TERRITORIES = "territories"
320
+
321
+ GENERATED_TYPE = "generated_type"
322
+
323
+ GENERATED_TYPE_CUSTOM = "custom"
324
+
325
+ UPLOAD_PHOTO_UNSUPPORTED_MESSAGE = "Photo Upload Operation is not supported by the module: "
326
+
327
+ SDK_MODULE_METADATA = "SDK-MODULE-METADATA"
328
+
329
+ INVALID_MODULE_API_NAME_ERROR = "INVALID MODULE API NAME ERROR"
330
+
331
+ PROVIDE_VALID_MODULE_API_NAME = "PROVIDE VALID MODULE API NAME: "
332
+
333
+ UPLOAD_PHOTO_UNSUPPORTED_ERROR = "UPLOAD PHOTO UNSUPPORTED MODULE"
234
334
 
235
335
  INVALID_MODULE = "INVALID_MODULE"
236
336
 
@@ -261,6 +361,8 @@ class Constants
261
361
  REQUEST_CATEGORY_UPDATE = 'UPDATE'
262
362
 
263
363
  MODULEPACKAGENAME = 'modulePackageName'
364
+
365
+ MYSQL_TABLE_NAME = "oauthtoken"
264
366
 
265
367
  INITIALIZATION_SUCCESSFUL = 'Initialization successful'
266
368
 
@@ -493,19 +595,23 @@ class Constants
493
595
  HOST_ERROR_MESSAGE = 'Host MUST NOT be null.'
494
596
 
495
597
  PORT_ERROR_MESSAGE = 'Port MUST NOT be null.'
598
+
599
+ REQUEST_PROXY_ERROR_MESSAGE = "request_proxy must be instance of Request Proxy"
600
+
601
+ USER_SIGNATURE_ERROR_MESSAGE = "user must be instance of UserSignature."
496
602
 
497
- USERSIGNATURE_ERROR_MESSAGE = "UserSignature MUST NOT be null."
498
-
499
- ENVIRONMENT_ERROR_MESSAGE = "Environment MUST NOT be null."
603
+ ENVIRONMENT_ERROR_MESSAGE = "environment must be instance of Environment."
500
604
 
501
- SDK_CONFIG_ERROR_MESSAGE = "sdkConfig MUST NOT be null."
605
+ SDK_CONFIG_ERROR_MESSAGE = "sdk_config must be instance of sdkConfig."
502
606
 
503
- TOKEN_ERROR_MESSAGE = "Token MUST NOT be null."
607
+ TOKEN_ERROR_MESSAGE = "token must be instance of Token."
504
608
 
505
- STORE_ERROR_MESSAGE = "Store MUST NOT be null."
609
+ STORE_ERROR_MESSAGE = "store must be instance of Store."
506
610
 
507
611
  INITIALIZATION_EXCEPTION = 'Exception in initialization'
508
612
 
613
+ SWITCH_USER_EXCEPTION = 'Exception in Switch user'
614
+
509
615
  SWITCH_USER_ERROR = "SWITCH USER ERROR"
510
616
 
511
617
  EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
@@ -528,9 +634,30 @@ class Constants
528
634
 
529
635
  ATTACHMENTS = '$attachments'
530
636
 
637
+ TERRITORY_NAMESPACE = 'com.zoho.crm.api.record.Territory'
638
+
639
+ IMAGEUPLOAD_NAMESPACE = 'com.zoho.crm.api.record.ImageUpload'
640
+
531
641
  ATTACHMENTS_NAMESPACE = 'com.zoho.crm.api.attachments.Attachment'
532
642
 
533
643
  PICKLIST = 'picklist'
534
644
 
535
645
  CONSENT_NAMESPACE = 'com.zoho.crm.api.record.Consent'
646
+
647
+ INVALID_TOKEN_ERROR = "INVALID TOKEN ERROR"
648
+
649
+ NO_ACCESS_TOKEN_ERROR = "ACCESS TOKEN IS NOT PRESENT IN RESPONSE"
650
+
651
+ CLIENT_ID_NULL_ERROR_MESSAGE = "ClientID MUST NOT be null"
652
+
653
+ CLIENT_SECRET_NULL_ERROR_MESSAGE = "ClientSecret MUST NOT be null"
654
+
655
+ TAX_NAMESPACE = "com.zoho.crm.api.record.Tax"
656
+
657
+ PRODUCTS = "Products"
658
+
659
+ TAX = "TAX"
660
+
661
+ TERRITORY = "Territory"
662
+
536
663
  end