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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +592 -26
- data/exe/appnigma +8 -0
- data/lib/appnigma/actions.rb +33 -0
- data/lib/appnigma/checks.rb +13 -0
- data/lib/appnigma/client.rb +30 -13
- data/lib/appnigma/command.rb +154 -0
- data/lib/appnigma/command_files.rb +46 -0
- data/lib/appnigma/connect_fields.rb +83 -0
- data/lib/appnigma/connections.rb +72 -3
- data/lib/appnigma/constants.rb +57 -0
- data/lib/appnigma/end_customers.rb +29 -0
- data/lib/appnigma/errors.rb +44 -6
- data/lib/appnigma/features.rb +19 -0
- data/lib/appnigma/files.rb +26 -0
- data/lib/appnigma/generated/api/default_api.rb +2149 -380
- data/lib/appnigma/generated/api_client.rb +1 -1
- data/lib/appnigma/generated/api_error.rb +1 -1
- data/lib/appnigma/generated/api_model_base.rb +1 -1
- data/lib/appnigma/generated/configuration.rb +1 -1
- data/lib/appnigma/generated/models/action_entry.rb +1 -1
- data/lib/appnigma/generated/models/check_logic_input.rb +276 -0
- data/lib/appnigma/generated/models/check_logic_output.rb +193 -0
- data/lib/appnigma/generated/models/client_event.rb +309 -0
- data/lib/appnigma/generated/models/client_event_delivery.rb +306 -0
- data/lib/appnigma/generated/models/client_event_type.rb +44 -0
- data/lib/appnigma/generated/models/client_webhook.rb +346 -0
- data/lib/appnigma/generated/models/connect_end_customer_input.rb +243 -0
- data/lib/appnigma/generated/models/connect_end_customer_output.rb +294 -0
- data/lib/appnigma/generated/models/connect_field.rb +308 -0
- data/lib/appnigma/generated/models/connection_status.rb +1 -1
- data/lib/appnigma/generated/models/create_connection_link_input.rb +1 -1
- data/lib/appnigma/generated/models/create_connection_link_output.rb +1 -1
- data/lib/appnigma/generated/models/create_logic_input.rb +273 -0
- data/lib/appnigma/generated/models/create_logic_input_trigger.rb +104 -0
- data/lib/appnigma/generated/models/create_logic_input_trigger_any_of.rb +257 -0
- data/lib/appnigma/generated/models/create_logic_input_trigger_any_of1.rb +238 -0
- data/lib/appnigma/generated/models/create_logic_output.rb +230 -0
- data/lib/appnigma/generated/models/create_portal_link_input.rb +2 -18
- data/lib/appnigma/generated/models/create_portal_link_output.rb +1 -1
- data/lib/appnigma/generated/models/create_webhook_input.rb +187 -0
- data/lib/appnigma/generated/models/create_webhook_output.rb +204 -0
- data/lib/appnigma/generated/models/crm_company.rb +1 -1
- data/lib/appnigma/generated/models/crm_company_get_output.rb +1 -1
- data/lib/appnigma/generated/models/crm_company_list_output.rb +1 -1
- data/lib/appnigma/generated/models/crm_company_write_output.rb +1 -1
- data/lib/appnigma/generated/models/crm_contact.rb +1 -1
- data/lib/appnigma/generated/models/crm_contact_get_output.rb +1 -1
- data/lib/appnigma/generated/models/crm_contact_list_output.rb +1 -1
- data/lib/appnigma/generated/models/crm_contact_write_output.rb +1 -1
- data/lib/appnigma/generated/models/crm_create_input.rb +1 -1
- data/lib/appnigma/generated/models/crm_custom_field.rb +1 -1
- data/lib/appnigma/generated/models/crm_deal.rb +1 -1
- data/lib/appnigma/generated/models/crm_deal_create_input.rb +1 -1
- data/lib/appnigma/generated/models/crm_deal_get_output.rb +1 -1
- data/lib/appnigma/generated/models/crm_deal_list_output.rb +1 -1
- data/lib/appnigma/generated/models/crm_deal_write_output.rb +1 -1
- data/lib/appnigma/generated/models/crm_email.rb +1 -1
- data/lib/appnigma/generated/models/crm_get_input.rb +1 -1
- data/lib/appnigma/generated/models/crm_labelled.rb +1 -1
- data/lib/appnigma/generated/models/crm_list_input.rb +1 -1
- data/lib/appnigma/generated/models/crm_phone.rb +1 -1
- data/lib/appnigma/generated/models/crm_update_input.rb +1 -1
- data/lib/appnigma/generated/models/delete_end_customer_input.rb +178 -0
- data/lib/appnigma/generated/models/delete_end_customer_output.rb +286 -0
- data/lib/appnigma/generated/models/delete_end_customer_output_connections_inner.rb +238 -0
- data/lib/appnigma/generated/models/delete_end_customer_output_logic_folder.rb +255 -0
- data/lib/appnigma/generated/models/delete_end_customer_output_steps_inner.rb +257 -0
- data/lib/appnigma/generated/models/delete_webhook_input.rb +189 -0
- data/lib/appnigma/generated/models/delete_webhook_output.rb +228 -0
- data/lib/appnigma/generated/models/discard_logic_input.rb +292 -0
- data/lib/appnigma/generated/models/discard_logic_output.rb +254 -0
- data/lib/appnigma/generated/models/disconnect_connection_input.rb +216 -0
- data/lib/appnigma/generated/models/disconnect_connection_output.rb +294 -0
- data/lib/appnigma/generated/models/edit_logic_input.rb +368 -0
- data/lib/appnigma/generated/models/edit_logic_output.rb +298 -0
- data/lib/appnigma/generated/models/encrypted_fields.rb +357 -0
- data/lib/appnigma/generated/models/end_customer.rb +17 -3
- data/lib/appnigma/generated/models/end_customer_connection.rb +1 -1
- data/lib/appnigma/generated/models/function_entry.rb +1 -1
- data/lib/appnigma/generated/models/function_owner.rb +1 -1
- data/lib/appnigma/generated/models/function_owner_one_of.rb +1 -1
- data/lib/appnigma/generated/models/function_owner_one_of1.rb +1 -1
- data/lib/appnigma/generated/models/get_alerts_output.rb +180 -0
- data/lib/appnigma/generated/models/get_connect_key_output.rb +256 -0
- data/lib/appnigma/generated/models/get_connection_input.rb +1 -1
- data/lib/appnigma/generated/models/get_connection_output.rb +34 -7
- data/lib/appnigma/generated/models/get_guide_output.rb +1 -1
- data/lib/appnigma/generated/models/get_logic_go_live_status_input.rb +247 -0
- data/lib/appnigma/generated/models/get_logic_go_live_status_output.rb +296 -0
- data/lib/appnigma/generated/models/get_logic_input.rb +247 -0
- data/lib/appnigma/generated/models/get_logic_output.rb +240 -0
- data/lib/appnigma/generated/models/get_logic_output_file.rb +204 -0
- data/lib/appnigma/generated/models/get_platform_input.rb +188 -0
- data/lib/appnigma/generated/models/get_platform_output.rb +326 -0
- data/lib/appnigma/generated/models/get_sync_output.rb +207 -0
- data/lib/appnigma/generated/models/go_live_logic_input.rb +316 -0
- data/lib/appnigma/generated/models/go_live_logic_output.rb +281 -0
- data/lib/appnigma/generated/models/json_value.rb +1 -1
- data/lib/appnigma/generated/models/list_actions_output.rb +1 -1
- data/lib/appnigma/generated/models/list_connections_output.rb +3 -3
- data/lib/appnigma/generated/models/list_events_input.rb +302 -0
- data/lib/appnigma/generated/models/list_events_output.rb +193 -0
- data/lib/appnigma/generated/models/list_features_output.rb +179 -0
- data/lib/appnigma/generated/models/list_features_output_features_inner.rb +229 -0
- data/lib/appnigma/generated/models/list_functions_output.rb +1 -1
- data/lib/appnigma/generated/models/list_logic_input.rb +162 -0
- data/lib/appnigma/generated/models/list_logic_output.rb +209 -0
- data/lib/appnigma/generated/models/list_logic_runs_input.rb +275 -0
- data/lib/appnigma/generated/models/list_logic_runs_output.rb +193 -0
- data/lib/appnigma/generated/models/list_platforms_output.rb +1 -1
- data/lib/appnigma/generated/models/list_record_changes_input.rb +375 -0
- data/lib/appnigma/generated/models/list_record_changes_output.rb +193 -0
- data/lib/appnigma/generated/models/list_webhooks_output.rb +180 -0
- data/lib/appnigma/generated/models/logic_check_problem.rb +203 -0
- data/lib/appnigma/generated/models/logic_conditional.rb +3 -3
- data/lib/appnigma/generated/models/logic_draft.rb +257 -0
- data/lib/appnigma/generated/models/logic_entry.rb +441 -0
- data/lib/appnigma/generated/models/logic_entry_failure.rb +205 -0
- data/lib/appnigma/generated/models/logic_folder_problem.rb +218 -0
- data/lib/appnigma/generated/models/logic_run.rb +483 -0
- data/lib/appnigma/generated/models/logic_test_call.rb +269 -0
- data/lib/appnigma/generated/models/platform_entry.rb +63 -6
- data/lib/appnigma/generated/models/platform_entry_coverage_inner.rb +1 -1
- data/lib/appnigma/generated/models/platform_request_input.rb +1 -1
- data/lib/appnigma/generated/models/platform_request_input_body.rb +1 -1
- data/lib/appnigma/generated/models/platform_request_output.rb +1 -1
- data/lib/appnigma/generated/models/ran_as.rb +1 -1
- data/lib/appnigma/generated/models/record_change.rb +231 -0
- data/lib/appnigma/generated/models/record_change_record.rb +105 -0
- data/lib/appnigma/generated/models/run_action_input.rb +1 -1
- data/lib/appnigma/generated/models/run_action_output.rb +1 -1
- data/lib/appnigma/generated/models/run_input.rb +1 -1
- data/lib/appnigma/generated/models/run_output.rb +1 -1
- data/lib/appnigma/generated/models/sdk_error.rb +1 -1
- data/lib/appnigma/generated/models/sdk_error_error.rb +3 -3
- data/lib/appnigma/generated/models/sdk_error_error_details.rb +81 -6
- data/lib/appnigma/generated/models/sdk_problem.rb +1 -1
- data/lib/appnigma/generated/models/set_alerts_input.rb +197 -0
- data/lib/appnigma/generated/models/set_alerts_output.rb +180 -0
- data/lib/appnigma/generated/models/set_sync_input.rb +177 -0
- data/lib/appnigma/generated/models/set_sync_output.rb +207 -0
- data/lib/appnigma/generated/models/switch_logic_off_input.rb +200 -0
- data/lib/appnigma/generated/models/switch_logic_off_output.rb +315 -0
- data/lib/appnigma/generated/models/switch_logic_on_input.rb +200 -0
- data/lib/appnigma/generated/models/switch_logic_on_output.rb +315 -0
- data/lib/appnigma/generated/models/sync_health.rb +231 -0
- data/lib/appnigma/generated/models/test_logic_input.rb +355 -0
- data/lib/appnigma/generated/models/test_logic_output.rb +418 -0
- data/lib/appnigma/generated/models/test_logic_output_error.rb +231 -0
- data/lib/appnigma/generated/models/update_logic_input.rb +359 -0
- data/lib/appnigma/generated/models/update_logic_output.rb +205 -0
- data/lib/appnigma/generated/version.rb +1 -1
- data/lib/appnigma/generated.rb +77 -1
- data/lib/appnigma/logic.rb +176 -0
- data/lib/appnigma/names.rb +4 -4
- data/lib/appnigma/platforms.rb +11 -1
- data/lib/appnigma/portal.rb +8 -5
- data/lib/appnigma/records.rb +46 -0
- data/lib/appnigma/schema_type.rb +149 -0
- data/lib/appnigma/sync.rb +30 -0
- data/lib/appnigma/types_printer.rb +154 -0
- data/lib/appnigma/verify_webhook.rb +107 -0
- data/lib/appnigma/version.rb +2 -2
- data/lib/appnigma/webhooks.rb +79 -0
- data/lib/appnigma.rb +1 -0
- metadata +95 -3
|
@@ -0,0 +1,309 @@
|
|
|
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 ClientEvent < ApiModelBase
|
|
18
|
+
# The same id your webhook was sent in Appnigma-Event-Id
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
attr_accessor :type
|
|
22
|
+
|
|
23
|
+
# ISO 8601, in UTC
|
|
24
|
+
attr_accessor :created_at
|
|
25
|
+
|
|
26
|
+
# Ids and codes only, never a record or a message. connection.*: endCustomerId, platform, code. go_live.*: attemptId, commitSha, and on go_live.failed a code. logic.failed: endCustomerId, platform, logicId, logicName, logicVersion, timing, errorCode, requestId.
|
|
27
|
+
attr_accessor :data
|
|
28
|
+
|
|
29
|
+
# One per webhook it was sent to; empty when none was on for its type
|
|
30
|
+
attr_accessor :deliveries
|
|
31
|
+
|
|
32
|
+
class EnumAttributeValidator
|
|
33
|
+
attr_reader :datatype
|
|
34
|
+
attr_reader :allowable_values
|
|
35
|
+
|
|
36
|
+
def initialize(datatype, allowable_values)
|
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
|
38
|
+
case datatype.to_s
|
|
39
|
+
when /Integer/i
|
|
40
|
+
value.to_i
|
|
41
|
+
when /Float/i
|
|
42
|
+
value.to_f
|
|
43
|
+
else
|
|
44
|
+
value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def valid?(value)
|
|
50
|
+
!value || allowable_values.include?(value)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'id' => :'id',
|
|
58
|
+
:'type' => :'type',
|
|
59
|
+
:'created_at' => :'createdAt',
|
|
60
|
+
:'data' => :'data',
|
|
61
|
+
:'deliveries' => :'deliveries'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Returns attribute mapping this model knows about
|
|
66
|
+
def self.acceptable_attribute_map
|
|
67
|
+
attribute_map
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Returns all the JSON keys this model knows about
|
|
71
|
+
def self.acceptable_attributes
|
|
72
|
+
acceptable_attribute_map.values
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Attribute type mapping.
|
|
76
|
+
def self.openapi_types
|
|
77
|
+
{
|
|
78
|
+
:'id' => :'String',
|
|
79
|
+
:'type' => :'ClientEventType',
|
|
80
|
+
:'created_at' => :'String',
|
|
81
|
+
:'data' => :'Object',
|
|
82
|
+
:'deliveries' => :'Array<ClientEventDelivery>'
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# List of attributes with nullable: true
|
|
87
|
+
def self.openapi_nullable
|
|
88
|
+
Set.new([
|
|
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::ClientEvent` 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::ClientEvent`. 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?(:'id')
|
|
119
|
+
self.id = attributes[:'id']
|
|
120
|
+
else
|
|
121
|
+
self.id = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'type')
|
|
125
|
+
self.type = attributes[:'type']
|
|
126
|
+
else
|
|
127
|
+
self.type = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'created_at')
|
|
131
|
+
self.created_at = attributes[:'created_at']
|
|
132
|
+
else
|
|
133
|
+
self.created_at = nil
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'data')
|
|
137
|
+
self.data = attributes[:'data']
|
|
138
|
+
else
|
|
139
|
+
self.data = nil
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'deliveries')
|
|
143
|
+
if (value = attributes[:'deliveries']).is_a?(Array)
|
|
144
|
+
self.deliveries = value
|
|
145
|
+
end
|
|
146
|
+
else
|
|
147
|
+
self.deliveries = nil
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
152
|
+
# @return Array for valid properties with the reasons
|
|
153
|
+
def list_invalid_properties
|
|
154
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
155
|
+
invalid_properties = Array.new
|
|
156
|
+
if @id.nil?
|
|
157
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if @type.nil?
|
|
161
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if @created_at.nil?
|
|
165
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if @data.nil?
|
|
169
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if @deliveries.nil?
|
|
173
|
+
invalid_properties.push('invalid value for "deliveries", deliveries cannot be nil.')
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
invalid_properties
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Check to see if the all the properties in the model are valid
|
|
180
|
+
# @return true if the model is valid
|
|
181
|
+
def valid?
|
|
182
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
183
|
+
return false if @id.nil?
|
|
184
|
+
return false if @type.nil?
|
|
185
|
+
return false if @created_at.nil?
|
|
186
|
+
return false if @data.nil?
|
|
187
|
+
return false if @deliveries.nil?
|
|
188
|
+
true
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Custom attribute writer method with validation
|
|
192
|
+
# @param [Object] id Value to be assigned
|
|
193
|
+
def id=(id)
|
|
194
|
+
if id.nil?
|
|
195
|
+
fail ArgumentError, 'id cannot be nil'
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
@id = id
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Custom attribute writer method with validation
|
|
202
|
+
# @param [Object] type Value to be assigned
|
|
203
|
+
def type=(type)
|
|
204
|
+
if type.nil?
|
|
205
|
+
fail ArgumentError, 'type cannot be nil'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@type = type
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Custom attribute writer method with validation
|
|
212
|
+
# @param [Object] created_at Value to be assigned
|
|
213
|
+
def created_at=(created_at)
|
|
214
|
+
if created_at.nil?
|
|
215
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@created_at = created_at
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Custom attribute writer method with validation
|
|
222
|
+
# @param [Object] data Value to be assigned
|
|
223
|
+
def data=(data)
|
|
224
|
+
if data.nil?
|
|
225
|
+
fail ArgumentError, 'data cannot be nil'
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
@data = data
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Custom attribute writer method with validation
|
|
232
|
+
# @param [Object] deliveries Value to be assigned
|
|
233
|
+
def deliveries=(deliveries)
|
|
234
|
+
if deliveries.nil?
|
|
235
|
+
fail ArgumentError, 'deliveries cannot be nil'
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
@deliveries = deliveries
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Checks equality by comparing each attribute.
|
|
242
|
+
# @param [Object] Object to be compared
|
|
243
|
+
def ==(o)
|
|
244
|
+
return true if self.equal?(o)
|
|
245
|
+
self.class == o.class &&
|
|
246
|
+
id == o.id &&
|
|
247
|
+
type == o.type &&
|
|
248
|
+
created_at == o.created_at &&
|
|
249
|
+
data == o.data &&
|
|
250
|
+
deliveries == o.deliveries
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# @see the `==` method
|
|
254
|
+
# @param [Object] Object to be compared
|
|
255
|
+
def eql?(o)
|
|
256
|
+
self == o
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Calculates hash code according to all attributes.
|
|
260
|
+
# @return [Integer] Hash code
|
|
261
|
+
def hash
|
|
262
|
+
[id, type, created_at, data, deliveries].hash
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Builds the object from hash
|
|
266
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
267
|
+
# @return [Object] Returns the model itself
|
|
268
|
+
def self.build_from_hash(attributes)
|
|
269
|
+
return nil unless attributes.is_a?(Hash)
|
|
270
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
271
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
272
|
+
map = acceptable_attribute_map
|
|
273
|
+
transformed_hash = {}
|
|
274
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
275
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
276
|
+
transformed_hash["#{key}"] = nil
|
|
277
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
278
|
+
# check to ensure the input is an array given that the attribute
|
|
279
|
+
# is documented as an array but the input is not
|
|
280
|
+
if attributes[map[key]].is_a?(Array)
|
|
281
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
282
|
+
end
|
|
283
|
+
elsif !attributes[map[key]].nil?
|
|
284
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
new(transformed_hash)
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# Returns the object in the form of hash
|
|
291
|
+
# @return [Hash] Returns the object in the form of hash
|
|
292
|
+
def to_hash
|
|
293
|
+
hash = {}
|
|
294
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
295
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
296
|
+
value = self.send(attr)
|
|
297
|
+
if value.nil?
|
|
298
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
299
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
hash[param] = _to_hash(value)
|
|
303
|
+
end
|
|
304
|
+
hash
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
end
|
|
@@ -0,0 +1,306 @@
|
|
|
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 ClientEventDelivery < ApiModelBase
|
|
18
|
+
attr_accessor :webhook_id
|
|
19
|
+
|
|
20
|
+
# pending, still being tried; delivered, your server answered 2xx; failed, every try failed or it could not be sent
|
|
21
|
+
attr_accessor :state
|
|
22
|
+
|
|
23
|
+
# How many sends were made
|
|
24
|
+
attr_accessor :tries
|
|
25
|
+
|
|
26
|
+
# The HTTP status your server last answered; null when it did not answer
|
|
27
|
+
attr_accessor :last_status
|
|
28
|
+
|
|
29
|
+
# Why the last try failed: http_status, your server answered other than 2xx; timed_out, no answer within 10 seconds; connection_failed; address_refused, the host no longer resolves only to public addresses; switched_off, the webhook was switched off; not_queued or internal_error, our side
|
|
30
|
+
attr_accessor :last_error_code
|
|
31
|
+
|
|
32
|
+
# ISO 8601, in UTC
|
|
33
|
+
attr_accessor :delivered_at
|
|
34
|
+
|
|
35
|
+
class EnumAttributeValidator
|
|
36
|
+
attr_reader :datatype
|
|
37
|
+
attr_reader :allowable_values
|
|
38
|
+
|
|
39
|
+
def initialize(datatype, allowable_values)
|
|
40
|
+
@allowable_values = allowable_values.map do |value|
|
|
41
|
+
case datatype.to_s
|
|
42
|
+
when /Integer/i
|
|
43
|
+
value.to_i
|
|
44
|
+
when /Float/i
|
|
45
|
+
value.to_f
|
|
46
|
+
else
|
|
47
|
+
value
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def valid?(value)
|
|
53
|
+
!value || allowable_values.include?(value)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
58
|
+
def self.attribute_map
|
|
59
|
+
{
|
|
60
|
+
:'webhook_id' => :'webhookId',
|
|
61
|
+
:'state' => :'state',
|
|
62
|
+
:'tries' => :'tries',
|
|
63
|
+
:'last_status' => :'lastStatus',
|
|
64
|
+
:'last_error_code' => :'lastErrorCode',
|
|
65
|
+
:'delivered_at' => :'deliveredAt'
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Returns attribute mapping this model knows about
|
|
70
|
+
def self.acceptable_attribute_map
|
|
71
|
+
attribute_map
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Returns all the JSON keys this model knows about
|
|
75
|
+
def self.acceptable_attributes
|
|
76
|
+
acceptable_attribute_map.values
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Attribute type mapping.
|
|
80
|
+
def self.openapi_types
|
|
81
|
+
{
|
|
82
|
+
:'webhook_id' => :'String',
|
|
83
|
+
:'state' => :'String',
|
|
84
|
+
:'tries' => :'Integer',
|
|
85
|
+
:'last_status' => :'Integer',
|
|
86
|
+
:'last_error_code' => :'String',
|
|
87
|
+
:'delivered_at' => :'String'
|
|
88
|
+
}
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# List of attributes with nullable: true
|
|
92
|
+
def self.openapi_nullable
|
|
93
|
+
Set.new([
|
|
94
|
+
:'last_status',
|
|
95
|
+
:'last_error_code',
|
|
96
|
+
:'delivered_at'
|
|
97
|
+
])
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Returns attribute type mapping
|
|
101
|
+
def self.acceptable_openapi_types
|
|
102
|
+
openapi_types
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Returns the nullable attributes
|
|
106
|
+
def self.acceptable_openapi_nullable
|
|
107
|
+
openapi_nullable
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Initializes the object
|
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
112
|
+
def initialize(attributes = {})
|
|
113
|
+
if (!attributes.is_a?(Hash))
|
|
114
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::ClientEventDelivery` initialize method"
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
118
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
119
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
120
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
121
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::ClientEventDelivery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
122
|
+
end
|
|
123
|
+
h[k.to_sym] = v
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'webhook_id')
|
|
127
|
+
self.webhook_id = attributes[:'webhook_id']
|
|
128
|
+
else
|
|
129
|
+
self.webhook_id = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'state')
|
|
133
|
+
self.state = attributes[:'state']
|
|
134
|
+
else
|
|
135
|
+
self.state = nil
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'tries')
|
|
139
|
+
self.tries = attributes[:'tries']
|
|
140
|
+
else
|
|
141
|
+
self.tries = nil
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'last_status')
|
|
145
|
+
self.last_status = attributes[:'last_status']
|
|
146
|
+
else
|
|
147
|
+
self.last_status = nil
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'last_error_code')
|
|
151
|
+
self.last_error_code = attributes[:'last_error_code']
|
|
152
|
+
else
|
|
153
|
+
self.last_error_code = nil
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'delivered_at')
|
|
157
|
+
self.delivered_at = attributes[:'delivered_at']
|
|
158
|
+
else
|
|
159
|
+
self.delivered_at = nil
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
164
|
+
# @return Array for valid properties with the reasons
|
|
165
|
+
def list_invalid_properties
|
|
166
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
167
|
+
invalid_properties = Array.new
|
|
168
|
+
if @webhook_id.nil?
|
|
169
|
+
invalid_properties.push('invalid value for "webhook_id", webhook_id cannot be nil.')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if @state.nil?
|
|
173
|
+
invalid_properties.push('invalid value for "state", state cannot be nil.')
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if @tries.nil?
|
|
177
|
+
invalid_properties.push('invalid value for "tries", tries cannot be nil.')
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
invalid_properties
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Check to see if the all the properties in the model are valid
|
|
184
|
+
# @return true if the model is valid
|
|
185
|
+
def valid?
|
|
186
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
187
|
+
return false if @webhook_id.nil?
|
|
188
|
+
return false if @state.nil?
|
|
189
|
+
state_validator = EnumAttributeValidator.new('String', ["pending", "delivered", "failed"])
|
|
190
|
+
return false unless state_validator.valid?(@state)
|
|
191
|
+
return false if @tries.nil?
|
|
192
|
+
last_error_code_validator = EnumAttributeValidator.new('String', ["http_status", "timed_out", "connection_failed", "address_refused", "switched_off", "not_queued", "internal_error"])
|
|
193
|
+
return false unless last_error_code_validator.valid?(@last_error_code)
|
|
194
|
+
true
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Custom attribute writer method with validation
|
|
198
|
+
# @param [Object] webhook_id Value to be assigned
|
|
199
|
+
def webhook_id=(webhook_id)
|
|
200
|
+
if webhook_id.nil?
|
|
201
|
+
fail ArgumentError, 'webhook_id cannot be nil'
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
@webhook_id = webhook_id
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
208
|
+
# @param [Object] state Object to be assigned
|
|
209
|
+
def state=(state)
|
|
210
|
+
validator = EnumAttributeValidator.new('String', ["pending", "delivered", "failed"])
|
|
211
|
+
unless validator.valid?(state)
|
|
212
|
+
fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
|
|
213
|
+
end
|
|
214
|
+
@state = state
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Custom attribute writer method with validation
|
|
218
|
+
# @param [Object] tries Value to be assigned
|
|
219
|
+
def tries=(tries)
|
|
220
|
+
if tries.nil?
|
|
221
|
+
fail ArgumentError, 'tries cannot be nil'
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
@tries = tries
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
228
|
+
# @param [Object] last_error_code Object to be assigned
|
|
229
|
+
def last_error_code=(last_error_code)
|
|
230
|
+
validator = EnumAttributeValidator.new('String', ["http_status", "timed_out", "connection_failed", "address_refused", "switched_off", "not_queued", "internal_error"])
|
|
231
|
+
unless validator.valid?(last_error_code)
|
|
232
|
+
fail ArgumentError, "invalid value for \"last_error_code\", must be one of #{validator.allowable_values}."
|
|
233
|
+
end
|
|
234
|
+
@last_error_code = last_error_code
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Checks equality by comparing each attribute.
|
|
238
|
+
# @param [Object] Object to be compared
|
|
239
|
+
def ==(o)
|
|
240
|
+
return true if self.equal?(o)
|
|
241
|
+
self.class == o.class &&
|
|
242
|
+
webhook_id == o.webhook_id &&
|
|
243
|
+
state == o.state &&
|
|
244
|
+
tries == o.tries &&
|
|
245
|
+
last_status == o.last_status &&
|
|
246
|
+
last_error_code == o.last_error_code &&
|
|
247
|
+
delivered_at == o.delivered_at
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# @see the `==` method
|
|
251
|
+
# @param [Object] Object to be compared
|
|
252
|
+
def eql?(o)
|
|
253
|
+
self == o
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Calculates hash code according to all attributes.
|
|
257
|
+
# @return [Integer] Hash code
|
|
258
|
+
def hash
|
|
259
|
+
[webhook_id, state, tries, last_status, last_error_code, delivered_at].hash
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Builds the object from hash
|
|
263
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
264
|
+
# @return [Object] Returns the model itself
|
|
265
|
+
def self.build_from_hash(attributes)
|
|
266
|
+
return nil unless attributes.is_a?(Hash)
|
|
267
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
268
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
269
|
+
map = acceptable_attribute_map
|
|
270
|
+
transformed_hash = {}
|
|
271
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
272
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
273
|
+
transformed_hash["#{key}"] = nil
|
|
274
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
275
|
+
# check to ensure the input is an array given that the attribute
|
|
276
|
+
# is documented as an array but the input is not
|
|
277
|
+
if attributes[map[key]].is_a?(Array)
|
|
278
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
279
|
+
end
|
|
280
|
+
elsif !attributes[map[key]].nil?
|
|
281
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
282
|
+
end
|
|
283
|
+
end
|
|
284
|
+
new(transformed_hash)
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Returns the object in the form of hash
|
|
288
|
+
# @return [Hash] Returns the object in the form of hash
|
|
289
|
+
def to_hash
|
|
290
|
+
hash = {}
|
|
291
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
292
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
293
|
+
value = self.send(attr)
|
|
294
|
+
if value.nil?
|
|
295
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
296
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
hash[param] = _to_hash(value)
|
|
300
|
+
end
|
|
301
|
+
hash
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
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 ClientEventType
|
|
18
|
+
CONNECTION_DROPPED = "connection.dropped".freeze
|
|
19
|
+
CONNECTION_RESTORED = "connection.restored".freeze
|
|
20
|
+
GO_LIVE_FINISHED = "go_live.finished".freeze
|
|
21
|
+
GO_LIVE_FAILED = "go_live.failed".freeze
|
|
22
|
+
LOGIC_FAILED = "logic.failed".freeze
|
|
23
|
+
RECORDS_CHANGED = "records.changed".freeze
|
|
24
|
+
|
|
25
|
+
def self.all_vars
|
|
26
|
+
@all_vars ||= [CONNECTION_DROPPED, CONNECTION_RESTORED, GO_LIVE_FINISHED, GO_LIVE_FAILED, LOGIC_FAILED, RECORDS_CHANGED].freeze
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Builds the enum from string
|
|
30
|
+
# @param [String] The enum value in the form of the string
|
|
31
|
+
# @return [String] The enum value
|
|
32
|
+
def self.build_from_hash(value)
|
|
33
|
+
new.build_from_hash(value)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Builds the enum from string
|
|
37
|
+
# @param [String] The enum value in the form of the string
|
|
38
|
+
# @return [String] The enum value
|
|
39
|
+
def build_from_hash(value)
|
|
40
|
+
return value if ClientEventType.all_vars.include?(value)
|
|
41
|
+
raise "Invalid ENUM value #{value} for class #ClientEventType"
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|