cloudreactor_api_client 0.1.0.pre

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 (151) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +92 -0
  4. data/cloudreactor_api_client.md +226 -0
  5. data/lib/cloudreactor_api_client/api/alert_methods_api.rb +482 -0
  6. data/lib/cloudreactor_api_client/api/email_notification_profiles_api.rb +482 -0
  7. data/lib/cloudreactor_api_client/api/pagerduty_profiles_api.rb +482 -0
  8. data/lib/cloudreactor_api_client/api/run_environments_api.rb +479 -0
  9. data/lib/cloudreactor_api_client/api/task_executions_api.rb +409 -0
  10. data/lib/cloudreactor_api_client/api/tasks_api.rb +412 -0
  11. data/lib/cloudreactor_api_client/api/workflow_executions_api.rb +549 -0
  12. data/lib/cloudreactor_api_client/api/workflow_task_instances_api.rb +424 -0
  13. data/lib/cloudreactor_api_client/api/workflow_transitions_api.rb +406 -0
  14. data/lib/cloudreactor_api_client/api/workflows_api.rb +482 -0
  15. data/lib/cloudreactor_api_client/api_client.rb +390 -0
  16. data/lib/cloudreactor_api_client/api_error.rb +57 -0
  17. data/lib/cloudreactor_api_client/configuration.rb +277 -0
  18. data/lib/cloudreactor_api_client/models/alert_method.rb +449 -0
  19. data/lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb +517 -0
  20. data/lib/cloudreactor_api_client/models/aws_ecs_execution_method_capability.rb +565 -0
  21. data/lib/cloudreactor_api_client/models/aws_ecs_launch_type.rb +37 -0
  22. data/lib/cloudreactor_api_client/models/aws_ecs_run_environment_execution_method_capability.rb +476 -0
  23. data/lib/cloudreactor_api_client/models/aws_ecs_service_load_balancer_details.rb +307 -0
  24. data/lib/cloudreactor_api_client/models/aws_ecs_service_options.rb +308 -0
  25. data/lib/cloudreactor_api_client/models/current_service_info.rb +255 -0
  26. data/lib/cloudreactor_api_client/models/email_notification_profile.rb +454 -0
  27. data/lib/cloudreactor_api_client/models/execution_method_capability.rb +54 -0
  28. data/lib/cloudreactor_api_client/models/failure_behavior_enum.rb +38 -0
  29. data/lib/cloudreactor_api_client/models/group.rb +268 -0
  30. data/lib/cloudreactor_api_client/models/link.rb +301 -0
  31. data/lib/cloudreactor_api_client/models/name_and_uuid.rb +236 -0
  32. data/lib/cloudreactor_api_client/models/notification_severity.rb +39 -0
  33. data/lib/cloudreactor_api_client/models/pager_duty_profile.rb +484 -0
  34. data/lib/cloudreactor_api_client/models/paginated_alert_method_list.rb +247 -0
  35. data/lib/cloudreactor_api_client/models/paginated_email_notification_profile_list.rb +247 -0
  36. data/lib/cloudreactor_api_client/models/paginated_pager_duty_profile_list.rb +247 -0
  37. data/lib/cloudreactor_api_client/models/paginated_run_environment_list.rb +247 -0
  38. data/lib/cloudreactor_api_client/models/paginated_task_execution_list.rb +247 -0
  39. data/lib/cloudreactor_api_client/models/paginated_task_list.rb +247 -0
  40. data/lib/cloudreactor_api_client/models/paginated_workflow_execution_summary_list.rb +247 -0
  41. data/lib/cloudreactor_api_client/models/paginated_workflow_summary_list.rb +247 -0
  42. data/lib/cloudreactor_api_client/models/paginated_workflow_task_instance_list.rb +247 -0
  43. data/lib/cloudreactor_api_client/models/paginated_workflow_transition_list.rb +247 -0
  44. data/lib/cloudreactor_api_client/models/patched_alert_method.rb +405 -0
  45. data/lib/cloudreactor_api_client/models/patched_email_notification_profile.rb +415 -0
  46. data/lib/cloudreactor_api_client/models/patched_pager_duty_profile.rb +436 -0
  47. data/lib/cloudreactor_api_client/models/patched_run_environment.rb +511 -0
  48. data/lib/cloudreactor_api_client/models/patched_task.rb +897 -0
  49. data/lib/cloudreactor_api_client/models/patched_task_execution.rb +1904 -0
  50. data/lib/cloudreactor_api_client/models/patched_workflow.rb +507 -0
  51. data/lib/cloudreactor_api_client/models/patched_workflow_execution.rb +559 -0
  52. data/lib/cloudreactor_api_client/models/patched_workflow_task_instance.rb +676 -0
  53. data/lib/cloudreactor_api_client/models/patched_workflow_transition.rb +432 -0
  54. data/lib/cloudreactor_api_client/models/propagate_tags_enum.rb +37 -0
  55. data/lib/cloudreactor_api_client/models/rule_type_enum.rb +43 -0
  56. data/lib/cloudreactor_api_client/models/run_environment.rb +555 -0
  57. data/lib/cloudreactor_api_client/models/start_transition_condition_enum.rb +39 -0
  58. data/lib/cloudreactor_api_client/models/stop_reason_enum.rb +42 -0
  59. data/lib/cloudreactor_api_client/models/task.rb +941 -0
  60. data/lib/cloudreactor_api_client/models/task_execution.rb +1954 -0
  61. data/lib/cloudreactor_api_client/models/task_execution_status.rb +46 -0
  62. data/lib/cloudreactor_api_client/models/threshold_property_enum.rb +39 -0
  63. data/lib/cloudreactor_api_client/models/timeout_behavior_enum.rb +40 -0
  64. data/lib/cloudreactor_api_client/models/unknown_execution_method_capability.rb +238 -0
  65. data/lib/cloudreactor_api_client/models/workflow.rb +556 -0
  66. data/lib/cloudreactor_api_client/models/workflow_execution.rb +629 -0
  67. data/lib/cloudreactor_api_client/models/workflow_execution_status.rb +42 -0
  68. data/lib/cloudreactor_api_client/models/workflow_execution_summary.rb +523 -0
  69. data/lib/cloudreactor_api_client/models/workflow_summary.rb +513 -0
  70. data/lib/cloudreactor_api_client/models/workflow_task_instance.rb +715 -0
  71. data/lib/cloudreactor_api_client/models/workflow_task_instance_execution.rb +280 -0
  72. data/lib/cloudreactor_api_client/models/workflow_task_instance_execution_base.rb +270 -0
  73. data/lib/cloudreactor_api_client/models/workflow_transition.rb +467 -0
  74. data/lib/cloudreactor_api_client/models/workflow_transition_evaluation.rb +280 -0
  75. data/lib/cloudreactor_api_client/version.rb +15 -0
  76. data/lib/cloudreactor_api_client.rb +121 -0
  77. data/lib/cloudreactor_wrapper_io/status_updater.rb +124 -0
  78. data/lib/cloudreactor_wrapper_io.rb +13 -0
  79. data/spec/api/alert_methods_api_spec.rb +114 -0
  80. data/spec/api/email_notification_profiles_api_spec.rb +114 -0
  81. data/spec/api/pagerduty_profiles_api_spec.rb +114 -0
  82. data/spec/api/run_environments_api_spec.rb +113 -0
  83. data/spec/api/task_executions_api_spec.rb +102 -0
  84. data/spec/api/tasks_api_spec.rb +103 -0
  85. data/spec/api/workflow_executions_api_spec.rb +124 -0
  86. data/spec/api/workflow_task_instances_api_spec.rb +107 -0
  87. data/spec/api/workflow_transitions_api_spec.rb +101 -0
  88. data/spec/api/workflows_api_spec.rb +114 -0
  89. data/spec/api_client_spec.rb +226 -0
  90. data/spec/configuration_spec.rb +42 -0
  91. data/spec/integration/task_execution_integration_spec.rb +51 -0
  92. data/spec/models/alert_method_spec.rb +136 -0
  93. data/spec/models/aws_ecs_execution_method_capability_spec.rb +166 -0
  94. data/spec/models/aws_ecs_execution_method_spec.rb +148 -0
  95. data/spec/models/aws_ecs_launch_type_spec.rb +28 -0
  96. data/spec/models/aws_ecs_run_environment_execution_method_capability_spec.rb +130 -0
  97. data/spec/models/aws_ecs_service_load_balancer_details_spec.rb +46 -0
  98. data/spec/models/aws_ecs_service_options_spec.rb +88 -0
  99. data/spec/models/current_service_info_spec.rb +52 -0
  100. data/spec/models/email_notification_profile_spec.rb +118 -0
  101. data/spec/models/execution_method_capability_spec.rb +43 -0
  102. data/spec/models/failure_behavior_enum_spec.rb +28 -0
  103. data/spec/models/group_spec.rb +46 -0
  104. data/spec/models/link_spec.rb +70 -0
  105. data/spec/models/name_and_uuid_spec.rb +46 -0
  106. data/spec/models/notification_severity_spec.rb +28 -0
  107. data/spec/models/pager_duty_profile_spec.rb +118 -0
  108. data/spec/models/paginated_alert_method_list_spec.rb +52 -0
  109. data/spec/models/paginated_email_notification_profile_list_spec.rb +52 -0
  110. data/spec/models/paginated_pager_duty_profile_list_spec.rb +52 -0
  111. data/spec/models/paginated_run_environment_list_spec.rb +52 -0
  112. data/spec/models/paginated_task_execution_list_spec.rb +52 -0
  113. data/spec/models/paginated_task_list_spec.rb +52 -0
  114. data/spec/models/paginated_workflow_execution_summary_list_spec.rb +52 -0
  115. data/spec/models/paginated_workflow_summary_list_spec.rb +52 -0
  116. data/spec/models/paginated_workflow_task_instance_list_spec.rb +52 -0
  117. data/spec/models/paginated_workflow_transition_list_spec.rb +52 -0
  118. data/spec/models/patched_alert_method_spec.rb +136 -0
  119. data/spec/models/patched_email_notification_profile_spec.rb +118 -0
  120. data/spec/models/patched_pager_duty_profile_spec.rb +118 -0
  121. data/spec/models/patched_run_environment_spec.rb +136 -0
  122. data/spec/models/patched_task_execution_spec.rb +466 -0
  123. data/spec/models/patched_task_spec.rb +244 -0
  124. data/spec/models/patched_workflow_execution_spec.rb +172 -0
  125. data/spec/models/patched_workflow_spec.rb +142 -0
  126. data/spec/models/patched_workflow_task_instance_spec.rb +196 -0
  127. data/spec/models/patched_workflow_transition_spec.rb +118 -0
  128. data/spec/models/propagate_tags_enum_spec.rb +28 -0
  129. data/spec/models/rule_type_enum_spec.rb +28 -0
  130. data/spec/models/run_environment_spec.rb +136 -0
  131. data/spec/models/start_transition_condition_enum_spec.rb +28 -0
  132. data/spec/models/stop_reason_enum_spec.rb +28 -0
  133. data/spec/models/task_execution_spec.rb +466 -0
  134. data/spec/models/task_execution_status_spec.rb +28 -0
  135. data/spec/models/task_spec.rb +244 -0
  136. data/spec/models/threshold_property_enum_spec.rb +28 -0
  137. data/spec/models/timeout_behavior_enum_spec.rb +28 -0
  138. data/spec/models/unknown_execution_method_capability_spec.rb +40 -0
  139. data/spec/models/workflow_execution_spec.rb +172 -0
  140. data/spec/models/workflow_execution_status_spec.rb +28 -0
  141. data/spec/models/workflow_execution_summary_spec.rb +130 -0
  142. data/spec/models/workflow_spec.rb +142 -0
  143. data/spec/models/workflow_summary_spec.rb +124 -0
  144. data/spec/models/workflow_task_instance_execution_base_spec.rb +58 -0
  145. data/spec/models/workflow_task_instance_execution_spec.rb +64 -0
  146. data/spec/models/workflow_task_instance_spec.rb +196 -0
  147. data/spec/models/workflow_transition_evaluation_spec.rb +64 -0
  148. data/spec/models/workflow_transition_spec.rb +118 -0
  149. data/spec/spec_helper.rb +111 -0
  150. data/spec/wrapper_io/status_updater_spec.rb +147 -0
  151. metadata +305 -0
@@ -0,0 +1,629 @@
1
+ =begin
2
+ #CloudReactor API
3
+
4
+ #CloudReactor API Documentation
5
+
6
+ The version of the OpenAPI document: 0.2.0
7
+ Contact: jeff@cloudreactor.io
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module CloudReactorAPIClient
17
+ class WorkflowExecution
18
+ attr_accessor :url
19
+
20
+ attr_accessor :uuid
21
+
22
+ attr_accessor :dashboard_url
23
+
24
+ attr_accessor :workflow
25
+
26
+ attr_accessor :status
27
+
28
+ attr_accessor :run_reason
29
+
30
+ attr_accessor :started_at
31
+
32
+ # Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
33
+ attr_accessor :started_by
34
+
35
+ attr_accessor :finished_at
36
+
37
+ attr_accessor :last_heartbeat_at
38
+
39
+ attr_accessor :stop_reason
40
+
41
+ attr_accessor :marked_done_at
42
+
43
+ # Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
44
+ attr_accessor :marked_done_by
45
+
46
+ attr_accessor :kill_started_at
47
+
48
+ # Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
49
+ attr_accessor :killed_by
50
+
51
+ attr_accessor :kill_finished_at
52
+
53
+ attr_accessor :kill_error_code
54
+
55
+ attr_accessor :failed_attempts
56
+
57
+ attr_accessor :timed_out_attempts
58
+
59
+ attr_accessor :workflow_snapshot
60
+
61
+ attr_accessor :workflow_task_instance_executions
62
+
63
+ attr_accessor :workflow_transition_evaluations
64
+
65
+ attr_accessor :created_at
66
+
67
+ attr_accessor :updated_at
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ :'url' => :'url',
73
+ :'uuid' => :'uuid',
74
+ :'dashboard_url' => :'dashboard_url',
75
+ :'workflow' => :'workflow',
76
+ :'status' => :'status',
77
+ :'run_reason' => :'run_reason',
78
+ :'started_at' => :'started_at',
79
+ :'started_by' => :'started_by',
80
+ :'finished_at' => :'finished_at',
81
+ :'last_heartbeat_at' => :'last_heartbeat_at',
82
+ :'stop_reason' => :'stop_reason',
83
+ :'marked_done_at' => :'marked_done_at',
84
+ :'marked_done_by' => :'marked_done_by',
85
+ :'kill_started_at' => :'kill_started_at',
86
+ :'killed_by' => :'killed_by',
87
+ :'kill_finished_at' => :'kill_finished_at',
88
+ :'kill_error_code' => :'kill_error_code',
89
+ :'failed_attempts' => :'failed_attempts',
90
+ :'timed_out_attempts' => :'timed_out_attempts',
91
+ :'workflow_snapshot' => :'workflow_snapshot',
92
+ :'workflow_task_instance_executions' => :'workflow_task_instance_executions',
93
+ :'workflow_transition_evaluations' => :'workflow_transition_evaluations',
94
+ :'created_at' => :'created_at',
95
+ :'updated_at' => :'updated_at'
96
+ }
97
+ end
98
+
99
+ # Returns all the JSON keys this model knows about
100
+ def self.acceptable_attributes
101
+ attribute_map.values
102
+ end
103
+
104
+ # Attribute type mapping.
105
+ def self.openapi_types
106
+ {
107
+ :'url' => :'String',
108
+ :'uuid' => :'String',
109
+ :'dashboard_url' => :'String',
110
+ :'workflow' => :'NameAndUuid',
111
+ :'status' => :'WorkflowExecutionStatus',
112
+ :'run_reason' => :'Integer',
113
+ :'started_at' => :'Time',
114
+ :'started_by' => :'String',
115
+ :'finished_at' => :'Time',
116
+ :'last_heartbeat_at' => :'Time',
117
+ :'stop_reason' => :'Integer',
118
+ :'marked_done_at' => :'Time',
119
+ :'marked_done_by' => :'String',
120
+ :'kill_started_at' => :'Time',
121
+ :'killed_by' => :'String',
122
+ :'kill_finished_at' => :'Time',
123
+ :'kill_error_code' => :'Integer',
124
+ :'failed_attempts' => :'Integer',
125
+ :'timed_out_attempts' => :'Integer',
126
+ :'workflow_snapshot' => :'Hash<String, Object>',
127
+ :'workflow_task_instance_executions' => :'Array<WorkflowTaskInstanceExecution>',
128
+ :'workflow_transition_evaluations' => :'Array<WorkflowTransitionEvaluation>',
129
+ :'created_at' => :'Time',
130
+ :'updated_at' => :'Time'
131
+ }
132
+ end
133
+
134
+ # List of attributes with nullable: true
135
+ def self.openapi_nullable
136
+ Set.new([
137
+ :'finished_at',
138
+ :'last_heartbeat_at',
139
+ :'stop_reason',
140
+ :'marked_done_at',
141
+ :'kill_started_at',
142
+ :'kill_finished_at',
143
+ :'kill_error_code',
144
+ ])
145
+ end
146
+
147
+ # Initializes the object
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ def initialize(attributes = {})
150
+ if (!attributes.is_a?(Hash))
151
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CloudReactorAPIClient::WorkflowExecution` initialize method"
152
+ end
153
+
154
+ # check to see if the attribute exists and convert string to symbol for hash key
155
+ attributes = attributes.each_with_object({}) { |(k, v), h|
156
+ if (!self.class.attribute_map.key?(k.to_sym))
157
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CloudReactorAPIClient::WorkflowExecution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
158
+ end
159
+ h[k.to_sym] = v
160
+ }
161
+
162
+ if attributes.key?(:'url')
163
+ self.url = attributes[:'url']
164
+ end
165
+
166
+ if attributes.key?(:'uuid')
167
+ self.uuid = attributes[:'uuid']
168
+ end
169
+
170
+ if attributes.key?(:'dashboard_url')
171
+ self.dashboard_url = attributes[:'dashboard_url']
172
+ end
173
+
174
+ if attributes.key?(:'workflow')
175
+ self.workflow = attributes[:'workflow']
176
+ end
177
+
178
+ if attributes.key?(:'status')
179
+ self.status = attributes[:'status']
180
+ end
181
+
182
+ if attributes.key?(:'run_reason')
183
+ self.run_reason = attributes[:'run_reason']
184
+ end
185
+
186
+ if attributes.key?(:'started_at')
187
+ self.started_at = attributes[:'started_at']
188
+ end
189
+
190
+ if attributes.key?(:'started_by')
191
+ self.started_by = attributes[:'started_by']
192
+ end
193
+
194
+ if attributes.key?(:'finished_at')
195
+ self.finished_at = attributes[:'finished_at']
196
+ end
197
+
198
+ if attributes.key?(:'last_heartbeat_at')
199
+ self.last_heartbeat_at = attributes[:'last_heartbeat_at']
200
+ end
201
+
202
+ if attributes.key?(:'stop_reason')
203
+ self.stop_reason = attributes[:'stop_reason']
204
+ end
205
+
206
+ if attributes.key?(:'marked_done_at')
207
+ self.marked_done_at = attributes[:'marked_done_at']
208
+ end
209
+
210
+ if attributes.key?(:'marked_done_by')
211
+ self.marked_done_by = attributes[:'marked_done_by']
212
+ end
213
+
214
+ if attributes.key?(:'kill_started_at')
215
+ self.kill_started_at = attributes[:'kill_started_at']
216
+ end
217
+
218
+ if attributes.key?(:'killed_by')
219
+ self.killed_by = attributes[:'killed_by']
220
+ end
221
+
222
+ if attributes.key?(:'kill_finished_at')
223
+ self.kill_finished_at = attributes[:'kill_finished_at']
224
+ end
225
+
226
+ if attributes.key?(:'kill_error_code')
227
+ self.kill_error_code = attributes[:'kill_error_code']
228
+ end
229
+
230
+ if attributes.key?(:'failed_attempts')
231
+ self.failed_attempts = attributes[:'failed_attempts']
232
+ end
233
+
234
+ if attributes.key?(:'timed_out_attempts')
235
+ self.timed_out_attempts = attributes[:'timed_out_attempts']
236
+ end
237
+
238
+ if attributes.key?(:'workflow_snapshot')
239
+ if (value = attributes[:'workflow_snapshot']).is_a?(Hash)
240
+ self.workflow_snapshot = value
241
+ end
242
+ end
243
+
244
+ if attributes.key?(:'workflow_task_instance_executions')
245
+ if (value = attributes[:'workflow_task_instance_executions']).is_a?(Array)
246
+ self.workflow_task_instance_executions = value
247
+ end
248
+ end
249
+
250
+ if attributes.key?(:'workflow_transition_evaluations')
251
+ if (value = attributes[:'workflow_transition_evaluations']).is_a?(Array)
252
+ self.workflow_transition_evaluations = value
253
+ end
254
+ end
255
+
256
+ if attributes.key?(:'created_at')
257
+ self.created_at = attributes[:'created_at']
258
+ end
259
+
260
+ if attributes.key?(:'updated_at')
261
+ self.updated_at = attributes[:'updated_at']
262
+ end
263
+ end
264
+
265
+ # Show invalid properties with the reasons. Usually used together with valid?
266
+ # @return Array for valid properties with the reasons
267
+ def list_invalid_properties
268
+ invalid_properties = Array.new
269
+ if @url.nil?
270
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
271
+ end
272
+
273
+ if @uuid.nil?
274
+ invalid_properties.push('invalid value for "uuid", uuid cannot be nil.')
275
+ end
276
+
277
+ if @dashboard_url.nil?
278
+ invalid_properties.push('invalid value for "dashboard_url", dashboard_url cannot be nil.')
279
+ end
280
+
281
+ if @workflow.nil?
282
+ invalid_properties.push('invalid value for "workflow", workflow cannot be nil.')
283
+ end
284
+
285
+ if @status.nil?
286
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
287
+ end
288
+
289
+ if !@run_reason.nil? && @run_reason > 2147483647
290
+ invalid_properties.push('invalid value for "run_reason", must be smaller than or equal to 2147483647.')
291
+ end
292
+
293
+ if !@run_reason.nil? && @run_reason < -2147483648
294
+ invalid_properties.push('invalid value for "run_reason", must be greater than or equal to -2147483648.')
295
+ end
296
+
297
+ if @started_at.nil?
298
+ invalid_properties.push('invalid value for "started_at", started_at cannot be nil.')
299
+ end
300
+
301
+ if @started_by.nil?
302
+ invalid_properties.push('invalid value for "started_by", started_by cannot be nil.')
303
+ end
304
+
305
+ if !@stop_reason.nil? && @stop_reason > 2147483647
306
+ invalid_properties.push('invalid value for "stop_reason", must be smaller than or equal to 2147483647.')
307
+ end
308
+
309
+ if !@stop_reason.nil? && @stop_reason < -2147483648
310
+ invalid_properties.push('invalid value for "stop_reason", must be greater than or equal to -2147483648.')
311
+ end
312
+
313
+ if @marked_done_by.nil?
314
+ invalid_properties.push('invalid value for "marked_done_by", marked_done_by cannot be nil.')
315
+ end
316
+
317
+ if @killed_by.nil?
318
+ invalid_properties.push('invalid value for "killed_by", killed_by cannot be nil.')
319
+ end
320
+
321
+ if !@kill_error_code.nil? && @kill_error_code > 2147483647
322
+ invalid_properties.push('invalid value for "kill_error_code", must be smaller than or equal to 2147483647.')
323
+ end
324
+
325
+ if !@kill_error_code.nil? && @kill_error_code < -2147483648
326
+ invalid_properties.push('invalid value for "kill_error_code", must be greater than or equal to -2147483648.')
327
+ end
328
+
329
+ if !@failed_attempts.nil? && @failed_attempts > 2147483647
330
+ invalid_properties.push('invalid value for "failed_attempts", must be smaller than or equal to 2147483647.')
331
+ end
332
+
333
+ if !@failed_attempts.nil? && @failed_attempts < -2147483648
334
+ invalid_properties.push('invalid value for "failed_attempts", must be greater than or equal to -2147483648.')
335
+ end
336
+
337
+ if !@timed_out_attempts.nil? && @timed_out_attempts > 2147483647
338
+ invalid_properties.push('invalid value for "timed_out_attempts", must be smaller than or equal to 2147483647.')
339
+ end
340
+
341
+ if !@timed_out_attempts.nil? && @timed_out_attempts < -2147483648
342
+ invalid_properties.push('invalid value for "timed_out_attempts", must be greater than or equal to -2147483648.')
343
+ end
344
+
345
+ if @workflow_snapshot.nil?
346
+ invalid_properties.push('invalid value for "workflow_snapshot", workflow_snapshot cannot be nil.')
347
+ end
348
+
349
+ if @workflow_task_instance_executions.nil?
350
+ invalid_properties.push('invalid value for "workflow_task_instance_executions", workflow_task_instance_executions cannot be nil.')
351
+ end
352
+
353
+ if @workflow_transition_evaluations.nil?
354
+ invalid_properties.push('invalid value for "workflow_transition_evaluations", workflow_transition_evaluations cannot be nil.')
355
+ end
356
+
357
+ if @created_at.nil?
358
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
359
+ end
360
+
361
+ if @updated_at.nil?
362
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
363
+ end
364
+
365
+ invalid_properties
366
+ end
367
+
368
+ # Check to see if the all the properties in the model are valid
369
+ # @return true if the model is valid
370
+ def valid?
371
+ return false if @url.nil?
372
+ return false if @uuid.nil?
373
+ return false if @dashboard_url.nil?
374
+ return false if @workflow.nil?
375
+ return false if @status.nil?
376
+ return false if !@run_reason.nil? && @run_reason > 2147483647
377
+ return false if !@run_reason.nil? && @run_reason < -2147483648
378
+ return false if @started_at.nil?
379
+ return false if @started_by.nil?
380
+ return false if !@stop_reason.nil? && @stop_reason > 2147483647
381
+ return false if !@stop_reason.nil? && @stop_reason < -2147483648
382
+ return false if @marked_done_by.nil?
383
+ return false if @killed_by.nil?
384
+ return false if !@kill_error_code.nil? && @kill_error_code > 2147483647
385
+ return false if !@kill_error_code.nil? && @kill_error_code < -2147483648
386
+ return false if !@failed_attempts.nil? && @failed_attempts > 2147483647
387
+ return false if !@failed_attempts.nil? && @failed_attempts < -2147483648
388
+ return false if !@timed_out_attempts.nil? && @timed_out_attempts > 2147483647
389
+ return false if !@timed_out_attempts.nil? && @timed_out_attempts < -2147483648
390
+ return false if @workflow_snapshot.nil?
391
+ return false if @workflow_task_instance_executions.nil?
392
+ return false if @workflow_transition_evaluations.nil?
393
+ return false if @created_at.nil?
394
+ return false if @updated_at.nil?
395
+ true
396
+ end
397
+
398
+ # Custom attribute writer method with validation
399
+ # @param [Object] run_reason Value to be assigned
400
+ def run_reason=(run_reason)
401
+ if !run_reason.nil? && run_reason > 2147483647
402
+ fail ArgumentError, 'invalid value for "run_reason", must be smaller than or equal to 2147483647.'
403
+ end
404
+
405
+ if !run_reason.nil? && run_reason < -2147483648
406
+ fail ArgumentError, 'invalid value for "run_reason", must be greater than or equal to -2147483648.'
407
+ end
408
+
409
+ @run_reason = run_reason
410
+ end
411
+
412
+ # Custom attribute writer method with validation
413
+ # @param [Object] stop_reason Value to be assigned
414
+ def stop_reason=(stop_reason)
415
+ if !stop_reason.nil? && stop_reason > 2147483647
416
+ fail ArgumentError, 'invalid value for "stop_reason", must be smaller than or equal to 2147483647.'
417
+ end
418
+
419
+ if !stop_reason.nil? && stop_reason < -2147483648
420
+ fail ArgumentError, 'invalid value for "stop_reason", must be greater than or equal to -2147483648.'
421
+ end
422
+
423
+ @stop_reason = stop_reason
424
+ end
425
+
426
+ # Custom attribute writer method with validation
427
+ # @param [Object] kill_error_code Value to be assigned
428
+ def kill_error_code=(kill_error_code)
429
+ if !kill_error_code.nil? && kill_error_code > 2147483647
430
+ fail ArgumentError, 'invalid value for "kill_error_code", must be smaller than or equal to 2147483647.'
431
+ end
432
+
433
+ if !kill_error_code.nil? && kill_error_code < -2147483648
434
+ fail ArgumentError, 'invalid value for "kill_error_code", must be greater than or equal to -2147483648.'
435
+ end
436
+
437
+ @kill_error_code = kill_error_code
438
+ end
439
+
440
+ # Custom attribute writer method with validation
441
+ # @param [Object] failed_attempts Value to be assigned
442
+ def failed_attempts=(failed_attempts)
443
+ if !failed_attempts.nil? && failed_attempts > 2147483647
444
+ fail ArgumentError, 'invalid value for "failed_attempts", must be smaller than or equal to 2147483647.'
445
+ end
446
+
447
+ if !failed_attempts.nil? && failed_attempts < -2147483648
448
+ fail ArgumentError, 'invalid value for "failed_attempts", must be greater than or equal to -2147483648.'
449
+ end
450
+
451
+ @failed_attempts = failed_attempts
452
+ end
453
+
454
+ # Custom attribute writer method with validation
455
+ # @param [Object] timed_out_attempts Value to be assigned
456
+ def timed_out_attempts=(timed_out_attempts)
457
+ if !timed_out_attempts.nil? && timed_out_attempts > 2147483647
458
+ fail ArgumentError, 'invalid value for "timed_out_attempts", must be smaller than or equal to 2147483647.'
459
+ end
460
+
461
+ if !timed_out_attempts.nil? && timed_out_attempts < -2147483648
462
+ fail ArgumentError, 'invalid value for "timed_out_attempts", must be greater than or equal to -2147483648.'
463
+ end
464
+
465
+ @timed_out_attempts = timed_out_attempts
466
+ end
467
+
468
+ # Checks equality by comparing each attribute.
469
+ # @param [Object] Object to be compared
470
+ def ==(o)
471
+ return true if self.equal?(o)
472
+ self.class == o.class &&
473
+ url == o.url &&
474
+ uuid == o.uuid &&
475
+ dashboard_url == o.dashboard_url &&
476
+ workflow == o.workflow &&
477
+ status == o.status &&
478
+ run_reason == o.run_reason &&
479
+ started_at == o.started_at &&
480
+ started_by == o.started_by &&
481
+ finished_at == o.finished_at &&
482
+ last_heartbeat_at == o.last_heartbeat_at &&
483
+ stop_reason == o.stop_reason &&
484
+ marked_done_at == o.marked_done_at &&
485
+ marked_done_by == o.marked_done_by &&
486
+ kill_started_at == o.kill_started_at &&
487
+ killed_by == o.killed_by &&
488
+ kill_finished_at == o.kill_finished_at &&
489
+ kill_error_code == o.kill_error_code &&
490
+ failed_attempts == o.failed_attempts &&
491
+ timed_out_attempts == o.timed_out_attempts &&
492
+ workflow_snapshot == o.workflow_snapshot &&
493
+ workflow_task_instance_executions == o.workflow_task_instance_executions &&
494
+ workflow_transition_evaluations == o.workflow_transition_evaluations &&
495
+ created_at == o.created_at &&
496
+ updated_at == o.updated_at
497
+ end
498
+
499
+ # @see the `==` method
500
+ # @param [Object] Object to be compared
501
+ def eql?(o)
502
+ self == o
503
+ end
504
+
505
+ # Calculates hash code according to all attributes.
506
+ # @return [Integer] Hash code
507
+ def hash
508
+ [url, uuid, dashboard_url, workflow, status, run_reason, started_at, started_by, finished_at, last_heartbeat_at, stop_reason, marked_done_at, marked_done_by, kill_started_at, killed_by, kill_finished_at, kill_error_code, failed_attempts, timed_out_attempts, workflow_snapshot, workflow_task_instance_executions, workflow_transition_evaluations, created_at, updated_at].hash
509
+ end
510
+
511
+ # Builds the object from hash
512
+ # @param [Hash] attributes Model attributes in the form of hash
513
+ # @return [Object] Returns the model itself
514
+ def self.build_from_hash(attributes)
515
+ new.build_from_hash(attributes)
516
+ end
517
+
518
+ # Builds the object from hash
519
+ # @param [Hash] attributes Model attributes in the form of hash
520
+ # @return [Object] Returns the model itself
521
+ def build_from_hash(attributes)
522
+ return nil unless attributes.is_a?(Hash)
523
+ self.class.openapi_types.each_pair do |key, type|
524
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
525
+ self.send("#{key}=", nil)
526
+ elsif type =~ /\AArray<(.*)>/i
527
+ # check to ensure the input is an array given that the attribute
528
+ # is documented as an array but the input is not
529
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
530
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
531
+ end
532
+ elsif !attributes[self.class.attribute_map[key]].nil?
533
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
534
+ end
535
+ end
536
+
537
+ self
538
+ end
539
+
540
+ # Deserializes the data based on type
541
+ # @param string type Data type
542
+ # @param string value Value to be deserialized
543
+ # @return [Object] Deserialized data
544
+ def _deserialize(type, value)
545
+ case type.to_sym
546
+ when :Time
547
+ Time.parse(value)
548
+ when :Date
549
+ Date.parse(value)
550
+ when :String
551
+ value.to_s
552
+ when :Integer
553
+ value.to_i
554
+ when :Float
555
+ value.to_f
556
+ when :Boolean
557
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
558
+ true
559
+ else
560
+ false
561
+ end
562
+ when :Object
563
+ # generic object (usually a Hash), return directly
564
+ value
565
+ when /\AArray<(?<inner_type>.+)>\z/
566
+ inner_type = Regexp.last_match[:inner_type]
567
+ value.map { |v| _deserialize(inner_type, v) }
568
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
569
+ k_type = Regexp.last_match[:k_type]
570
+ v_type = Regexp.last_match[:v_type]
571
+ {}.tap do |hash|
572
+ value.each do |k, v|
573
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
574
+ end
575
+ end
576
+ else # model
577
+ # models (e.g. Pet) or oneOf
578
+ klass = CloudReactorAPIClient.const_get(type)
579
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
580
+ end
581
+ end
582
+
583
+ # Returns the string representation of the object
584
+ # @return [String] String presentation of the object
585
+ def to_s
586
+ to_hash.to_s
587
+ end
588
+
589
+ # to_body is an alias to to_hash (backward compatibility)
590
+ # @return [Hash] Returns the object in the form of hash
591
+ def to_body
592
+ to_hash
593
+ end
594
+
595
+ # Returns the object in the form of hash
596
+ # @return [Hash] Returns the object in the form of hash
597
+ def to_hash
598
+ hash = {}
599
+ self.class.attribute_map.each_pair do |attr, param|
600
+ value = self.send(attr)
601
+ if value.nil?
602
+ is_nullable = self.class.openapi_nullable.include?(attr)
603
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
604
+ end
605
+
606
+ hash[param] = _to_hash(value)
607
+ end
608
+ hash
609
+ end
610
+
611
+ # Outputs non-array value in the form of hash
612
+ # For object, use to_hash. Otherwise, just return the value
613
+ # @param [Object] value Any valid value
614
+ # @return [Hash] Returns the value in the form of hash
615
+ def _to_hash(value)
616
+ if value.is_a?(Array)
617
+ value.compact.map { |v| _to_hash(v) }
618
+ elsif value.is_a?(Hash)
619
+ {}.tap do |hash|
620
+ value.each { |k, v| hash[k] = _to_hash(v) }
621
+ end
622
+ elsif value.respond_to? :to_hash
623
+ value.to_hash
624
+ else
625
+ value
626
+ end
627
+ end
628
+ end
629
+ end
@@ -0,0 +1,42 @@
1
+ =begin
2
+ #CloudReactor API
3
+
4
+ #CloudReactor API Documentation
5
+
6
+ The version of the OpenAPI document: 0.2.0
7
+ Contact: jeff@cloudreactor.io
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module CloudReactorAPIClient
17
+ class WorkflowExecutionStatus
18
+ RUNNING = "RUNNING".freeze
19
+ SUCCEEDED = "SUCCEEDED".freeze
20
+ FAILED = "FAILED".freeze
21
+ TERMINATED_AFTER_TIME_OUT = "TERMINATED_AFTER_TIME_OUT".freeze
22
+ STOPPING = "STOPPING".freeze
23
+ STOPPED = "STOPPED".freeze
24
+ MANUALLY_STARTED = "MANUALLY_STARTED".freeze
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ constantValues = WorkflowExecutionStatus.constants.select { |c| WorkflowExecutionStatus::const_get(c) == value }
38
+ raise "Invalid ENUM value #{value} for class #WorkflowExecutionStatus" if constantValues.empty?
39
+ value
40
+ end
41
+ end
42
+ end