appnigma-sdk 0.2.0 → 1.0.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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +90 -69
  4. data/lib/appnigma/client.rb +21 -28
  5. data/lib/appnigma/constants.rb +1 -0
  6. data/lib/appnigma/crm.rb +63 -6
  7. data/lib/appnigma/errors.rb +15 -0
  8. data/lib/appnigma/generated/api/default_api.rb +523 -61
  9. data/lib/appnigma/generated/api_client.rb +1 -1
  10. data/lib/appnigma/generated/api_error.rb +1 -1
  11. data/lib/appnigma/generated/api_model_base.rb +1 -1
  12. data/lib/appnigma/generated/configuration.rb +1 -1
  13. data/lib/appnigma/generated/models/action_entry.rb +341 -0
  14. data/lib/appnigma/generated/models/connection_status.rb +1 -1
  15. data/lib/appnigma/generated/models/create_connection_link_input.rb +1 -1
  16. data/lib/appnigma/generated/models/create_connection_link_output.rb +2 -2
  17. data/lib/appnigma/generated/models/crm_company.rb +1 -1
  18. data/lib/appnigma/generated/models/crm_company_get_output.rb +1 -1
  19. data/lib/appnigma/generated/models/crm_company_list_output.rb +1 -1
  20. data/lib/appnigma/generated/models/{post_output.rb → crm_company_write_output.rb} +20 -46
  21. data/lib/appnigma/generated/models/crm_contact.rb +1 -1
  22. data/lib/appnigma/generated/models/crm_contact_get_output.rb +1 -1
  23. data/lib/appnigma/generated/models/crm_contact_list_output.rb +1 -1
  24. data/lib/appnigma/generated/models/crm_contact_write_output.rb +177 -0
  25. data/lib/appnigma/generated/models/crm_create_input.rb +256 -0
  26. data/lib/appnigma/generated/models/crm_custom_field.rb +1 -1
  27. data/lib/appnigma/generated/models/crm_deal.rb +1 -1
  28. data/lib/appnigma/generated/models/{post_input.rb → crm_deal_create_input.rb} +48 -81
  29. data/lib/appnigma/generated/models/crm_deal_get_output.rb +1 -1
  30. data/lib/appnigma/generated/models/crm_deal_list_output.rb +1 -1
  31. data/lib/appnigma/generated/models/crm_deal_write_output.rb +177 -0
  32. data/lib/appnigma/generated/models/crm_email.rb +1 -1
  33. data/lib/appnigma/generated/models/crm_get_input.rb +1 -1
  34. data/lib/appnigma/generated/models/crm_labelled.rb +1 -1
  35. data/lib/appnigma/generated/models/crm_list_input.rb +1 -1
  36. data/lib/appnigma/generated/models/crm_phone.rb +1 -1
  37. data/lib/appnigma/generated/models/{pull_input.rb → crm_update_input.rb} +66 -100
  38. data/lib/appnigma/generated/models/function_entry.rb +1 -1
  39. data/lib/appnigma/generated/models/function_owner.rb +1 -1
  40. data/lib/appnigma/generated/models/function_owner_one_of.rb +1 -1
  41. data/lib/appnigma/generated/models/function_owner_one_of1.rb +1 -1
  42. data/lib/appnigma/generated/models/get_connection_output.rb +1 -1
  43. data/lib/appnigma/generated/models/get_guide_output.rb +1 -1
  44. data/lib/appnigma/generated/models/json_value.rb +1 -1
  45. data/lib/appnigma/generated/models/{pull_output_records_inner.rb → list_actions_output.rb} +21 -47
  46. data/lib/appnigma/generated/models/list_functions_output.rb +1 -1
  47. data/lib/appnigma/generated/models/list_platforms_output.rb +179 -0
  48. data/lib/appnigma/generated/models/platform_entry.rb +269 -0
  49. data/lib/appnigma/generated/models/platform_entry_coverage_inner.rb +219 -0
  50. data/lib/appnigma/generated/models/platform_request_input.rb +1 -1
  51. data/lib/appnigma/generated/models/platform_request_input_body.rb +1 -1
  52. data/lib/appnigma/generated/models/platform_request_output.rb +1 -1
  53. data/lib/appnigma/generated/models/ran_as.rb +4 -6
  54. data/lib/appnigma/generated/models/run_action_input.rb +277 -0
  55. data/lib/appnigma/generated/models/{pull_output.rb → run_action_output.rb} +21 -34
  56. data/lib/appnigma/generated/models/run_input.rb +3 -3
  57. data/lib/appnigma/generated/models/run_output.rb +1 -1
  58. data/lib/appnigma/generated/models/sdk_error.rb +1 -1
  59. data/lib/appnigma/generated/models/sdk_error_error.rb +3 -3
  60. data/lib/appnigma/generated/models/sdk_error_error_details.rb +32 -3
  61. data/lib/appnigma/generated/models/sdk_problem.rb +1 -1
  62. data/lib/appnigma/generated/version.rb +1 -1
  63. data/lib/appnigma/generated.rb +14 -7
  64. data/lib/appnigma/names.rb +9 -0
  65. data/lib/appnigma/platforms.rb +18 -0
  66. data/lib/appnigma/retry.rb +3 -3
  67. data/lib/appnigma/transport.rb +10 -4
  68. data/lib/appnigma/version.rb +2 -2
  69. metadata +15 -7
  70. data/lib/appnigma/generated/models/post_input_record_value.rb +0 -104
@@ -0,0 +1,177 @@
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: 3.0.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 CrmContactWriteOutput < ApiModelBase
18
+ attr_accessor :record
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'record' => :'record'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'record' => :'CrmContact'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Returns attribute type mapping
51
+ def self.acceptable_openapi_types
52
+ openapi_types
53
+ end
54
+
55
+ # Returns the nullable attributes
56
+ def self.acceptable_openapi_nullable
57
+ openapi_nullable
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::CrmContactWriteOutput` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!acceptable_attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::CrmContactWriteOutput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'record')
77
+ self.record = attributes[:'record']
78
+ else
79
+ self.record = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @record.nil?
89
+ invalid_properties.push('invalid value for "record", record cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if @record.nil?
100
+ true
101
+ end
102
+
103
+ # Custom attribute writer method with validation
104
+ # @param [Object] record Value to be assigned
105
+ def record=(record)
106
+ if record.nil?
107
+ fail ArgumentError, 'record cannot be nil'
108
+ end
109
+
110
+ @record = record
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ record == o.record
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [record].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ attributes = attributes.transform_keys(&:to_sym)
139
+ # include attributes inherited from allOf parents (the nearest declaration wins)
140
+ map = acceptable_attribute_map
141
+ transformed_hash = {}
142
+ acceptable_openapi_types.each_pair do |key, type|
143
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
144
+ transformed_hash["#{key}"] = nil
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[map[key]].is_a?(Array)
149
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
150
+ end
151
+ elsif !attributes[map[key]].nil?
152
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
153
+ end
154
+ end
155
+ new(transformed_hash)
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ # include attributes inherited from allOf parents (the nearest declaration wins)
163
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
164
+ value = self.send(attr)
165
+ if value.nil?
166
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
167
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
168
+ end
169
+
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ end
176
+
177
+ end
@@ -0,0 +1,256 @@
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: 3.0.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 CrmCreateInput < ApiModelBase
18
+ # Your own id for the end customer.
19
+ attr_accessor :end_customer_id
20
+
21
+ # The platform key, such as hubspot.
22
+ attr_accessor :platform
23
+
24
+ # The fields to set, in the shapes they are read in, each optional. null clears a value; a field left out is left alone. Ids, times, customFields and raw are the CRM's to set.
25
+ attr_accessor :record
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'end_customer_id' => :'endCustomerId',
31
+ :'platform' => :'platform',
32
+ :'record' => :'record'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'end_customer_id' => :'String',
50
+ :'platform' => :'String',
51
+ :'record' => :'Hash<String, JsonValue>'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Returns attribute type mapping
62
+ def self.acceptable_openapi_types
63
+ openapi_types
64
+ end
65
+
66
+ # Returns the nullable attributes
67
+ def self.acceptable_openapi_nullable
68
+ openapi_nullable
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::CrmCreateInput` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ acceptable_attribute_map = self.class.acceptable_attribute_map
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!acceptable_attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::CrmCreateInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'end_customer_id')
88
+ self.end_customer_id = attributes[:'end_customer_id']
89
+ else
90
+ self.end_customer_id = nil
91
+ end
92
+
93
+ if attributes.key?(:'platform')
94
+ self.platform = attributes[:'platform']
95
+ else
96
+ self.platform = nil
97
+ end
98
+
99
+ if attributes.key?(:'record')
100
+ if (value = attributes[:'record']).is_a?(Hash)
101
+ self.record = value
102
+ end
103
+ else
104
+ self.record = nil
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
112
+ invalid_properties = Array.new
113
+ if @end_customer_id.nil?
114
+ invalid_properties.push('invalid value for "end_customer_id", end_customer_id cannot be nil.')
115
+ end
116
+
117
+ pattern = Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
118
+ if @end_customer_id !~ pattern
119
+ invalid_properties.push("invalid value for \"end_customer_id\", must conform to the pattern #{pattern}.")
120
+ end
121
+
122
+ if @platform.nil?
123
+ invalid_properties.push('invalid value for "platform", platform cannot be nil.')
124
+ end
125
+
126
+ pattern = Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
127
+ if @platform !~ pattern
128
+ invalid_properties.push("invalid value for \"platform\", must conform to the pattern #{pattern}.")
129
+ end
130
+
131
+ if @record.nil?
132
+ invalid_properties.push('invalid value for "record", record cannot be nil.')
133
+ end
134
+
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ warn '[DEPRECATED] the `valid?` method is obsolete'
142
+ return false if @end_customer_id.nil?
143
+ return false if @end_customer_id !~ Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
144
+ return false if @platform.nil?
145
+ return false if @platform !~ Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
146
+ return false if @record.nil?
147
+ true
148
+ end
149
+
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] end_customer_id Value to be assigned
152
+ def end_customer_id=(end_customer_id)
153
+ if end_customer_id.nil?
154
+ fail ArgumentError, 'end_customer_id cannot be nil'
155
+ end
156
+
157
+ pattern = Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
158
+ if end_customer_id !~ pattern
159
+ fail ArgumentError, "invalid value for \"end_customer_id\", must conform to the pattern #{pattern}."
160
+ end
161
+
162
+ @end_customer_id = end_customer_id
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] platform Value to be assigned
167
+ def platform=(platform)
168
+ if platform.nil?
169
+ fail ArgumentError, 'platform cannot be nil'
170
+ end
171
+
172
+ pattern = Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
173
+ if platform !~ pattern
174
+ fail ArgumentError, "invalid value for \"platform\", must conform to the pattern #{pattern}."
175
+ end
176
+
177
+ @platform = platform
178
+ end
179
+
180
+ # Custom attribute writer method with validation
181
+ # @param [Object] record Value to be assigned
182
+ def record=(record)
183
+ if record.nil?
184
+ fail ArgumentError, 'record cannot be nil'
185
+ end
186
+
187
+ @record = record
188
+ end
189
+
190
+ # Checks equality by comparing each attribute.
191
+ # @param [Object] Object to be compared
192
+ def ==(o)
193
+ return true if self.equal?(o)
194
+ self.class == o.class &&
195
+ end_customer_id == o.end_customer_id &&
196
+ platform == o.platform &&
197
+ record == o.record
198
+ end
199
+
200
+ # @see the `==` method
201
+ # @param [Object] Object to be compared
202
+ def eql?(o)
203
+ self == o
204
+ end
205
+
206
+ # Calculates hash code according to all attributes.
207
+ # @return [Integer] Hash code
208
+ def hash
209
+ [end_customer_id, platform, record].hash
210
+ end
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def self.build_from_hash(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+ attributes = attributes.transform_keys(&:to_sym)
218
+ # include attributes inherited from allOf parents (the nearest declaration wins)
219
+ map = acceptable_attribute_map
220
+ transformed_hash = {}
221
+ acceptable_openapi_types.each_pair do |key, type|
222
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
223
+ transformed_hash["#{key}"] = nil
224
+ elsif type =~ /\AArray<(.*)>/i
225
+ # check to ensure the input is an array given that the attribute
226
+ # is documented as an array but the input is not
227
+ if attributes[map[key]].is_a?(Array)
228
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
229
+ end
230
+ elsif !attributes[map[key]].nil?
231
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
232
+ end
233
+ end
234
+ new(transformed_hash)
235
+ end
236
+
237
+ # Returns the object in the form of hash
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_hash
240
+ hash = {}
241
+ # include attributes inherited from allOf parents (the nearest declaration wins)
242
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ if value.nil?
245
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ end
255
+
256
+ end
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 3.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.26.0
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 3.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.26.0