appnigma-sdk 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +592 -26
  4. data/exe/appnigma +8 -0
  5. data/lib/appnigma/actions.rb +33 -0
  6. data/lib/appnigma/checks.rb +13 -0
  7. data/lib/appnigma/client.rb +30 -13
  8. data/lib/appnigma/command.rb +154 -0
  9. data/lib/appnigma/command_files.rb +46 -0
  10. data/lib/appnigma/connect_fields.rb +83 -0
  11. data/lib/appnigma/connections.rb +72 -3
  12. data/lib/appnigma/constants.rb +57 -0
  13. data/lib/appnigma/end_customers.rb +29 -0
  14. data/lib/appnigma/errors.rb +44 -6
  15. data/lib/appnigma/features.rb +19 -0
  16. data/lib/appnigma/files.rb +26 -0
  17. data/lib/appnigma/generated/api/default_api.rb +2149 -380
  18. data/lib/appnigma/generated/api_client.rb +1 -1
  19. data/lib/appnigma/generated/api_error.rb +1 -1
  20. data/lib/appnigma/generated/api_model_base.rb +1 -1
  21. data/lib/appnigma/generated/configuration.rb +1 -1
  22. data/lib/appnigma/generated/models/action_entry.rb +1 -1
  23. data/lib/appnigma/generated/models/check_logic_input.rb +276 -0
  24. data/lib/appnigma/generated/models/check_logic_output.rb +193 -0
  25. data/lib/appnigma/generated/models/client_event.rb +309 -0
  26. data/lib/appnigma/generated/models/client_event_delivery.rb +306 -0
  27. data/lib/appnigma/generated/models/client_event_type.rb +44 -0
  28. data/lib/appnigma/generated/models/client_webhook.rb +346 -0
  29. data/lib/appnigma/generated/models/connect_end_customer_input.rb +243 -0
  30. data/lib/appnigma/generated/models/connect_end_customer_output.rb +294 -0
  31. data/lib/appnigma/generated/models/connect_field.rb +308 -0
  32. data/lib/appnigma/generated/models/connection_status.rb +1 -1
  33. data/lib/appnigma/generated/models/create_connection_link_input.rb +1 -1
  34. data/lib/appnigma/generated/models/create_connection_link_output.rb +1 -1
  35. data/lib/appnigma/generated/models/create_logic_input.rb +273 -0
  36. data/lib/appnigma/generated/models/create_logic_input_trigger.rb +104 -0
  37. data/lib/appnigma/generated/models/create_logic_input_trigger_any_of.rb +257 -0
  38. data/lib/appnigma/generated/models/create_logic_input_trigger_any_of1.rb +238 -0
  39. data/lib/appnigma/generated/models/create_logic_output.rb +230 -0
  40. data/lib/appnigma/generated/models/create_portal_link_input.rb +2 -18
  41. data/lib/appnigma/generated/models/create_portal_link_output.rb +1 -1
  42. data/lib/appnigma/generated/models/create_webhook_input.rb +187 -0
  43. data/lib/appnigma/generated/models/create_webhook_output.rb +204 -0
  44. data/lib/appnigma/generated/models/crm_company.rb +1 -1
  45. data/lib/appnigma/generated/models/crm_company_get_output.rb +1 -1
  46. data/lib/appnigma/generated/models/crm_company_list_output.rb +1 -1
  47. data/lib/appnigma/generated/models/crm_company_write_output.rb +1 -1
  48. data/lib/appnigma/generated/models/crm_contact.rb +1 -1
  49. data/lib/appnigma/generated/models/crm_contact_get_output.rb +1 -1
  50. data/lib/appnigma/generated/models/crm_contact_list_output.rb +1 -1
  51. data/lib/appnigma/generated/models/crm_contact_write_output.rb +1 -1
  52. data/lib/appnigma/generated/models/crm_create_input.rb +1 -1
  53. data/lib/appnigma/generated/models/crm_custom_field.rb +1 -1
  54. data/lib/appnigma/generated/models/crm_deal.rb +1 -1
  55. data/lib/appnigma/generated/models/crm_deal_create_input.rb +1 -1
  56. data/lib/appnigma/generated/models/crm_deal_get_output.rb +1 -1
  57. data/lib/appnigma/generated/models/crm_deal_list_output.rb +1 -1
  58. data/lib/appnigma/generated/models/crm_deal_write_output.rb +1 -1
  59. data/lib/appnigma/generated/models/crm_email.rb +1 -1
  60. data/lib/appnigma/generated/models/crm_get_input.rb +1 -1
  61. data/lib/appnigma/generated/models/crm_labelled.rb +1 -1
  62. data/lib/appnigma/generated/models/crm_list_input.rb +1 -1
  63. data/lib/appnigma/generated/models/crm_phone.rb +1 -1
  64. data/lib/appnigma/generated/models/crm_update_input.rb +1 -1
  65. data/lib/appnigma/generated/models/delete_end_customer_input.rb +178 -0
  66. data/lib/appnigma/generated/models/delete_end_customer_output.rb +286 -0
  67. data/lib/appnigma/generated/models/delete_end_customer_output_connections_inner.rb +238 -0
  68. data/lib/appnigma/generated/models/delete_end_customer_output_logic_folder.rb +255 -0
  69. data/lib/appnigma/generated/models/delete_end_customer_output_steps_inner.rb +257 -0
  70. data/lib/appnigma/generated/models/delete_webhook_input.rb +189 -0
  71. data/lib/appnigma/generated/models/delete_webhook_output.rb +228 -0
  72. data/lib/appnigma/generated/models/discard_logic_input.rb +292 -0
  73. data/lib/appnigma/generated/models/discard_logic_output.rb +254 -0
  74. data/lib/appnigma/generated/models/disconnect_connection_input.rb +216 -0
  75. data/lib/appnigma/generated/models/disconnect_connection_output.rb +294 -0
  76. data/lib/appnigma/generated/models/edit_logic_input.rb +368 -0
  77. data/lib/appnigma/generated/models/edit_logic_output.rb +298 -0
  78. data/lib/appnigma/generated/models/encrypted_fields.rb +357 -0
  79. data/lib/appnigma/generated/models/end_customer.rb +17 -3
  80. data/lib/appnigma/generated/models/end_customer_connection.rb +1 -1
  81. data/lib/appnigma/generated/models/function_entry.rb +1 -1
  82. data/lib/appnigma/generated/models/function_owner.rb +1 -1
  83. data/lib/appnigma/generated/models/function_owner_one_of.rb +1 -1
  84. data/lib/appnigma/generated/models/function_owner_one_of1.rb +1 -1
  85. data/lib/appnigma/generated/models/get_alerts_output.rb +180 -0
  86. data/lib/appnigma/generated/models/get_connect_key_output.rb +256 -0
  87. data/lib/appnigma/generated/models/get_connection_input.rb +1 -1
  88. data/lib/appnigma/generated/models/get_connection_output.rb +34 -7
  89. data/lib/appnigma/generated/models/get_guide_output.rb +1 -1
  90. data/lib/appnigma/generated/models/get_logic_go_live_status_input.rb +247 -0
  91. data/lib/appnigma/generated/models/get_logic_go_live_status_output.rb +296 -0
  92. data/lib/appnigma/generated/models/get_logic_input.rb +247 -0
  93. data/lib/appnigma/generated/models/get_logic_output.rb +240 -0
  94. data/lib/appnigma/generated/models/get_logic_output_file.rb +204 -0
  95. data/lib/appnigma/generated/models/get_platform_input.rb +188 -0
  96. data/lib/appnigma/generated/models/get_platform_output.rb +326 -0
  97. data/lib/appnigma/generated/models/get_sync_output.rb +207 -0
  98. data/lib/appnigma/generated/models/go_live_logic_input.rb +316 -0
  99. data/lib/appnigma/generated/models/go_live_logic_output.rb +281 -0
  100. data/lib/appnigma/generated/models/json_value.rb +1 -1
  101. data/lib/appnigma/generated/models/list_actions_output.rb +1 -1
  102. data/lib/appnigma/generated/models/list_connections_output.rb +3 -3
  103. data/lib/appnigma/generated/models/list_events_input.rb +302 -0
  104. data/lib/appnigma/generated/models/list_events_output.rb +193 -0
  105. data/lib/appnigma/generated/models/list_features_output.rb +179 -0
  106. data/lib/appnigma/generated/models/list_features_output_features_inner.rb +229 -0
  107. data/lib/appnigma/generated/models/list_functions_output.rb +1 -1
  108. data/lib/appnigma/generated/models/list_logic_input.rb +162 -0
  109. data/lib/appnigma/generated/models/list_logic_output.rb +209 -0
  110. data/lib/appnigma/generated/models/list_logic_runs_input.rb +275 -0
  111. data/lib/appnigma/generated/models/list_logic_runs_output.rb +193 -0
  112. data/lib/appnigma/generated/models/list_platforms_output.rb +1 -1
  113. data/lib/appnigma/generated/models/list_record_changes_input.rb +375 -0
  114. data/lib/appnigma/generated/models/list_record_changes_output.rb +193 -0
  115. data/lib/appnigma/generated/models/list_webhooks_output.rb +180 -0
  116. data/lib/appnigma/generated/models/logic_check_problem.rb +203 -0
  117. data/lib/appnigma/generated/models/logic_conditional.rb +3 -3
  118. data/lib/appnigma/generated/models/logic_draft.rb +257 -0
  119. data/lib/appnigma/generated/models/logic_entry.rb +441 -0
  120. data/lib/appnigma/generated/models/logic_entry_failure.rb +205 -0
  121. data/lib/appnigma/generated/models/logic_folder_problem.rb +218 -0
  122. data/lib/appnigma/generated/models/logic_run.rb +483 -0
  123. data/lib/appnigma/generated/models/logic_test_call.rb +269 -0
  124. data/lib/appnigma/generated/models/platform_entry.rb +63 -6
  125. data/lib/appnigma/generated/models/platform_entry_coverage_inner.rb +1 -1
  126. data/lib/appnigma/generated/models/platform_request_input.rb +1 -1
  127. data/lib/appnigma/generated/models/platform_request_input_body.rb +1 -1
  128. data/lib/appnigma/generated/models/platform_request_output.rb +1 -1
  129. data/lib/appnigma/generated/models/ran_as.rb +1 -1
  130. data/lib/appnigma/generated/models/record_change.rb +231 -0
  131. data/lib/appnigma/generated/models/record_change_record.rb +105 -0
  132. data/lib/appnigma/generated/models/run_action_input.rb +1 -1
  133. data/lib/appnigma/generated/models/run_action_output.rb +1 -1
  134. data/lib/appnigma/generated/models/run_input.rb +1 -1
  135. data/lib/appnigma/generated/models/run_output.rb +1 -1
  136. data/lib/appnigma/generated/models/sdk_error.rb +1 -1
  137. data/lib/appnigma/generated/models/sdk_error_error.rb +3 -3
  138. data/lib/appnigma/generated/models/sdk_error_error_details.rb +81 -6
  139. data/lib/appnigma/generated/models/sdk_problem.rb +1 -1
  140. data/lib/appnigma/generated/models/set_alerts_input.rb +197 -0
  141. data/lib/appnigma/generated/models/set_alerts_output.rb +180 -0
  142. data/lib/appnigma/generated/models/set_sync_input.rb +177 -0
  143. data/lib/appnigma/generated/models/set_sync_output.rb +207 -0
  144. data/lib/appnigma/generated/models/switch_logic_off_input.rb +200 -0
  145. data/lib/appnigma/generated/models/switch_logic_off_output.rb +315 -0
  146. data/lib/appnigma/generated/models/switch_logic_on_input.rb +200 -0
  147. data/lib/appnigma/generated/models/switch_logic_on_output.rb +315 -0
  148. data/lib/appnigma/generated/models/sync_health.rb +231 -0
  149. data/lib/appnigma/generated/models/test_logic_input.rb +355 -0
  150. data/lib/appnigma/generated/models/test_logic_output.rb +418 -0
  151. data/lib/appnigma/generated/models/test_logic_output_error.rb +231 -0
  152. data/lib/appnigma/generated/models/update_logic_input.rb +359 -0
  153. data/lib/appnigma/generated/models/update_logic_output.rb +205 -0
  154. data/lib/appnigma/generated/version.rb +1 -1
  155. data/lib/appnigma/generated.rb +77 -1
  156. data/lib/appnigma/logic.rb +176 -0
  157. data/lib/appnigma/names.rb +4 -4
  158. data/lib/appnigma/platforms.rb +11 -1
  159. data/lib/appnigma/portal.rb +8 -5
  160. data/lib/appnigma/records.rb +46 -0
  161. data/lib/appnigma/schema_type.rb +149 -0
  162. data/lib/appnigma/sync.rb +30 -0
  163. data/lib/appnigma/types_printer.rb +154 -0
  164. data/lib/appnigma/verify_webhook.rb +107 -0
  165. data/lib/appnigma/version.rb +2 -2
  166. data/lib/appnigma/webhooks.rb +79 -0
  167. data/lib/appnigma.rb +1 -0
  168. metadata +95 -3
@@ -0,0 +1,294 @@
1
+ =begin
2
+ #Appnigma SDK API
3
+
4
+ #The routes a customer's product calls through an Appnigma SDK. Every answer carries a request id in X-Request-Id; quote it when you write to support.
5
+
6
+ The version of the OpenAPI document: 5.4.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Appnigma::Generated
17
+ class DisconnectConnectionOutput < ApiModelBase
18
+ attr_accessor :end_customer_id
19
+
20
+ attr_accessor :platform
21
+
22
+ # Always disconnected: the login and the connection are gone
23
+ attr_accessor :status
24
+
25
+ # The folder for this end customer's own logic, end-customers/<logicFolderKey>/ in your logic repo. It comes from their id, so it is the same if they connect again.
26
+ attr_accessor :logic_folder_key
27
+
28
+ # Always null: the account is no longer read
29
+ attr_accessor :sync
30
+
31
+ class EnumAttributeValidator
32
+ attr_reader :datatype
33
+ attr_reader :allowable_values
34
+
35
+ def initialize(datatype, allowable_values)
36
+ @allowable_values = allowable_values.map do |value|
37
+ case datatype.to_s
38
+ when /Integer/i
39
+ value.to_i
40
+ when /Float/i
41
+ value.to_f
42
+ else
43
+ value
44
+ end
45
+ end
46
+ end
47
+
48
+ def valid?(value)
49
+ !value || allowable_values.include?(value)
50
+ end
51
+ end
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'end_customer_id' => :'endCustomerId',
57
+ :'platform' => :'platform',
58
+ :'status' => :'status',
59
+ :'logic_folder_key' => :'logicFolderKey',
60
+ :'sync' => :'sync'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'end_customer_id' => :'String',
78
+ :'platform' => :'String',
79
+ :'status' => :'String',
80
+ :'logic_folder_key' => :'String',
81
+ :'sync' => :'SyncHealth'
82
+ }
83
+ end
84
+
85
+ # List of attributes with nullable: true
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ :'sync'
89
+ ])
90
+ end
91
+
92
+ # Returns attribute type mapping
93
+ def self.acceptable_openapi_types
94
+ openapi_types
95
+ end
96
+
97
+ # Returns the nullable attributes
98
+ def self.acceptable_openapi_nullable
99
+ openapi_nullable
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ if (!attributes.is_a?(Hash))
106
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::DisconnectConnectionOutput` initialize method"
107
+ end
108
+
109
+ # check to see if the attribute exists and convert string to symbol for hash key
110
+ acceptable_attribute_map = self.class.acceptable_attribute_map
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!acceptable_attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::DisconnectConnectionOutput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'end_customer_id')
119
+ self.end_customer_id = attributes[:'end_customer_id']
120
+ else
121
+ self.end_customer_id = nil
122
+ end
123
+
124
+ if attributes.key?(:'platform')
125
+ self.platform = attributes[:'platform']
126
+ else
127
+ self.platform = nil
128
+ end
129
+
130
+ if attributes.key?(:'status')
131
+ self.status = attributes[:'status']
132
+ else
133
+ self.status = nil
134
+ end
135
+
136
+ if attributes.key?(:'logic_folder_key')
137
+ self.logic_folder_key = attributes[:'logic_folder_key']
138
+ else
139
+ self.logic_folder_key = nil
140
+ end
141
+
142
+ if attributes.key?(:'sync')
143
+ self.sync = attributes[:'sync']
144
+ else
145
+ self.sync = nil
146
+ end
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properties with the reasons
151
+ def list_invalid_properties
152
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
153
+ invalid_properties = Array.new
154
+ if @end_customer_id.nil?
155
+ invalid_properties.push('invalid value for "end_customer_id", end_customer_id cannot be nil.')
156
+ end
157
+
158
+ if @platform.nil?
159
+ invalid_properties.push('invalid value for "platform", platform cannot be nil.')
160
+ end
161
+
162
+ if @status.nil?
163
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
164
+ end
165
+
166
+ if @logic_folder_key.nil?
167
+ invalid_properties.push('invalid value for "logic_folder_key", logic_folder_key cannot be nil.')
168
+ end
169
+
170
+ invalid_properties
171
+ end
172
+
173
+ # Check to see if the all the properties in the model are valid
174
+ # @return true if the model is valid
175
+ def valid?
176
+ warn '[DEPRECATED] the `valid?` method is obsolete'
177
+ return false if @end_customer_id.nil?
178
+ return false if @platform.nil?
179
+ return false if @status.nil?
180
+ status_validator = EnumAttributeValidator.new('String', ["disconnected"])
181
+ return false unless status_validator.valid?(@status)
182
+ return false if @logic_folder_key.nil?
183
+ true
184
+ end
185
+
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] end_customer_id Value to be assigned
188
+ def end_customer_id=(end_customer_id)
189
+ if end_customer_id.nil?
190
+ fail ArgumentError, 'end_customer_id cannot be nil'
191
+ end
192
+
193
+ @end_customer_id = end_customer_id
194
+ end
195
+
196
+ # Custom attribute writer method with validation
197
+ # @param [Object] platform Value to be assigned
198
+ def platform=(platform)
199
+ if platform.nil?
200
+ fail ArgumentError, 'platform cannot be nil'
201
+ end
202
+
203
+ @platform = platform
204
+ end
205
+
206
+ # Custom attribute writer method checking allowed values (enum).
207
+ # @param [Object] status Object to be assigned
208
+ def status=(status)
209
+ validator = EnumAttributeValidator.new('String', ["disconnected"])
210
+ unless validator.valid?(status)
211
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
212
+ end
213
+ @status = status
214
+ end
215
+
216
+ # Custom attribute writer method with validation
217
+ # @param [Object] logic_folder_key Value to be assigned
218
+ def logic_folder_key=(logic_folder_key)
219
+ if logic_folder_key.nil?
220
+ fail ArgumentError, 'logic_folder_key cannot be nil'
221
+ end
222
+
223
+ @logic_folder_key = logic_folder_key
224
+ end
225
+
226
+ # Checks equality by comparing each attribute.
227
+ # @param [Object] Object to be compared
228
+ def ==(o)
229
+ return true if self.equal?(o)
230
+ self.class == o.class &&
231
+ end_customer_id == o.end_customer_id &&
232
+ platform == o.platform &&
233
+ status == o.status &&
234
+ logic_folder_key == o.logic_folder_key &&
235
+ sync == o.sync
236
+ end
237
+
238
+ # @see the `==` method
239
+ # @param [Object] Object to be compared
240
+ def eql?(o)
241
+ self == o
242
+ end
243
+
244
+ # Calculates hash code according to all attributes.
245
+ # @return [Integer] Hash code
246
+ def hash
247
+ [end_customer_id, platform, status, logic_folder_key, sync].hash
248
+ end
249
+
250
+ # Builds the object from hash
251
+ # @param [Hash] attributes Model attributes in the form of hash
252
+ # @return [Object] Returns the model itself
253
+ def self.build_from_hash(attributes)
254
+ return nil unless attributes.is_a?(Hash)
255
+ attributes = attributes.transform_keys(&:to_sym)
256
+ # include attributes inherited from allOf parents (the nearest declaration wins)
257
+ map = acceptable_attribute_map
258
+ transformed_hash = {}
259
+ acceptable_openapi_types.each_pair do |key, type|
260
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
261
+ transformed_hash["#{key}"] = nil
262
+ elsif type =~ /\AArray<(.*)>/i
263
+ # check to ensure the input is an array given that the attribute
264
+ # is documented as an array but the input is not
265
+ if attributes[map[key]].is_a?(Array)
266
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
267
+ end
268
+ elsif !attributes[map[key]].nil?
269
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
270
+ end
271
+ end
272
+ new(transformed_hash)
273
+ end
274
+
275
+ # Returns the object in the form of hash
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_hash
278
+ hash = {}
279
+ # include attributes inherited from allOf parents (the nearest declaration wins)
280
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
281
+ value = self.send(attr)
282
+ if value.nil?
283
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
284
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
285
+ end
286
+
287
+ hash[param] = _to_hash(value)
288
+ end
289
+ hash
290
+ end
291
+
292
+ end
293
+
294
+ end
@@ -0,0 +1,368 @@
1
+ =begin
2
+ #Appnigma SDK API
3
+
4
+ #The routes a customer's product calls through an Appnigma SDK. Every answer carries a request id in X-Request-Id; quote it when you write to support.
5
+
6
+ The version of the OpenAPI document: 5.4.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Appnigma::Generated
17
+ class EditLogicInput < ApiModelBase
18
+ # Whose logic: an end customer's, or, null or left out, your own. Your own id for the end customer: it must be 1 to 255 characters, with no control characters and not only spaces. Stored exactly as sent: ids that differ only in case or spaces are different end customers.
19
+ attr_accessor :end_customer_id
20
+
21
+ # The platform key, such as hubspot.
22
+ attr_accessor :platform
23
+
24
+ # The logic's name, the same as its file name.
25
+ attr_accessor :name
26
+
27
+ # What to change, in the person's own words.
28
+ attr_accessor :prompt
29
+
30
+ # The draft's revision you last had, so a change is made only on it; 0 when there is no draft. Left out, the draft as it is now.
31
+ attr_accessor :revision
32
+
33
+ # Who asked, in your own terms, such as your user's id or email. Kept on the call's record as sent.
34
+ attr_accessor :requested_by
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'end_customer_id' => :'endCustomerId',
40
+ :'platform' => :'platform',
41
+ :'name' => :'name',
42
+ :'prompt' => :'prompt',
43
+ :'revision' => :'revision',
44
+ :'requested_by' => :'requestedBy'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'end_customer_id' => :'String',
62
+ :'platform' => :'String',
63
+ :'name' => :'String',
64
+ :'prompt' => :'String',
65
+ :'revision' => :'Integer',
66
+ :'requested_by' => :'String'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ :'end_customer_id',
74
+ ])
75
+ end
76
+
77
+ # Returns attribute type mapping
78
+ def self.acceptable_openapi_types
79
+ openapi_types
80
+ end
81
+
82
+ # Returns the nullable attributes
83
+ def self.acceptable_openapi_nullable
84
+ openapi_nullable
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::EditLogicInput` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ acceptable_attribute_map = self.class.acceptable_attribute_map
96
+ attributes = attributes.each_with_object({}) { |(k, v), h|
97
+ if (!acceptable_attribute_map.key?(k.to_sym))
98
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::EditLogicInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
99
+ end
100
+ h[k.to_sym] = v
101
+ }
102
+
103
+ if attributes.key?(:'end_customer_id')
104
+ self.end_customer_id = attributes[:'end_customer_id']
105
+ end
106
+
107
+ if attributes.key?(:'platform')
108
+ self.platform = attributes[:'platform']
109
+ else
110
+ self.platform = nil
111
+ end
112
+
113
+ if attributes.key?(:'name')
114
+ self.name = attributes[:'name']
115
+ else
116
+ self.name = nil
117
+ end
118
+
119
+ if attributes.key?(:'prompt')
120
+ self.prompt = attributes[:'prompt']
121
+ else
122
+ self.prompt = nil
123
+ end
124
+
125
+ if attributes.key?(:'revision')
126
+ self.revision = attributes[:'revision']
127
+ end
128
+
129
+ if attributes.key?(:'requested_by')
130
+ self.requested_by = attributes[:'requested_by']
131
+ end
132
+ end
133
+
134
+ # Show invalid properties with the reasons. Usually used together with valid?
135
+ # @return Array for valid properties with the reasons
136
+ def list_invalid_properties
137
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
138
+ invalid_properties = Array.new
139
+ if @platform.nil?
140
+ invalid_properties.push('invalid value for "platform", platform cannot be nil.')
141
+ end
142
+
143
+ pattern = Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
144
+ if @platform !~ pattern
145
+ invalid_properties.push("invalid value for \"platform\", must conform to the pattern #{pattern}.")
146
+ end
147
+
148
+ if @name.nil?
149
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
150
+ end
151
+
152
+ if @name.to_s.length > 64
153
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 64.')
154
+ end
155
+
156
+ pattern = Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
157
+ if @name !~ pattern
158
+ invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
159
+ end
160
+
161
+ if @prompt.nil?
162
+ invalid_properties.push('invalid value for "prompt", prompt cannot be nil.')
163
+ end
164
+
165
+ if @prompt.to_s.length > 4000
166
+ invalid_properties.push('invalid value for "prompt", the character length must be smaller than or equal to 4000.')
167
+ end
168
+
169
+ if @prompt.to_s.length < 1
170
+ invalid_properties.push('invalid value for "prompt", the character length must be greater than or equal to 1.')
171
+ end
172
+
173
+ if !@revision.nil? && @revision > 9007199254740991
174
+ invalid_properties.push('invalid value for "revision", must be smaller than or equal to 9007199254740991.')
175
+ end
176
+
177
+ if !@revision.nil? && @revision < 0
178
+ invalid_properties.push('invalid value for "revision", must be greater than or equal to 0.')
179
+ end
180
+
181
+ if !@requested_by.nil? && @requested_by.to_s.length > 200
182
+ invalid_properties.push('invalid value for "requested_by", the character length must be smaller than or equal to 200.')
183
+ end
184
+
185
+ if !@requested_by.nil? && @requested_by.to_s.length < 1
186
+ invalid_properties.push('invalid value for "requested_by", the character length must be greater than or equal to 1.')
187
+ end
188
+
189
+ invalid_properties
190
+ end
191
+
192
+ # Check to see if the all the properties in the model are valid
193
+ # @return true if the model is valid
194
+ def valid?
195
+ warn '[DEPRECATED] the `valid?` method is obsolete'
196
+ return false if @platform.nil?
197
+ return false if @platform !~ Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
198
+ return false if @name.nil?
199
+ return false if @name.to_s.length > 64
200
+ return false if @name !~ Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
201
+ return false if @prompt.nil?
202
+ return false if @prompt.to_s.length > 4000
203
+ return false if @prompt.to_s.length < 1
204
+ return false if !@revision.nil? && @revision > 9007199254740991
205
+ return false if !@revision.nil? && @revision < 0
206
+ return false if !@requested_by.nil? && @requested_by.to_s.length > 200
207
+ return false if !@requested_by.nil? && @requested_by.to_s.length < 1
208
+ true
209
+ end
210
+
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] platform Value to be assigned
213
+ def platform=(platform)
214
+ if platform.nil?
215
+ fail ArgumentError, 'platform cannot be nil'
216
+ end
217
+
218
+ pattern = Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
219
+ if platform !~ pattern
220
+ fail ArgumentError, "invalid value for \"platform\", must conform to the pattern #{pattern}."
221
+ end
222
+
223
+ @platform = platform
224
+ end
225
+
226
+ # Custom attribute writer method with validation
227
+ # @param [Object] name Value to be assigned
228
+ def name=(name)
229
+ if name.nil?
230
+ fail ArgumentError, 'name cannot be nil'
231
+ end
232
+
233
+ if name.to_s.length > 64
234
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 64.'
235
+ end
236
+
237
+ pattern = Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
238
+ if name !~ pattern
239
+ fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
240
+ end
241
+
242
+ @name = name
243
+ end
244
+
245
+ # Custom attribute writer method with validation
246
+ # @param [Object] prompt Value to be assigned
247
+ def prompt=(prompt)
248
+ if prompt.nil?
249
+ fail ArgumentError, 'prompt cannot be nil'
250
+ end
251
+
252
+ if prompt.to_s.length > 4000
253
+ fail ArgumentError, 'invalid value for "prompt", the character length must be smaller than or equal to 4000.'
254
+ end
255
+
256
+ if prompt.to_s.length < 1
257
+ fail ArgumentError, 'invalid value for "prompt", the character length must be greater than or equal to 1.'
258
+ end
259
+
260
+ @prompt = prompt
261
+ end
262
+
263
+ # Custom attribute writer method with validation
264
+ # @param [Object] revision Value to be assigned
265
+ def revision=(revision)
266
+ if revision.nil?
267
+ fail ArgumentError, 'revision cannot be nil'
268
+ end
269
+
270
+ if revision > 9007199254740991
271
+ fail ArgumentError, 'invalid value for "revision", must be smaller than or equal to 9007199254740991.'
272
+ end
273
+
274
+ if revision < 0
275
+ fail ArgumentError, 'invalid value for "revision", must be greater than or equal to 0.'
276
+ end
277
+
278
+ @revision = revision
279
+ end
280
+
281
+ # Custom attribute writer method with validation
282
+ # @param [Object] requested_by Value to be assigned
283
+ def requested_by=(requested_by)
284
+ if requested_by.nil?
285
+ fail ArgumentError, 'requested_by cannot be nil'
286
+ end
287
+
288
+ if requested_by.to_s.length > 200
289
+ fail ArgumentError, 'invalid value for "requested_by", the character length must be smaller than or equal to 200.'
290
+ end
291
+
292
+ if requested_by.to_s.length < 1
293
+ fail ArgumentError, 'invalid value for "requested_by", the character length must be greater than or equal to 1.'
294
+ end
295
+
296
+ @requested_by = requested_by
297
+ end
298
+
299
+ # Checks equality by comparing each attribute.
300
+ # @param [Object] Object to be compared
301
+ def ==(o)
302
+ return true if self.equal?(o)
303
+ self.class == o.class &&
304
+ end_customer_id == o.end_customer_id &&
305
+ platform == o.platform &&
306
+ name == o.name &&
307
+ prompt == o.prompt &&
308
+ revision == o.revision &&
309
+ requested_by == o.requested_by
310
+ end
311
+
312
+ # @see the `==` method
313
+ # @param [Object] Object to be compared
314
+ def eql?(o)
315
+ self == o
316
+ end
317
+
318
+ # Calculates hash code according to all attributes.
319
+ # @return [Integer] Hash code
320
+ def hash
321
+ [end_customer_id, platform, name, prompt, revision, requested_by].hash
322
+ end
323
+
324
+ # Builds the object from hash
325
+ # @param [Hash] attributes Model attributes in the form of hash
326
+ # @return [Object] Returns the model itself
327
+ def self.build_from_hash(attributes)
328
+ return nil unless attributes.is_a?(Hash)
329
+ attributes = attributes.transform_keys(&:to_sym)
330
+ # include attributes inherited from allOf parents (the nearest declaration wins)
331
+ map = acceptable_attribute_map
332
+ transformed_hash = {}
333
+ acceptable_openapi_types.each_pair do |key, type|
334
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
335
+ transformed_hash["#{key}"] = nil
336
+ elsif type =~ /\AArray<(.*)>/i
337
+ # check to ensure the input is an array given that the attribute
338
+ # is documented as an array but the input is not
339
+ if attributes[map[key]].is_a?(Array)
340
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
341
+ end
342
+ elsif !attributes[map[key]].nil?
343
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
344
+ end
345
+ end
346
+ new(transformed_hash)
347
+ end
348
+
349
+ # Returns the object in the form of hash
350
+ # @return [Hash] Returns the object in the form of hash
351
+ def to_hash
352
+ hash = {}
353
+ # include attributes inherited from allOf parents (the nearest declaration wins)
354
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
355
+ value = self.send(attr)
356
+ if value.nil?
357
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
358
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
359
+ end
360
+
361
+ hash[param] = _to_hash(value)
362
+ end
363
+ hash
364
+ end
365
+
366
+ end
367
+
368
+ end