ZCRMSDK 2.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -10,6 +10,7 @@ module Record
10
10
  @name = nil
11
11
  @id = nil
12
12
  @value = nil
13
+ @display_name = nil
13
14
  @key_modified = Hash.new
14
15
  end
15
16
 
@@ -85,6 +86,24 @@ module Record
85
86
  @key_modified['value'] = 1
86
87
  end
87
88
 
89
+ # The method to get the display_name
90
+ # @return A String value
91
+
92
+ def display_name
93
+ @display_name
94
+ end
95
+
96
+ # The method to set the value to display_name
97
+ # @param display_name [String] A String
98
+
99
+ def display_name=(display_name)
100
+ if display_name!=nil and !display_name.is_a? String
101
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: display_name EXPECTED TYPE: String', nil, nil)
102
+ end
103
+ @display_name = display_name
104
+ @key_modified['display_name'] = 1
105
+ end
106
+
88
107
  # The method to check if the user has modified the given key
89
108
  # @param key [String] A String
90
109
  # @return A Integer value
@@ -70,18 +70,18 @@ module Record
70
70
  end
71
71
 
72
72
  # The method to get the territory
73
- # @return An instance of Territory
73
+ # @return An instance of MassUpdateTerritory
74
74
 
75
75
  def territory
76
76
  @territory
77
77
  end
78
78
 
79
79
  # The method to set the value to territory
80
- # @param territory [Territory] An instance of Territory
80
+ # @param territory [MassUpdateTerritory] An instance of MassUpdateTerritory
81
81
 
82
82
  def territory=(territory)
83
- if territory!=nil and !territory.is_a? Territory
84
- raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: territory EXPECTED TYPE: Territory', nil, nil)
83
+ if territory!=nil and !territory.is_a? MassUpdateTerritory
84
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: territory EXPECTED TYPE: MassUpdateTerritory', nil, nil)
85
85
  end
86
86
  @territory = territory
87
87
  @key_modified['territory'] = 1
@@ -0,0 +1,80 @@
1
+ require_relative '../util/model'
2
+
3
+ module Record
4
+ class MassUpdateTerritory
5
+ include Util::Model
6
+
7
+ # Creates an instance of MassUpdateTerritory
8
+ def initialize
9
+ @id = nil
10
+ @include_child = nil
11
+ @key_modified = Hash.new
12
+ end
13
+
14
+ # The method to get the id
15
+ # @return A Integer value
16
+
17
+ def id
18
+ @id
19
+ end
20
+
21
+ # The method to set the value to id
22
+ # @param id [Integer] A Integer
23
+
24
+ def id=(id)
25
+ if id!=nil and !id.is_a? Integer
26
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: Integer', nil, nil)
27
+ end
28
+ @id = id
29
+ @key_modified['id'] = 1
30
+ end
31
+
32
+ # The method to get the include_child
33
+ # @return A Boolean value
34
+
35
+ def include_child
36
+ @include_child
37
+ end
38
+
39
+ # The method to set the value to include_child
40
+ # @param include_child [Boolean] A Boolean
41
+
42
+ def include_child=(include_child)
43
+ if include_child!=nil and ! [true, false].include?include_child
44
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: include_child EXPECTED TYPE: Boolean', nil, nil)
45
+ end
46
+ @include_child = include_child
47
+ @key_modified['include_child'] = 1
48
+ end
49
+
50
+ # The method to check if the user has modified the given key
51
+ # @param key [String] A String
52
+ # @return A Integer value
53
+
54
+ def is_key_modified(key)
55
+ if key!=nil and !key.is_a? String
56
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
57
+ end
58
+ if @key_modified.key?(key)
59
+ return @key_modified[key]
60
+ end
61
+
62
+ nil
63
+ end
64
+
65
+ # The method to mark the given key as modified
66
+ # @param key [String] A String
67
+ # @param modification [Integer] A Integer
68
+
69
+ def set_key_modified(key, modification)
70
+ if key!=nil and !key.is_a? String
71
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
72
+ end
73
+ if modification!=nil and !modification.is_a? Integer
74
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: Integer', nil, nil)
75
+ end
76
+ @key_modified[key] = modification
77
+ end
78
+
79
+ end
80
+ end
@@ -0,0 +1,99 @@
1
+ require_relative '../util/model'
2
+
3
+ module Record
4
+ class MultiSelectLookup
5
+ include Util::Model
6
+
7
+ # Creates an instance of MultiSelectLookup
8
+ def initialize
9
+ @id = nil
10
+ @fieldname = nil
11
+ @has_more = nil
12
+ @key_modified = Hash.new
13
+ end
14
+
15
+ # The method to get the id
16
+ # @return A Integer value
17
+
18
+ def id
19
+ @id
20
+ end
21
+
22
+ # The method to set the value to id
23
+ # @param id [Integer] A Integer
24
+
25
+ def id=(id)
26
+ if id!=nil and !id.is_a? Integer
27
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: Integer', nil, nil)
28
+ end
29
+ @id = id
30
+ @key_modified['id'] = 1
31
+ end
32
+
33
+ # The method to get the fieldname
34
+ # @return An instance of Hash
35
+
36
+ def fieldname
37
+ @fieldname
38
+ end
39
+
40
+ # The method to set the value to fieldname
41
+ # @param fieldname [Hash] An instance of Hash
42
+
43
+ def fieldname=(fieldname)
44
+ if fieldname!=nil and !fieldname.is_a? Hash
45
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: fieldname EXPECTED TYPE: Hash', nil, nil)
46
+ end
47
+ @fieldname = fieldname
48
+ @key_modified['fieldName'] = 1
49
+ end
50
+
51
+ # The method to get the has_more
52
+ # @return An instance of Hash
53
+
54
+ def has_more
55
+ @has_more
56
+ end
57
+
58
+ # The method to set the value to has_more
59
+ # @param has_more [Hash] An instance of Hash
60
+
61
+ def has_more=(has_more)
62
+ if has_more!=nil and !has_more.is_a? Hash
63
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: has_more EXPECTED TYPE: Hash', nil, nil)
64
+ end
65
+ @has_more = has_more
66
+ @key_modified['$has_more'] = 1
67
+ end
68
+
69
+ # The method to check if the user has modified the given key
70
+ # @param key [String] A String
71
+ # @return A Integer value
72
+
73
+ def is_key_modified(key)
74
+ if key!=nil and !key.is_a? String
75
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
76
+ end
77
+ if @key_modified.key?(key)
78
+ return @key_modified[key]
79
+ end
80
+
81
+ nil
82
+ end
83
+
84
+ # The method to mark the given key as modified
85
+ # @param key [String] A String
86
+ # @param modification [Integer] A Integer
87
+
88
+ def set_key_modified(key, modification)
89
+ if key!=nil and !key.is_a? String
90
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
91
+ end
92
+ if modification!=nil and !modification.is_a? Integer
93
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: Integer', nil, nil)
94
+ end
95
+ @key_modified[key] = modification
96
+ end
97
+
98
+ end
99
+ end
@@ -0,0 +1,80 @@
1
+ require_relative '../util/model'
2
+
3
+ module Record
4
+ class MultiSelectPicklist
5
+ include Util::Model
6
+
7
+ # Creates an instance of MultiSelectPicklist
8
+ def initialize
9
+ @id = nil
10
+ @fieldname = nil
11
+ @key_modified = Hash.new
12
+ end
13
+
14
+ # The method to get the id
15
+ # @return A Integer value
16
+
17
+ def id
18
+ @id
19
+ end
20
+
21
+ # The method to set the value to id
22
+ # @param id [Integer] A Integer
23
+
24
+ def id=(id)
25
+ if id!=nil and !id.is_a? Integer
26
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: Integer', nil, nil)
27
+ end
28
+ @id = id
29
+ @key_modified['id'] = 1
30
+ end
31
+
32
+ # The method to get the fieldname
33
+ # @return An instance of Hash
34
+
35
+ def fieldname
36
+ @fieldname
37
+ end
38
+
39
+ # The method to set the value to fieldname
40
+ # @param fieldname [Hash] An instance of Hash
41
+
42
+ def fieldname=(fieldname)
43
+ if fieldname!=nil and !fieldname.is_a? Hash
44
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: fieldname EXPECTED TYPE: Hash', nil, nil)
45
+ end
46
+ @fieldname = fieldname
47
+ @key_modified['fieldName'] = 1
48
+ end
49
+
50
+ # The method to check if the user has modified the given key
51
+ # @param key [String] A String
52
+ # @return A Integer value
53
+
54
+ def is_key_modified(key)
55
+ if key!=nil and !key.is_a? String
56
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
57
+ end
58
+ if @key_modified.key?(key)
59
+ return @key_modified[key]
60
+ end
61
+
62
+ nil
63
+ end
64
+
65
+ # The method to mark the given key as modified
66
+ # @param key [String] A String
67
+ # @param modification [Integer] A Integer
68
+
69
+ def set_key_modified(key, modification)
70
+ if key!=nil and !key.is_a? String
71
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
72
+ end
73
+ if modification!=nil and !modification.is_a? Integer
74
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: Integer', nil, nil)
75
+ end
76
+ @key_modified[key] = modification
77
+ end
78
+
79
+ end
80
+ end
@@ -0,0 +1,31 @@
1
+ require_relative '../record/record'
2
+ require_relative '../util/model'
3
+
4
+ module Record
5
+ class PriceBook < Record
6
+ include Util::Model
7
+
8
+ # Creates an instance of PriceBook
9
+ def initialize
10
+ super
11
+ end
12
+
13
+ # The method to get the name
14
+ # @return A String value
15
+
16
+ def name
17
+ get_key_value('name')
18
+ end
19
+
20
+ # The method to set the value to name
21
+ # @param name [String] A String
22
+
23
+ def name=(name)
24
+ if name!=nil and !name.is_a? String
25
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: String', nil, nil)
26
+ end
27
+ add_key_value('name', name)
28
+ end
29
+
30
+ end
31
+ end
@@ -37,7 +37,7 @@ module Record
37
37
  end
38
38
  handler_instance = Handler::CommonAPIHandler.new
39
39
  api_path = ''
40
- api_path = api_path + '/crm/v2/'
40
+ api_path = api_path + '/crm/v2.1/'
41
41
  api_path = api_path + module_api_name.to_s
42
42
  api_path = api_path + '/'
43
43
  api_path = api_path + id.to_s
@@ -46,7 +46,7 @@ module Record
46
46
  handler_instance.category_method = 'READ'
47
47
  handler_instance.param = param_instance
48
48
  handler_instance.header = header_instance
49
- Util::Utility.get_fields(module_api_name)
49
+ Util::Utility.get_fields(module_api_name, handler_instance)
50
50
  handler_instance.module_api_name = module_api_name
51
51
  require_relative 'response_handler'
52
52
  handler_instance.api_call(ResponseHandler.name, 'application/json')
@@ -70,7 +70,7 @@ module Record
70
70
  end
71
71
  handler_instance = Handler::CommonAPIHandler.new
72
72
  api_path = ''
73
- api_path = api_path + '/crm/v2/'
73
+ api_path = api_path + '/crm/v2.1/'
74
74
  api_path = api_path + module_api_name.to_s
75
75
  api_path = api_path + '/'
76
76
  api_path = api_path + id.to_s
@@ -79,7 +79,7 @@ module Record
79
79
  handler_instance.category_method = 'UPDATE'
80
80
  handler_instance.content_type = 'application/json'
81
81
  handler_instance.request = request
82
- Util::Utility.get_fields(module_api_name)
82
+ Util::Utility.get_fields(module_api_name, handler_instance)
83
83
  handler_instance.module_api_name = module_api_name
84
84
  require_relative 'action_handler'
85
85
  handler_instance.api_call(ActionHandler.name, 'application/json')
@@ -103,7 +103,7 @@ module Record
103
103
  end
104
104
  handler_instance = Handler::CommonAPIHandler.new
105
105
  api_path = ''
106
- api_path = api_path + '/crm/v2/'
106
+ api_path = api_path + '/crm/v2.1/'
107
107
  api_path = api_path + module_api_name.to_s
108
108
  api_path = api_path + '/'
109
109
  api_path = api_path + id.to_s
@@ -133,14 +133,14 @@ module Record
133
133
  end
134
134
  handler_instance = Handler::CommonAPIHandler.new
135
135
  api_path = ''
136
- api_path = api_path + '/crm/v2/'
136
+ api_path = api_path + '/crm/v2.1/'
137
137
  api_path = api_path + module_api_name.to_s
138
138
  handler_instance.api_path = api_path
139
139
  handler_instance.http_method = Constants::REQUEST_METHOD_GET
140
140
  handler_instance.category_method = 'READ'
141
141
  handler_instance.param = param_instance
142
142
  handler_instance.header = header_instance
143
- Util::Utility.get_fields(module_api_name)
143
+ Util::Utility.get_fields(module_api_name, handler_instance)
144
144
  handler_instance.module_api_name = module_api_name
145
145
  require_relative 'response_handler'
146
146
  handler_instance.api_call(ResponseHandler.name, 'application/json')
@@ -160,7 +160,7 @@ module Record
160
160
  end
161
161
  handler_instance = Handler::CommonAPIHandler.new
162
162
  api_path = ''
163
- api_path = api_path + '/crm/v2/'
163
+ api_path = api_path + '/crm/v2.1/'
164
164
  api_path = api_path + module_api_name.to_s
165
165
  handler_instance.api_path = api_path
166
166
  handler_instance.http_method = Constants::REQUEST_METHOD_POST
@@ -168,7 +168,7 @@ module Record
168
168
  handler_instance.content_type = 'application/json'
169
169
  handler_instance.request = request
170
170
  handler_instance.mandatory_checker = true
171
- Util::Utility.get_fields(module_api_name)
171
+ Util::Utility.get_fields(module_api_name, handler_instance)
172
172
  handler_instance.module_api_name = module_api_name
173
173
  require_relative 'action_handler'
174
174
  handler_instance.api_call(ActionHandler.name, 'application/json')
@@ -188,7 +188,7 @@ module Record
188
188
  end
189
189
  handler_instance = Handler::CommonAPIHandler.new
190
190
  api_path = ''
191
- api_path = api_path + '/crm/v2/'
191
+ api_path = api_path + '/crm/v2.1/'
192
192
  api_path = api_path + module_api_name.to_s
193
193
  handler_instance.api_path = api_path
194
194
  handler_instance.http_method = Constants::REQUEST_METHOD_PUT
@@ -196,7 +196,7 @@ module Record
196
196
  handler_instance.content_type = 'application/json'
197
197
  handler_instance.request = request
198
198
  handler_instance.mandatory_checker = true
199
- Util::Utility.get_fields(module_api_name)
199
+ Util::Utility.get_fields(module_api_name, handler_instance)
200
200
  handler_instance.module_api_name = module_api_name
201
201
  require_relative 'action_handler'
202
202
  handler_instance.api_call(ActionHandler.name, 'application/json')
@@ -216,7 +216,7 @@ module Record
216
216
  end
217
217
  handler_instance = Handler::CommonAPIHandler.new
218
218
  api_path = ''
219
- api_path = api_path + '/crm/v2/'
219
+ api_path = api_path + '/crm/v2.1/'
220
220
  api_path = api_path + module_api_name.to_s
221
221
  handler_instance.api_path = api_path
222
222
  handler_instance.http_method = Constants::REQUEST_METHOD_DELETE
@@ -240,7 +240,7 @@ module Record
240
240
  end
241
241
  handler_instance = Handler::CommonAPIHandler.new
242
242
  api_path = ''
243
- api_path = api_path + '/crm/v2/'
243
+ api_path = api_path + '/crm/v2.1/'
244
244
  api_path = api_path + module_api_name.to_s
245
245
  api_path = api_path + '/upsert'
246
246
  handler_instance.api_path = api_path
@@ -248,7 +248,7 @@ module Record
248
248
  handler_instance.category_method = 'ACTION'
249
249
  handler_instance.content_type = 'application/json'
250
250
  handler_instance.request = request
251
- Util::Utility.get_fields(module_api_name)
251
+ Util::Utility.get_fields(module_api_name, handler_instance)
252
252
  handler_instance.module_api_name = module_api_name
253
253
  require_relative 'action_handler'
254
254
  handler_instance.api_call(ActionHandler.name, 'application/json')
@@ -272,7 +272,7 @@ module Record
272
272
  end
273
273
  handler_instance = Handler::CommonAPIHandler.new
274
274
  api_path = ''
275
- api_path = api_path + '/crm/v2/'
275
+ api_path = api_path + '/crm/v2.1/'
276
276
  api_path = api_path + module_api_name.to_s
277
277
  api_path = api_path + '/deleted'
278
278
  handler_instance.api_path = api_path
@@ -298,14 +298,14 @@ module Record
298
298
  end
299
299
  handler_instance = Handler::CommonAPIHandler.new
300
300
  api_path = ''
301
- api_path = api_path + '/crm/v2/'
301
+ api_path = api_path + '/crm/v2.1/'
302
302
  api_path = api_path + module_api_name.to_s
303
303
  api_path = api_path + '/search'
304
304
  handler_instance.api_path = api_path
305
305
  handler_instance.http_method = Constants::REQUEST_METHOD_GET
306
306
  handler_instance.category_method = 'READ'
307
307
  handler_instance.param = param_instance
308
- Util::Utility.get_fields(module_api_name)
308
+ Util::Utility.get_fields(module_api_name, handler_instance)
309
309
  handler_instance.module_api_name = module_api_name
310
310
  require_relative 'response_handler'
311
311
  handler_instance.api_call(ResponseHandler.name, 'application/json')
@@ -325,7 +325,7 @@ module Record
325
325
  end
326
326
  handler_instance = Handler::CommonAPIHandler.new
327
327
  api_path = ''
328
- api_path = api_path + '/crm/v2/Leads/'
328
+ api_path = api_path + '/crm/v2.1/Leads/'
329
329
  api_path = api_path + id.to_s
330
330
  api_path = api_path + '/actions/convert'
331
331
  handler_instance.api_path = api_path
@@ -334,7 +334,7 @@ module Record
334
334
  handler_instance.content_type = 'application/json'
335
335
  handler_instance.request = request
336
336
  handler_instance.mandatory_checker = true
337
- Util::Utility.get_fields("Deals")
337
+ Util::Utility.get_fields("Deals", handler_instance)
338
338
  require_relative 'convert_action_handler'
339
339
  handler_instance.api_call(ConvertActionHandler.name, 'application/json')
340
340
  end
@@ -353,7 +353,7 @@ module Record
353
353
  end
354
354
  handler_instance = Handler::CommonAPIHandler.new
355
355
  api_path = ''
356
- api_path = api_path + '/crm/v2/'
356
+ api_path = api_path + '/crm/v2.1/'
357
357
  api_path = api_path + module_api_name.to_s
358
358
  api_path = api_path + '/'
359
359
  api_path = api_path + id.to_s
@@ -383,7 +383,7 @@ module Record
383
383
  end
384
384
  handler_instance = Handler::CommonAPIHandler.new
385
385
  api_path = ''
386
- api_path = api_path + '/crm/v2/'
386
+ api_path = api_path + '/crm/v2.1/'
387
387
  api_path = api_path + module_api_name.to_s
388
388
  api_path = api_path + '/'
389
389
  api_path = api_path + id.to_s
@@ -394,7 +394,7 @@ module Record
394
394
  handler_instance.content_type = 'multipart/form-data'
395
395
  handler_instance.request = request
396
396
  handler_instance.mandatory_checker = true
397
- Util::Utility.get_modules()
397
+ Util::Utility.verify_photo_support(module_api_name)
398
398
  require_relative 'file_handler'
399
399
  handler_instance.api_call(FileHandler.name, 'application/json')
400
400
  end
@@ -413,7 +413,7 @@ module Record
413
413
  end
414
414
  handler_instance = Handler::CommonAPIHandler.new
415
415
  api_path = ''
416
- api_path = api_path + '/crm/v2/'
416
+ api_path = api_path + '/crm/v2.1/'
417
417
  api_path = api_path + module_api_name.to_s
418
418
  api_path = api_path + '/'
419
419
  api_path = api_path + id.to_s
@@ -439,7 +439,7 @@ module Record
439
439
  end
440
440
  handler_instance = Handler::CommonAPIHandler.new
441
441
  api_path = ''
442
- api_path = api_path + '/crm/v2/'
442
+ api_path = api_path + '/crm/v2.1/'
443
443
  api_path = api_path + module_api_name.to_s
444
444
  api_path = api_path + '/actions/mass_update'
445
445
  handler_instance.api_path = api_path
@@ -448,7 +448,7 @@ module Record
448
448
  handler_instance.content_type = 'application/json'
449
449
  handler_instance.request = request
450
450
  handler_instance.mandatory_checker = true
451
- Util::Utility.get_fields(module_api_name)
451
+ Util::Utility.get_fields(module_api_name, handler_instance)
452
452
  handler_instance.module_api_name = module_api_name
453
453
  require_relative 'mass_update_action_handler'
454
454
  handler_instance.api_call(MassUpdateActionHandler.name, 'application/json')
@@ -468,7 +468,7 @@ module Record
468
468
  end
469
469
  handler_instance = Handler::CommonAPIHandler.new
470
470
  api_path = ''
471
- api_path = api_path + '/crm/v2/'
471
+ api_path = api_path + '/crm/v2.1/'
472
472
  api_path = api_path + module_api_name.to_s
473
473
  api_path = api_path + '/actions/mass_update'
474
474
  handler_instance.api_path = api_path
@@ -479,6 +479,157 @@ module Record
479
479
  handler_instance.api_call(MassUpdateResponseHandler.name, 'application/json')
480
480
  end
481
481
 
482
+ # The method to assign territories to multiple records
483
+ # @param module_api_name [String] A String
484
+ # @param request [BodyWrapper] An instance of BodyWrapper
485
+ # @return An instance of APIResponse
486
+ # @raise SDKException
487
+ def assign_territories_to_multiple_records(module_api_name, request)
488
+ if !module_api_name.is_a? String
489
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: module_api_name EXPECTED TYPE: String', nil, nil)
490
+ end
491
+ if request!=nil and !request.is_a? BodyWrapper
492
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', nil, nil)
493
+ end
494
+ handler_instance = Handler::CommonAPIHandler.new
495
+ api_path = ''
496
+ api_path = api_path + '/crm/v2.1/'
497
+ api_path = api_path + module_api_name.to_s
498
+ api_path = api_path + '/actions/assign_territories'
499
+ handler_instance.api_path = api_path
500
+ handler_instance.http_method = Constants::REQUEST_METHOD_POST
501
+ handler_instance.category_method = 'UPDATE'
502
+ handler_instance.content_type = 'application/json'
503
+ handler_instance.request = request
504
+ handler_instance.mandatory_checker = true
505
+ Util::Utility.get_fields(module_api_name, handler_instance)
506
+ handler_instance.module_api_name = module_api_name
507
+ require_relative 'action_handler'
508
+ handler_instance.api_call(ActionHandler.name, 'application/json')
509
+ end
510
+
511
+ # The method to assign territory to record
512
+ # @param module_api_name [String] A String
513
+ # @param id [Integer] A Integer
514
+ # @param request [BodyWrapper] An instance of BodyWrapper
515
+ # @return An instance of APIResponse
516
+ # @raise SDKException
517
+ def assign_territory_to_record(module_api_name, id, request)
518
+ if !module_api_name.is_a? String
519
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: module_api_name EXPECTED TYPE: String', nil, nil)
520
+ end
521
+ if !id.is_a? Integer
522
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: Integer', nil, nil)
523
+ end
524
+ if request!=nil and !request.is_a? BodyWrapper
525
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', nil, nil)
526
+ end
527
+ handler_instance = Handler::CommonAPIHandler.new
528
+ api_path = ''
529
+ api_path = api_path + '/crm/v2.1/'
530
+ api_path = api_path + module_api_name.to_s
531
+ api_path = api_path + '/'
532
+ api_path = api_path + id.to_s
533
+ api_path = api_path + '/actions/assign_territories'
534
+ handler_instance.api_path = api_path
535
+ handler_instance.http_method = Constants::REQUEST_METHOD_POST
536
+ handler_instance.category_method = 'UPDATE'
537
+ handler_instance.content_type = 'application/json'
538
+ handler_instance.request = request
539
+ Util::Utility.get_fields(module_api_name, handler_instance)
540
+ handler_instance.module_api_name = module_api_name
541
+ require_relative 'action_handler'
542
+ handler_instance.api_call(ActionHandler.name, 'application/json')
543
+ end
544
+
545
+ # The method to remove territories from multiple records
546
+ # @param module_api_name [String] A String
547
+ # @param request [BodyWrapper] An instance of BodyWrapper
548
+ # @return An instance of APIResponse
549
+ # @raise SDKException
550
+ def remove_territories_from_multiple_records(module_api_name, request)
551
+ if !module_api_name.is_a? String
552
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: module_api_name EXPECTED TYPE: String', nil, nil)
553
+ end
554
+ if request!=nil and !request.is_a? BodyWrapper
555
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', nil, nil)
556
+ end
557
+ handler_instance = Handler::CommonAPIHandler.new
558
+ api_path = ''
559
+ api_path = api_path + '/crm/v2.1/'
560
+ api_path = api_path + module_api_name.to_s
561
+ api_path = api_path + '/actions/remove_territories'
562
+ handler_instance.api_path = api_path
563
+ handler_instance.http_method = Constants::REQUEST_METHOD_POST
564
+ handler_instance.category_method = 'UPDATE'
565
+ handler_instance.content_type = 'application/json'
566
+ handler_instance.request = request
567
+ handler_instance.mandatory_checker = true
568
+ Util::Utility.get_fields(module_api_name, handler_instance)
569
+ handler_instance.module_api_name = module_api_name
570
+ require_relative 'action_handler'
571
+ handler_instance.api_call(ActionHandler.name, 'application/json')
572
+ end
573
+
574
+ # The method to remove territories from record
575
+ # @param module_api_name [String] A String
576
+ # @param id [Integer] A Integer
577
+ # @param request [BodyWrapper] An instance of BodyWrapper
578
+ # @return An instance of APIResponse
579
+ # @raise SDKException
580
+ def remove_territories_from_record(module_api_name, id, request)
581
+ if !module_api_name.is_a? String
582
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: module_api_name EXPECTED TYPE: String', nil, nil)
583
+ end
584
+ if !id.is_a? Integer
585
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: Integer', nil, nil)
586
+ end
587
+ if request!=nil and !request.is_a? BodyWrapper
588
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', nil, nil)
589
+ end
590
+ handler_instance = Handler::CommonAPIHandler.new
591
+ api_path = ''
592
+ api_path = api_path + '/crm/v2.1/'
593
+ api_path = api_path + module_api_name.to_s
594
+ api_path = api_path + '/'
595
+ api_path = api_path + id.to_s
596
+ api_path = api_path + '/actions/remove_territories'
597
+ handler_instance.api_path = api_path
598
+ handler_instance.http_method = Constants::REQUEST_METHOD_POST
599
+ handler_instance.category_method = 'UPDATE'
600
+ handler_instance.content_type = 'application/json'
601
+ handler_instance.request = request
602
+ Util::Utility.get_fields(module_api_name, handler_instance)
603
+ handler_instance.module_api_name = module_api_name
604
+ require_relative 'action_handler'
605
+ handler_instance.api_call(ActionHandler.name, 'application/json')
606
+ end
607
+
608
+ # The method to record count
609
+ # @param module_api_name [String] A String
610
+ # @param param_instance [ParameterMap] An instance of ParameterMap
611
+ # @return An instance of APIResponse
612
+ # @raise SDKException
613
+ def record_count(module_api_name, param_instance=nil)
614
+ if !module_api_name.is_a? String
615
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: module_api_name EXPECTED TYPE: String', nil, nil)
616
+ end
617
+ if param_instance!=nil and !param_instance.is_a? ParameterMap
618
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', nil, nil)
619
+ end
620
+ handler_instance = Handler::CommonAPIHandler.new
621
+ api_path = ''
622
+ api_path = api_path + '/crm/v2.1/'
623
+ api_path = api_path + module_api_name.to_s
624
+ api_path = api_path + '/actions/count'
625
+ handler_instance.api_path = api_path
626
+ handler_instance.http_method = Constants::REQUEST_METHOD_GET
627
+ handler_instance.category_method = 'READ'
628
+ handler_instance.param = param_instance
629
+ require_relative 'count_handler'
630
+ handler_instance.api_call(CountHandler.name, 'application/json')
631
+ end
632
+
482
633
  class GetRecordParam
483
634
  @@approved = Param.new('approved', 'com.zoho.crm.api.Record.GetRecordParam')
484
635
  def self.approved
@@ -673,5 +824,24 @@ module Record
673
824
  end
674
825
  end
675
826
 
827
+ class RecordCountParam
828
+ @@criteria = Param.new('criteria', 'com.zoho.crm.api.Record.RecordCountParam')
829
+ def self.criteria
830
+ @@criteria
831
+ end
832
+ @@email = Param.new('email', 'com.zoho.crm.api.Record.RecordCountParam')
833
+ def self.email
834
+ @@email
835
+ end
836
+ @@phone = Param.new('phone', 'com.zoho.crm.api.Record.RecordCountParam')
837
+ def self.phone
838
+ @@phone
839
+ end
840
+ @@word = Param.new('word', 'com.zoho.crm.api.Record.RecordCountParam')
841
+ def self.word
842
+ @@word
843
+ end
844
+ end
845
+
676
846
  end
677
847
  end