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
@@ -16,7 +16,7 @@ module Store
16
16
 
17
17
  unless File.exist? @file_path
18
18
  File.new(@file_path, 'w')
19
- @csv_file = CSV.open(@file_path, 'a', write_headers: true, headers: [Constants::USER_MAIL, Constants::CLIENT_ID, Constants::REFRESH_TOKEN, Constants::ACCESS_TOKEN, Constants::GRANT_TOKEN, Constants::EXPIRY_TIME])
19
+ @csv_file = CSV.open(@file_path, 'a', write_headers: true, headers: [Constants::ID,Constants::USER_MAIL, Constants::CLIENT_ID,Constants::CLIENT_SECRET, Constants::REFRESH_TOKEN, Constants::ACCESS_TOKEN, Constants::GRANT_TOKEN, Constants::EXPIRY_TIME,Constants::REDIRECT_URL])
20
20
  end
21
21
  @csv_file = CSV.open(@file_path, 'a')
22
22
  end
@@ -38,15 +38,34 @@ module Store
38
38
  end
39
39
 
40
40
  file_contents.each do |row|
41
- token_check = grant_token.nil? ? refresh_token == row[2] : grant_token == row[4]
41
+ token_check = grant_token.nil? ? refresh_token == row[4] : grant_token == row[6]
42
42
 
43
- if (row[0] == user_email) && (row[1] == client_id) && token_check
44
- token.refresh_token = row[2]
43
+ if (row[1] == user_email) && (row[2] == client_id) && token_check
45
44
 
46
- token.access_token = row[3]
45
+ grant_token = (!row[6].nil? && !row[6].empty?) ? row[6] : nil
47
46
 
48
- token.expires_in = row[5]
49
- return token
47
+ redirect_url = (!row[8].nil? && !row[8].empty?) ? row[8] : nil
48
+
49
+ oauthtoken = token
50
+
51
+ oauthtoken.id = row[0]
52
+
53
+ oauthtoken.user_mail = row[1]
54
+
55
+ oauthtoken.client_id = row[2]
56
+
57
+ oauthtoken.client_secret = row[3]
58
+
59
+ oauthtoken.refresh_token = row[4]
60
+
61
+ oauthtoken.access_token = row[5]
62
+
63
+ oauthtoken.grant_token = grant_token
64
+
65
+ oauthtoken.expires_in = row[7]
66
+
67
+ oauthtoken.redirect_url = redirect_url
68
+ return oauthtoken
50
69
  end
51
70
  end
52
71
  end
@@ -60,25 +79,21 @@ module Store
60
79
  file_contents = CSV.table(@file_path)
61
80
  file_contents.each do |row|
62
81
  unless row == @csv_file.header_row?
63
- token_type = nil
64
- token_value = nil
65
- if !row[4].nil? && row[4].length.positive?
66
- token_type = TokenType::GRANT
67
- token_value = row[4]
68
- else
69
- token_type = TokenType::REFRESH
70
- token_value = row[2]
71
- end
82
+ grant_token = (!row[6].nil? && !row[6].empty?) ? row[6] : nil
72
83
 
73
- token = Authenticator::OAuthToken.new(row[1], nil, token_value, token_type)
84
+ redirect_url = (!row[8].nil? && !row[8].empty?) ? row[8] : nil
74
85
 
75
- token.user_mail = row[0]
86
+ token = Authenticator::OAuthToken.new(client_id: row[2],client_secret: row[3],grant_token: grant_token,refresh_token: row[4])
87
+
88
+ token.id = row[0]
76
89
 
77
- token.refresh_token = row[2]
90
+ token.user_mail = row[1]
78
91
 
79
- token.access_token = row[3]
92
+ token.access_token = row[5]
80
93
 
81
- token.expires_in = row[5]
94
+ token.expires_in = row[7]
95
+
96
+ token.redirect_url = redirect_url
82
97
 
83
98
  tokens.push(token)
84
99
  end
@@ -96,10 +111,14 @@ module Store
96
111
  delete_token(token)
97
112
  values_list = []
98
113
 
114
+ values_list.push(token.id)
115
+
99
116
  values_list.push(user.email)
100
117
 
101
118
  values_list.push(token.client_id)
102
119
 
120
+ values_list.push(token.client_secret)
121
+
103
122
  values_list.push(token.refresh_token)
104
123
 
105
124
  values_list.push(token.access_token)
@@ -107,6 +126,8 @@ module Store
107
126
  values_list.push(token.grant_token)
108
127
 
109
128
  values_list.push(token.expires_in)
129
+
130
+ values_list.push(token.redirect_url)
110
131
  end
111
132
  @csv_file = CSV.open(@file_path, 'a') if @csv_file.closed?
112
133
  @csv_file << values_list
@@ -161,5 +182,54 @@ module Store
161
182
  rescue StandardError => e
162
183
  raise SDKException.new(Constants::TOKEN_STORE, Constants::DELETE_TOKENS_FILE_ERROR, nil, e)
163
184
  end
185
+
186
+ def get_token_by_id(id, token)
187
+ if token.is_a? Authenticator::OAuthToken
188
+
189
+ is_row_present = false
190
+
191
+ file_contents = CSV.read(@file_path)
192
+
193
+ file_contents.each do |row|
194
+
195
+ if row[0] == id
196
+
197
+ is_row_present = true
198
+
199
+ grant_token = (!row[6].nil? && !row[6].empty?) ? row[6] : nil
200
+
201
+ redirect_url = (!row[8].nil? && !row[8].empty?) ? row[8] : nil
202
+
203
+ oauthtoken = token
204
+
205
+ oauthtoken.id = row[0]
206
+
207
+ oauthtoken.user_mail = row[1]
208
+
209
+ oauthtoken.client_id = row[2]
210
+
211
+ oauthtoken.client_secret = row[3]
212
+
213
+ oauthtoken.refresh_token = row[4]
214
+
215
+ oauthtoken.access_token = row[5]
216
+
217
+ oauthtoken.grant_token = grant_token
218
+
219
+ oauthtoken.expires_in = row[7]
220
+
221
+ oauthtoken.redirect_url = redirect_url
222
+
223
+ return oauthtoken
224
+ end
225
+ end
226
+ if !is_row_present
227
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::GET_TOKEN_BY_ID_FILE_ERROR, nil, nil)
228
+ end
229
+ end
230
+ nil
231
+ rescue StandardError => e
232
+ raise SDKException.new(Constants::TOKEN_STORE, Constants::GET_TOKEN_BY_ID_FILE_ERROR, nil, e)
233
+ end
164
234
  end
165
235
  end
@@ -22,5 +22,12 @@ module Store
22
22
  def delete_token(token); end
23
23
 
24
24
  def delete_tokens; end
25
+
26
+ # This method is used to get the user token details.
27
+ # @param user A UserSignature class instance.
28
+ # @param id A String containing id
29
+ # @return A Token class instance representing the user token details.
30
+ # @raise SDKException
31
+ def get_token_by_id(id, token); end
25
32
  end
26
33
  end
@@ -4,15 +4,16 @@ require 'logger'
4
4
 
5
5
  module SDKLog
6
6
  class Log
7
- attr_accessor :level, :path
8
- def initialize(level, path)
7
+ attr_reader :level , :path
8
+ def initialize(level,path)
9
9
  @level = level
10
10
  @path = path
11
11
  end
12
12
 
13
- def self.initialize(level, path)
13
+ def self.initialize(level:, path:nil)
14
14
  Log.new(level, path)
15
15
  end
16
+
16
17
  end
17
18
 
18
19
  class SDKLogger
@@ -22,15 +23,23 @@ module SDKLog
22
23
  @@logger = nil
23
24
 
24
25
  def self.initialize(log)
25
- if(log.level != Levels::OFF) && !log.path.nil? && log.path.length > 0
26
- File.new(log.path, 'w') unless File.exist? log.path if log.path != nil
27
- sdk_logger = WEBrick::BasicLog.new(log.path, @@log_levels_precedence[log.level])
28
- elsif !log.level.nil? and log.level == Levels::OFF
29
- sdk_logger = WEBrick::BasicLog.new(nil, @@log_levels_precedence[log.level])
26
+
27
+ if !log.level.nil? && log.level != Levels::OFF && !log.path.nil? && log.path.length > 0
28
+ if @@log_levels_precedence.key? log.level
29
+ File.new(log.path, 'w') unless File.exist? log.path if log.path != nil
30
+ sdk_logger = WEBrick::BasicLog.new(log.path, @@log_levels_precedence[log.level])
31
+ end
32
+ end
33
+
34
+ if !log.level.nil? && log.path.nil?
35
+ if @@log_levels_precedence.key? log.level
36
+ sdk_logger = WEBrick::BasicLog.new(nil, @@log_levels_precedence[log.level])
37
+ end
30
38
  end
39
+
31
40
  @@logger = sdk_logger
32
41
  rescue StandardError => e
33
- raise SDKException.new(nil, Constants::SDK_LOGGER_INITIALIZE, nil, e)
42
+ raise SDKException.new(nil, Constants::LOGGER_INITIALIZATION_ERROR, nil, e)
34
43
  end
35
44
 
36
45
  def self.info(message)
@@ -0,0 +1,121 @@
1
+ require_relative '../util/choice'
2
+ require_relative '../util/model'
3
+
4
+ module AssignmentRules
5
+ require_relative 'response_handler'
6
+ class APIException
7
+ include Util::Model
8
+ include ResponseHandler
9
+
10
+ # Creates an instance of APIException
11
+ def initialize
12
+ @status = nil
13
+ @code = nil
14
+ @message = nil
15
+ @details = nil
16
+ @key_modified = Hash.new
17
+ end
18
+
19
+ # The method to get the status
20
+ # @return An instance of Util::Choice
21
+
22
+ def status
23
+ @status
24
+ end
25
+
26
+ # The method to set the value to status
27
+ # @param status [Util::Choice] An instance of Util::Choice
28
+
29
+ def status=(status)
30
+ if status!=nil and !status.is_a? Util::Choice
31
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Util::Choice', nil, nil)
32
+ end
33
+ @status = status
34
+ @key_modified['status'] = 1
35
+ end
36
+
37
+ # The method to get the code
38
+ # @return An instance of Util::Choice
39
+
40
+ def code
41
+ @code
42
+ end
43
+
44
+ # The method to set the value to code
45
+ # @param code [Util::Choice] An instance of Util::Choice
46
+
47
+ def code=(code)
48
+ if code!=nil and !code.is_a? Util::Choice
49
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Util::Choice', nil, nil)
50
+ end
51
+ @code = code
52
+ @key_modified['code'] = 1
53
+ end
54
+
55
+ # The method to get the message
56
+ # @return An instance of Util::Choice
57
+
58
+ def message
59
+ @message
60
+ end
61
+
62
+ # The method to set the value to message
63
+ # @param message [Util::Choice] An instance of Util::Choice
64
+
65
+ def message=(message)
66
+ if message!=nil and !message.is_a? Util::Choice
67
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Util::Choice', nil, nil)
68
+ end
69
+ @message = message
70
+ @key_modified['message'] = 1
71
+ end
72
+
73
+ # The method to get the details
74
+ # @return An instance of Hash
75
+
76
+ def details
77
+ @details
78
+ end
79
+
80
+ # The method to set the value to details
81
+ # @param details [Hash] An instance of Hash
82
+
83
+ def details=(details)
84
+ if details!=nil and !details.is_a? Hash
85
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: Hash', nil, nil)
86
+ end
87
+ @details = details
88
+ @key_modified['details'] = 1
89
+ end
90
+
91
+ # The method to check if the user has modified the given key
92
+ # @param key [String] A String
93
+ # @return A Integer value
94
+
95
+ def is_key_modified(key)
96
+ if key!=nil and !key.is_a? String
97
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
98
+ end
99
+ if @key_modified.key?(key)
100
+ return @key_modified[key]
101
+ end
102
+
103
+ nil
104
+ end
105
+
106
+ # The method to mark the given key as modified
107
+ # @param key [String] A String
108
+ # @param modification [Integer] A Integer
109
+
110
+ def set_key_modified(key, modification)
111
+ if key!=nil and !key.is_a? String
112
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
113
+ end
114
+ if modification!=nil and !modification.is_a? Integer
115
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: Integer', nil, nil)
116
+ end
117
+ @key_modified[key] = modification
118
+ end
119
+
120
+ end
121
+ end
@@ -0,0 +1,215 @@
1
+ require_relative '../modules/module'
2
+ require_relative '../users/user'
3
+ require_relative '../util/model'
4
+
5
+ module AssignmentRules
6
+ class AssignmentRule
7
+ include Util::Model
8
+
9
+ # Creates an instance of AssignmentRule
10
+ def initialize
11
+ @modified_time = nil
12
+ @created_time = nil
13
+ @default_assignee = nil
14
+ @module_1 = nil
15
+ @name = nil
16
+ @modified_by = nil
17
+ @id = nil
18
+ @description = nil
19
+ @created_by = nil
20
+ @key_modified = Hash.new
21
+ end
22
+
23
+ # The method to get the modified_time
24
+ # @return An instance of DateTime
25
+
26
+ def modified_time
27
+ @modified_time
28
+ end
29
+
30
+ # The method to set the value to modified_time
31
+ # @param modified_time [DateTime] An instance of DateTime
32
+
33
+ def modified_time=(modified_time)
34
+ if modified_time!=nil and !modified_time.is_a? DateTime
35
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modified_time EXPECTED TYPE: DateTime', nil, nil)
36
+ end
37
+ @modified_time = modified_time
38
+ @key_modified['modified_time'] = 1
39
+ end
40
+
41
+ # The method to get the created_time
42
+ # @return An instance of DateTime
43
+
44
+ def created_time
45
+ @created_time
46
+ end
47
+
48
+ # The method to set the value to created_time
49
+ # @param created_time [DateTime] An instance of DateTime
50
+
51
+ def created_time=(created_time)
52
+ if created_time!=nil and !created_time.is_a? DateTime
53
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: created_time EXPECTED TYPE: DateTime', nil, nil)
54
+ end
55
+ @created_time = created_time
56
+ @key_modified['created_time'] = 1
57
+ end
58
+
59
+ # The method to get the default_assignee
60
+ # @return An instance of DefaultUser
61
+
62
+ def default_assignee
63
+ @default_assignee
64
+ end
65
+
66
+ # The method to set the value to default_assignee
67
+ # @param default_assignee [DefaultUser] An instance of DefaultUser
68
+
69
+ def default_assignee=(default_assignee)
70
+ if default_assignee!=nil and !default_assignee.is_a? DefaultUser
71
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: default_assignee EXPECTED TYPE: DefaultUser', nil, nil)
72
+ end
73
+ @default_assignee = default_assignee
74
+ @key_modified['default_assignee'] = 1
75
+ end
76
+
77
+ # The method to get the module
78
+ # @return An instance of Modules::Module
79
+
80
+ def module
81
+ @module_1
82
+ end
83
+
84
+ # The method to set the value to module
85
+ # @param module_1 [Modules::Module] An instance of Modules::Module
86
+
87
+ def module=(module_1)
88
+ if module_1!=nil and !module_1.is_a? Modules::Module
89
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: module_1 EXPECTED TYPE: Module', nil, nil)
90
+ end
91
+ @module_1 = module_1
92
+ @key_modified['module'] = 1
93
+ end
94
+
95
+ # The method to get the name
96
+ # @return A String value
97
+
98
+ def name
99
+ @name
100
+ end
101
+
102
+ # The method to set the value to name
103
+ # @param name [String] A String
104
+
105
+ def name=(name)
106
+ if name!=nil and !name.is_a? String
107
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: String', nil, nil)
108
+ end
109
+ @name = name
110
+ @key_modified['name'] = 1
111
+ end
112
+
113
+ # The method to get the modified_by
114
+ # @return An instance of Users::User
115
+
116
+ def modified_by
117
+ @modified_by
118
+ end
119
+
120
+ # The method to set the value to modified_by
121
+ # @param modified_by [Users::User] An instance of Users::User
122
+
123
+ def modified_by=(modified_by)
124
+ if modified_by!=nil and !modified_by.is_a? Users::User
125
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modified_by EXPECTED TYPE: User', nil, nil)
126
+ end
127
+ @modified_by = modified_by
128
+ @key_modified['modified_by'] = 1
129
+ end
130
+
131
+ # The method to get the id
132
+ # @return A Integer value
133
+
134
+ def id
135
+ @id
136
+ end
137
+
138
+ # The method to set the value to id
139
+ # @param id [Integer] A Integer
140
+
141
+ def id=(id)
142
+ if id!=nil and !id.is_a? Integer
143
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: Integer', nil, nil)
144
+ end
145
+ @id = id
146
+ @key_modified['id'] = 1
147
+ end
148
+
149
+ # The method to get the description
150
+ # @return A String value
151
+
152
+ def description
153
+ @description
154
+ end
155
+
156
+ # The method to set the value to description
157
+ # @param description [String] A String
158
+
159
+ def description=(description)
160
+ if description!=nil and !description.is_a? String
161
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: description EXPECTED TYPE: String', nil, nil)
162
+ end
163
+ @description = description
164
+ @key_modified['description'] = 1
165
+ end
166
+
167
+ # The method to get the created_by
168
+ # @return An instance of Users::User
169
+
170
+ def created_by
171
+ @created_by
172
+ end
173
+
174
+ # The method to set the value to created_by
175
+ # @param created_by [Users::User] An instance of Users::User
176
+
177
+ def created_by=(created_by)
178
+ if created_by!=nil and !created_by.is_a? Users::User
179
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: created_by EXPECTED TYPE: User', nil, nil)
180
+ end
181
+ @created_by = created_by
182
+ @key_modified['created_by'] = 1
183
+ end
184
+
185
+ # The method to check if the user has modified the given key
186
+ # @param key [String] A String
187
+ # @return A Integer value
188
+
189
+ def is_key_modified(key)
190
+ if key!=nil and !key.is_a? String
191
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
192
+ end
193
+ if @key_modified.key?(key)
194
+ return @key_modified[key]
195
+ end
196
+
197
+ nil
198
+ end
199
+
200
+ # The method to mark the given key as modified
201
+ # @param key [String] A String
202
+ # @param modification [Integer] A Integer
203
+
204
+ def set_key_modified(key, modification)
205
+ if key!=nil and !key.is_a? String
206
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
207
+ end
208
+ if modification!=nil and !modification.is_a? Integer
209
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: Integer', nil, nil)
210
+ end
211
+ @key_modified[key] = modification
212
+ end
213
+
214
+ end
215
+ end