svix 1.39.0 → 1.41.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/stream_api.rb +157 -0
  4. data/lib/svix/api/stream_event_types_api.rb +486 -0
  5. data/lib/svix/models/app_usage_stats_in.rb +1 -0
  6. data/lib/svix/models/app_usage_stats_out.rb +33 -4
  7. data/lib/svix/models/event_example_in.rb +35 -4
  8. data/lib/svix/models/event_in.rb +38 -1
  9. data/lib/svix/models/event_out.rb +38 -1
  10. data/lib/svix/models/list_response_application_out.rb +2 -0
  11. data/lib/svix/models/list_response_application_stats.rb +2 -0
  12. data/lib/svix/models/list_response_background_task_out.rb +2 -0
  13. data/lib/svix/models/list_response_endpoint_message_out.rb +2 -0
  14. data/lib/svix/models/list_response_endpoint_out.rb +2 -0
  15. data/lib/svix/models/list_response_event_type_out.rb +2 -0
  16. data/lib/svix/models/list_response_integration_out.rb +2 -0
  17. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +2 -0
  18. data/lib/svix/models/list_response_message_attempt_out.rb +2 -0
  19. data/lib/svix/models/list_response_message_endpoint_out.rb +2 -0
  20. data/lib/svix/models/list_response_message_out.rb +2 -0
  21. data/lib/svix/models/list_response_operational_webhook_endpoint_out.rb +2 -0
  22. data/lib/svix/models/list_response_sink_out.rb +2 -0
  23. data/lib/svix/models/list_response_stream_event_type_out.rb +261 -0
  24. data/lib/svix/models/list_response_stream_out.rb +2 -0
  25. data/lib/svix/models/list_response_stream_sink_out.rb +2 -0
  26. data/lib/svix/models/list_response_template_out.rb +2 -0
  27. data/lib/svix/models/sink_http_config.rb +11 -1
  28. data/lib/svix/models/stream_event_type_in.rb +262 -0
  29. data/lib/svix/models/stream_event_type_out.rb +294 -0
  30. data/lib/svix/models/stream_event_type_patch.rb +254 -0
  31. data/lib/svix/version.rb +1 -1
  32. metadata +7 -3
  33. data/lib/svix/api/sink_api.rb +0 -179
@@ -15,6 +15,7 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class AppUsageStatsIn
18
+ # Specific app IDs or UIDs to aggregate stats for. Note that if none of the given IDs or UIDs are resolved, a 422 response will be given.
18
19
  attr_accessor :app_ids
19
20
 
20
21
  attr_accessor :since
@@ -21,6 +21,9 @@ module Svix
21
21
 
22
22
  attr_accessor :task
23
23
 
24
+ # Any app IDs or UIDs received in the request that weren't found. Stats will be produced for all the others.
25
+ attr_accessor :unresolved_app_ids
26
+
24
27
  class EnumAttributeValidator
25
28
  attr_reader :datatype
26
29
  attr_reader :allowable_values
@@ -48,7 +51,8 @@ module Svix
48
51
  {
49
52
  :'id' => :'id',
50
53
  :'status' => :'status',
51
- :'task' => :'task'
54
+ :'task' => :'task',
55
+ :'unresolved_app_ids' => :'unresolvedAppIds'
52
56
  }
53
57
  end
54
58
 
@@ -62,7 +66,8 @@ module Svix
62
66
  {
63
67
  :'id' => :'String',
64
68
  :'status' => :'BackgroundTaskStatus',
65
- :'task' => :'BackgroundTaskType'
69
+ :'task' => :'BackgroundTaskType',
70
+ :'unresolved_app_ids' => :'Array<String>'
66
71
  }
67
72
  end
68
73
 
@@ -104,6 +109,14 @@ module Svix
104
109
  else
105
110
  self.task = nil
106
111
  end
112
+
113
+ if attributes.key?(:'unresolved_app_ids')
114
+ if (value = attributes[:'unresolved_app_ids']).is_a?(Array)
115
+ self.unresolved_app_ids = value
116
+ end
117
+ else
118
+ self.unresolved_app_ids = nil
119
+ end
107
120
  end
108
121
 
109
122
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -123,6 +136,10 @@ module Svix
123
136
  invalid_properties.push('invalid value for "task", task cannot be nil.')
124
137
  end
125
138
 
139
+ if @unresolved_app_ids.nil?
140
+ invalid_properties.push('invalid value for "unresolved_app_ids", unresolved_app_ids cannot be nil.')
141
+ end
142
+
126
143
  invalid_properties
127
144
  end
128
145
 
@@ -133,9 +150,20 @@ module Svix
133
150
  return false if @id.nil?
134
151
  return false if @status.nil?
135
152
  return false if @task.nil?
153
+ return false if @unresolved_app_ids.nil?
136
154
  true
137
155
  end
138
156
 
157
+ # Custom attribute writer method with validation
158
+ # @param [Object] unresolved_app_ids Value to be assigned
159
+ def unresolved_app_ids=(unresolved_app_ids)
160
+ if unresolved_app_ids.nil?
161
+ fail ArgumentError, 'unresolved_app_ids cannot be nil'
162
+ end
163
+
164
+ @unresolved_app_ids = unresolved_app_ids
165
+ end
166
+
139
167
  # Checks equality by comparing each attribute.
140
168
  # @param [Object] Object to be compared
141
169
  def ==(o)
@@ -143,7 +171,8 @@ module Svix
143
171
  self.class == o.class &&
144
172
  id == o.id &&
145
173
  status == o.status &&
146
- task == o.task
174
+ task == o.task &&
175
+ unresolved_app_ids == o.unresolved_app_ids
147
176
  end
148
177
 
149
178
  # @see the `==` method
@@ -155,7 +184,7 @@ module Svix
155
184
  # Calculates hash code according to all attributes.
156
185
  # @return [Integer] Hash code
157
186
  def hash
158
- [id, status, task].hash
187
+ [id, status, task, unresolved_app_ids].hash
159
188
  end
160
189
 
161
190
  # Builds the object from hash
@@ -18,10 +18,14 @@ module Svix
18
18
  # The event type's name
19
19
  attr_accessor :event_type
20
20
 
21
+ # If the event type schema contains an array of examples, chooses which one to send. Defaults to the first example. Ignored if the schema doesn't contain an array of examples.
22
+ attr_accessor :example_index
23
+
21
24
  # Attribute mapping from ruby-style variable name to JSON key.
22
25
  def self.attribute_map
23
26
  {
24
- :'event_type' => :'eventType'
27
+ :'event_type' => :'eventType',
28
+ :'example_index' => :'exampleIndex'
25
29
  }
26
30
  end
27
31
 
@@ -33,7 +37,8 @@ module Svix
33
37
  # Attribute type mapping.
34
38
  def self.openapi_types
35
39
  {
36
- :'event_type' => :'String'
40
+ :'event_type' => :'String',
41
+ :'example_index' => :'Integer'
37
42
  }
38
43
  end
39
44
 
@@ -63,6 +68,12 @@ module Svix
63
68
  else
64
69
  self.event_type = nil
65
70
  end
71
+
72
+ if attributes.key?(:'example_index')
73
+ self.example_index = attributes[:'example_index']
74
+ else
75
+ self.example_index = 0
76
+ end
66
77
  end
67
78
 
68
79
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -83,6 +94,10 @@ module Svix
83
94
  invalid_properties.push("invalid value for \"event_type\", must conform to the pattern #{pattern}.")
84
95
  end
85
96
 
97
+ if !@example_index.nil? && @example_index < 0
98
+ invalid_properties.push('invalid value for "example_index", must be greater than or equal to 0.')
99
+ end
100
+
86
101
  invalid_properties
87
102
  end
88
103
 
@@ -93,6 +108,7 @@ module Svix
93
108
  return false if @event_type.nil?
94
109
  return false if @event_type.to_s.length > 256
95
110
  return false if @event_type !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
111
+ return false if !@example_index.nil? && @example_index < 0
96
112
  true
97
113
  end
98
114
 
@@ -115,12 +131,27 @@ module Svix
115
131
  @event_type = event_type
116
132
  end
117
133
 
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] example_index Value to be assigned
136
+ def example_index=(example_index)
137
+ if example_index.nil?
138
+ fail ArgumentError, 'example_index cannot be nil'
139
+ end
140
+
141
+ if example_index < 0
142
+ fail ArgumentError, 'invalid value for "example_index", must be greater than or equal to 0.'
143
+ end
144
+
145
+ @example_index = example_index
146
+ end
147
+
118
148
  # Checks equality by comparing each attribute.
119
149
  # @param [Object] Object to be compared
120
150
  def ==(o)
121
151
  return true if self.equal?(o)
122
152
  self.class == o.class &&
123
- event_type == o.event_type
153
+ event_type == o.event_type &&
154
+ example_index == o.example_index
124
155
  end
125
156
 
126
157
  # @see the `==` method
@@ -132,7 +163,7 @@ module Svix
132
163
  # Calculates hash code according to all attributes.
133
164
  # @return [Integer] Hash code
134
165
  def hash
135
- [event_type].hash
166
+ [event_type, example_index].hash
136
167
  end
137
168
 
138
169
  # Builds the object from hash
@@ -15,11 +15,15 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class EventIn
18
+ # The event type's name
19
+ attr_accessor :event_type
20
+
18
21
  attr_accessor :payload
19
22
 
20
23
  # Attribute mapping from ruby-style variable name to JSON key.
21
24
  def self.attribute_map
22
25
  {
26
+ :'event_type' => :'eventType',
23
27
  :'payload' => :'payload'
24
28
  }
25
29
  end
@@ -32,6 +36,7 @@ module Svix
32
36
  # Attribute type mapping.
33
37
  def self.openapi_types
34
38
  {
39
+ :'event_type' => :'String',
35
40
  :'payload' => :'String'
36
41
  }
37
42
  end
@@ -39,6 +44,7 @@ module Svix
39
44
  # List of attributes with nullable: true
40
45
  def self.openapi_nullable
41
46
  Set.new([
47
+ :'event_type',
42
48
  ])
43
49
  end
44
50
 
@@ -57,6 +63,10 @@ module Svix
57
63
  h[k.to_sym] = v
58
64
  }
59
65
 
66
+ if attributes.key?(:'event_type')
67
+ self.event_type = attributes[:'event_type']
68
+ end
69
+
60
70
  if attributes.key?(:'payload')
61
71
  self.payload = attributes[:'payload']
62
72
  else
@@ -69,6 +79,15 @@ module Svix
69
79
  def list_invalid_properties
70
80
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
81
  invalid_properties = Array.new
82
+ if !@event_type.nil? && @event_type.to_s.length > 256
83
+ invalid_properties.push('invalid value for "event_type", the character length must be smaller than or equal to 256.')
84
+ end
85
+
86
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
87
+ if !@event_type.nil? && @event_type !~ pattern
88
+ invalid_properties.push("invalid value for \"event_type\", must conform to the pattern #{pattern}.")
89
+ end
90
+
72
91
  if @payload.nil?
73
92
  invalid_properties.push('invalid value for "payload", payload cannot be nil.')
74
93
  end
@@ -80,15 +99,33 @@ module Svix
80
99
  # @return true if the model is valid
81
100
  def valid?
82
101
  warn '[DEPRECATED] the `valid?` method is obsolete'
102
+ return false if !@event_type.nil? && @event_type.to_s.length > 256
103
+ return false if !@event_type.nil? && @event_type !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
83
104
  return false if @payload.nil?
84
105
  true
85
106
  end
86
107
 
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] event_type Value to be assigned
110
+ def event_type=(event_type)
111
+ if !event_type.nil? && event_type.to_s.length > 256
112
+ fail ArgumentError, 'invalid value for "event_type", the character length must be smaller than or equal to 256.'
113
+ end
114
+
115
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
116
+ if !event_type.nil? && event_type !~ pattern
117
+ fail ArgumentError, "invalid value for \"event_type\", must conform to the pattern #{pattern}."
118
+ end
119
+
120
+ @event_type = event_type
121
+ end
122
+
87
123
  # Checks equality by comparing each attribute.
88
124
  # @param [Object] Object to be compared
89
125
  def ==(o)
90
126
  return true if self.equal?(o)
91
127
  self.class == o.class &&
128
+ event_type == o.event_type &&
92
129
  payload == o.payload
93
130
  end
94
131
 
@@ -101,7 +138,7 @@ module Svix
101
138
  # Calculates hash code according to all attributes.
102
139
  # @return [Integer] Hash code
103
140
  def hash
104
- [payload].hash
141
+ [event_type, payload].hash
105
142
  end
106
143
 
107
144
  # Builds the object from hash
@@ -15,6 +15,9 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class EventOut
18
+ # The event type's name
19
+ attr_accessor :event_type
20
+
18
21
  attr_accessor :payload
19
22
 
20
23
  attr_accessor :timestamp
@@ -22,6 +25,7 @@ module Svix
22
25
  # Attribute mapping from ruby-style variable name to JSON key.
23
26
  def self.attribute_map
24
27
  {
28
+ :'event_type' => :'eventType',
25
29
  :'payload' => :'payload',
26
30
  :'timestamp' => :'timestamp'
27
31
  }
@@ -35,6 +39,7 @@ module Svix
35
39
  # Attribute type mapping.
36
40
  def self.openapi_types
37
41
  {
42
+ :'event_type' => :'String',
38
43
  :'payload' => :'String',
39
44
  :'timestamp' => :'Time'
40
45
  }
@@ -43,6 +48,7 @@ module Svix
43
48
  # List of attributes with nullable: true
44
49
  def self.openapi_nullable
45
50
  Set.new([
51
+ :'event_type',
46
52
  ])
47
53
  end
48
54
 
@@ -61,6 +67,10 @@ module Svix
61
67
  h[k.to_sym] = v
62
68
  }
63
69
 
70
+ if attributes.key?(:'event_type')
71
+ self.event_type = attributes[:'event_type']
72
+ end
73
+
64
74
  if attributes.key?(:'payload')
65
75
  self.payload = attributes[:'payload']
66
76
  else
@@ -79,6 +89,15 @@ module Svix
79
89
  def list_invalid_properties
80
90
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
91
  invalid_properties = Array.new
92
+ if !@event_type.nil? && @event_type.to_s.length > 256
93
+ invalid_properties.push('invalid value for "event_type", the character length must be smaller than or equal to 256.')
94
+ end
95
+
96
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
97
+ if !@event_type.nil? && @event_type !~ pattern
98
+ invalid_properties.push("invalid value for \"event_type\", must conform to the pattern #{pattern}.")
99
+ end
100
+
82
101
  if @payload.nil?
83
102
  invalid_properties.push('invalid value for "payload", payload cannot be nil.')
84
103
  end
@@ -94,16 +113,34 @@ module Svix
94
113
  # @return true if the model is valid
95
114
  def valid?
96
115
  warn '[DEPRECATED] the `valid?` method is obsolete'
116
+ return false if !@event_type.nil? && @event_type.to_s.length > 256
117
+ return false if !@event_type.nil? && @event_type !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
97
118
  return false if @payload.nil?
98
119
  return false if @timestamp.nil?
99
120
  true
100
121
  end
101
122
 
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] event_type Value to be assigned
125
+ def event_type=(event_type)
126
+ if !event_type.nil? && event_type.to_s.length > 256
127
+ fail ArgumentError, 'invalid value for "event_type", the character length must be smaller than or equal to 256.'
128
+ end
129
+
130
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
131
+ if !event_type.nil? && event_type !~ pattern
132
+ fail ArgumentError, "invalid value for \"event_type\", must conform to the pattern #{pattern}."
133
+ end
134
+
135
+ @event_type = event_type
136
+ end
137
+
102
138
  # Checks equality by comparing each attribute.
103
139
  # @param [Object] Object to be compared
104
140
  def ==(o)
105
141
  return true if self.equal?(o)
106
142
  self.class == o.class &&
143
+ event_type == o.event_type &&
107
144
  payload == o.payload &&
108
145
  timestamp == o.timestamp
109
146
  end
@@ -117,7 +154,7 @@ module Svix
117
154
  # Calculates hash code according to all attributes.
118
155
  # @return [Integer] Hash code
119
156
  def hash
120
- [payload, timestamp].hash
157
+ [event_type, payload, timestamp].hash
121
158
  end
122
159
 
123
160
  # Builds the object from hash
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')
@@ -87,6 +87,8 @@ module Svix
87
87
 
88
88
  if attributes.key?(:'iterator')
89
89
  self.iterator = attributes[:'iterator']
90
+ else
91
+ self.iterator = nil
90
92
  end
91
93
 
92
94
  if attributes.key?(:'prev_iterator')