rocket_stack_sdk 1.0.3 → 1.0.4

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 (170) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -13
  3. data/docs/CreateCronJob201ResponseData.md +3 -1
  4. data/docs/CreateCronJobRequestDeliveryTarget.md +9 -9
  5. data/docs/CreateCronJobRequestDeliveryTargetAnyOf.md +30 -0
  6. data/docs/CreateCronJobRequestDeliveryTargetAnyOf1.md +30 -0
  7. data/docs/CreateCronJobRequestSchedule.md +1 -1
  8. data/docs/CreateDownloadUrlRequest.md +1 -1
  9. data/docs/CreateQueueRequestDeliveryTarget.md +9 -9
  10. data/docs/CreateQueueRequestDeliveryTargetAnyOf.md +30 -0
  11. data/docs/CreateQueueRequestDeliveryTargetAnyOf1.md +30 -0
  12. data/docs/CreateScheduleRequest.md +1 -1
  13. data/docs/CronApi.md +85 -7
  14. data/docs/DeleteCronJob200Response.md +22 -0
  15. data/docs/DeleteCronJob200ResponseData.md +20 -0
  16. data/docs/FinalizeUploadRequest.md +1 -1
  17. data/docs/FunctionsApi.md +72 -2
  18. data/docs/GetFunctionCode200Response.md +22 -0
  19. data/docs/GetFunctionCode200ResponseData.md +28 -0
  20. data/docs/GetFunctionCode200ResponseDataFilesInner.md +20 -0
  21. data/docs/GetMessageStatus200Response.md +1 -1
  22. data/docs/GetMessageStatus200ResponseData.md +2 -2
  23. data/docs/InvokeFunctionRequest.md +2 -2
  24. data/docs/KvApi.md +26 -26
  25. data/docs/ListCronInvocations200Response.md +22 -0
  26. data/docs/ListCronInvocations200ResponseData.md +20 -0
  27. data/docs/ListCronInvocations200ResponseDataItemsInner.md +42 -0
  28. data/docs/ListQueueMessages200Response.md +22 -0
  29. data/docs/ListQueueMessages200ResponseData.md +20 -0
  30. data/docs/ListQueueMessages200ResponseDataItemsInner.md +32 -0
  31. data/docs/PutKvItemRequest.md +3 -3
  32. data/docs/QueuesApi.md +80 -2
  33. data/docs/ResourcesApi.md +1 -1
  34. data/docs/SchedulerApi.md +81 -3
  35. data/docs/StorageApi.md +5 -5
  36. data/docs/UpdateCronJobRequestSchedule.md +1 -1
  37. data/docs/UpdateScheduleRequest.md +1 -1
  38. data/lib/rocket_stack_sdk/api/cron_api.rb +92 -8
  39. data/lib/rocket_stack_sdk/api/functions_api.rb +68 -5
  40. data/lib/rocket_stack_sdk/api/kv_api.rb +38 -50
  41. data/lib/rocket_stack_sdk/api/queues_api.rb +89 -5
  42. data/lib/rocket_stack_sdk/api/resources_api.rb +3 -3
  43. data/lib/rocket_stack_sdk/api/scheduler_api.rb +89 -5
  44. data/lib/rocket_stack_sdk/api/storage_api.rb +9 -9
  45. data/lib/rocket_stack_sdk/api_client.rb +3 -3
  46. data/lib/rocket_stack_sdk/api_error.rb +3 -3
  47. data/lib/rocket_stack_sdk/api_model_base.rb +3 -3
  48. data/lib/rocket_stack_sdk/configuration.rb +5 -5
  49. data/lib/rocket_stack_sdk/models/create_cron_job201_response.rb +3 -3
  50. data/lib/rocket_stack_sdk/models/create_cron_job201_response_data.rb +33 -7
  51. data/lib/rocket_stack_sdk/models/create_cron_job_request.rb +3 -3
  52. data/lib/rocket_stack_sdk/models/create_cron_job_request_delivery_target.rb +79 -319
  53. data/lib/rocket_stack_sdk/models/create_cron_job_request_delivery_target_any_of.rb +351 -0
  54. data/lib/rocket_stack_sdk/models/create_cron_job_request_delivery_target_any_of1.rb +351 -0
  55. data/lib/rocket_stack_sdk/models/create_cron_job_request_schedule.rb +3 -5
  56. data/lib/rocket_stack_sdk/models/create_download_url200_response.rb +3 -3
  57. data/lib/rocket_stack_sdk/models/create_download_url200_response_data.rb +3 -3
  58. data/lib/rocket_stack_sdk/models/create_download_url_request.rb +4 -3
  59. data/lib/rocket_stack_sdk/models/create_function202_response.rb +3 -3
  60. data/lib/rocket_stack_sdk/models/create_function202_response_data.rb +3 -3
  61. data/lib/rocket_stack_sdk/models/create_queue201_response.rb +3 -3
  62. data/lib/rocket_stack_sdk/models/create_queue201_response_data.rb +3 -3
  63. data/lib/rocket_stack_sdk/models/create_queue_request.rb +3 -3
  64. data/lib/rocket_stack_sdk/models/create_queue_request_delivery_target.rb +79 -319
  65. data/lib/rocket_stack_sdk/models/create_queue_request_delivery_target_any_of.rb +351 -0
  66. data/lib/rocket_stack_sdk/models/create_queue_request_delivery_target_any_of1.rb +351 -0
  67. data/lib/rocket_stack_sdk/models/create_schedule201_response.rb +3 -3
  68. data/lib/rocket_stack_sdk/models/create_schedule201_response_data.rb +3 -3
  69. data/lib/rocket_stack_sdk/models/create_schedule_request.rb +4 -3
  70. data/lib/rocket_stack_sdk/models/delete_cron_job200_response.rb +182 -0
  71. data/lib/rocket_stack_sdk/models/delete_cron_job200_response_data.rb +190 -0
  72. data/lib/rocket_stack_sdk/models/delete_kv_item200_response.rb +3 -3
  73. data/lib/rocket_stack_sdk/models/delete_kv_item200_response_data.rb +3 -3
  74. data/lib/rocket_stack_sdk/models/enqueue_message201_response.rb +3 -3
  75. data/lib/rocket_stack_sdk/models/enqueue_message201_response_data.rb +3 -3
  76. data/lib/rocket_stack_sdk/models/enqueue_message_request.rb +3 -3
  77. data/lib/rocket_stack_sdk/models/finalize_upload200_response.rb +3 -3
  78. data/lib/rocket_stack_sdk/models/finalize_upload200_response_data.rb +3 -3
  79. data/lib/rocket_stack_sdk/models/finalize_upload_request.rb +4 -3
  80. data/lib/rocket_stack_sdk/models/get_cron_job200_response.rb +3 -3
  81. data/lib/rocket_stack_sdk/models/get_function200_response.rb +3 -3
  82. data/lib/rocket_stack_sdk/models/get_function_code200_response.rb +182 -0
  83. data/lib/rocket_stack_sdk/models/get_function_code200_response_data.rb +290 -0
  84. data/lib/rocket_stack_sdk/models/get_function_code200_response_data_files_inner.rb +190 -0
  85. data/lib/rocket_stack_sdk/models/get_kv_item200_response.rb +3 -3
  86. data/lib/rocket_stack_sdk/models/get_kv_item200_response_data.rb +3 -3
  87. data/lib/rocket_stack_sdk/models/get_message_status200_response.rb +4 -4
  88. data/lib/rocket_stack_sdk/models/get_message_status200_response_data.rb +3 -3
  89. data/lib/rocket_stack_sdk/models/get_queue200_response.rb +3 -3
  90. data/lib/rocket_stack_sdk/models/get_schedule200_response.rb +3 -3
  91. data/lib/rocket_stack_sdk/models/get_schedule_status200_response.rb +3 -3
  92. data/lib/rocket_stack_sdk/models/get_schedule_status200_response_data.rb +3 -3
  93. data/lib/rocket_stack_sdk/models/get_template200_response.rb +3 -3
  94. data/lib/rocket_stack_sdk/models/invoke_function200_response.rb +3 -3
  95. data/lib/rocket_stack_sdk/models/invoke_function200_response_data.rb +3 -3
  96. data/lib/rocket_stack_sdk/models/invoke_function_request.rb +3 -7
  97. data/lib/rocket_stack_sdk/models/list_capabilities200_response.rb +3 -3
  98. data/lib/rocket_stack_sdk/models/list_capabilities200_response_data_inner.rb +3 -3
  99. data/lib/rocket_stack_sdk/models/list_cron_invocations200_response.rb +182 -0
  100. data/lib/rocket_stack_sdk/models/list_cron_invocations200_response_data.rb +176 -0
  101. data/lib/rocket_stack_sdk/models/list_cron_invocations200_response_data_items_inner.rb +347 -0
  102. data/lib/rocket_stack_sdk/models/list_cron_jobs200_response.rb +3 -3
  103. data/lib/rocket_stack_sdk/models/list_cron_jobs200_response_data.rb +3 -3
  104. data/lib/rocket_stack_sdk/models/list_cron_jobs200_response_data_items_inner.rb +3 -3
  105. data/lib/rocket_stack_sdk/models/list_cron_jobs200_response_data_items_inner_schedule.rb +3 -3
  106. data/lib/rocket_stack_sdk/models/list_functions200_response.rb +3 -3
  107. data/lib/rocket_stack_sdk/models/list_functions200_response_data.rb +3 -3
  108. data/lib/rocket_stack_sdk/models/list_functions200_response_data_items_inner.rb +3 -3
  109. data/lib/rocket_stack_sdk/models/list_functions200_response_data_items_inner_actual_spec.rb +3 -3
  110. data/lib/rocket_stack_sdk/models/list_functions200_response_data_items_inner_desired_spec.rb +3 -3
  111. data/lib/rocket_stack_sdk/models/list_functions200_response_data_items_inner_desired_spec_code.rb +3 -3
  112. data/lib/rocket_stack_sdk/models/list_functions200_response_error.rb +3 -3
  113. data/lib/rocket_stack_sdk/models/list_functions401_response.rb +3 -3
  114. data/lib/rocket_stack_sdk/models/list_kv_items200_response.rb +3 -3
  115. data/lib/rocket_stack_sdk/models/list_kv_items200_response_data.rb +3 -3
  116. data/lib/rocket_stack_sdk/models/list_kv_items200_response_data_items_inner.rb +3 -3
  117. data/lib/rocket_stack_sdk/models/list_queue_messages200_response.rb +182 -0
  118. data/lib/rocket_stack_sdk/models/list_queue_messages200_response_data.rb +176 -0
  119. data/lib/rocket_stack_sdk/models/list_queue_messages200_response_data_items_inner.rb +312 -0
  120. data/lib/rocket_stack_sdk/models/list_queues200_response.rb +3 -3
  121. data/lib/rocket_stack_sdk/models/list_queues200_response_data.rb +3 -3
  122. data/lib/rocket_stack_sdk/models/list_queues200_response_data_items_inner.rb +3 -3
  123. data/lib/rocket_stack_sdk/models/list_queues200_response_data_items_inner_delivery_target.rb +3 -3
  124. data/lib/rocket_stack_sdk/models/list_schedules200_response.rb +3 -3
  125. data/lib/rocket_stack_sdk/models/list_schedules200_response_data.rb +3 -3
  126. data/lib/rocket_stack_sdk/models/list_schedules200_response_data_items_inner.rb +3 -3
  127. data/lib/rocket_stack_sdk/models/list_snippets200_response.rb +3 -3
  128. data/lib/rocket_stack_sdk/models/list_snippets200_response_data_inner.rb +3 -3
  129. data/lib/rocket_stack_sdk/models/list_storage_objects200_response.rb +3 -3
  130. data/lib/rocket_stack_sdk/models/list_storage_objects200_response_data.rb +3 -3
  131. data/lib/rocket_stack_sdk/models/list_storage_objects200_response_data_items_inner.rb +3 -3
  132. data/lib/rocket_stack_sdk/models/list_templates200_response.rb +3 -3
  133. data/lib/rocket_stack_sdk/models/list_templates200_response_data_inner.rb +3 -3
  134. data/lib/rocket_stack_sdk/models/put_kv_item200_response.rb +3 -3
  135. data/lib/rocket_stack_sdk/models/put_kv_item200_response_data.rb +3 -3
  136. data/lib/rocket_stack_sdk/models/put_kv_item_request.rb +7 -4
  137. data/lib/rocket_stack_sdk/models/put_kv_item_request_if_version.rb +4 -3
  138. data/lib/rocket_stack_sdk/models/update_cron_job200_response.rb +3 -3
  139. data/lib/rocket_stack_sdk/models/update_cron_job200_response_data.rb +3 -3
  140. data/lib/rocket_stack_sdk/models/update_cron_job_request.rb +3 -3
  141. data/lib/rocket_stack_sdk/models/update_cron_job_request_schedule.rb +3 -5
  142. data/lib/rocket_stack_sdk/models/update_function_request.rb +3 -3
  143. data/lib/rocket_stack_sdk/models/update_queue200_response.rb +3 -3
  144. data/lib/rocket_stack_sdk/models/update_queue200_response_data.rb +3 -3
  145. data/lib/rocket_stack_sdk/models/update_queue_request.rb +3 -3
  146. data/lib/rocket_stack_sdk/models/update_schedule200_response.rb +3 -3
  147. data/lib/rocket_stack_sdk/models/update_schedule200_response_data.rb +3 -3
  148. data/lib/rocket_stack_sdk/models/update_schedule_request.rb +4 -3
  149. data/lib/rocket_stack_sdk/models/upload_object201_response.rb +3 -3
  150. data/lib/rocket_stack_sdk/models/upload_object201_response_data.rb +3 -3
  151. data/lib/rocket_stack_sdk/version.rb +4 -4
  152. data/lib/rocket_stack_sdk.rb +18 -4
  153. data/rocket_stack_sdk.gemspec +5 -5
  154. data/spec/models/create_cron_job_request_delivery_target_any_of1_spec.rb +76 -0
  155. data/spec/models/create_cron_job_request_delivery_target_any_of_spec.rb +76 -0
  156. data/spec/models/create_queue_request_delivery_target_any_of1_spec.rb +76 -0
  157. data/spec/models/create_queue_request_delivery_target_any_of_spec.rb +76 -0
  158. data/spec/models/delete_cron_job200_response_data_spec.rb +42 -0
  159. data/spec/models/delete_cron_job200_response_spec.rb +48 -0
  160. data/spec/models/get_function_code200_response_data_files_inner_spec.rb +42 -0
  161. data/spec/models/get_function_code200_response_data_spec.rb +74 -0
  162. data/spec/models/get_function_code200_response_spec.rb +48 -0
  163. data/spec/models/list_cron_invocations200_response_data_items_inner_spec.rb +112 -0
  164. data/spec/models/list_cron_invocations200_response_data_spec.rb +42 -0
  165. data/spec/models/list_cron_invocations200_response_spec.rb +48 -0
  166. data/spec/models/list_queue_messages200_response_data_items_inner_spec.rb +78 -0
  167. data/spec/models/list_queue_messages200_response_data_spec.rb +42 -0
  168. data/spec/models/list_queue_messages200_response_spec.rb +48 -0
  169. data/spec/spec_helper.rb +3 -3
  170. metadata +141 -81
@@ -0,0 +1,351 @@
1
+ =begin
2
+ #Rocketstack Control Plane API
3
+
4
+ #Combined API for Functions, Queues, KV, Storage, Cron, and Scheduler.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
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 RocketStackSdk
17
+ class CreateCronJobRequestDeliveryTargetAnyOf < ApiModelBase
18
+ # Deliver to a RocketStack function.
19
+ attr_accessor :type
20
+
21
+ # Function resource ID. Required when type is function.
22
+ attr_accessor :function_id
23
+
24
+ # Optional webhook headers (max 10). Authorization, Cookie, Host, and Content-Length are forbidden.
25
+ attr_accessor :webhook_headers
26
+
27
+ attr_accessor :timeout_seconds
28
+
29
+ attr_accessor :max_in_flight
30
+
31
+ attr_accessor :max_per_second
32
+
33
+ # HTTP status codes that trigger delivery retries.
34
+ attr_accessor :retryable_status_codes
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'type' => :'type',
62
+ :'function_id' => :'functionId',
63
+ :'webhook_headers' => :'webhookHeaders',
64
+ :'timeout_seconds' => :'timeoutSeconds',
65
+ :'max_in_flight' => :'maxInFlight',
66
+ :'max_per_second' => :'maxPerSecond',
67
+ :'retryable_status_codes' => :'retryableStatusCodes'
68
+ }
69
+ end
70
+
71
+ # Returns attribute mapping this model knows about
72
+ def self.acceptable_attribute_map
73
+ attribute_map
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ acceptable_attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'type' => :'String',
85
+ :'function_id' => :'String',
86
+ :'webhook_headers' => :'Hash<String, String>',
87
+ :'timeout_seconds' => :'Float',
88
+ :'max_in_flight' => :'Float',
89
+ :'max_per_second' => :'Float',
90
+ :'retryable_status_codes' => :'Array<Float>'
91
+ }
92
+ end
93
+
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ ])
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RocketStackSdk::CreateCronJobRequestDeliveryTargetAnyOf` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ acceptable_attribute_map = self.class.acceptable_attribute_map
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!acceptable_attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RocketStackSdk::CreateCronJobRequestDeliveryTargetAnyOf`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'type')
117
+ self.type = attributes[:'type']
118
+ else
119
+ self.type = nil
120
+ end
121
+
122
+ if attributes.key?(:'function_id')
123
+ self.function_id = attributes[:'function_id']
124
+ else
125
+ self.function_id = nil
126
+ end
127
+
128
+ if attributes.key?(:'webhook_headers')
129
+ if (value = attributes[:'webhook_headers']).is_a?(Hash)
130
+ self.webhook_headers = value
131
+ end
132
+ end
133
+
134
+ if attributes.key?(:'timeout_seconds')
135
+ self.timeout_seconds = attributes[:'timeout_seconds']
136
+ end
137
+
138
+ if attributes.key?(:'max_in_flight')
139
+ self.max_in_flight = attributes[:'max_in_flight']
140
+ end
141
+
142
+ if attributes.key?(:'max_per_second')
143
+ self.max_per_second = attributes[:'max_per_second']
144
+ end
145
+
146
+ if attributes.key?(:'retryable_status_codes')
147
+ if (value = attributes[:'retryable_status_codes']).is_a?(Array)
148
+ self.retryable_status_codes = value
149
+ end
150
+ end
151
+ end
152
+
153
+ # Show invalid properties with the reasons. Usually used together with valid?
154
+ # @return Array for valid properties with the reasons
155
+ def list_invalid_properties
156
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
157
+ invalid_properties = Array.new
158
+ if @type.nil?
159
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
160
+ end
161
+
162
+ if @function_id.nil?
163
+ invalid_properties.push('invalid value for "function_id", function_id cannot be nil.')
164
+ end
165
+
166
+ if !@timeout_seconds.nil? && @timeout_seconds > 30
167
+ invalid_properties.push('invalid value for "timeout_seconds", must be smaller than or equal to 30.')
168
+ end
169
+
170
+ if !@timeout_seconds.nil? && @timeout_seconds < 1
171
+ invalid_properties.push('invalid value for "timeout_seconds", must be greater than or equal to 1.')
172
+ end
173
+
174
+ if !@max_in_flight.nil? && @max_in_flight > 50
175
+ invalid_properties.push('invalid value for "max_in_flight", must be smaller than or equal to 50.')
176
+ end
177
+
178
+ if !@max_in_flight.nil? && @max_in_flight < 1
179
+ invalid_properties.push('invalid value for "max_in_flight", must be greater than or equal to 1.')
180
+ end
181
+
182
+ if !@max_per_second.nil? && @max_per_second > 200
183
+ invalid_properties.push('invalid value for "max_per_second", must be smaller than or equal to 200.')
184
+ end
185
+
186
+ if !@max_per_second.nil? && @max_per_second < 1
187
+ invalid_properties.push('invalid value for "max_per_second", must be greater than or equal to 1.')
188
+ end
189
+
190
+ invalid_properties
191
+ end
192
+
193
+ # Check to see if the all the properties in the model are valid
194
+ # @return true if the model is valid
195
+ def valid?
196
+ warn '[DEPRECATED] the `valid?` method is obsolete'
197
+ return false if @type.nil?
198
+ type_validator = EnumAttributeValidator.new('String', ["function"])
199
+ return false unless type_validator.valid?(@type)
200
+ return false if @function_id.nil?
201
+ return false if !@timeout_seconds.nil? && @timeout_seconds > 30
202
+ return false if !@timeout_seconds.nil? && @timeout_seconds < 1
203
+ return false if !@max_in_flight.nil? && @max_in_flight > 50
204
+ return false if !@max_in_flight.nil? && @max_in_flight < 1
205
+ return false if !@max_per_second.nil? && @max_per_second > 200
206
+ return false if !@max_per_second.nil? && @max_per_second < 1
207
+ true
208
+ end
209
+
210
+ # Custom attribute writer method checking allowed values (enum).
211
+ # @param [Object] type Object to be assigned
212
+ def type=(type)
213
+ validator = EnumAttributeValidator.new('String', ["function"])
214
+ unless validator.valid?(type)
215
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
216
+ end
217
+ @type = type
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] function_id Value to be assigned
222
+ def function_id=(function_id)
223
+ if function_id.nil?
224
+ fail ArgumentError, 'function_id cannot be nil'
225
+ end
226
+
227
+ @function_id = function_id
228
+ end
229
+
230
+ # Custom attribute writer method with validation
231
+ # @param [Object] timeout_seconds Value to be assigned
232
+ def timeout_seconds=(timeout_seconds)
233
+ if timeout_seconds.nil?
234
+ fail ArgumentError, 'timeout_seconds cannot be nil'
235
+ end
236
+
237
+ if timeout_seconds > 30
238
+ fail ArgumentError, 'invalid value for "timeout_seconds", must be smaller than or equal to 30.'
239
+ end
240
+
241
+ if timeout_seconds < 1
242
+ fail ArgumentError, 'invalid value for "timeout_seconds", must be greater than or equal to 1.'
243
+ end
244
+
245
+ @timeout_seconds = timeout_seconds
246
+ end
247
+
248
+ # Custom attribute writer method with validation
249
+ # @param [Object] max_in_flight Value to be assigned
250
+ def max_in_flight=(max_in_flight)
251
+ if max_in_flight.nil?
252
+ fail ArgumentError, 'max_in_flight cannot be nil'
253
+ end
254
+
255
+ if max_in_flight > 50
256
+ fail ArgumentError, 'invalid value for "max_in_flight", must be smaller than or equal to 50.'
257
+ end
258
+
259
+ if max_in_flight < 1
260
+ fail ArgumentError, 'invalid value for "max_in_flight", must be greater than or equal to 1.'
261
+ end
262
+
263
+ @max_in_flight = max_in_flight
264
+ end
265
+
266
+ # Custom attribute writer method with validation
267
+ # @param [Object] max_per_second Value to be assigned
268
+ def max_per_second=(max_per_second)
269
+ if max_per_second.nil?
270
+ fail ArgumentError, 'max_per_second cannot be nil'
271
+ end
272
+
273
+ if max_per_second > 200
274
+ fail ArgumentError, 'invalid value for "max_per_second", must be smaller than or equal to 200.'
275
+ end
276
+
277
+ if max_per_second < 1
278
+ fail ArgumentError, 'invalid value for "max_per_second", must be greater than or equal to 1.'
279
+ end
280
+
281
+ @max_per_second = max_per_second
282
+ end
283
+
284
+ # Checks equality by comparing each attribute.
285
+ # @param [Object] Object to be compared
286
+ def ==(o)
287
+ return true if self.equal?(o)
288
+ self.class == o.class &&
289
+ type == o.type &&
290
+ function_id == o.function_id &&
291
+ webhook_headers == o.webhook_headers &&
292
+ timeout_seconds == o.timeout_seconds &&
293
+ max_in_flight == o.max_in_flight &&
294
+ max_per_second == o.max_per_second &&
295
+ retryable_status_codes == o.retryable_status_codes
296
+ end
297
+
298
+ # @see the `==` method
299
+ # @param [Object] Object to be compared
300
+ def eql?(o)
301
+ self == o
302
+ end
303
+
304
+ # Calculates hash code according to all attributes.
305
+ # @return [Integer] Hash code
306
+ def hash
307
+ [type, function_id, webhook_headers, timeout_seconds, max_in_flight, max_per_second, retryable_status_codes].hash
308
+ end
309
+
310
+ # Builds the object from hash
311
+ # @param [Hash] attributes Model attributes in the form of hash
312
+ # @return [Object] Returns the model itself
313
+ def self.build_from_hash(attributes)
314
+ return nil unless attributes.is_a?(Hash)
315
+ attributes = attributes.transform_keys(&:to_sym)
316
+ transformed_hash = {}
317
+ openapi_types.each_pair do |key, type|
318
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
319
+ transformed_hash["#{key}"] = nil
320
+ elsif type =~ /\AArray<(.*)>/i
321
+ # check to ensure the input is an array given that the attribute
322
+ # is documented as an array but the input is not
323
+ if attributes[attribute_map[key]].is_a?(Array)
324
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
325
+ end
326
+ elsif !attributes[attribute_map[key]].nil?
327
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
328
+ end
329
+ end
330
+ new(transformed_hash)
331
+ end
332
+
333
+ # Returns the object in the form of hash
334
+ # @return [Hash] Returns the object in the form of hash
335
+ def to_hash
336
+ hash = {}
337
+ self.class.attribute_map.each_pair do |attr, param|
338
+ value = self.send(attr)
339
+ if value.nil?
340
+ is_nullable = self.class.openapi_nullable.include?(attr)
341
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
342
+ end
343
+
344
+ hash[param] = _to_hash(value)
345
+ end
346
+ hash
347
+ end
348
+
349
+ end
350
+
351
+ end
@@ -0,0 +1,351 @@
1
+ =begin
2
+ #Rocketstack Control Plane API
3
+
4
+ #Combined API for Functions, Queues, KV, Storage, Cron, and Scheduler.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
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 RocketStackSdk
17
+ class CreateCronJobRequestDeliveryTargetAnyOf1 < ApiModelBase
18
+ # Deliver to an HTTPS webhook.
19
+ attr_accessor :type
20
+
21
+ # HTTPS webhook URL. Must not contain credentials in the URL.
22
+ attr_accessor :webhook_url
23
+
24
+ # Optional webhook headers (max 10). Authorization, Cookie, Host, and Content-Length are forbidden.
25
+ attr_accessor :webhook_headers
26
+
27
+ attr_accessor :timeout_seconds
28
+
29
+ attr_accessor :max_in_flight
30
+
31
+ attr_accessor :max_per_second
32
+
33
+ # HTTP status codes that trigger delivery retries.
34
+ attr_accessor :retryable_status_codes
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'type' => :'type',
62
+ :'webhook_url' => :'webhookUrl',
63
+ :'webhook_headers' => :'webhookHeaders',
64
+ :'timeout_seconds' => :'timeoutSeconds',
65
+ :'max_in_flight' => :'maxInFlight',
66
+ :'max_per_second' => :'maxPerSecond',
67
+ :'retryable_status_codes' => :'retryableStatusCodes'
68
+ }
69
+ end
70
+
71
+ # Returns attribute mapping this model knows about
72
+ def self.acceptable_attribute_map
73
+ attribute_map
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ acceptable_attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'type' => :'String',
85
+ :'webhook_url' => :'String',
86
+ :'webhook_headers' => :'Hash<String, String>',
87
+ :'timeout_seconds' => :'Float',
88
+ :'max_in_flight' => :'Float',
89
+ :'max_per_second' => :'Float',
90
+ :'retryable_status_codes' => :'Array<Float>'
91
+ }
92
+ end
93
+
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ ])
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RocketStackSdk::CreateCronJobRequestDeliveryTargetAnyOf1` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ acceptable_attribute_map = self.class.acceptable_attribute_map
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!acceptable_attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RocketStackSdk::CreateCronJobRequestDeliveryTargetAnyOf1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'type')
117
+ self.type = attributes[:'type']
118
+ else
119
+ self.type = nil
120
+ end
121
+
122
+ if attributes.key?(:'webhook_url')
123
+ self.webhook_url = attributes[:'webhook_url']
124
+ else
125
+ self.webhook_url = nil
126
+ end
127
+
128
+ if attributes.key?(:'webhook_headers')
129
+ if (value = attributes[:'webhook_headers']).is_a?(Hash)
130
+ self.webhook_headers = value
131
+ end
132
+ end
133
+
134
+ if attributes.key?(:'timeout_seconds')
135
+ self.timeout_seconds = attributes[:'timeout_seconds']
136
+ end
137
+
138
+ if attributes.key?(:'max_in_flight')
139
+ self.max_in_flight = attributes[:'max_in_flight']
140
+ end
141
+
142
+ if attributes.key?(:'max_per_second')
143
+ self.max_per_second = attributes[:'max_per_second']
144
+ end
145
+
146
+ if attributes.key?(:'retryable_status_codes')
147
+ if (value = attributes[:'retryable_status_codes']).is_a?(Array)
148
+ self.retryable_status_codes = value
149
+ end
150
+ end
151
+ end
152
+
153
+ # Show invalid properties with the reasons. Usually used together with valid?
154
+ # @return Array for valid properties with the reasons
155
+ def list_invalid_properties
156
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
157
+ invalid_properties = Array.new
158
+ if @type.nil?
159
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
160
+ end
161
+
162
+ if @webhook_url.nil?
163
+ invalid_properties.push('invalid value for "webhook_url", webhook_url cannot be nil.')
164
+ end
165
+
166
+ if !@timeout_seconds.nil? && @timeout_seconds > 30
167
+ invalid_properties.push('invalid value for "timeout_seconds", must be smaller than or equal to 30.')
168
+ end
169
+
170
+ if !@timeout_seconds.nil? && @timeout_seconds < 1
171
+ invalid_properties.push('invalid value for "timeout_seconds", must be greater than or equal to 1.')
172
+ end
173
+
174
+ if !@max_in_flight.nil? && @max_in_flight > 50
175
+ invalid_properties.push('invalid value for "max_in_flight", must be smaller than or equal to 50.')
176
+ end
177
+
178
+ if !@max_in_flight.nil? && @max_in_flight < 1
179
+ invalid_properties.push('invalid value for "max_in_flight", must be greater than or equal to 1.')
180
+ end
181
+
182
+ if !@max_per_second.nil? && @max_per_second > 200
183
+ invalid_properties.push('invalid value for "max_per_second", must be smaller than or equal to 200.')
184
+ end
185
+
186
+ if !@max_per_second.nil? && @max_per_second < 1
187
+ invalid_properties.push('invalid value for "max_per_second", must be greater than or equal to 1.')
188
+ end
189
+
190
+ invalid_properties
191
+ end
192
+
193
+ # Check to see if the all the properties in the model are valid
194
+ # @return true if the model is valid
195
+ def valid?
196
+ warn '[DEPRECATED] the `valid?` method is obsolete'
197
+ return false if @type.nil?
198
+ type_validator = EnumAttributeValidator.new('String', ["webhook"])
199
+ return false unless type_validator.valid?(@type)
200
+ return false if @webhook_url.nil?
201
+ return false if !@timeout_seconds.nil? && @timeout_seconds > 30
202
+ return false if !@timeout_seconds.nil? && @timeout_seconds < 1
203
+ return false if !@max_in_flight.nil? && @max_in_flight > 50
204
+ return false if !@max_in_flight.nil? && @max_in_flight < 1
205
+ return false if !@max_per_second.nil? && @max_per_second > 200
206
+ return false if !@max_per_second.nil? && @max_per_second < 1
207
+ true
208
+ end
209
+
210
+ # Custom attribute writer method checking allowed values (enum).
211
+ # @param [Object] type Object to be assigned
212
+ def type=(type)
213
+ validator = EnumAttributeValidator.new('String', ["webhook"])
214
+ unless validator.valid?(type)
215
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
216
+ end
217
+ @type = type
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] webhook_url Value to be assigned
222
+ def webhook_url=(webhook_url)
223
+ if webhook_url.nil?
224
+ fail ArgumentError, 'webhook_url cannot be nil'
225
+ end
226
+
227
+ @webhook_url = webhook_url
228
+ end
229
+
230
+ # Custom attribute writer method with validation
231
+ # @param [Object] timeout_seconds Value to be assigned
232
+ def timeout_seconds=(timeout_seconds)
233
+ if timeout_seconds.nil?
234
+ fail ArgumentError, 'timeout_seconds cannot be nil'
235
+ end
236
+
237
+ if timeout_seconds > 30
238
+ fail ArgumentError, 'invalid value for "timeout_seconds", must be smaller than or equal to 30.'
239
+ end
240
+
241
+ if timeout_seconds < 1
242
+ fail ArgumentError, 'invalid value for "timeout_seconds", must be greater than or equal to 1.'
243
+ end
244
+
245
+ @timeout_seconds = timeout_seconds
246
+ end
247
+
248
+ # Custom attribute writer method with validation
249
+ # @param [Object] max_in_flight Value to be assigned
250
+ def max_in_flight=(max_in_flight)
251
+ if max_in_flight.nil?
252
+ fail ArgumentError, 'max_in_flight cannot be nil'
253
+ end
254
+
255
+ if max_in_flight > 50
256
+ fail ArgumentError, 'invalid value for "max_in_flight", must be smaller than or equal to 50.'
257
+ end
258
+
259
+ if max_in_flight < 1
260
+ fail ArgumentError, 'invalid value for "max_in_flight", must be greater than or equal to 1.'
261
+ end
262
+
263
+ @max_in_flight = max_in_flight
264
+ end
265
+
266
+ # Custom attribute writer method with validation
267
+ # @param [Object] max_per_second Value to be assigned
268
+ def max_per_second=(max_per_second)
269
+ if max_per_second.nil?
270
+ fail ArgumentError, 'max_per_second cannot be nil'
271
+ end
272
+
273
+ if max_per_second > 200
274
+ fail ArgumentError, 'invalid value for "max_per_second", must be smaller than or equal to 200.'
275
+ end
276
+
277
+ if max_per_second < 1
278
+ fail ArgumentError, 'invalid value for "max_per_second", must be greater than or equal to 1.'
279
+ end
280
+
281
+ @max_per_second = max_per_second
282
+ end
283
+
284
+ # Checks equality by comparing each attribute.
285
+ # @param [Object] Object to be compared
286
+ def ==(o)
287
+ return true if self.equal?(o)
288
+ self.class == o.class &&
289
+ type == o.type &&
290
+ webhook_url == o.webhook_url &&
291
+ webhook_headers == o.webhook_headers &&
292
+ timeout_seconds == o.timeout_seconds &&
293
+ max_in_flight == o.max_in_flight &&
294
+ max_per_second == o.max_per_second &&
295
+ retryable_status_codes == o.retryable_status_codes
296
+ end
297
+
298
+ # @see the `==` method
299
+ # @param [Object] Object to be compared
300
+ def eql?(o)
301
+ self == o
302
+ end
303
+
304
+ # Calculates hash code according to all attributes.
305
+ # @return [Integer] Hash code
306
+ def hash
307
+ [type, webhook_url, webhook_headers, timeout_seconds, max_in_flight, max_per_second, retryable_status_codes].hash
308
+ end
309
+
310
+ # Builds the object from hash
311
+ # @param [Hash] attributes Model attributes in the form of hash
312
+ # @return [Object] Returns the model itself
313
+ def self.build_from_hash(attributes)
314
+ return nil unless attributes.is_a?(Hash)
315
+ attributes = attributes.transform_keys(&:to_sym)
316
+ transformed_hash = {}
317
+ openapi_types.each_pair do |key, type|
318
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
319
+ transformed_hash["#{key}"] = nil
320
+ elsif type =~ /\AArray<(.*)>/i
321
+ # check to ensure the input is an array given that the attribute
322
+ # is documented as an array but the input is not
323
+ if attributes[attribute_map[key]].is_a?(Array)
324
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
325
+ end
326
+ elsif !attributes[attribute_map[key]].nil?
327
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
328
+ end
329
+ end
330
+ new(transformed_hash)
331
+ end
332
+
333
+ # Returns the object in the form of hash
334
+ # @return [Hash] Returns the object in the form of hash
335
+ def to_hash
336
+ hash = {}
337
+ self.class.attribute_map.each_pair do |attr, param|
338
+ value = self.send(attr)
339
+ if value.nil?
340
+ is_nullable = self.class.openapi_nullable.include?(attr)
341
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
342
+ end
343
+
344
+ hash[param] = _to_hash(value)
345
+ end
346
+ hash
347
+ end
348
+
349
+ end
350
+
351
+ end