ZCRMSDK 2.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/src/ZCRMSDK.rb +87 -2
  3. data/src/com/zoho/api/authenticator/oauth_token.rb +86 -31
  4. data/src/com/zoho/api/authenticator/store/db_store.rb +71 -29
  5. data/src/com/zoho/api/authenticator/store/file_store.rb +91 -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 +42 -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 +1127 -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 +215 -61
  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_module_lookup.rb +99 -0
  57. data/src/com/zoho/crm/api/fields/multi_select_lookup.rb +19 -0
  58. data/src/com/zoho/crm/api/fields/multi_user_lookup.rb +175 -0
  59. data/src/com/zoho/crm/api/fields/pick_list_value.rb +19 -0
  60. data/src/com/zoho/crm/api/fields/related_details.rb +19 -0
  61. data/src/com/zoho/crm/api/files/file_operations.rb +2 -2
  62. data/src/com/zoho/crm/api/initializer.rb +45 -17
  63. data/src/com/zoho/crm/api/inventory_templates/api_exception.rb +121 -0
  64. data/src/com/zoho/crm/api/inventory_templates/inventory_template.rb +352 -0
  65. data/src/com/zoho/crm/api/inventory_templates/inventory_templates_operations.rb +82 -0
  66. data/src/com/zoho/crm/api/inventory_templates/response_handler.rb +10 -0
  67. data/src/com/zoho/crm/api/inventory_templates/response_wrapper.rb +83 -0
  68. data/src/com/zoho/crm/api/layouts/layout.rb +38 -0
  69. data/src/com/zoho/crm/api/layouts/layouts_operations.rb +2 -2
  70. data/src/com/zoho/crm/api/layouts/section.rb +19 -0
  71. data/src/com/zoho/crm/api/modules/module.rb +57 -0
  72. data/src/com/zoho/crm/api/modules/modules_operations.rb +4 -4
  73. data/src/com/zoho/crm/api/notes/note.rb +19 -0
  74. data/src/com/zoho/crm/api/notes/notes_operations.rb +7 -7
  75. data/src/com/zoho/crm/api/notification/notification_operations.rb +6 -6
  76. data/src/com/zoho/crm/api/org/hierarchy_preference.rb +61 -0
  77. data/src/com/zoho/crm/api/org/org.rb +38 -0
  78. data/src/com/zoho/crm/api/org/org_operations.rb +2 -2
  79. data/src/com/zoho/crm/api/pipeline/action_handler.rb +10 -0
  80. data/src/com/zoho/crm/api/pipeline/action_response.rb +10 -0
  81. data/src/com/zoho/crm/api/pipeline/action_wrapper.rb +63 -0
  82. data/src/com/zoho/crm/api/pipeline/api_exception.rb +129 -0
  83. data/src/com/zoho/crm/api/pipeline/body_wrapper.rb +61 -0
  84. data/src/com/zoho/crm/api/pipeline/forecast_category.rb +80 -0
  85. data/src/com/zoho/crm/api/pipeline/pick_list_value.rb +175 -0
  86. data/src/com/zoho/crm/api/pipeline/pipeline.rb +213 -0
  87. data/src/com/zoho/crm/api/pipeline/pipeline_operations.rb +165 -0
  88. data/src/com/zoho/crm/api/pipeline/response_handler.rb +10 -0
  89. data/src/com/zoho/crm/api/pipeline/response_wrapper.rb +63 -0
  90. data/src/com/zoho/crm/api/pipeline/stage.rb +80 -0
  91. data/src/com/zoho/crm/api/pipeline/success_response.rb +123 -0
  92. data/src/com/zoho/crm/api/pipeline/transfer_action_handler.rb +10 -0
  93. data/src/com/zoho/crm/api/pipeline/transfer_action_response.rb +10 -0
  94. data/src/com/zoho/crm/api/pipeline/transfer_action_wrapper.rb +63 -0
  95. data/src/com/zoho/crm/api/pipeline/transfer_and_delete_wrapper.rb +61 -0
  96. data/src/com/zoho/crm/api/pipeline/transfer_pipe_line.rb +80 -0
  97. data/src/com/zoho/crm/api/profiles/category.rb +19 -0
  98. data/src/com/zoho/crm/api/profiles/default_view.rb +99 -0
  99. data/src/com/zoho/crm/api/profiles/profile.rb +49 -11
  100. data/src/com/zoho/crm/api/profiles/profiles_operations.rb +2 -2
  101. data/src/com/zoho/crm/api/query/query_operations.rb +1 -1
  102. data/src/com/zoho/crm/api/record/api_exception.rb +2 -0
  103. data/src/com/zoho/crm/api/record/body_wrapper.rb +0 -19
  104. data/src/com/zoho/crm/api/record/count_handler.rb +10 -0
  105. data/src/com/zoho/crm/api/record/count_wrapper.rb +63 -0
  106. data/src/com/zoho/crm/api/record/field.rb +17 -17
  107. data/src/com/zoho/crm/api/record/image_upload.rb +213 -0
  108. data/src/com/zoho/crm/api/record/line_tax.rb +19 -0
  109. data/src/com/zoho/crm/api/record/mass_update_body_wrapper.rb +4 -4
  110. data/src/com/zoho/crm/api/record/mass_update_territory.rb +80 -0
  111. data/src/com/zoho/crm/api/record/multi_select_lookup.rb +99 -0
  112. data/src/com/zoho/crm/api/record/multi_select_picklist.rb +80 -0
  113. data/src/com/zoho/crm/api/record/price_book.rb +31 -0
  114. data/src/com/zoho/crm/api/record/record_operations.rb +196 -26
  115. data/src/com/zoho/crm/api/record/tax.rb +80 -0
  116. data/src/com/zoho/crm/api/record/territory.rb +70 -12
  117. data/src/com/zoho/crm/api/record/widget.rb +80 -0
  118. data/src/com/zoho/crm/api/record/wizard.rb +80 -0
  119. data/src/com/zoho/crm/api/related_lists/related_lists_operations.rb +2 -2
  120. data/src/com/zoho/crm/api/related_records/related_records_operations.rb +6 -6
  121. data/src/com/zoho/crm/api/request_proxy.rb +3 -4
  122. data/src/com/zoho/crm/api/roles/roles_operations.rb +2 -2
  123. data/src/com/zoho/crm/api/sdk_config.rb +2 -68
  124. data/src/com/zoho/crm/api/send_mail/action_handler.rb +10 -0
  125. data/src/com/zoho/crm/api/send_mail/action_response.rb +10 -0
  126. data/src/com/zoho/crm/api/send_mail/action_wrapper.rb +63 -0
  127. data/src/com/zoho/crm/api/send_mail/api_exception.rb +125 -0
  128. data/src/com/zoho/crm/api/send_mail/body_wrapper.rb +61 -0
  129. data/src/com/zoho/crm/api/send_mail/data_subject_request.rb +80 -0
  130. data/src/com/zoho/crm/api/send_mail/inventory_details.rb +100 -0
  131. data/src/com/zoho/crm/api/send_mail/mail.rb +423 -0
  132. data/src/com/zoho/crm/api/send_mail/response_handler.rb +10 -0
  133. data/src/com/zoho/crm/api/send_mail/response_wrapper.rb +63 -0
  134. data/src/com/zoho/crm/api/send_mail/send_mail_operations.rb +61 -0
  135. data/src/com/zoho/crm/api/send_mail/success_response.rb +121 -0
  136. data/src/com/zoho/crm/api/send_mail/template.rb +10 -0
  137. data/src/com/zoho/crm/api/send_mail/user_address.rb +137 -0
  138. data/src/com/zoho/crm/api/share_records/share_records_operations.rb +4 -4
  139. data/src/com/zoho/crm/api/tags/tag.rb +19 -0
  140. data/src/com/zoho/crm/api/tags/tags_operations.rb +11 -11
  141. data/src/com/zoho/crm/api/taxes/taxes_operations.rb +6 -6
  142. data/src/com/zoho/crm/api/territories/response_wrapper.rb +20 -0
  143. data/src/com/zoho/crm/api/territories/territories_operations.rb +2 -2
  144. data/src/com/zoho/crm/api/territories/territory.rb +61 -23
  145. data/src/com/zoho/crm/api/users/user.rb +34 -0
  146. data/src/com/zoho/crm/api/users/users_operations.rb +6 -6
  147. data/src/com/zoho/crm/api/util/api_http_connector.rb +6 -5
  148. data/src/com/zoho/crm/api/util/common_api_handler.rb +5 -3
  149. data/src/com/zoho/crm/api/util/constants.rb +140 -15
  150. data/src/com/zoho/crm/api/util/converter.rb +30 -7
  151. data/src/com/zoho/crm/api/util/data_type_converter.rb +8 -2
  152. data/src/com/zoho/crm/api/util/form_data_converter.rb +4 -15
  153. data/src/com/zoho/crm/api/util/json_converter.rb +7 -9
  154. data/src/com/zoho/crm/api/util/module_fields_handler.rb +1 -1
  155. data/src/com/zoho/crm/api/util/utility.rb +274 -87
  156. data/src/com/zoho/crm/api/variable_groups/variable_groups_operations.rb +3 -3
  157. data/src/com/zoho/crm/api/variables/variables_operations.rb +9 -9
  158. data/src/com/zoho/crm/api/wizards/api_exception.rb +121 -0
  159. data/src/com/zoho/crm/api/wizards/button.rb +252 -0
  160. data/src/com/zoho/crm/api/wizards/chart_data.rb +118 -0
  161. data/src/com/zoho/crm/api/wizards/connection.rb +80 -0
  162. data/src/com/zoho/crm/api/wizards/container.rb +119 -0
  163. data/src/com/zoho/crm/api/wizards/node.rb +118 -0
  164. data/src/com/zoho/crm/api/wizards/response_handler.rb +10 -0
  165. data/src/com/zoho/crm/api/wizards/response_wrapper.rb +63 -0
  166. data/src/com/zoho/crm/api/wizards/screen.rb +99 -0
  167. data/src/com/zoho/crm/api/wizards/segment.rb +176 -0
  168. data/src/com/zoho/crm/api/wizards/transition.rb +80 -0
  169. data/src/com/zoho/crm/api/wizards/wizard.rb +273 -0
  170. data/src/com/zoho/crm/api/wizards/wizards_operations.rb +61 -0
  171. data/src/resources/JSONDetails.json +1 -1
  172. data/src/version.rb +1 -1
  173. metadata +92 -7
  174. data/src/com/zoho/crm/api/record/inventory_line_items.rb +0 -235
@@ -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
@@ -80,6 +80,23 @@ module Users
80
80
  add_key_value('signature', signature)
81
81
  end
82
82
 
83
+ # The method to get the sort_order_preference
84
+ # @return A String value
85
+
86
+ def sort_order_preference
87
+ get_key_value('sort_order_preference')
88
+ end
89
+
90
+ # The method to set the value to sort_order_preference
91
+ # @param sort_order_preference [String] A String
92
+
93
+ def sort_order_preference=(sort_order_preference)
94
+ if sort_order_preference!=nil and !sort_order_preference.is_a? String
95
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: sort_order_preference EXPECTED TYPE: String', nil, nil)
96
+ end
97
+ add_key_value('sort_order_preference', sort_order_preference)
98
+ end
99
+
83
100
  # The method to get the city
84
101
  # @return A String value
85
102
 
@@ -335,6 +352,23 @@ module Users
335
352
  add_key_value('country_locale', country_locale)
336
353
  end
337
354
 
355
+ # The method to get the sandboxdeveloper
356
+ # @return A Boolean value
357
+
358
+ def sandboxdeveloper
359
+ get_key_value('sandboxDeveloper')
360
+ end
361
+
362
+ # The method to set the value to sandboxdeveloper
363
+ # @param sandboxdeveloper [Boolean] A Boolean
364
+
365
+ def sandboxdeveloper=(sandboxdeveloper)
366
+ if sandboxdeveloper!=nil and ! [true, false].include?sandboxdeveloper
367
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: sandboxdeveloper EXPECTED TYPE: Boolean', nil, nil)
368
+ end
369
+ add_key_value('sandboxDeveloper', sandboxdeveloper)
370
+ end
371
+
338
372
  # The method to get the first_name
339
373
  # @return A String value
340
374
 
@@ -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
@@ -96,16 +96,17 @@ module Util
96
96
 
97
97
  def to_s
98
98
  req_headers = @headers.clone
99
- req_headers [Constants::AUTHORIZATION] = Constants::CANT_DISCLOSE
99
+ req_headers[Constants::AUTHORIZATION] = Constants::CANT_DISCLOSE
100
100
  @request_method + ' - ' + Constants::URL + ' = ' + @url + ', ' + Constants::HEADERS + ' = ' + req_headers.to_s + ', ' + Constants::PARAMS + ' = ' + @parameters.to_s
101
101
  end
102
102
 
103
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
104
106
  if request_proxy.user_name.nil?
105
- 'Proxy settings - Host : ' + request_proxy.host + ' , Port : ' + request_proxy.port.to_s
106
- else
107
- '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
108
108
  end
109
+ proxy_log
109
110
  end
110
111
  end
111
112
  end
@@ -121,10 +121,12 @@ module Handler
121
121
  unless response.body.nil?
122
122
  mime_type = headers[Constants::CONTENT_TYPE]
123
123
 
124
- mime_type = mime_type.split(';')[0] if mime_type.include? ';'
125
- converter_instance = get_converter_class_instance(mime_type.to_s.downcase)
124
+ unless mime_type.nil?
125
+ mime_type = mime_type.split(';')[0] if mime_type.include? ';'
126
+ converter_instance = get_converter_class_instance(mime_type.to_s.downcase)
126
127
 
127
- return_object = converter_instance.get_wrapped_response(response, class_name)
128
+ return_object = converter_instance.get_wrapped_response(response, class_name)
129
+ end
128
130
  end
129
131
 
130
132
  unless return_object.nil?
@@ -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,75 @@ class Constants
94
96
 
95
97
  HTTP = 'http'
96
98
 
99
+ INVENTORY_MODULES_ITEMS = ["invoiced_items", "quoted_items","purchase_items","ordered_items"]
100
+
101
+ PRODUCT_NAME = "Product_Name"
102
+
103
+ DEFAULT_MODULENAME_VS_APINAME = {
104
+
105
+ "leads" => "Leads",
106
+
107
+ "contacts" => "Contacts",
108
+
109
+ "accounts" => "Accounts",
110
+
111
+ "deals" => "Deals",
112
+
113
+ "tasks" => "Tasks",
114
+
115
+ "events" => "Events",
116
+
117
+ "activities" => "Activities",
118
+
119
+ "calls" => "Calls",
120
+
121
+ "products" => "Products",
122
+
123
+ "quotes" => "Quotes",
124
+
125
+ "sales_orders" => "Sales_Orders",
126
+
127
+ "purchase_orders" => "Purchase_Orders",
128
+
129
+ "invoices" => "Invoices",
130
+
131
+ "campaigns" => "Campaigns",
132
+
133
+ "vendors" => "Vendors",
134
+
135
+ "price_books" => "Price_Books",
136
+
137
+ "cases" => "Cases",
138
+
139
+ "solutions" => "Solutions",
140
+
141
+ "visits" => "Visits",
142
+
143
+ "approvals" => "Approvals",
144
+
145
+ "notes" => "Notes",
146
+
147
+ "attachments" => "Attachments",
148
+
149
+ "actions_performed" => "Actions_Performed",
150
+
151
+ }
152
+
153
+ USER_AGENT = "Mozilla/5.0"
154
+
155
+ USER_AGENT_KEY = "user-agent"
156
+
97
157
  CONTENT_API_URL = 'content.zohoapis.com'
98
158
 
99
159
  INVALID_URL_ERROR = 'Invalid URI Error'
100
160
 
101
161
  ZOHO_SDK = 'X-ZOHO-SDK'
102
162
 
103
- SDK_VERSION = '2.0.0'
163
+ SDK_VERSION = '3.0.1'
104
164
 
105
- SET_TO_CONTENT_TYPE = ['/crm/bulk/v2/read', '/crm/bulk/v2/write']
165
+ SET_CONTENT_TYPE_HEADER = ['/crm/bulk/v2.1/read', '/crm/bulk/v2.1/write']
166
+
167
+ RESOURCE_PATH_INVALID_ERROR_MESSAGE = "Resource Path MUST be a valid directory."
106
168
 
107
169
  IS_GENERATE_REQUEST_BODY =[REQUEST_METHOD_POST,REQUEST_METHOD_PUT,REQUEST_METHOD_PATCH]
108
170
 
@@ -112,9 +174,9 @@ class Constants
112
174
 
113
175
  CRM = "crm"
114
176
 
115
- API_VERSION = "v2"
177
+ API_VERSION = "v2.1"
116
178
 
117
- PHOTO_SUPPORTED_MODULES = ["leads", "contacts", "accounts", "products", "vendors"]
179
+ PHOTO_SUPPORTED_MODULES = ["Leads", "Contacts", "Accounts", "Products", "Vendors", "Deals", "Cases", "Solutions"]
118
180
 
119
181
  PARAMETER_NULL_ERROR = 'NULL PARAMETER ERROR'
120
182
 
@@ -142,9 +204,9 @@ class Constants
142
204
 
143
205
  NULL_VALUE_ERROR_MESSAGE = ' MUST NOT be null'
144
206
 
145
- PARAM_INSTANCE_NULL_ERROR = 'Param<T> Instance MUST NOT be null'
207
+ PARAM_INSTANCE_NULL_ERROR = 'Param Instance MUST NOT be null'
146
208
 
147
- HEADER_INSTANCE_NULL_ERROR = 'Header<T> Instance MUST NOT be null'
209
+ HEADER_INSTANCE_NULL_ERROR = 'Header Instance MUST NOT be null'
148
210
 
149
211
  SDK_UNINITIALIZATION_ERROR = 'SDK UNINITIALIZED ERROR'
150
212
 
@@ -152,6 +214,8 @@ class Constants
152
214
 
153
215
  MYSQL_HOST = 'localhost'
154
216
 
217
+ LINEITEM_PRODUCT = "com.zoho.crm.api.record.LineItemProduct"
218
+
155
219
  REFRESH_TOKEN_MESSAGE = 'Access Token has expired. Hence refreshing.'
156
220
 
157
221
  MYSQL_DATABASE_NAME = 'zohooauth'
@@ -168,6 +232,16 @@ class Constants
168
232
 
169
233
  EXPIRY_TIME = 'expiry_time'
170
234
 
235
+ PROXY_SETTINGS = "Proxy settings - "
236
+
237
+ PROXY_HOST = "Host: "
238
+
239
+ PROXY_PORT = "Port: "
240
+
241
+ PROXY_USER = "User: "
242
+
243
+ PROXY_DOMAIN = "Domain: "
244
+
171
245
  USER_MAIL_NULL_ERROR = 'USER MAIL NULL ERROR'
172
246
 
173
247
  USER_MAIL_NULL_ERROR_MESSAGE = 'User Mail MUST NOT be null. Use setUserMail() to set value.'
@@ -178,6 +252,10 @@ class Constants
178
252
 
179
253
  GET_TOKEN_DB_ERROR = 'Exception in get_token - DBStore:'
180
254
 
255
+ GET_TOKEN_BY_ID_DB_ERROR = "Exception in getTokenById - DBStore : Given ID is invalid"
256
+
257
+ GET_TOKEN_BY_ID_FILE_ERROR = "Exception in getTokenById - FileStore : Given ID is invalid"
258
+
181
259
  GET_TOKENS_DB_ERROR = 'Exception in get_tokens - DBStore:'
182
260
 
183
261
  DELETE_TOKEN_DB_ERROR = 'Exception in delete_token - DBStore:'
@@ -188,6 +266,8 @@ class Constants
188
266
 
189
267
  GET_TOKEN_FILE_ERROR = 'Exception in get_token - FileStore:'
190
268
 
269
+ LOGGER_INITIALIZATION_ERROR = "Exception in Logger Initialization : "
270
+
191
271
  REFRESH_SINGLE_MODULE_FIELDS_ERROR = 'Exception in refreshing fields of module : '
192
272
 
193
273
  REFRESH_ALL_MODULE_FIELDS_ERROR = 'Exception in refreshing fields of all modules : '
@@ -214,8 +294,6 @@ class Constants
214
294
 
215
295
  DELETE_TOKENS_FILE_ERROR = 'Exception in delete_tokens - FileStore:'
216
296
 
217
- SDK_LOGGER_INITIALIZE = 'Exception in Logger Initialization'
218
-
219
297
  DELETE_MODULE_FROM_FIELDFILE_ERROR = 'Exception in deleting module from Fields file'
220
298
 
221
299
  DELETE_FIELD_FILE_ERROR = 'Exception in deleting Current User Fields file'
@@ -230,7 +308,25 @@ class Constants
230
308
 
231
309
  GIVEN_VALUE = "given-value"
232
310
 
233
- PHOTO_UPLOAD_ERROR_MESSAGE = "The given module is not supported in API.";
311
+ MULTI_SELECT_LOOKUP = "multiselectlookup"
312
+
313
+ MULTI_USER_LOOKUP = "multiuserlookup"
314
+
315
+ TERRITORIES = "territories"
316
+
317
+ GENERATED_TYPE = "generated_type"
318
+
319
+ GENERATED_TYPE_CUSTOM = "custom"
320
+
321
+ UPLOAD_PHOTO_UNSUPPORTED_MESSAGE = "Photo Upload Operation is not supported by the module: "
322
+
323
+ SDK_MODULE_METADATA = "SDK-MODULE-METADATA"
324
+
325
+ INVALID_MODULE_API_NAME_ERROR = "INVALID MODULE API NAME ERROR"
326
+
327
+ PROVIDE_VALID_MODULE_API_NAME = "PROVIDE VALID MODULE API NAME: "
328
+
329
+ UPLOAD_PHOTO_UNSUPPORTED_ERROR = "UPLOAD PHOTO UNSUPPORTED MODULE"
234
330
 
235
331
  INVALID_MODULE = "INVALID_MODULE"
236
332
 
@@ -261,6 +357,8 @@ class Constants
261
357
  REQUEST_CATEGORY_UPDATE = 'UPDATE'
262
358
 
263
359
  MODULEPACKAGENAME = 'modulePackageName'
360
+
361
+ MYSQL_TABLE_NAME = "oauthtoken"
264
362
 
265
363
  INITIALIZATION_SUCCESSFUL = 'Initialization successful'
266
364
 
@@ -296,6 +394,8 @@ class Constants
296
394
 
297
395
  CASES = 'cases'
298
396
 
397
+ DISCOUNT = "DISCOUNT"
398
+
299
399
  CANT_DISCLOSE = " ## can't disclose ## "
300
400
 
301
401
  APPLICATION_FORM_URLENCODED = 'application/x-www-form-urlencoded'
@@ -493,19 +593,23 @@ class Constants
493
593
  HOST_ERROR_MESSAGE = 'Host MUST NOT be null.'
494
594
 
495
595
  PORT_ERROR_MESSAGE = 'Port MUST NOT be null.'
596
+
597
+ REQUEST_PROXY_ERROR_MESSAGE = "request_proxy must be instance of Request Proxy"
598
+
599
+ USER_SIGNATURE_ERROR_MESSAGE = "user must be instance of UserSignature."
496
600
 
497
- USERSIGNATURE_ERROR_MESSAGE = "UserSignature MUST NOT be null."
498
-
499
- ENVIRONMENT_ERROR_MESSAGE = "Environment MUST NOT be null."
601
+ ENVIRONMENT_ERROR_MESSAGE = "environment must be instance of Environment."
500
602
 
501
- SDK_CONFIG_ERROR_MESSAGE = "sdkConfig MUST NOT be null."
603
+ SDK_CONFIG_ERROR_MESSAGE = "sdk_config must be instance of sdkConfig."
502
604
 
503
- TOKEN_ERROR_MESSAGE = "Token MUST NOT be null."
605
+ TOKEN_ERROR_MESSAGE = "token must be instance of Token."
504
606
 
505
- STORE_ERROR_MESSAGE = "Store MUST NOT be null."
607
+ STORE_ERROR_MESSAGE = "store must be instance of Store."
506
608
 
507
609
  INITIALIZATION_EXCEPTION = 'Exception in initialization'
508
610
 
611
+ SWITCH_USER_EXCEPTION = 'Exception in Switch user'
612
+
509
613
  SWITCH_USER_ERROR = "SWITCH USER ERROR"
510
614
 
511
615
  EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
@@ -528,9 +632,30 @@ class Constants
528
632
 
529
633
  ATTACHMENTS = '$attachments'
530
634
 
635
+ TERRITORY_NAMESPACE = 'com.zoho.crm.api.record.Territory'
636
+
637
+ IMAGEUPLOAD_NAMESPACE = 'com.zoho.crm.api.record.ImageUpload'
638
+
531
639
  ATTACHMENTS_NAMESPACE = 'com.zoho.crm.api.attachments.Attachment'
532
640
 
533
641
  PICKLIST = 'picklist'
534
642
 
535
643
  CONSENT_NAMESPACE = 'com.zoho.crm.api.record.Consent'
644
+
645
+ INVALID_TOKEN_ERROR = "INVALID TOKEN ERROR"
646
+
647
+ NO_ACCESS_TOKEN_ERROR = "ACCESS TOKEN IS NOT PRESENT IN RESPONSE"
648
+
649
+ CLIENT_ID_NULL_ERROR_MESSAGE = "ClientID MUST NOT be null"
650
+
651
+ CLIENT_SECRET_NULL_ERROR_MESSAGE = "ClientSecret MUST NOT be null"
652
+
653
+ TAX_NAMESPACE = "com.zoho.crm.api.record.Tax"
654
+
655
+ PRODUCTS = "Products"
656
+
657
+ TAX = "TAX"
658
+
659
+ TERRITORY = "Territory"
660
+
536
661
  end