appnigma-sdk 2.1.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 +7 -0
  3. data/README.md +567 -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 +58 -5
  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 +2103 -402
  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 +1 -1
  75. data/lib/appnigma/generated/models/disconnect_connection_output.rb +18 -5
  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 +75 -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 +93 -3
@@ -0,0 +1,257 @@
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 LogicDraft < ApiModelBase
18
+ attr_accessor :source
19
+
20
+ # Send it back with a save, so a save on an older revision is refused instead of written over
21
+ attr_accessor :revision
22
+
23
+ # The blob of the file on main the draft began from; null for a new logic
24
+ attr_accessor :base_sha
25
+
26
+ # ISO 8601, in UTC
27
+ attr_accessor :updated_at
28
+
29
+ # The revision a go-live committed, until it is live
30
+ attr_accessor :going_live_revision
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'source' => :'source',
36
+ :'revision' => :'revision',
37
+ :'base_sha' => :'baseSha',
38
+ :'updated_at' => :'updatedAt',
39
+ :'going_live_revision' => :'goingLiveRevision'
40
+ }
41
+ end
42
+
43
+ # Returns attribute mapping this model knows about
44
+ def self.acceptable_attribute_map
45
+ attribute_map
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ acceptable_attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'source' => :'String',
57
+ :'revision' => :'Integer',
58
+ :'base_sha' => :'String',
59
+ :'updated_at' => :'String',
60
+ :'going_live_revision' => :'Integer'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ :'base_sha',
68
+ :'going_live_revision'
69
+ ])
70
+ end
71
+
72
+ # Returns attribute type mapping
73
+ def self.acceptable_openapi_types
74
+ openapi_types
75
+ end
76
+
77
+ # Returns the nullable attributes
78
+ def self.acceptable_openapi_nullable
79
+ openapi_nullable
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::LogicDraft` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::LogicDraft`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'source')
99
+ self.source = attributes[:'source']
100
+ else
101
+ self.source = nil
102
+ end
103
+
104
+ if attributes.key?(:'revision')
105
+ self.revision = attributes[:'revision']
106
+ else
107
+ self.revision = nil
108
+ end
109
+
110
+ if attributes.key?(:'base_sha')
111
+ self.base_sha = attributes[:'base_sha']
112
+ else
113
+ self.base_sha = nil
114
+ end
115
+
116
+ if attributes.key?(:'updated_at')
117
+ self.updated_at = attributes[:'updated_at']
118
+ else
119
+ self.updated_at = nil
120
+ end
121
+
122
+ if attributes.key?(:'going_live_revision')
123
+ self.going_live_revision = attributes[:'going_live_revision']
124
+ else
125
+ self.going_live_revision = nil
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ if @source.nil?
135
+ invalid_properties.push('invalid value for "source", source cannot be nil.')
136
+ end
137
+
138
+ if @revision.nil?
139
+ invalid_properties.push('invalid value for "revision", revision cannot be nil.')
140
+ end
141
+
142
+ if @updated_at.nil?
143
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
144
+ end
145
+
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ warn '[DEPRECATED] the `valid?` method is obsolete'
153
+ return false if @source.nil?
154
+ return false if @revision.nil?
155
+ return false if @updated_at.nil?
156
+ true
157
+ end
158
+
159
+ # Custom attribute writer method with validation
160
+ # @param [Object] source Value to be assigned
161
+ def source=(source)
162
+ if source.nil?
163
+ fail ArgumentError, 'source cannot be nil'
164
+ end
165
+
166
+ @source = source
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] revision Value to be assigned
171
+ def revision=(revision)
172
+ if revision.nil?
173
+ fail ArgumentError, 'revision cannot be nil'
174
+ end
175
+
176
+ @revision = revision
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] updated_at Value to be assigned
181
+ def updated_at=(updated_at)
182
+ if updated_at.nil?
183
+ fail ArgumentError, 'updated_at cannot be nil'
184
+ end
185
+
186
+ @updated_at = updated_at
187
+ end
188
+
189
+ # Checks equality by comparing each attribute.
190
+ # @param [Object] Object to be compared
191
+ def ==(o)
192
+ return true if self.equal?(o)
193
+ self.class == o.class &&
194
+ source == o.source &&
195
+ revision == o.revision &&
196
+ base_sha == o.base_sha &&
197
+ updated_at == o.updated_at &&
198
+ going_live_revision == o.going_live_revision
199
+ end
200
+
201
+ # @see the `==` method
202
+ # @param [Object] Object to be compared
203
+ def eql?(o)
204
+ self == o
205
+ end
206
+
207
+ # Calculates hash code according to all attributes.
208
+ # @return [Integer] Hash code
209
+ def hash
210
+ [source, revision, base_sha, updated_at, going_live_revision].hash
211
+ end
212
+
213
+ # Builds the object from hash
214
+ # @param [Hash] attributes Model attributes in the form of hash
215
+ # @return [Object] Returns the model itself
216
+ def self.build_from_hash(attributes)
217
+ return nil unless attributes.is_a?(Hash)
218
+ attributes = attributes.transform_keys(&:to_sym)
219
+ # include attributes inherited from allOf parents (the nearest declaration wins)
220
+ map = acceptable_attribute_map
221
+ transformed_hash = {}
222
+ acceptable_openapi_types.each_pair do |key, type|
223
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
224
+ transformed_hash["#{key}"] = nil
225
+ elsif type =~ /\AArray<(.*)>/i
226
+ # check to ensure the input is an array given that the attribute
227
+ # is documented as an array but the input is not
228
+ if attributes[map[key]].is_a?(Array)
229
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
230
+ end
231
+ elsif !attributes[map[key]].nil?
232
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
233
+ end
234
+ end
235
+ new(transformed_hash)
236
+ end
237
+
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_hash
241
+ hash = {}
242
+ # include attributes inherited from allOf parents (the nearest declaration wins)
243
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ end
256
+
257
+ end
@@ -0,0 +1,441 @@
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 LogicEntry < ApiModelBase
18
+ # client: your own logic, under src/logic/. end_customer: one end customer's.
19
+ attr_accessor :owner
20
+
21
+ # The end customer's id; null for your own, or for an end customer with no connection left to read it from
22
+ attr_accessor :end_customer_id
23
+
24
+ # The end customer's logic folder key: their files are under end-customers/<logicFolderKey>/. Null for your own.
25
+ attr_accessor :logic_folder_key
26
+
27
+ attr_accessor :platform
28
+
29
+ # The logic's name, the same as its file name
30
+ attr_accessor :name
31
+
32
+ # The live version's id; null when nothing of it is live
33
+ attr_accessor :logic_id
34
+
35
+ # The live version; null when nothing of it is live
36
+ attr_accessor :version
37
+
38
+ attr_accessor :description
39
+
40
+ # Whether the live version runs around platform calls by itself; false when nothing of it is live
41
+ attr_accessor :always_on
42
+
43
+ # False only for always-on logic switched off, for everyone or for this end customer
44
+ attr_accessor :on
45
+
46
+ # live; failed, its last go-live left it out; draft, a new logic with only a draft; checking, a go-live being checked
47
+ attr_accessor :status
48
+
49
+ attr_accessor :failure
50
+
51
+ # Whether changes are kept on our side, not live yet
52
+ attr_accessor :has_draft
53
+
54
+ class EnumAttributeValidator
55
+ attr_reader :datatype
56
+ attr_reader :allowable_values
57
+
58
+ def initialize(datatype, allowable_values)
59
+ @allowable_values = allowable_values.map do |value|
60
+ case datatype.to_s
61
+ when /Integer/i
62
+ value.to_i
63
+ when /Float/i
64
+ value.to_f
65
+ else
66
+ value
67
+ end
68
+ end
69
+ end
70
+
71
+ def valid?(value)
72
+ !value || allowable_values.include?(value)
73
+ end
74
+ end
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'owner' => :'owner',
80
+ :'end_customer_id' => :'endCustomerId',
81
+ :'logic_folder_key' => :'logicFolderKey',
82
+ :'platform' => :'platform',
83
+ :'name' => :'name',
84
+ :'logic_id' => :'logicId',
85
+ :'version' => :'version',
86
+ :'description' => :'description',
87
+ :'always_on' => :'alwaysOn',
88
+ :'on' => :'on',
89
+ :'status' => :'status',
90
+ :'failure' => :'failure',
91
+ :'has_draft' => :'hasDraft'
92
+ }
93
+ end
94
+
95
+ # Returns attribute mapping this model knows about
96
+ def self.acceptable_attribute_map
97
+ attribute_map
98
+ end
99
+
100
+ # Returns all the JSON keys this model knows about
101
+ def self.acceptable_attributes
102
+ acceptable_attribute_map.values
103
+ end
104
+
105
+ # Attribute type mapping.
106
+ def self.openapi_types
107
+ {
108
+ :'owner' => :'String',
109
+ :'end_customer_id' => :'String',
110
+ :'logic_folder_key' => :'String',
111
+ :'platform' => :'String',
112
+ :'name' => :'String',
113
+ :'logic_id' => :'String',
114
+ :'version' => :'Integer',
115
+ :'description' => :'String',
116
+ :'always_on' => :'Boolean',
117
+ :'on' => :'Boolean',
118
+ :'status' => :'String',
119
+ :'failure' => :'LogicEntryFailure',
120
+ :'has_draft' => :'Boolean'
121
+ }
122
+ end
123
+
124
+ # List of attributes with nullable: true
125
+ def self.openapi_nullable
126
+ Set.new([
127
+ :'end_customer_id',
128
+ :'logic_folder_key',
129
+ :'logic_id',
130
+ :'version',
131
+ :'description',
132
+ :'failure',
133
+ ])
134
+ end
135
+
136
+ # Returns attribute type mapping
137
+ def self.acceptable_openapi_types
138
+ openapi_types
139
+ end
140
+
141
+ # Returns the nullable attributes
142
+ def self.acceptable_openapi_nullable
143
+ openapi_nullable
144
+ end
145
+
146
+ # Initializes the object
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ def initialize(attributes = {})
149
+ if (!attributes.is_a?(Hash))
150
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::LogicEntry` initialize method"
151
+ end
152
+
153
+ # check to see if the attribute exists and convert string to symbol for hash key
154
+ acceptable_attribute_map = self.class.acceptable_attribute_map
155
+ attributes = attributes.each_with_object({}) { |(k, v), h|
156
+ if (!acceptable_attribute_map.key?(k.to_sym))
157
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::LogicEntry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
158
+ end
159
+ h[k.to_sym] = v
160
+ }
161
+
162
+ if attributes.key?(:'owner')
163
+ self.owner = attributes[:'owner']
164
+ else
165
+ self.owner = nil
166
+ end
167
+
168
+ if attributes.key?(:'end_customer_id')
169
+ self.end_customer_id = attributes[:'end_customer_id']
170
+ else
171
+ self.end_customer_id = nil
172
+ end
173
+
174
+ if attributes.key?(:'logic_folder_key')
175
+ self.logic_folder_key = attributes[:'logic_folder_key']
176
+ else
177
+ self.logic_folder_key = nil
178
+ end
179
+
180
+ if attributes.key?(:'platform')
181
+ self.platform = attributes[:'platform']
182
+ else
183
+ self.platform = nil
184
+ end
185
+
186
+ if attributes.key?(:'name')
187
+ self.name = attributes[:'name']
188
+ else
189
+ self.name = nil
190
+ end
191
+
192
+ if attributes.key?(:'logic_id')
193
+ self.logic_id = attributes[:'logic_id']
194
+ else
195
+ self.logic_id = nil
196
+ end
197
+
198
+ if attributes.key?(:'version')
199
+ self.version = attributes[:'version']
200
+ else
201
+ self.version = nil
202
+ end
203
+
204
+ if attributes.key?(:'description')
205
+ self.description = attributes[:'description']
206
+ else
207
+ self.description = nil
208
+ end
209
+
210
+ if attributes.key?(:'always_on')
211
+ self.always_on = attributes[:'always_on']
212
+ else
213
+ self.always_on = nil
214
+ end
215
+
216
+ if attributes.key?(:'on')
217
+ self.on = attributes[:'on']
218
+ else
219
+ self.on = nil
220
+ end
221
+
222
+ if attributes.key?(:'status')
223
+ self.status = attributes[:'status']
224
+ else
225
+ self.status = nil
226
+ end
227
+
228
+ if attributes.key?(:'failure')
229
+ self.failure = attributes[:'failure']
230
+ else
231
+ self.failure = nil
232
+ end
233
+
234
+ if attributes.key?(:'has_draft')
235
+ self.has_draft = attributes[:'has_draft']
236
+ else
237
+ self.has_draft = nil
238
+ end
239
+ end
240
+
241
+ # Show invalid properties with the reasons. Usually used together with valid?
242
+ # @return Array for valid properties with the reasons
243
+ def list_invalid_properties
244
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
245
+ invalid_properties = Array.new
246
+ if @owner.nil?
247
+ invalid_properties.push('invalid value for "owner", owner cannot be nil.')
248
+ end
249
+
250
+ if @platform.nil?
251
+ invalid_properties.push('invalid value for "platform", platform cannot be nil.')
252
+ end
253
+
254
+ if @name.nil?
255
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
256
+ end
257
+
258
+ if @always_on.nil?
259
+ invalid_properties.push('invalid value for "always_on", always_on cannot be nil.')
260
+ end
261
+
262
+ if @on.nil?
263
+ invalid_properties.push('invalid value for "on", on cannot be nil.')
264
+ end
265
+
266
+ if @status.nil?
267
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
268
+ end
269
+
270
+ if @has_draft.nil?
271
+ invalid_properties.push('invalid value for "has_draft", has_draft cannot be nil.')
272
+ end
273
+
274
+ invalid_properties
275
+ end
276
+
277
+ # Check to see if the all the properties in the model are valid
278
+ # @return true if the model is valid
279
+ def valid?
280
+ warn '[DEPRECATED] the `valid?` method is obsolete'
281
+ return false if @owner.nil?
282
+ owner_validator = EnumAttributeValidator.new('String', ["client", "end_customer"])
283
+ return false unless owner_validator.valid?(@owner)
284
+ return false if @platform.nil?
285
+ return false if @name.nil?
286
+ return false if @always_on.nil?
287
+ return false if @on.nil?
288
+ return false if @status.nil?
289
+ status_validator = EnumAttributeValidator.new('String', ["live", "failed", "draft", "checking"])
290
+ return false unless status_validator.valid?(@status)
291
+ return false if @has_draft.nil?
292
+ true
293
+ end
294
+
295
+ # Custom attribute writer method checking allowed values (enum).
296
+ # @param [Object] owner Object to be assigned
297
+ def owner=(owner)
298
+ validator = EnumAttributeValidator.new('String', ["client", "end_customer"])
299
+ unless validator.valid?(owner)
300
+ fail ArgumentError, "invalid value for \"owner\", must be one of #{validator.allowable_values}."
301
+ end
302
+ @owner = owner
303
+ end
304
+
305
+ # Custom attribute writer method with validation
306
+ # @param [Object] platform Value to be assigned
307
+ def platform=(platform)
308
+ if platform.nil?
309
+ fail ArgumentError, 'platform cannot be nil'
310
+ end
311
+
312
+ @platform = platform
313
+ end
314
+
315
+ # Custom attribute writer method with validation
316
+ # @param [Object] name Value to be assigned
317
+ def name=(name)
318
+ if name.nil?
319
+ fail ArgumentError, 'name cannot be nil'
320
+ end
321
+
322
+ @name = name
323
+ end
324
+
325
+ # Custom attribute writer method with validation
326
+ # @param [Object] always_on Value to be assigned
327
+ def always_on=(always_on)
328
+ if always_on.nil?
329
+ fail ArgumentError, 'always_on cannot be nil'
330
+ end
331
+
332
+ @always_on = always_on
333
+ end
334
+
335
+ # Custom attribute writer method with validation
336
+ # @param [Object] on Value to be assigned
337
+ def on=(on)
338
+ if on.nil?
339
+ fail ArgumentError, 'on cannot be nil'
340
+ end
341
+
342
+ @on = on
343
+ end
344
+
345
+ # Custom attribute writer method checking allowed values (enum).
346
+ # @param [Object] status Object to be assigned
347
+ def status=(status)
348
+ validator = EnumAttributeValidator.new('String', ["live", "failed", "draft", "checking"])
349
+ unless validator.valid?(status)
350
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
351
+ end
352
+ @status = status
353
+ end
354
+
355
+ # Custom attribute writer method with validation
356
+ # @param [Object] has_draft Value to be assigned
357
+ def has_draft=(has_draft)
358
+ if has_draft.nil?
359
+ fail ArgumentError, 'has_draft cannot be nil'
360
+ end
361
+
362
+ @has_draft = has_draft
363
+ end
364
+
365
+ # Checks equality by comparing each attribute.
366
+ # @param [Object] Object to be compared
367
+ def ==(o)
368
+ return true if self.equal?(o)
369
+ self.class == o.class &&
370
+ owner == o.owner &&
371
+ end_customer_id == o.end_customer_id &&
372
+ logic_folder_key == o.logic_folder_key &&
373
+ platform == o.platform &&
374
+ name == o.name &&
375
+ logic_id == o.logic_id &&
376
+ version == o.version &&
377
+ description == o.description &&
378
+ always_on == o.always_on &&
379
+ on == o.on &&
380
+ status == o.status &&
381
+ failure == o.failure &&
382
+ has_draft == o.has_draft
383
+ end
384
+
385
+ # @see the `==` method
386
+ # @param [Object] Object to be compared
387
+ def eql?(o)
388
+ self == o
389
+ end
390
+
391
+ # Calculates hash code according to all attributes.
392
+ # @return [Integer] Hash code
393
+ def hash
394
+ [owner, end_customer_id, logic_folder_key, platform, name, logic_id, version, description, always_on, on, status, failure, has_draft].hash
395
+ end
396
+
397
+ # Builds the object from hash
398
+ # @param [Hash] attributes Model attributes in the form of hash
399
+ # @return [Object] Returns the model itself
400
+ def self.build_from_hash(attributes)
401
+ return nil unless attributes.is_a?(Hash)
402
+ attributes = attributes.transform_keys(&:to_sym)
403
+ # include attributes inherited from allOf parents (the nearest declaration wins)
404
+ map = acceptable_attribute_map
405
+ transformed_hash = {}
406
+ acceptable_openapi_types.each_pair do |key, type|
407
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
408
+ transformed_hash["#{key}"] = nil
409
+ elsif type =~ /\AArray<(.*)>/i
410
+ # check to ensure the input is an array given that the attribute
411
+ # is documented as an array but the input is not
412
+ if attributes[map[key]].is_a?(Array)
413
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
414
+ end
415
+ elsif !attributes[map[key]].nil?
416
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
417
+ end
418
+ end
419
+ new(transformed_hash)
420
+ end
421
+
422
+ # Returns the object in the form of hash
423
+ # @return [Hash] Returns the object in the form of hash
424
+ def to_hash
425
+ hash = {}
426
+ # include attributes inherited from allOf parents (the nearest declaration wins)
427
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
428
+ value = self.send(attr)
429
+ if value.nil?
430
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
431
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
432
+ end
433
+
434
+ hash[param] = _to_hash(value)
435
+ end
436
+ hash
437
+ end
438
+
439
+ end
440
+
441
+ end