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,559 @@
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 PatchedWorkflowExecution
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::PatchedWorkflowExecution` 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::PatchedWorkflowExecution`. 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 !@run_reason.nil? && @run_reason > 2147483647
270
+ invalid_properties.push('invalid value for "run_reason", must be smaller than or equal to 2147483647.')
271
+ end
272
+
273
+ if !@run_reason.nil? && @run_reason < -2147483648
274
+ invalid_properties.push('invalid value for "run_reason", must be greater than or equal to -2147483648.')
275
+ end
276
+
277
+ if !@stop_reason.nil? && @stop_reason > 2147483647
278
+ invalid_properties.push('invalid value for "stop_reason", must be smaller than or equal to 2147483647.')
279
+ end
280
+
281
+ if !@stop_reason.nil? && @stop_reason < -2147483648
282
+ invalid_properties.push('invalid value for "stop_reason", must be greater than or equal to -2147483648.')
283
+ end
284
+
285
+ if !@kill_error_code.nil? && @kill_error_code > 2147483647
286
+ invalid_properties.push('invalid value for "kill_error_code", must be smaller than or equal to 2147483647.')
287
+ end
288
+
289
+ if !@kill_error_code.nil? && @kill_error_code < -2147483648
290
+ invalid_properties.push('invalid value for "kill_error_code", must be greater than or equal to -2147483648.')
291
+ end
292
+
293
+ if !@failed_attempts.nil? && @failed_attempts > 2147483647
294
+ invalid_properties.push('invalid value for "failed_attempts", must be smaller than or equal to 2147483647.')
295
+ end
296
+
297
+ if !@failed_attempts.nil? && @failed_attempts < -2147483648
298
+ invalid_properties.push('invalid value for "failed_attempts", must be greater than or equal to -2147483648.')
299
+ end
300
+
301
+ if !@timed_out_attempts.nil? && @timed_out_attempts > 2147483647
302
+ invalid_properties.push('invalid value for "timed_out_attempts", must be smaller than or equal to 2147483647.')
303
+ end
304
+
305
+ if !@timed_out_attempts.nil? && @timed_out_attempts < -2147483648
306
+ invalid_properties.push('invalid value for "timed_out_attempts", must be greater than or equal to -2147483648.')
307
+ end
308
+
309
+ invalid_properties
310
+ end
311
+
312
+ # Check to see if the all the properties in the model are valid
313
+ # @return true if the model is valid
314
+ def valid?
315
+ return false if !@run_reason.nil? && @run_reason > 2147483647
316
+ return false if !@run_reason.nil? && @run_reason < -2147483648
317
+ return false if !@stop_reason.nil? && @stop_reason > 2147483647
318
+ return false if !@stop_reason.nil? && @stop_reason < -2147483648
319
+ return false if !@kill_error_code.nil? && @kill_error_code > 2147483647
320
+ return false if !@kill_error_code.nil? && @kill_error_code < -2147483648
321
+ return false if !@failed_attempts.nil? && @failed_attempts > 2147483647
322
+ return false if !@failed_attempts.nil? && @failed_attempts < -2147483648
323
+ return false if !@timed_out_attempts.nil? && @timed_out_attempts > 2147483647
324
+ return false if !@timed_out_attempts.nil? && @timed_out_attempts < -2147483648
325
+ true
326
+ end
327
+
328
+ # Custom attribute writer method with validation
329
+ # @param [Object] run_reason Value to be assigned
330
+ def run_reason=(run_reason)
331
+ if !run_reason.nil? && run_reason > 2147483647
332
+ fail ArgumentError, 'invalid value for "run_reason", must be smaller than or equal to 2147483647.'
333
+ end
334
+
335
+ if !run_reason.nil? && run_reason < -2147483648
336
+ fail ArgumentError, 'invalid value for "run_reason", must be greater than or equal to -2147483648.'
337
+ end
338
+
339
+ @run_reason = run_reason
340
+ end
341
+
342
+ # Custom attribute writer method with validation
343
+ # @param [Object] stop_reason Value to be assigned
344
+ def stop_reason=(stop_reason)
345
+ if !stop_reason.nil? && stop_reason > 2147483647
346
+ fail ArgumentError, 'invalid value for "stop_reason", must be smaller than or equal to 2147483647.'
347
+ end
348
+
349
+ if !stop_reason.nil? && stop_reason < -2147483648
350
+ fail ArgumentError, 'invalid value for "stop_reason", must be greater than or equal to -2147483648.'
351
+ end
352
+
353
+ @stop_reason = stop_reason
354
+ end
355
+
356
+ # Custom attribute writer method with validation
357
+ # @param [Object] kill_error_code Value to be assigned
358
+ def kill_error_code=(kill_error_code)
359
+ if !kill_error_code.nil? && kill_error_code > 2147483647
360
+ fail ArgumentError, 'invalid value for "kill_error_code", must be smaller than or equal to 2147483647.'
361
+ end
362
+
363
+ if !kill_error_code.nil? && kill_error_code < -2147483648
364
+ fail ArgumentError, 'invalid value for "kill_error_code", must be greater than or equal to -2147483648.'
365
+ end
366
+
367
+ @kill_error_code = kill_error_code
368
+ end
369
+
370
+ # Custom attribute writer method with validation
371
+ # @param [Object] failed_attempts Value to be assigned
372
+ def failed_attempts=(failed_attempts)
373
+ if !failed_attempts.nil? && failed_attempts > 2147483647
374
+ fail ArgumentError, 'invalid value for "failed_attempts", must be smaller than or equal to 2147483647.'
375
+ end
376
+
377
+ if !failed_attempts.nil? && failed_attempts < -2147483648
378
+ fail ArgumentError, 'invalid value for "failed_attempts", must be greater than or equal to -2147483648.'
379
+ end
380
+
381
+ @failed_attempts = failed_attempts
382
+ end
383
+
384
+ # Custom attribute writer method with validation
385
+ # @param [Object] timed_out_attempts Value to be assigned
386
+ def timed_out_attempts=(timed_out_attempts)
387
+ if !timed_out_attempts.nil? && timed_out_attempts > 2147483647
388
+ fail ArgumentError, 'invalid value for "timed_out_attempts", must be smaller than or equal to 2147483647.'
389
+ end
390
+
391
+ if !timed_out_attempts.nil? && timed_out_attempts < -2147483648
392
+ fail ArgumentError, 'invalid value for "timed_out_attempts", must be greater than or equal to -2147483648.'
393
+ end
394
+
395
+ @timed_out_attempts = timed_out_attempts
396
+ end
397
+
398
+ # Checks equality by comparing each attribute.
399
+ # @param [Object] Object to be compared
400
+ def ==(o)
401
+ return true if self.equal?(o)
402
+ self.class == o.class &&
403
+ url == o.url &&
404
+ uuid == o.uuid &&
405
+ dashboard_url == o.dashboard_url &&
406
+ workflow == o.workflow &&
407
+ status == o.status &&
408
+ run_reason == o.run_reason &&
409
+ started_at == o.started_at &&
410
+ started_by == o.started_by &&
411
+ finished_at == o.finished_at &&
412
+ last_heartbeat_at == o.last_heartbeat_at &&
413
+ stop_reason == o.stop_reason &&
414
+ marked_done_at == o.marked_done_at &&
415
+ marked_done_by == o.marked_done_by &&
416
+ kill_started_at == o.kill_started_at &&
417
+ killed_by == o.killed_by &&
418
+ kill_finished_at == o.kill_finished_at &&
419
+ kill_error_code == o.kill_error_code &&
420
+ failed_attempts == o.failed_attempts &&
421
+ timed_out_attempts == o.timed_out_attempts &&
422
+ workflow_snapshot == o.workflow_snapshot &&
423
+ workflow_task_instance_executions == o.workflow_task_instance_executions &&
424
+ workflow_transition_evaluations == o.workflow_transition_evaluations &&
425
+ created_at == o.created_at &&
426
+ updated_at == o.updated_at
427
+ end
428
+
429
+ # @see the `==` method
430
+ # @param [Object] Object to be compared
431
+ def eql?(o)
432
+ self == o
433
+ end
434
+
435
+ # Calculates hash code according to all attributes.
436
+ # @return [Integer] Hash code
437
+ def hash
438
+ [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
439
+ end
440
+
441
+ # Builds the object from hash
442
+ # @param [Hash] attributes Model attributes in the form of hash
443
+ # @return [Object] Returns the model itself
444
+ def self.build_from_hash(attributes)
445
+ new.build_from_hash(attributes)
446
+ end
447
+
448
+ # Builds the object from hash
449
+ # @param [Hash] attributes Model attributes in the form of hash
450
+ # @return [Object] Returns the model itself
451
+ def build_from_hash(attributes)
452
+ return nil unless attributes.is_a?(Hash)
453
+ self.class.openapi_types.each_pair do |key, type|
454
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
455
+ self.send("#{key}=", nil)
456
+ elsif type =~ /\AArray<(.*)>/i
457
+ # check to ensure the input is an array given that the attribute
458
+ # is documented as an array but the input is not
459
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
460
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
461
+ end
462
+ elsif !attributes[self.class.attribute_map[key]].nil?
463
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
464
+ end
465
+ end
466
+
467
+ self
468
+ end
469
+
470
+ # Deserializes the data based on type
471
+ # @param string type Data type
472
+ # @param string value Value to be deserialized
473
+ # @return [Object] Deserialized data
474
+ def _deserialize(type, value)
475
+ case type.to_sym
476
+ when :Time
477
+ Time.parse(value)
478
+ when :Date
479
+ Date.parse(value)
480
+ when :String
481
+ value.to_s
482
+ when :Integer
483
+ value.to_i
484
+ when :Float
485
+ value.to_f
486
+ when :Boolean
487
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
488
+ true
489
+ else
490
+ false
491
+ end
492
+ when :Object
493
+ # generic object (usually a Hash), return directly
494
+ value
495
+ when /\AArray<(?<inner_type>.+)>\z/
496
+ inner_type = Regexp.last_match[:inner_type]
497
+ value.map { |v| _deserialize(inner_type, v) }
498
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
499
+ k_type = Regexp.last_match[:k_type]
500
+ v_type = Regexp.last_match[:v_type]
501
+ {}.tap do |hash|
502
+ value.each do |k, v|
503
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
504
+ end
505
+ end
506
+ else # model
507
+ # models (e.g. Pet) or oneOf
508
+ klass = CloudReactorAPIClient.const_get(type)
509
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
510
+ end
511
+ end
512
+
513
+ # Returns the string representation of the object
514
+ # @return [String] String presentation of the object
515
+ def to_s
516
+ to_hash.to_s
517
+ end
518
+
519
+ # to_body is an alias to to_hash (backward compatibility)
520
+ # @return [Hash] Returns the object in the form of hash
521
+ def to_body
522
+ to_hash
523
+ end
524
+
525
+ # Returns the object in the form of hash
526
+ # @return [Hash] Returns the object in the form of hash
527
+ def to_hash
528
+ hash = {}
529
+ self.class.attribute_map.each_pair do |attr, param|
530
+ value = self.send(attr)
531
+ if value.nil?
532
+ is_nullable = self.class.openapi_nullable.include?(attr)
533
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
534
+ end
535
+
536
+ hash[param] = _to_hash(value)
537
+ end
538
+ hash
539
+ end
540
+
541
+ # Outputs non-array value in the form of hash
542
+ # For object, use to_hash. Otherwise, just return the value
543
+ # @param [Object] value Any valid value
544
+ # @return [Hash] Returns the value in the form of hash
545
+ def _to_hash(value)
546
+ if value.is_a?(Array)
547
+ value.compact.map { |v| _to_hash(v) }
548
+ elsif value.is_a?(Hash)
549
+ {}.tap do |hash|
550
+ value.each { |k, v| hash[k] = _to_hash(v) }
551
+ end
552
+ elsif value.respond_to? :to_hash
553
+ value.to_hash
554
+ else
555
+ value
556
+ end
557
+ end
558
+ end
559
+ end