ZCRMSDK 2.1.0 → 3.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/src/ZCRMSDK.rb +84 -1
  3. data/src/com/zoho/api/authenticator/oauth_token.rb +87 -31
  4. data/src/com/zoho/api/authenticator/store/db_store.rb +48 -28
  5. data/src/com/zoho/api/authenticator/store/file_store.rb +69 -21
  6. data/src/com/zoho/api/authenticator/store/token_store.rb +7 -0
  7. data/src/com/zoho/api/logger/sdk_logger.rb +19 -9
  8. data/src/com/zoho/crm/api/assignment_rules/api_exception.rb +121 -0
  9. data/src/com/zoho/crm/api/assignment_rules/assignment_rule.rb +215 -0
  10. data/src/com/zoho/crm/api/assignment_rules/assignment_rules_operations.rb +61 -0
  11. data/src/com/zoho/crm/api/assignment_rules/default_user.rb +80 -0
  12. data/src/com/zoho/crm/api/assignment_rules/response_handler.rb +10 -0
  13. data/src/com/zoho/crm/api/assignment_rules/response_wrapper.rb +63 -0
  14. data/src/com/zoho/crm/api/attachments/attachment.rb +4 -4
  15. data/src/com/zoho/crm/api/attachments/attachments_operations.rb +6 -6
  16. data/src/com/zoho/crm/api/blue_print/blue_print_operations.rb +2 -2
  17. data/src/com/zoho/crm/api/blue_print/escalation.rb +80 -0
  18. data/src/com/zoho/crm/api/blue_print/field.rb +1107 -0
  19. data/src/com/zoho/crm/api/blue_print/next_transition.rb +38 -0
  20. data/src/com/zoho/crm/api/blue_print/process_info.rb +4 -4
  21. data/src/com/zoho/crm/api/blue_print/transition.rb +19 -1
  22. data/src/com/zoho/crm/api/blue_print/validation_error.rb +57 -0
  23. data/src/com/zoho/crm/api/bulk_read/bulk_read_operations.rb +3 -3
  24. data/src/com/zoho/crm/api/bulk_read/criteria.rb +20 -0
  25. data/src/com/zoho/crm/api/bulk_read/query.rb +5 -4
  26. data/src/com/zoho/crm/api/bulk_write/bulk_write_operations.rb +3 -3
  27. data/src/com/zoho/crm/api/bulk_write/resource.rb +24 -4
  28. data/src/com/zoho/crm/api/contact_roles/contact_roles_operations.rb +7 -7
  29. data/src/com/zoho/crm/api/currencies/currencies_operations.rb +7 -7
  30. data/src/com/zoho/crm/api/custom_views/criteria.rb +5 -4
  31. data/src/com/zoho/crm/api/custom_views/custom_view.rb +100 -41
  32. data/src/com/zoho/crm/api/custom_views/custom_views_operations.rb +2 -2
  33. data/src/com/zoho/crm/api/custom_views/{shared_details.rb → shared_to.rb} +2 -2
  34. data/src/com/zoho/crm/api/dc/au_datacenter.rb +3 -3
  35. data/src/com/zoho/crm/api/dc/cn_datacenter.rb +3 -3
  36. data/src/com/zoho/crm/api/dc/datacenter.rb +3 -2
  37. data/src/com/zoho/crm/api/dc/eu_datacenter.rb +3 -3
  38. data/src/com/zoho/crm/api/dc/in_datacenter.rb +3 -3
  39. data/src/com/zoho/crm/api/dc/us_datacenter.rb +3 -3
  40. data/src/com/zoho/crm/api/email_templates/api_exception.rb +121 -0
  41. data/src/com/zoho/crm/api/email_templates/attachment.rb +118 -0
  42. data/src/com/zoho/crm/api/email_templates/email_template.rb +390 -0
  43. data/src/com/zoho/crm/api/email_templates/email_templates_operations.rb +61 -0
  44. data/src/com/zoho/crm/api/email_templates/response_handler.rb +10 -0
  45. data/src/com/zoho/crm/api/email_templates/response_wrapper.rb +83 -0
  46. data/src/com/zoho/crm/api/field_attachments/api_exception.rb +121 -0
  47. data/src/com/zoho/crm/api/field_attachments/body_wrapper.rb +62 -0
  48. data/src/com/zoho/crm/api/field_attachments/field_attachments_operations.rb +52 -0
  49. data/src/com/zoho/crm/api/field_attachments/file_body_wrapper.rb +64 -0
  50. data/src/com/zoho/crm/api/field_attachments/response_handler.rb +10 -0
  51. data/src/com/zoho/crm/api/fields/external.rb +99 -0
  52. data/src/com/zoho/crm/api/fields/field.rb +192 -38
  53. data/src/com/zoho/crm/api/fields/fields_operations.rb +2 -2
  54. data/src/com/zoho/crm/api/fields/history_tracking.rb +80 -0
  55. data/src/com/zoho/crm/api/fields/maps.rb +80 -0
  56. data/src/com/zoho/crm/api/fields/multi_select_lookup.rb +19 -0
  57. data/src/com/zoho/crm/api/fields/multi_user_lookup.rb +175 -0
  58. data/src/com/zoho/crm/api/fields/pick_list_value.rb +19 -0
  59. data/src/com/zoho/crm/api/fields/related_details.rb +19 -0
  60. data/src/com/zoho/crm/api/files/file_operations.rb +2 -2
  61. data/src/com/zoho/crm/api/initializer.rb +40 -15
  62. data/src/com/zoho/crm/api/inventory_templates/api_exception.rb +121 -0
  63. data/src/com/zoho/crm/api/inventory_templates/inventory_template.rb +352 -0
  64. data/src/com/zoho/crm/api/inventory_templates/inventory_templates_operations.rb +82 -0
  65. data/src/com/zoho/crm/api/inventory_templates/response_handler.rb +10 -0
  66. data/src/com/zoho/crm/api/inventory_templates/response_wrapper.rb +83 -0
  67. data/src/com/zoho/crm/api/layouts/layout.rb +38 -0
  68. data/src/com/zoho/crm/api/layouts/layouts_operations.rb +2 -2
  69. data/src/com/zoho/crm/api/layouts/section.rb +19 -0
  70. data/src/com/zoho/crm/api/modules/module.rb +57 -0
  71. data/src/com/zoho/crm/api/modules/modules_operations.rb +4 -4
  72. data/src/com/zoho/crm/api/notes/notes_operations.rb +7 -7
  73. data/src/com/zoho/crm/api/notification/notification_operations.rb +6 -6
  74. data/src/com/zoho/crm/api/org/org_operations.rb +2 -2
  75. data/src/com/zoho/crm/api/pipeline/action_handler.rb +10 -0
  76. data/src/com/zoho/crm/api/pipeline/action_response.rb +10 -0
  77. data/src/com/zoho/crm/api/pipeline/action_wrapper.rb +63 -0
  78. data/src/com/zoho/crm/api/pipeline/api_exception.rb +129 -0
  79. data/src/com/zoho/crm/api/pipeline/body_wrapper.rb +61 -0
  80. data/src/com/zoho/crm/api/pipeline/forecast_category.rb +80 -0
  81. data/src/com/zoho/crm/api/pipeline/pick_list_value.rb +175 -0
  82. data/src/com/zoho/crm/api/pipeline/pipeline.rb +213 -0
  83. data/src/com/zoho/crm/api/pipeline/pipeline_operations.rb +165 -0
  84. data/src/com/zoho/crm/api/pipeline/response_handler.rb +10 -0
  85. data/src/com/zoho/crm/api/pipeline/response_wrapper.rb +63 -0
  86. data/src/com/zoho/crm/api/pipeline/stage.rb +80 -0
  87. data/src/com/zoho/crm/api/pipeline/success_response.rb +123 -0
  88. data/src/com/zoho/crm/api/pipeline/transfer_action_handler.rb +10 -0
  89. data/src/com/zoho/crm/api/pipeline/transfer_action_response.rb +10 -0
  90. data/src/com/zoho/crm/api/pipeline/transfer_action_wrapper.rb +63 -0
  91. data/src/com/zoho/crm/api/pipeline/transfer_and_delete_wrapper.rb +61 -0
  92. data/src/com/zoho/crm/api/pipeline/transfer_pipe_line.rb +80 -0
  93. data/src/com/zoho/crm/api/profiles/default_view.rb +99 -0
  94. data/src/com/zoho/crm/api/profiles/profile.rb +57 -0
  95. data/src/com/zoho/crm/api/profiles/profiles_operations.rb +2 -2
  96. data/src/com/zoho/crm/api/query/query_operations.rb +1 -1
  97. data/src/com/zoho/crm/api/record/api_exception.rb +2 -0
  98. data/src/com/zoho/crm/api/record/body_wrapper.rb +0 -19
  99. data/src/com/zoho/crm/api/record/count_handler.rb +10 -0
  100. data/src/com/zoho/crm/api/record/count_wrapper.rb +63 -0
  101. data/src/com/zoho/crm/api/record/field.rb +1 -0
  102. data/src/com/zoho/crm/api/record/image_upload.rb +213 -0
  103. data/src/com/zoho/crm/api/record/inventory_line_items.rb +56 -39
  104. data/src/com/zoho/crm/api/record/mass_update_body_wrapper.rb +4 -4
  105. data/src/com/zoho/crm/api/record/mass_update_territory.rb +80 -0
  106. data/src/com/zoho/crm/api/record/multi_select_lookup.rb +99 -0
  107. data/src/com/zoho/crm/api/record/multi_select_picklist.rb +80 -0
  108. data/src/com/zoho/crm/api/record/price_book.rb +31 -0
  109. data/src/com/zoho/crm/api/record/record_operations.rb +201 -111
  110. data/src/com/zoho/crm/api/record/tax.rb +80 -0
  111. data/src/com/zoho/crm/api/record/territory.rb +70 -12
  112. data/src/com/zoho/crm/api/record/widget.rb +80 -0
  113. data/src/com/zoho/crm/api/record/wizard.rb +80 -0
  114. data/src/com/zoho/crm/api/related_lists/related_lists_operations.rb +2 -2
  115. data/src/com/zoho/crm/api/related_records/related_records_operations.rb +8 -36
  116. data/src/com/zoho/crm/api/request_proxy.rb +3 -4
  117. data/src/com/zoho/crm/api/roles/roles_operations.rb +2 -2
  118. data/src/com/zoho/crm/api/sdk_config.rb +2 -68
  119. data/src/com/zoho/crm/api/send_mail/action_handler.rb +10 -0
  120. data/src/com/zoho/crm/api/send_mail/action_response.rb +10 -0
  121. data/src/com/zoho/crm/api/send_mail/action_wrapper.rb +63 -0
  122. data/src/com/zoho/crm/api/send_mail/api_exception.rb +125 -0
  123. data/src/com/zoho/crm/api/send_mail/body_wrapper.rb +61 -0
  124. data/src/com/zoho/crm/api/send_mail/data_subject_request.rb +80 -0
  125. data/src/com/zoho/crm/api/send_mail/inventory_details.rb +100 -0
  126. data/src/com/zoho/crm/api/send_mail/mail.rb +423 -0
  127. data/src/com/zoho/crm/api/send_mail/response_handler.rb +10 -0
  128. data/src/com/zoho/crm/api/send_mail/response_wrapper.rb +63 -0
  129. data/src/com/zoho/crm/api/send_mail/send_mail_operations.rb +61 -0
  130. data/src/com/zoho/crm/api/send_mail/success_response.rb +121 -0
  131. data/src/com/zoho/crm/api/send_mail/template.rb +10 -0
  132. data/src/com/zoho/crm/api/send_mail/user_address.rb +137 -0
  133. data/src/com/zoho/crm/api/share_records/share_records_operations.rb +4 -4
  134. data/src/com/zoho/crm/api/tags/tag.rb +19 -0
  135. data/src/com/zoho/crm/api/tags/tags_operations.rb +11 -11
  136. data/src/com/zoho/crm/api/taxes/taxes_operations.rb +6 -6
  137. data/src/com/zoho/crm/api/territories/response_wrapper.rb +20 -0
  138. data/src/com/zoho/crm/api/territories/territories_operations.rb +2 -2
  139. data/src/com/zoho/crm/api/territories/territory.rb +61 -23
  140. data/src/com/zoho/crm/api/users/users_operations.rb +6 -6
  141. data/src/com/zoho/crm/api/util/api_http_connector.rb +5 -5
  142. data/src/com/zoho/crm/api/util/common_api_handler.rb +0 -1
  143. data/src/com/zoho/crm/api/util/constants.rb +140 -13
  144. data/src/com/zoho/crm/api/util/converter.rb +21 -4
  145. data/src/com/zoho/crm/api/util/form_data_converter.rb +3 -15
  146. data/src/com/zoho/crm/api/util/utility.rb +226 -86
  147. data/src/com/zoho/crm/api/variable_groups/variable_groups_operations.rb +3 -3
  148. data/src/com/zoho/crm/api/variables/variables_operations.rb +9 -9
  149. data/src/com/zoho/crm/api/wizards/api_exception.rb +121 -0
  150. data/src/com/zoho/crm/api/wizards/button.rb +214 -0
  151. data/src/com/zoho/crm/api/wizards/chart_data.rb +118 -0
  152. data/src/com/zoho/crm/api/wizards/connection.rb +80 -0
  153. data/src/com/zoho/crm/api/wizards/container.rb +119 -0
  154. data/src/com/zoho/crm/api/wizards/node.rb +118 -0
  155. data/src/com/zoho/crm/api/wizards/response_handler.rb +10 -0
  156. data/src/com/zoho/crm/api/wizards/response_wrapper.rb +63 -0
  157. data/src/com/zoho/crm/api/wizards/screen.rb +99 -0
  158. data/src/com/zoho/crm/api/wizards/segment.rb +176 -0
  159. data/src/com/zoho/crm/api/wizards/wizard.rb +273 -0
  160. data/src/com/zoho/crm/api/wizards/wizards_operations.rb +61 -0
  161. data/src/resources/JSONDetails.json +1 -1
  162. data/src/version.rb +1 -1
  163. metadata +88 -5
@@ -1,16 +1,15 @@
1
1
  require_relative 'util/constants'
2
2
 
3
3
  class RequestProxy
4
- attr_accessor :host, :port, :user_name, :password
5
- def initialize(host, port, user_name = nil, password = nil)
4
+ attr_reader :host , :port ,:user_name ,:password
5
+ def initialize(host:, port:, user_name:, password:"")
6
+
6
7
  raise SDKException.new(Constants::REQUEST_PROXY_ERROR, Constants::HOST_ERROR_MESSAGE) if host.nil?
7
8
 
8
9
  raise SDKException.new(Constants::REQUEST_PROXY_ERROR, Constants::PORT_ERROR_MESSAGE) if port.nil?
9
-
10
10
  @host = host
11
11
  @port = port
12
12
  @user_name = user_name
13
13
  @password = password
14
- @password = '' if password.nil?
15
14
  end
16
15
  end
@@ -16,7 +16,7 @@ module Roles
16
16
  def get_roles
17
17
  handler_instance = Handler::CommonAPIHandler.new
18
18
  api_path = ''
19
- api_path = api_path + '/crm/v2/settings/roles'
19
+ api_path = api_path + '/crm/v2.1/settings/roles'
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 Roles
34
34
  end
35
35
  handler_instance = Handler::CommonAPIHandler.new
36
36
  api_path = ''
37
- api_path = api_path + '/crm/v2/settings/roles/'
37
+ api_path = api_path + '/crm/v2.1/settings/roles/'
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
@@ -1,49 +1,7 @@
1
1
  class SDKConfig
2
- class Builder
3
- def initialize
4
- @auto_refresh_fields = false
5
- @pick_list_validation = true
6
- @open_timeout = 60
7
- @read_timeout = 60
8
- @write_timeout = 60
9
- @keep_alive_timeout = 2
10
- end
2
+ attr_reader :auto_refresh_fields , :pick_list_validation ,:open_timeout ,:read_timeout ,:write_timeout ,:keep_alive_timeout
11
3
 
12
- def auto_refresh_fields(auto_refresh_fields)
13
- @auto_refresh_fields = auto_refresh_fields
14
- self
15
- end
16
-
17
- def pick_list_validation(pick_list_validation)
18
- @pick_list_validation = pick_list_validation
19
- self
20
- end
21
-
22
- def open_timeout(open_timeout)
23
- @open_timeout = open_timeout
24
- self
25
- end
26
-
27
- def read_timeout(read_timeout)
28
- @read_timeout = read_timeout
29
- self
30
- end
31
-
32
- def write_timeout(write_timeout)
33
- @write_timeout = write_timeout
34
- self
35
- end
36
-
37
- def keep_alive_timeout(keep_alive_timeout)
38
- @keep_alive_timeout = keep_alive_timeout
39
- self
40
- end
41
-
42
- def build
43
- SDKConfig.new(@auto_refresh_fields, @pick_list_validation,@open_timeout,@read_timeout,@write_timeout,@keep_alive_timeout)
44
- end
45
- end
46
- def initialize(auto_refresh_fields, pick_list_validation,open_timeout,read_timeout,write_timeout,keep_alive_timeout)
4
+ def initialize(auto_refresh_fields: false, pick_list_validation: true,open_timeout: 60,read_timeout: 60,write_timeout: 60,keep_alive_timeout: 2)
47
5
  @auto_refresh_fields = auto_refresh_fields
48
6
  @pick_list_validation = pick_list_validation
49
7
  @open_timeout = open_timeout
@@ -51,28 +9,4 @@ class SDKConfig
51
9
  @write_timeout = write_timeout
52
10
  @keep_alive_timeout = keep_alive_timeout
53
11
  end
54
-
55
- def auto_refresh_fields
56
- @auto_refresh_fields
57
- end
58
-
59
- def pick_list_validation
60
- @pick_list_validation
61
- end
62
-
63
- def open_timeout
64
- @open_timeout
65
- end
66
-
67
- def read_timeout
68
- @read_timeout
69
- end
70
-
71
- def write_timeout
72
- @write_timeout
73
- end
74
-
75
- def keep_alive_timeout
76
- @keep_alive_timeout
77
- end
78
12
  end
@@ -0,0 +1,10 @@
1
+ module SendMail
2
+ module ActionHandler
3
+
4
+ # Creates an instance of ActionHandler
5
+ def initialize
6
+ end
7
+
8
+
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module SendMail
2
+ module ActionResponse
3
+
4
+ # Creates an instance of ActionResponse
5
+ def initialize
6
+ end
7
+
8
+
9
+ end
10
+ end
@@ -0,0 +1,63 @@
1
+ require_relative '../util/model'
2
+
3
+ module SendMail
4
+ require_relative 'action_handler'
5
+ class ActionWrapper
6
+ include Util::Model
7
+ include ActionHandler
8
+
9
+ # Creates an instance of ActionWrapper
10
+ def initialize
11
+ @data = nil
12
+ @key_modified = Hash.new
13
+ end
14
+
15
+ # The method to get the data
16
+ # @return An instance of Array
17
+
18
+ def data
19
+ @data
20
+ end
21
+
22
+ # The method to set the value to data
23
+ # @param data [Array] An instance of Array
24
+
25
+ def data=(data)
26
+ if data!=nil and !data.is_a? Array
27
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: data EXPECTED TYPE: Array', nil, nil)
28
+ end
29
+ @data = data
30
+ @key_modified['data'] = 1
31
+ end
32
+
33
+ # The method to check if the user has modified the given key
34
+ # @param key [String] A String
35
+ # @return A Integer value
36
+
37
+ def is_key_modified(key)
38
+ if key!=nil and !key.is_a? String
39
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
40
+ end
41
+ if @key_modified.key?(key)
42
+ return @key_modified[key]
43
+ end
44
+
45
+ nil
46
+ end
47
+
48
+ # The method to mark the given key as modified
49
+ # @param key [String] A String
50
+ # @param modification [Integer] A Integer
51
+
52
+ def set_key_modified(key, modification)
53
+ if key!=nil and !key.is_a? String
54
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
55
+ end
56
+ if modification!=nil and !modification.is_a? Integer
57
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: Integer', nil, nil)
58
+ end
59
+ @key_modified[key] = modification
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,125 @@
1
+ require_relative '../util/choice'
2
+ require_relative '../util/model'
3
+
4
+ module SendMail
5
+ require_relative 'response_handler'
6
+ require_relative 'action_response'
7
+ require_relative 'action_handler'
8
+ class APIException
9
+ include Util::Model
10
+ include ResponseHandler
11
+ include ActionResponse
12
+ include ActionHandler
13
+
14
+ # Creates an instance of APIException
15
+ def initialize
16
+ @status = nil
17
+ @code = nil
18
+ @message = nil
19
+ @details = nil
20
+ @key_modified = Hash.new
21
+ end
22
+
23
+ # The method to get the status
24
+ # @return An instance of Util::Choice
25
+
26
+ def status
27
+ @status
28
+ end
29
+
30
+ # The method to set the value to status
31
+ # @param status [Util::Choice] An instance of Util::Choice
32
+
33
+ def status=(status)
34
+ if status!=nil and !status.is_a? Util::Choice
35
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Util::Choice', nil, nil)
36
+ end
37
+ @status = status
38
+ @key_modified['status'] = 1
39
+ end
40
+
41
+ # The method to get the code
42
+ # @return An instance of Util::Choice
43
+
44
+ def code
45
+ @code
46
+ end
47
+
48
+ # The method to set the value to code
49
+ # @param code [Util::Choice] An instance of Util::Choice
50
+
51
+ def code=(code)
52
+ if code!=nil and !code.is_a? Util::Choice
53
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Util::Choice', nil, nil)
54
+ end
55
+ @code = code
56
+ @key_modified['code'] = 1
57
+ end
58
+
59
+ # The method to get the message
60
+ # @return An instance of Util::Choice
61
+
62
+ def message
63
+ @message
64
+ end
65
+
66
+ # The method to set the value to message
67
+ # @param message [Util::Choice] An instance of Util::Choice
68
+
69
+ def message=(message)
70
+ if message!=nil and !message.is_a? Util::Choice
71
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Util::Choice', nil, nil)
72
+ end
73
+ @message = message
74
+ @key_modified['message'] = 1
75
+ end
76
+
77
+ # The method to get the details
78
+ # @return An instance of Hash
79
+
80
+ def details
81
+ @details
82
+ end
83
+
84
+ # The method to set the value to details
85
+ # @param details [Hash] An instance of Hash
86
+
87
+ def details=(details)
88
+ if details!=nil and !details.is_a? Hash
89
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: Hash', nil, nil)
90
+ end
91
+ @details = details
92
+ @key_modified['details'] = 1
93
+ end
94
+
95
+ # The method to check if the user has modified the given key
96
+ # @param key [String] A String
97
+ # @return A Integer value
98
+
99
+ def is_key_modified(key)
100
+ if key!=nil and !key.is_a? String
101
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
102
+ end
103
+ if @key_modified.key?(key)
104
+ return @key_modified[key]
105
+ end
106
+
107
+ nil
108
+ end
109
+
110
+ # The method to mark the given key as modified
111
+ # @param key [String] A String
112
+ # @param modification [Integer] A Integer
113
+
114
+ def set_key_modified(key, modification)
115
+ if key!=nil and !key.is_a? String
116
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
117
+ end
118
+ if modification!=nil and !modification.is_a? Integer
119
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: Integer', nil, nil)
120
+ end
121
+ @key_modified[key] = modification
122
+ end
123
+
124
+ end
125
+ end
@@ -0,0 +1,61 @@
1
+ require_relative '../util/model'
2
+
3
+ module SendMail
4
+ class BodyWrapper
5
+ include Util::Model
6
+
7
+ # Creates an instance of BodyWrapper
8
+ def initialize
9
+ @data = nil
10
+ @key_modified = Hash.new
11
+ end
12
+
13
+ # The method to get the data
14
+ # @return An instance of Array
15
+
16
+ def data
17
+ @data
18
+ end
19
+
20
+ # The method to set the value to data
21
+ # @param data [Array] An instance of Array
22
+
23
+ def data=(data)
24
+ if data!=nil and !data.is_a? Array
25
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: data EXPECTED TYPE: Array', nil, nil)
26
+ end
27
+ @data = data
28
+ @key_modified['data'] = 1
29
+ end
30
+
31
+ # The method to check if the user has modified the given key
32
+ # @param key [String] A String
33
+ # @return A Integer value
34
+
35
+ def is_key_modified(key)
36
+ if key!=nil and !key.is_a? String
37
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
38
+ end
39
+ if @key_modified.key?(key)
40
+ return @key_modified[key]
41
+ end
42
+
43
+ nil
44
+ end
45
+
46
+ # The method to mark the given key as modified
47
+ # @param key [String] A String
48
+ # @param modification [Integer] A Integer
49
+
50
+ def set_key_modified(key, modification)
51
+ if key!=nil and !key.is_a? String
52
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: String', nil, nil)
53
+ end
54
+ if modification!=nil and !modification.is_a? Integer
55
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: Integer', nil, nil)
56
+ end
57
+ @key_modified[key] = modification
58
+ end
59
+
60
+ end
61
+ end
@@ -0,0 +1,80 @@
1
+ require_relative '../util/model'
2
+
3
+ module SendMail
4
+ class DataSubjectRequest
5
+ include Util::Model
6
+
7
+ # Creates an instance of DataSubjectRequest
8
+ def initialize
9
+ @id = nil
10
+ @type = 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 type
33
+ # @return A String value
34
+
35
+ def type
36
+ @type
37
+ end
38
+
39
+ # The method to set the value to type
40
+ # @param type [String] A String
41
+
42
+ def type=(type)
43
+ if type!=nil and !type.is_a? String
44
+ raise SDKException.new(Constants::DATA_TYPE_ERROR, 'KEY: type EXPECTED TYPE: String', nil, nil)
45
+ end
46
+ @type = type
47
+ @key_modified['type'] = 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