svix 1.45.1 → 1.57.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
@@ -15,6 +15,7 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class RecoverOut
18
+ # The QueueBackgroundTask's ID.
18
19
  attr_accessor :id
19
20
 
20
21
  attr_accessor :status
@@ -115,6 +116,19 @@ module Svix
115
116
  invalid_properties.push('invalid value for "id", id cannot be nil.')
116
117
  end
117
118
 
119
+ if @id.to_s.length > 33
120
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 33.')
121
+ end
122
+
123
+ if @id.to_s.length < 33
124
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 33.')
125
+ end
126
+
127
+ pattern = Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
128
+ if @id !~ pattern
129
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
130
+ end
131
+
118
132
  if @status.nil?
119
133
  invalid_properties.push('invalid value for "status", status cannot be nil.')
120
134
  end
@@ -131,11 +145,37 @@ module Svix
131
145
  def valid?
132
146
  warn '[DEPRECATED] the `valid?` method is obsolete'
133
147
  return false if @id.nil?
148
+ return false if @id.to_s.length > 33
149
+ return false if @id.to_s.length < 33
150
+ return false if @id !~ Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
134
151
  return false if @status.nil?
135
152
  return false if @task.nil?
136
153
  true
137
154
  end
138
155
 
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] id Value to be assigned
158
+ def id=(id)
159
+ if id.nil?
160
+ fail ArgumentError, 'id cannot be nil'
161
+ end
162
+
163
+ if id.to_s.length > 33
164
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 33.'
165
+ end
166
+
167
+ if id.to_s.length < 33
168
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 33.'
169
+ end
170
+
171
+ pattern = Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
172
+ if id !~ pattern
173
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
174
+ end
175
+
176
+ @id = id
177
+ end
178
+
139
179
  # Checks equality by comparing each attribute.
140
180
  # @param [Object] Object to be compared
141
181
  def ==(o)
@@ -15,6 +15,7 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class ReplayOut
18
+ # The QueueBackgroundTask's ID.
18
19
  attr_accessor :id
19
20
 
20
21
  attr_accessor :status
@@ -115,6 +116,19 @@ module Svix
115
116
  invalid_properties.push('invalid value for "id", id cannot be nil.')
116
117
  end
117
118
 
119
+ if @id.to_s.length > 33
120
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 33.')
121
+ end
122
+
123
+ if @id.to_s.length < 33
124
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 33.')
125
+ end
126
+
127
+ pattern = Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
128
+ if @id !~ pattern
129
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
130
+ end
131
+
118
132
  if @status.nil?
119
133
  invalid_properties.push('invalid value for "status", status cannot be nil.')
120
134
  end
@@ -131,11 +145,37 @@ module Svix
131
145
  def valid?
132
146
  warn '[DEPRECATED] the `valid?` method is obsolete'
133
147
  return false if @id.nil?
148
+ return false if @id.to_s.length > 33
149
+ return false if @id.to_s.length < 33
150
+ return false if @id !~ Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
134
151
  return false if @status.nil?
135
152
  return false if @task.nil?
136
153
  true
137
154
  end
138
155
 
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] id Value to be assigned
158
+ def id=(id)
159
+ if id.nil?
160
+ fail ArgumentError, 'id cannot be nil'
161
+ end
162
+
163
+ if id.to_s.length > 33
164
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 33.'
165
+ end
166
+
167
+ if id.to_s.length < 33
168
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 33.'
169
+ end
170
+
171
+ pattern = Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
172
+ if id !~ pattern
173
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
174
+ end
175
+
176
+ @id = id
177
+ end
178
+
139
179
  # Checks equality by comparing each attribute.
140
180
  # @param [Object] Object to be compared
141
181
  def ==(o)
@@ -18,7 +18,7 @@ module Svix
18
18
  # How long the token will be valid for, in seconds. Can be up to 31,536,000 seconds (1 year).
19
19
  attr_accessor :expiry
20
20
 
21
- # Updates the previous token's expiration, in seconds. If set to 0, the old token will immediately be revoked. Must be between 0 and 86,400 seconds (1 day). Defaults to 300 seconds (5 minutes).
21
+ # Updates the previous token's expiration, in seconds. If set to 0, the old token will immediately be revoked. Must be between 0 and 86,400 seconds (1 day). Defaults to 300 seconds (5 minutes).
22
22
  attr_accessor :old_token_expiry
23
23
 
24
24
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,233 @@
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 SinkSecretOut
18
+ # The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret.
19
+ attr_accessor :key
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'key' => :'key'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'key' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ :'key'
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::SinkSecretOut` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::SinkSecretOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'key')
63
+ self.key = attributes[:'key']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
+ invalid_properties = Array.new
72
+ pattern = Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/)
73
+ if !@key.nil? && @key !~ pattern
74
+ invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
75
+ end
76
+
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ return false if !@key.nil? && @key !~ Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/)
85
+ true
86
+ end
87
+
88
+ # Custom attribute writer method with validation
89
+ # @param [Object] key Value to be assigned
90
+ def key=(key)
91
+ pattern = Regexp.new(/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/)
92
+ if !key.nil? && key !~ pattern
93
+ fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
94
+ end
95
+
96
+ @key = key
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ key == o.key
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [key].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ attributes = attributes.transform_keys(&:to_sym)
125
+ transformed_hash = {}
126
+ openapi_types.each_pair do |key, type|
127
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = nil
129
+ elsif type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[attribute_map[key]].is_a?(Array)
133
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
134
+ end
135
+ elsif !attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
137
+ end
138
+ end
139
+ new(transformed_hash)
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def self._deserialize(type, value)
147
+ case type.to_sym
148
+ when :Time
149
+ Time.parse(value)
150
+ when :Date
151
+ Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :Boolean
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ # models (e.g. Pet) or oneOf
180
+ klass = Svix.const_get(type)
181
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+
231
+ end
232
+
233
+ end
@@ -15,8 +15,10 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class StreamIn
18
+ # The stream's description.
18
19
  attr_accessor :description
19
20
 
21
+ # An optional unique identifier for the stream.
20
22
  attr_accessor :uid
21
23
 
22
24
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -43,6 +45,7 @@ module Svix
43
45
  # List of attributes with nullable: true
44
46
  def self.openapi_nullable
45
47
  Set.new([
48
+ :'uid'
46
49
  ])
47
50
  end
48
51
 
@@ -130,20 +133,16 @@ module Svix
130
133
  # Custom attribute writer method with validation
131
134
  # @param [Object] uid Value to be assigned
132
135
  def uid=(uid)
133
- if uid.nil?
134
- fail ArgumentError, 'uid cannot be nil'
135
- end
136
-
137
- if uid.to_s.length > 60
136
+ if !uid.nil? && uid.to_s.length > 60
138
137
  fail ArgumentError, 'invalid value for "uid", the character length must be smaller than or equal to 60.'
139
138
  end
140
139
 
141
- if uid.to_s.length < 1
140
+ if !uid.nil? && uid.to_s.length < 1
142
141
  fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.'
143
142
  end
144
143
 
145
144
  pattern = Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
146
- if uid !~ pattern
145
+ if !uid.nil? && uid !~ pattern
147
146
  fail ArgumentError, "invalid value for \"uid\", must conform to the pattern #{pattern}."
148
147
  end
149
148
 
@@ -17,10 +17,13 @@ module Svix
17
17
  class StreamOut
18
18
  attr_accessor :created_at
19
19
 
20
+ # The stream's description.
20
21
  attr_accessor :description
21
22
 
23
+ # The stream's ID.
22
24
  attr_accessor :id
23
25
 
26
+ # The stream's UID.
24
27
  attr_accessor :uid
25
28
 
26
29
  attr_accessor :updated_at
@@ -56,6 +59,7 @@ module Svix
56
59
  def self.openapi_nullable
57
60
  Set.new([
58
61
  :'description',
62
+ :'uid',
59
63
  ])
60
64
  end
61
65
 
@@ -114,6 +118,19 @@ module Svix
114
118
  invalid_properties.push('invalid value for "id", id cannot be nil.')
115
119
  end
116
120
 
121
+ if @id.to_s.length > 27
122
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 27.')
123
+ end
124
+
125
+ if @id.to_s.length < 27
126
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 27.')
127
+ end
128
+
129
+ pattern = Regexp.new(/^strm_[A-Za-z0-9]{22}$/)
130
+ if @id !~ pattern
131
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
132
+ end
133
+
117
134
  if !@uid.nil? && @uid.to_s.length > 60
118
135
  invalid_properties.push('invalid value for "uid", the character length must be smaller than or equal to 60.')
119
136
  end
@@ -140,6 +157,9 @@ module Svix
140
157
  warn '[DEPRECATED] the `valid?` method is obsolete'
141
158
  return false if @created_at.nil?
142
159
  return false if @id.nil?
160
+ return false if @id.to_s.length > 27
161
+ return false if @id.to_s.length < 27
162
+ return false if @id !~ Regexp.new(/^strm_[A-Za-z0-9]{22}$/)
143
163
  return false if !@uid.nil? && @uid.to_s.length > 60
144
164
  return false if !@uid.nil? && @uid.to_s.length < 1
145
165
  return false if !@uid.nil? && @uid !~ Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
@@ -148,22 +168,41 @@ module Svix
148
168
  end
149
169
 
150
170
  # Custom attribute writer method with validation
151
- # @param [Object] uid Value to be assigned
152
- def uid=(uid)
153
- if uid.nil?
154
- fail ArgumentError, 'uid cannot be nil'
171
+ # @param [Object] id Value to be assigned
172
+ def id=(id)
173
+ if id.nil?
174
+ fail ArgumentError, 'id cannot be nil'
175
+ end
176
+
177
+ if id.to_s.length > 27
178
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 27.'
155
179
  end
156
180
 
157
- if uid.to_s.length > 60
181
+ if id.to_s.length < 27
182
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 27.'
183
+ end
184
+
185
+ pattern = Regexp.new(/^strm_[A-Za-z0-9]{22}$/)
186
+ if id !~ pattern
187
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
188
+ end
189
+
190
+ @id = id
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] uid Value to be assigned
195
+ def uid=(uid)
196
+ if !uid.nil? && uid.to_s.length > 60
158
197
  fail ArgumentError, 'invalid value for "uid", the character length must be smaller than or equal to 60.'
159
198
  end
160
199
 
161
- if uid.to_s.length < 1
200
+ if !uid.nil? && uid.to_s.length < 1
162
201
  fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.'
163
202
  end
164
203
 
165
204
  pattern = Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
166
- if uid !~ pattern
205
+ if !uid.nil? && uid !~ pattern
167
206
  fail ArgumentError, "invalid value for \"uid\", must conform to the pattern #{pattern}."
168
207
  end
169
208
 
@@ -15,8 +15,10 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class StreamPatch
18
+ # The Stream's description.
18
19
  attr_accessor :description
19
20
 
21
+ # An optional unique identifier for the stream.
20
22
  attr_accessor :uid
21
23
 
22
24
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -43,6 +45,7 @@ module Svix
43
45
  # List of attributes with nullable: true
44
46
  def self.openapi_nullable
45
47
  Set.new([
48
+ :'uid'
46
49
  ])
47
50
  end
48
51
 
@@ -104,20 +107,16 @@ module Svix
104
107
  # Custom attribute writer method with validation
105
108
  # @param [Object] uid Value to be assigned
106
109
  def uid=(uid)
107
- if uid.nil?
108
- fail ArgumentError, 'uid cannot be nil'
109
- end
110
-
111
- if uid.to_s.length > 60
110
+ if !uid.nil? && uid.to_s.length > 60
112
111
  fail ArgumentError, 'invalid value for "uid", the character length must be smaller than or equal to 60.'
113
112
  end
114
113
 
115
- if uid.to_s.length < 1
114
+ if !uid.nil? && uid.to_s.length < 1
116
115
  fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.'
117
116
  end
118
117
 
119
118
  pattern = Regexp.new(/^(?!strm_)[a-zA-Z0-9_-]+$/)
120
- if uid !~ pattern
119
+ if !uid.nil? && uid !~ pattern
121
120
  fail ArgumentError, "invalid value for \"uid\", must conform to the pattern #{pattern}."
122
121
  end
123
122