svix 1.56.0 → 1.58.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 (98) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/application_api.rb +115 -10
  4. data/lib/svix/api/authentication_api.rb +101 -16
  5. data/lib/svix/api/background_tasks_api.rb +43 -17
  6. data/lib/svix/api/endpoint_api.rb +312 -96
  7. data/lib/svix/api/inbound_api.rb +4 -4
  8. data/lib/svix/api/integration_api.rb +102 -24
  9. data/lib/svix/api/message_api.rb +142 -39
  10. data/lib/svix/api/message_attempt_api.rb +135 -372
  11. data/lib/svix/api/statistics_api.rb +6 -6
  12. data/lib/svix/api/stream_api.rb +203 -142
  13. data/lib/svix/api/transformation_template_api.rb +88 -23
  14. data/lib/svix/api/webhook_endpoint_api.rb +253 -77
  15. data/lib/svix/background_tasks_api.rb +2 -2
  16. data/lib/svix/message_attempt_api.rb +7 -3
  17. data/lib/svix/models/active_application_out.rb +373 -0
  18. data/lib/svix/models/active_endpoint_out.rb +355 -0
  19. data/lib/svix/models/aggregate_event_types_out.rb +40 -0
  20. data/lib/svix/models/aggregated_event_types.rb +305 -0
  21. data/lib/svix/models/app_portal_access_in.rb +18 -0
  22. data/lib/svix/models/app_usage_stats_out.rb +40 -0
  23. data/lib/svix/models/application_message_failure.rb +277 -0
  24. data/lib/svix/models/application_message_id_pair.rb +317 -0
  25. data/lib/svix/models/application_out.rb +41 -2
  26. data/lib/svix/models/application_patch.rb +1 -1
  27. data/lib/svix/models/application_stats.rb +41 -2
  28. data/lib/svix/models/application_stats_out.rb +324 -0
  29. data/lib/svix/models/auth_token_out.rb +40 -1
  30. data/lib/svix/models/background_task_finished_event.rb +272 -0
  31. data/lib/svix/models/background_task_finished_event2.rb +331 -0
  32. data/lib/svix/models/background_task_out.rb +40 -0
  33. data/lib/svix/models/background_task_type.rb +2 -1
  34. data/lib/svix/models/{template_in.rb → connector_in.rb} +4 -4
  35. data/lib/svix/models/{transformation_template_kind.rb → connector_kind.rb} +3 -3
  36. data/lib/svix/models/create_stream_in.rb +12 -12
  37. data/lib/svix/models/data.rb +108 -0
  38. data/lib/svix/models/data_any_of.rb +240 -0
  39. data/lib/svix/models/data_any_of1.rb +223 -0
  40. data/lib/svix/models/data_any_of2.rb +241 -0
  41. data/lib/svix/models/data_any_of3.rb +223 -0
  42. data/lib/svix/models/data_any_of4.rb +240 -0
  43. data/lib/svix/models/endpoint_created_event_data.rb +82 -4
  44. data/lib/svix/models/endpoint_deleted_event_data.rb +82 -4
  45. data/lib/svix/models/endpoint_disabled_event.rb +1 -1
  46. data/lib/svix/models/endpoint_disabled_event_data.rb +119 -16
  47. data/lib/svix/models/endpoint_disabled_trigger.rb +40 -0
  48. data/lib/svix/models/endpoint_enabled_event.rb +272 -0
  49. data/lib/svix/models/endpoint_enabled_event_data.rb +410 -0
  50. data/lib/svix/models/endpoint_message_out.rb +40 -1
  51. data/lib/svix/models/endpoint_mtls_config_out.rb +215 -0
  52. data/lib/svix/models/endpoint_oauth_config_in.rb +2 -2
  53. data/lib/svix/models/endpoint_oauth_config_out.rb +315 -0
  54. data/lib/svix/models/endpoint_out.rb +40 -1
  55. data/lib/svix/models/endpoint_patch.rb +1 -1
  56. data/lib/svix/models/endpoint_updated_event_data.rb +82 -4
  57. data/lib/svix/models/environment_in.rb +17 -19
  58. data/lib/svix/models/environment_settings_out.rb +23 -1
  59. data/lib/svix/models/event_type_import_open_api_in.rb +14 -2
  60. data/lib/svix/models/export_event_type_out.rb +40 -0
  61. data/lib/svix/models/expung_all_contents_out.rb +315 -0
  62. data/lib/svix/models/inbound_path_params.rb +1 -1
  63. data/lib/svix/models/integration_in.rb +41 -1
  64. data/lib/svix/models/integration_out.rb +81 -2
  65. data/lib/svix/models/integration_update.rb +41 -1
  66. data/lib/svix/models/list_response_active_application_out.rb +261 -0
  67. data/lib/svix/models/message_attempt_endpoint_out.rb +120 -3
  68. data/lib/svix/models/message_attempt_exhausted_event_data.rb +122 -5
  69. data/lib/svix/models/message_attempt_failed_data.rb +40 -1
  70. data/lib/svix/models/message_attempt_failing_event_data.rb +122 -5
  71. data/lib/svix/models/message_attempt_out.rb +120 -3
  72. data/lib/svix/models/message_attempt_recovered_event_data.rb +122 -5
  73. data/lib/svix/models/message_broadcast_out.rb +40 -0
  74. data/lib/svix/models/message_endpoint_out.rb +40 -1
  75. data/lib/svix/models/message_out.rb +40 -1
  76. data/lib/svix/models/message_precheck_in.rb +288 -0
  77. data/lib/svix/models/message_precheck_out.rb +221 -0
  78. data/lib/svix/models/{oauth2_auth_method_in.rb → oauth2_auth_method_in_out.rb} +3 -3
  79. data/lib/svix/models/{oauth2_grant_type_in.rb → oauth2_grant_type_in_out.rb} +3 -3
  80. data/lib/svix/models/operational_webhook_endpoint_headers_in.rb +223 -0
  81. data/lib/svix/models/operational_webhook_endpoint_headers_out.rb +251 -0
  82. data/lib/svix/models/operational_webhook_endpoint_out.rb +40 -1
  83. data/lib/svix/models/polling_endpoint_message_out.rb +454 -0
  84. data/lib/svix/models/polling_endpoint_out.rb +255 -0
  85. data/lib/svix/models/recover_out.rb +40 -0
  86. data/lib/svix/models/replay_out.rb +40 -0
  87. data/lib/svix/models/rotate_poller_token_in.rb +1 -1
  88. data/lib/svix/models/sink_secret_out.rb +233 -0
  89. data/lib/svix/models/stream_in.rb +6 -7
  90. data/lib/svix/models/stream_out.rb +46 -7
  91. data/lib/svix/models/stream_patch.rb +6 -7
  92. data/lib/svix/models/stream_portal_access_in.rb +293 -0
  93. data/lib/svix/models/template_out.rb +81 -1
  94. data/lib/svix/models/template_patch.rb +1 -1
  95. data/lib/svix/models/template_update.rb +1 -1
  96. data/lib/svix/version.rb +1 -1
  97. metadata +35 -7
  98. data/lib/svix/operational_webhook_endpoint_api.rb +0 -37
@@ -0,0 +1,317 @@
1
+ =begin
2
+ #Svix API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.1.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Svix
17
+ class ApplicationMessageIdPair
18
+ # The Application's ID.
19
+ attr_accessor :app_id
20
+
21
+ # The Message's ID.
22
+ attr_accessor :msg_id
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'app_id' => :'appId',
28
+ :'msg_id' => :'msgId'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'app_id' => :'String',
41
+ :'msg_id' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::ApplicationMessageIdPair` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::ApplicationMessageIdPair`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'app_id')
67
+ self.app_id = attributes[:'app_id']
68
+ else
69
+ self.app_id = nil
70
+ end
71
+
72
+ if attributes.key?(:'msg_id')
73
+ self.msg_id = attributes[:'msg_id']
74
+ else
75
+ self.msg_id = nil
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ if @app_id.nil?
85
+ invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
86
+ end
87
+
88
+ if @app_id.to_s.length > 31
89
+ invalid_properties.push('invalid value for "app_id", the character length must be smaller than or equal to 31.')
90
+ end
91
+
92
+ if @app_id.to_s.length < 31
93
+ invalid_properties.push('invalid value for "app_id", the character length must be great than or equal to 31.')
94
+ end
95
+
96
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
97
+ if @app_id !~ pattern
98
+ invalid_properties.push("invalid value for \"app_id\", must conform to the pattern #{pattern}.")
99
+ end
100
+
101
+ if @msg_id.nil?
102
+ invalid_properties.push('invalid value for "msg_id", msg_id cannot be nil.')
103
+ end
104
+
105
+ if @msg_id.to_s.length > 31
106
+ invalid_properties.push('invalid value for "msg_id", the character length must be smaller than or equal to 31.')
107
+ end
108
+
109
+ if @msg_id.to_s.length < 31
110
+ invalid_properties.push('invalid value for "msg_id", the character length must be great than or equal to 31.')
111
+ end
112
+
113
+ pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
114
+ if @msg_id !~ pattern
115
+ invalid_properties.push("invalid value for \"msg_id\", must conform to the pattern #{pattern}.")
116
+ end
117
+
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
125
+ return false if @app_id.nil?
126
+ return false if @app_id.to_s.length > 31
127
+ return false if @app_id.to_s.length < 31
128
+ return false if @app_id !~ Regexp.new(/^app_[A-Za-z0-9]{27}$/)
129
+ return false if @msg_id.nil?
130
+ return false if @msg_id.to_s.length > 31
131
+ return false if @msg_id.to_s.length < 31
132
+ return false if @msg_id !~ Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
133
+ true
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] app_id Value to be assigned
138
+ def app_id=(app_id)
139
+ if app_id.nil?
140
+ fail ArgumentError, 'app_id cannot be nil'
141
+ end
142
+
143
+ if app_id.to_s.length > 31
144
+ fail ArgumentError, 'invalid value for "app_id", the character length must be smaller than or equal to 31.'
145
+ end
146
+
147
+ if app_id.to_s.length < 31
148
+ fail ArgumentError, 'invalid value for "app_id", the character length must be great than or equal to 31.'
149
+ end
150
+
151
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
152
+ if app_id !~ pattern
153
+ fail ArgumentError, "invalid value for \"app_id\", must conform to the pattern #{pattern}."
154
+ end
155
+
156
+ @app_id = app_id
157
+ end
158
+
159
+ # Custom attribute writer method with validation
160
+ # @param [Object] msg_id Value to be assigned
161
+ def msg_id=(msg_id)
162
+ if msg_id.nil?
163
+ fail ArgumentError, 'msg_id cannot be nil'
164
+ end
165
+
166
+ if msg_id.to_s.length > 31
167
+ fail ArgumentError, 'invalid value for "msg_id", the character length must be smaller than or equal to 31.'
168
+ end
169
+
170
+ if msg_id.to_s.length < 31
171
+ fail ArgumentError, 'invalid value for "msg_id", the character length must be great than or equal to 31.'
172
+ end
173
+
174
+ pattern = Regexp.new(/^msg_[A-Za-z0-9]{27}$/)
175
+ if msg_id !~ pattern
176
+ fail ArgumentError, "invalid value for \"msg_id\", must conform to the pattern #{pattern}."
177
+ end
178
+
179
+ @msg_id = msg_id
180
+ end
181
+
182
+ # Checks equality by comparing each attribute.
183
+ # @param [Object] Object to be compared
184
+ def ==(o)
185
+ return true if self.equal?(o)
186
+ self.class == o.class &&
187
+ app_id == o.app_id &&
188
+ msg_id == o.msg_id
189
+ end
190
+
191
+ # @see the `==` method
192
+ # @param [Object] Object to be compared
193
+ def eql?(o)
194
+ self == o
195
+ end
196
+
197
+ # Calculates hash code according to all attributes.
198
+ # @return [Integer] Hash code
199
+ def hash
200
+ [app_id, msg_id].hash
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def self.build_from_hash(attributes)
207
+ return nil unless attributes.is_a?(Hash)
208
+ attributes = attributes.transform_keys(&:to_sym)
209
+ transformed_hash = {}
210
+ openapi_types.each_pair do |key, type|
211
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
212
+ transformed_hash["#{key}"] = nil
213
+ elsif type =~ /\AArray<(.*)>/i
214
+ # check to ensure the input is an array given that the attribute
215
+ # is documented as an array but the input is not
216
+ if attributes[attribute_map[key]].is_a?(Array)
217
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
218
+ end
219
+ elsif !attributes[attribute_map[key]].nil?
220
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
221
+ end
222
+ end
223
+ new(transformed_hash)
224
+ end
225
+
226
+ # Deserializes the data based on type
227
+ # @param string type Data type
228
+ # @param string value Value to be deserialized
229
+ # @return [Object] Deserialized data
230
+ def self._deserialize(type, value)
231
+ case type.to_sym
232
+ when :Time
233
+ Time.parse(value)
234
+ when :Date
235
+ Date.parse(value)
236
+ when :String
237
+ value.to_s
238
+ when :Integer
239
+ value.to_i
240
+ when :Float
241
+ value.to_f
242
+ when :Boolean
243
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
244
+ true
245
+ else
246
+ false
247
+ end
248
+ when :Object
249
+ # generic object (usually a Hash), return directly
250
+ value
251
+ when /\AArray<(?<inner_type>.+)>\z/
252
+ inner_type = Regexp.last_match[:inner_type]
253
+ value.map { |v| _deserialize(inner_type, v) }
254
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
255
+ k_type = Regexp.last_match[:k_type]
256
+ v_type = Regexp.last_match[:v_type]
257
+ {}.tap do |hash|
258
+ value.each do |k, v|
259
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
260
+ end
261
+ end
262
+ else # model
263
+ # models (e.g. Pet) or oneOf
264
+ klass = Svix.const_get(type)
265
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
266
+ end
267
+ end
268
+
269
+ # Returns the string representation of the object
270
+ # @return [String] String presentation of the object
271
+ def to_s
272
+ to_hash.to_s
273
+ end
274
+
275
+ # to_body is an alias to to_hash (backward compatibility)
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_body
278
+ to_hash
279
+ end
280
+
281
+ # Returns the object in the form of hash
282
+ # @return [Hash] Returns the object in the form of hash
283
+ def to_hash
284
+ hash = {}
285
+ self.class.attribute_map.each_pair do |attr, param|
286
+ value = self.send(attr)
287
+ if value.nil?
288
+ is_nullable = self.class.openapi_nullable.include?(attr)
289
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
290
+ end
291
+
292
+ hash[param] = _to_hash(value)
293
+ end
294
+ hash
295
+ end
296
+
297
+ # Outputs non-array value in the form of hash
298
+ # For object, use to_hash. Otherwise, just return the value
299
+ # @param [Object] value Any valid value
300
+ # @return [Hash] Returns the value in the form of hash
301
+ def _to_hash(value)
302
+ if value.is_a?(Array)
303
+ value.compact.map { |v| _to_hash(v) }
304
+ elsif value.is_a?(Hash)
305
+ {}.tap do |hash|
306
+ value.each { |k, v| hash[k] = _to_hash(v) }
307
+ end
308
+ elsif value.respond_to? :to_hash
309
+ value.to_hash
310
+ else
311
+ value
312
+ end
313
+ end
314
+
315
+ end
316
+
317
+ end
@@ -17,7 +17,7 @@ module Svix
17
17
  class ApplicationOut
18
18
  attr_accessor :created_at
19
19
 
20
- # The app's ID
20
+ # The Application's ID.
21
21
  attr_accessor :id
22
22
 
23
23
  attr_accessor :metadata
@@ -26,7 +26,7 @@ module Svix
26
26
 
27
27
  attr_accessor :rate_limit
28
28
 
29
- # The app's UID
29
+ # The Application's UID.
30
30
  attr_accessor :uid
31
31
 
32
32
  attr_accessor :updated_at
@@ -139,6 +139,19 @@ module Svix
139
139
  invalid_properties.push('invalid value for "id", id cannot be nil.')
140
140
  end
141
141
 
142
+ if @id.to_s.length > 31
143
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 31.')
144
+ end
145
+
146
+ if @id.to_s.length < 31
147
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 31.')
148
+ end
149
+
150
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
151
+ if @id !~ pattern
152
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
153
+ end
154
+
142
155
  if @metadata.nil?
143
156
  invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
144
157
  end
@@ -177,6 +190,9 @@ module Svix
177
190
  warn '[DEPRECATED] the `valid?` method is obsolete'
178
191
  return false if @created_at.nil?
179
192
  return false if @id.nil?
193
+ return false if @id.to_s.length > 31
194
+ return false if @id.to_s.length < 31
195
+ return false if @id !~ Regexp.new(/^app_[A-Za-z0-9]{27}$/)
180
196
  return false if @metadata.nil?
181
197
  return false if @name.nil?
182
198
  return false if !@rate_limit.nil? && @rate_limit < 0
@@ -187,6 +203,29 @@ module Svix
187
203
  true
188
204
  end
189
205
 
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] id Value to be assigned
208
+ def id=(id)
209
+ if id.nil?
210
+ fail ArgumentError, 'id cannot be nil'
211
+ end
212
+
213
+ if id.to_s.length > 31
214
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 31.'
215
+ end
216
+
217
+ if id.to_s.length < 31
218
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 31.'
219
+ end
220
+
221
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
222
+ if id !~ pattern
223
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
224
+ end
225
+
226
+ @id = id
227
+ end
228
+
190
229
  # Custom attribute writer method with validation
191
230
  # @param [Object] rate_limit Value to be assigned
192
231
  def rate_limit=(rate_limit)
@@ -21,7 +21,7 @@ module Svix
21
21
 
22
22
  attr_accessor :rate_limit
23
23
 
24
- # The app's UID
24
+ # The Application's UID.
25
25
  attr_accessor :uid
26
26
 
27
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -15,10 +15,10 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class ApplicationStats
18
- # The app's ID
18
+ # The Application's ID.
19
19
  attr_accessor :app_id
20
20
 
21
- # The app's UID
21
+ # The Application's UID.
22
22
  attr_accessor :app_uid
23
23
 
24
24
  attr_accessor :message_destinations
@@ -94,6 +94,19 @@ module Svix
94
94
  invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
95
95
  end
96
96
 
97
+ if @app_id.to_s.length > 31
98
+ invalid_properties.push('invalid value for "app_id", the character length must be smaller than or equal to 31.')
99
+ end
100
+
101
+ if @app_id.to_s.length < 31
102
+ invalid_properties.push('invalid value for "app_id", the character length must be great than or equal to 31.')
103
+ end
104
+
105
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
106
+ if @app_id !~ pattern
107
+ invalid_properties.push("invalid value for \"app_id\", must conform to the pattern #{pattern}.")
108
+ end
109
+
97
110
  if !@app_uid.nil? && @app_uid.to_s.length > 256
98
111
  invalid_properties.push('invalid value for "app_uid", the character length must be smaller than or equal to 256.')
99
112
  end
@@ -119,6 +132,9 @@ module Svix
119
132
  def valid?
120
133
  warn '[DEPRECATED] the `valid?` method is obsolete'
121
134
  return false if @app_id.nil?
135
+ return false if @app_id.to_s.length > 31
136
+ return false if @app_id.to_s.length < 31
137
+ return false if @app_id !~ Regexp.new(/^app_[A-Za-z0-9]{27}$/)
122
138
  return false if !@app_uid.nil? && @app_uid.to_s.length > 256
123
139
  return false if !@app_uid.nil? && @app_uid.to_s.length < 1
124
140
  return false if !@app_uid.nil? && @app_uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
@@ -126,6 +142,29 @@ module Svix
126
142
  true
127
143
  end
128
144
 
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] app_id Value to be assigned
147
+ def app_id=(app_id)
148
+ if app_id.nil?
149
+ fail ArgumentError, 'app_id cannot be nil'
150
+ end
151
+
152
+ if app_id.to_s.length > 31
153
+ fail ArgumentError, 'invalid value for "app_id", the character length must be smaller than or equal to 31.'
154
+ end
155
+
156
+ if app_id.to_s.length < 31
157
+ fail ArgumentError, 'invalid value for "app_id", the character length must be great than or equal to 31.'
158
+ end
159
+
160
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
161
+ if app_id !~ pattern
162
+ fail ArgumentError, "invalid value for \"app_id\", must conform to the pattern #{pattern}."
163
+ end
164
+
165
+ @app_id = app_id
166
+ end
167
+
129
168
  # Custom attribute writer method with validation
130
169
  # @param [Object] app_uid Value to be assigned
131
170
  def app_uid=(app_uid)