late-sdk 0.0.672 → 0.0.673

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.
@@ -0,0 +1,274 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class InlineObject3 < ApiModelBase
18
+ # Human-readable error message suitable for end-user display.
19
+ attr_accessor :error
20
+
21
+ # Machine-readable error code. Stable across versions.
22
+ attr_accessor :code
23
+
24
+ # Discriminator for which gate fired.
25
+ attr_accessor :reason
26
+
27
+ # Link to the relevant documentation page.
28
+ attr_accessor :documentation_url
29
+
30
+ # Deep-link to send the end-user to. For `free_tier_exceeded` and `twitter_passthrough` this is the Zernio billing tab. For `enterprise_required` this is the Zernio enterprise contact page.
31
+ attr_accessor :dashboard_url
32
+
33
+ attr_accessor :details
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
+ :'error' => :'error',
61
+ :'code' => :'code',
62
+ :'reason' => :'reason',
63
+ :'documentation_url' => :'documentation_url',
64
+ :'dashboard_url' => :'dashboard_url',
65
+ :'details' => :'details'
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
+ :'error' => :'String',
83
+ :'code' => :'String',
84
+ :'reason' => :'String',
85
+ :'documentation_url' => :'String',
86
+ :'dashboard_url' => :'String',
87
+ :'details' => :'InlineObject3Details'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
94
+ ])
95
+ end
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ def initialize(attributes = {})
100
+ if (!attributes.is_a?(Hash))
101
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::InlineObject3` initialize method"
102
+ end
103
+
104
+ # check to see if the attribute exists and convert string to symbol for hash key
105
+ acceptable_attribute_map = self.class.acceptable_attribute_map
106
+ attributes = attributes.each_with_object({}) { |(k, v), h|
107
+ if (!acceptable_attribute_map.key?(k.to_sym))
108
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::InlineObject3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
109
+ end
110
+ h[k.to_sym] = v
111
+ }
112
+
113
+ if attributes.key?(:'error')
114
+ self.error = attributes[:'error']
115
+ else
116
+ self.error = nil
117
+ end
118
+
119
+ if attributes.key?(:'code')
120
+ self.code = attributes[:'code']
121
+ else
122
+ self.code = nil
123
+ end
124
+
125
+ if attributes.key?(:'reason')
126
+ self.reason = attributes[:'reason']
127
+ else
128
+ self.reason = nil
129
+ end
130
+
131
+ if attributes.key?(:'documentation_url')
132
+ self.documentation_url = attributes[:'documentation_url']
133
+ end
134
+
135
+ if attributes.key?(:'dashboard_url')
136
+ self.dashboard_url = attributes[:'dashboard_url']
137
+ end
138
+
139
+ if attributes.key?(:'details')
140
+ self.details = attributes[:'details']
141
+ end
142
+ end
143
+
144
+ # Show invalid properties with the reasons. Usually used together with valid?
145
+ # @return Array for valid properties with the reasons
146
+ def list_invalid_properties
147
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
148
+ invalid_properties = Array.new
149
+ if @error.nil?
150
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
151
+ end
152
+
153
+ if @code.nil?
154
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
155
+ end
156
+
157
+ if @reason.nil?
158
+ invalid_properties.push('invalid value for "reason", reason cannot be nil.')
159
+ end
160
+
161
+ invalid_properties
162
+ end
163
+
164
+ # Check to see if the all the properties in the model are valid
165
+ # @return true if the model is valid
166
+ def valid?
167
+ warn '[DEPRECATED] the `valid?` method is obsolete'
168
+ return false if @error.nil?
169
+ return false if @code.nil?
170
+ code_validator = EnumAttributeValidator.new('String', ["PAYMENT_REQUIRED"])
171
+ return false unless code_validator.valid?(@code)
172
+ return false if @reason.nil?
173
+ reason_validator = EnumAttributeValidator.new('String', ["free_tier_exceeded", "twitter_passthrough", "enterprise_required"])
174
+ return false unless reason_validator.valid?(@reason)
175
+ true
176
+ end
177
+
178
+ # Custom attribute writer method with validation
179
+ # @param [Object] error Value to be assigned
180
+ def error=(error)
181
+ if error.nil?
182
+ fail ArgumentError, 'error cannot be nil'
183
+ end
184
+
185
+ @error = error
186
+ end
187
+
188
+ # Custom attribute writer method checking allowed values (enum).
189
+ # @param [Object] code Object to be assigned
190
+ def code=(code)
191
+ validator = EnumAttributeValidator.new('String', ["PAYMENT_REQUIRED"])
192
+ unless validator.valid?(code)
193
+ fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
194
+ end
195
+ @code = code
196
+ end
197
+
198
+ # Custom attribute writer method checking allowed values (enum).
199
+ # @param [Object] reason Object to be assigned
200
+ def reason=(reason)
201
+ validator = EnumAttributeValidator.new('String', ["free_tier_exceeded", "twitter_passthrough", "enterprise_required"])
202
+ unless validator.valid?(reason)
203
+ fail ArgumentError, "invalid value for \"reason\", must be one of #{validator.allowable_values}."
204
+ end
205
+ @reason = reason
206
+ end
207
+
208
+ # Checks equality by comparing each attribute.
209
+ # @param [Object] Object to be compared
210
+ def ==(o)
211
+ return true if self.equal?(o)
212
+ self.class == o.class &&
213
+ error == o.error &&
214
+ code == o.code &&
215
+ reason == o.reason &&
216
+ documentation_url == o.documentation_url &&
217
+ dashboard_url == o.dashboard_url &&
218
+ details == o.details
219
+ end
220
+
221
+ # @see the `==` method
222
+ # @param [Object] Object to be compared
223
+ def eql?(o)
224
+ self == o
225
+ end
226
+
227
+ # Calculates hash code according to all attributes.
228
+ # @return [Integer] Hash code
229
+ def hash
230
+ [error, code, reason, documentation_url, dashboard_url, details].hash
231
+ end
232
+
233
+ # Builds the object from hash
234
+ # @param [Hash] attributes Model attributes in the form of hash
235
+ # @return [Object] Returns the model itself
236
+ def self.build_from_hash(attributes)
237
+ return nil unless attributes.is_a?(Hash)
238
+ attributes = attributes.transform_keys(&:to_sym)
239
+ transformed_hash = {}
240
+ openapi_types.each_pair do |key, type|
241
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
242
+ transformed_hash["#{key}"] = nil
243
+ elsif type =~ /\AArray<(.*)>/i
244
+ # check to ensure the input is an array given that the attribute
245
+ # is documented as an array but the input is not
246
+ if attributes[attribute_map[key]].is_a?(Array)
247
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
248
+ end
249
+ elsif !attributes[attribute_map[key]].nil?
250
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
251
+ end
252
+ end
253
+ new(transformed_hash)
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ if value.nil?
263
+ is_nullable = self.class.openapi_nullable.include?(attr)
264
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
+ end
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ end
273
+
274
+ end
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Zernio
17
17
  # Structured context for SDK clients that want to render their own UX. Keys vary by `reason`.
18
- class InlineObject2Details < ApiModelBase
18
+ class InlineObject3Details < ApiModelBase
19
19
  # How many accounts the free tier allows. Only set when reason=free_tier_exceeded.
20
20
  attr_accessor :free_tier_account_limit
21
21
 
@@ -68,14 +68,14 @@ module Zernio
68
68
  # @param [Hash] attributes Model attributes in the form of hash
69
69
  def initialize(attributes = {})
70
70
  if (!attributes.is_a?(Hash))
71
- fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::InlineObject2Details` initialize method"
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::InlineObject3Details` initialize method"
72
72
  end
73
73
 
74
74
  # check to see if the attribute exists and convert string to symbol for hash key
75
75
  acceptable_attribute_map = self.class.acceptable_attribute_map
76
76
  attributes = attributes.each_with_object({}) { |(k, v), h|
77
77
  if (!acceptable_attribute_map.key?(k.to_sym))
78
- fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::InlineObject2Details`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::InlineObject3Details`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
79
  end
80
80
  h[k.to_sym] = v
81
81
  }
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Zernio
14
- VERSION = '0.0.672'
14
+ VERSION = '0.0.673'
15
15
  end
data/lib/zernio-sdk.rb CHANGED
@@ -768,7 +768,8 @@ require 'zernio-sdk/models/initiate_whats_app_call_request'
768
768
  require 'zernio-sdk/models/inline_object'
769
769
  require 'zernio-sdk/models/inline_object1'
770
770
  require 'zernio-sdk/models/inline_object2'
771
- require 'zernio-sdk/models/inline_object2_details'
771
+ require 'zernio-sdk/models/inline_object3'
772
+ require 'zernio-sdk/models/inline_object3_details'
772
773
  require 'zernio-sdk/models/instagram_account_insights_response'
773
774
  require 'zernio-sdk/models/instagram_account_insights_response_date_range'
774
775
  require 'zernio-sdk/models/instagram_account_insights_response_metrics_value'