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,715 @@
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
+ # A WorkflowTaskInstance contains a Task that is configured to run in a Workflow.
18
+ class WorkflowTaskInstance
19
+ attr_accessor :url
20
+
21
+ attr_accessor :uuid
22
+
23
+ attr_accessor :name
24
+
25
+ attr_accessor :description
26
+
27
+ attr_accessor :workflow
28
+
29
+ attr_accessor :task
30
+
31
+ attr_accessor :start_transition_condition
32
+
33
+ attr_accessor :max_complete_executions
34
+
35
+ attr_accessor :should_eval_transitions_after_first_execution
36
+
37
+ attr_accessor :condition_count_threshold
38
+
39
+ attr_accessor :condition_ratio_threshold
40
+
41
+ attr_accessor :max_age_seconds
42
+
43
+ attr_accessor :default_max_retries
44
+
45
+ attr_accessor :failure_behavior
46
+
47
+ attr_accessor :allow_workflow_execution_after_failure
48
+
49
+ attr_accessor :timeout_behavior
50
+
51
+ attr_accessor :allow_workflow_execution_after_timeout
52
+
53
+ attr_accessor :environment_variables_overrides
54
+
55
+ attr_accessor :allocated_cpu_units
56
+
57
+ attr_accessor :allocated_memory_mb
58
+
59
+ attr_accessor :use_task_alert_methods
60
+
61
+ attr_accessor :ui_color
62
+
63
+ attr_accessor :ui_icon_type
64
+
65
+ attr_accessor :ui_scale
66
+
67
+ attr_accessor :ui_center_margin_top
68
+
69
+ attr_accessor :ui_center_margin_left
70
+
71
+ attr_accessor :created_at
72
+
73
+ attr_accessor :updated_at
74
+
75
+ # Attribute mapping from ruby-style variable name to JSON key.
76
+ def self.attribute_map
77
+ {
78
+ :'url' => :'url',
79
+ :'uuid' => :'uuid',
80
+ :'name' => :'name',
81
+ :'description' => :'description',
82
+ :'workflow' => :'workflow',
83
+ :'task' => :'task',
84
+ :'start_transition_condition' => :'start_transition_condition',
85
+ :'max_complete_executions' => :'max_complete_executions',
86
+ :'should_eval_transitions_after_first_execution' => :'should_eval_transitions_after_first_execution',
87
+ :'condition_count_threshold' => :'condition_count_threshold',
88
+ :'condition_ratio_threshold' => :'condition_ratio_threshold',
89
+ :'max_age_seconds' => :'max_age_seconds',
90
+ :'default_max_retries' => :'default_max_retries',
91
+ :'failure_behavior' => :'failure_behavior',
92
+ :'allow_workflow_execution_after_failure' => :'allow_workflow_execution_after_failure',
93
+ :'timeout_behavior' => :'timeout_behavior',
94
+ :'allow_workflow_execution_after_timeout' => :'allow_workflow_execution_after_timeout',
95
+ :'environment_variables_overrides' => :'environment_variables_overrides',
96
+ :'allocated_cpu_units' => :'allocated_cpu_units',
97
+ :'allocated_memory_mb' => :'allocated_memory_mb',
98
+ :'use_task_alert_methods' => :'use_task_alert_methods',
99
+ :'ui_color' => :'ui_color',
100
+ :'ui_icon_type' => :'ui_icon_type',
101
+ :'ui_scale' => :'ui_scale',
102
+ :'ui_center_margin_top' => :'ui_center_margin_top',
103
+ :'ui_center_margin_left' => :'ui_center_margin_left',
104
+ :'created_at' => :'created_at',
105
+ :'updated_at' => :'updated_at'
106
+ }
107
+ end
108
+
109
+ # Returns all the JSON keys this model knows about
110
+ def self.acceptable_attributes
111
+ attribute_map.values
112
+ end
113
+
114
+ # Attribute type mapping.
115
+ def self.openapi_types
116
+ {
117
+ :'url' => :'String',
118
+ :'uuid' => :'String',
119
+ :'name' => :'String',
120
+ :'description' => :'String',
121
+ :'workflow' => :'NameAndUuid',
122
+ :'task' => :'NameAndUuid',
123
+ :'start_transition_condition' => :'StartTransitionConditionEnum',
124
+ :'max_complete_executions' => :'Integer',
125
+ :'should_eval_transitions_after_first_execution' => :'Boolean',
126
+ :'condition_count_threshold' => :'Integer',
127
+ :'condition_ratio_threshold' => :'Float',
128
+ :'max_age_seconds' => :'Integer',
129
+ :'default_max_retries' => :'Integer',
130
+ :'failure_behavior' => :'FailureBehaviorEnum',
131
+ :'allow_workflow_execution_after_failure' => :'Boolean',
132
+ :'timeout_behavior' => :'TimeoutBehaviorEnum',
133
+ :'allow_workflow_execution_after_timeout' => :'Boolean',
134
+ :'environment_variables_overrides' => :'Hash<String, Object>',
135
+ :'allocated_cpu_units' => :'Integer',
136
+ :'allocated_memory_mb' => :'Integer',
137
+ :'use_task_alert_methods' => :'Boolean',
138
+ :'ui_color' => :'String',
139
+ :'ui_icon_type' => :'String',
140
+ :'ui_scale' => :'Float',
141
+ :'ui_center_margin_top' => :'Float',
142
+ :'ui_center_margin_left' => :'Float',
143
+ :'created_at' => :'Time',
144
+ :'updated_at' => :'Time'
145
+ }
146
+ end
147
+
148
+ # List of attributes with nullable: true
149
+ def self.openapi_nullable
150
+ Set.new([
151
+ :'max_complete_executions',
152
+ :'condition_count_threshold',
153
+ :'condition_ratio_threshold',
154
+ :'max_age_seconds',
155
+ :'environment_variables_overrides',
156
+ :'allocated_cpu_units',
157
+ :'allocated_memory_mb',
158
+ :'ui_scale',
159
+ :'ui_center_margin_top',
160
+ :'ui_center_margin_left',
161
+ ])
162
+ end
163
+
164
+ # Initializes the object
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ def initialize(attributes = {})
167
+ if (!attributes.is_a?(Hash))
168
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CloudReactorAPIClient::WorkflowTaskInstance` initialize method"
169
+ end
170
+
171
+ # check to see if the attribute exists and convert string to symbol for hash key
172
+ attributes = attributes.each_with_object({}) { |(k, v), h|
173
+ if (!self.class.attribute_map.key?(k.to_sym))
174
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CloudReactorAPIClient::WorkflowTaskInstance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
175
+ end
176
+ h[k.to_sym] = v
177
+ }
178
+
179
+ if attributes.key?(:'url')
180
+ self.url = attributes[:'url']
181
+ end
182
+
183
+ if attributes.key?(:'uuid')
184
+ self.uuid = attributes[:'uuid']
185
+ end
186
+
187
+ if attributes.key?(:'name')
188
+ self.name = attributes[:'name']
189
+ end
190
+
191
+ if attributes.key?(:'description')
192
+ self.description = attributes[:'description']
193
+ end
194
+
195
+ if attributes.key?(:'workflow')
196
+ self.workflow = attributes[:'workflow']
197
+ end
198
+
199
+ if attributes.key?(:'task')
200
+ self.task = attributes[:'task']
201
+ end
202
+
203
+ if attributes.key?(:'start_transition_condition')
204
+ self.start_transition_condition = attributes[:'start_transition_condition']
205
+ end
206
+
207
+ if attributes.key?(:'max_complete_executions')
208
+ self.max_complete_executions = attributes[:'max_complete_executions']
209
+ end
210
+
211
+ if attributes.key?(:'should_eval_transitions_after_first_execution')
212
+ self.should_eval_transitions_after_first_execution = attributes[:'should_eval_transitions_after_first_execution']
213
+ end
214
+
215
+ if attributes.key?(:'condition_count_threshold')
216
+ self.condition_count_threshold = attributes[:'condition_count_threshold']
217
+ end
218
+
219
+ if attributes.key?(:'condition_ratio_threshold')
220
+ self.condition_ratio_threshold = attributes[:'condition_ratio_threshold']
221
+ end
222
+
223
+ if attributes.key?(:'max_age_seconds')
224
+ self.max_age_seconds = attributes[:'max_age_seconds']
225
+ end
226
+
227
+ if attributes.key?(:'default_max_retries')
228
+ self.default_max_retries = attributes[:'default_max_retries']
229
+ end
230
+
231
+ if attributes.key?(:'failure_behavior')
232
+ self.failure_behavior = attributes[:'failure_behavior']
233
+ end
234
+
235
+ if attributes.key?(:'allow_workflow_execution_after_failure')
236
+ self.allow_workflow_execution_after_failure = attributes[:'allow_workflow_execution_after_failure']
237
+ end
238
+
239
+ if attributes.key?(:'timeout_behavior')
240
+ self.timeout_behavior = attributes[:'timeout_behavior']
241
+ end
242
+
243
+ if attributes.key?(:'allow_workflow_execution_after_timeout')
244
+ self.allow_workflow_execution_after_timeout = attributes[:'allow_workflow_execution_after_timeout']
245
+ end
246
+
247
+ if attributes.key?(:'environment_variables_overrides')
248
+ if (value = attributes[:'environment_variables_overrides']).is_a?(Hash)
249
+ self.environment_variables_overrides = value
250
+ end
251
+ end
252
+
253
+ if attributes.key?(:'allocated_cpu_units')
254
+ self.allocated_cpu_units = attributes[:'allocated_cpu_units']
255
+ end
256
+
257
+ if attributes.key?(:'allocated_memory_mb')
258
+ self.allocated_memory_mb = attributes[:'allocated_memory_mb']
259
+ end
260
+
261
+ if attributes.key?(:'use_task_alert_methods')
262
+ self.use_task_alert_methods = attributes[:'use_task_alert_methods']
263
+ end
264
+
265
+ if attributes.key?(:'ui_color')
266
+ self.ui_color = attributes[:'ui_color']
267
+ end
268
+
269
+ if attributes.key?(:'ui_icon_type')
270
+ self.ui_icon_type = attributes[:'ui_icon_type']
271
+ end
272
+
273
+ if attributes.key?(:'ui_scale')
274
+ self.ui_scale = attributes[:'ui_scale']
275
+ end
276
+
277
+ if attributes.key?(:'ui_center_margin_top')
278
+ self.ui_center_margin_top = attributes[:'ui_center_margin_top']
279
+ end
280
+
281
+ if attributes.key?(:'ui_center_margin_left')
282
+ self.ui_center_margin_left = attributes[:'ui_center_margin_left']
283
+ end
284
+
285
+ if attributes.key?(:'created_at')
286
+ self.created_at = attributes[:'created_at']
287
+ end
288
+
289
+ if attributes.key?(:'updated_at')
290
+ self.updated_at = attributes[:'updated_at']
291
+ end
292
+ end
293
+
294
+ # Show invalid properties with the reasons. Usually used together with valid?
295
+ # @return Array for valid properties with the reasons
296
+ def list_invalid_properties
297
+ invalid_properties = Array.new
298
+ if @url.nil?
299
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
300
+ end
301
+
302
+ if @uuid.nil?
303
+ invalid_properties.push('invalid value for "uuid", uuid cannot be nil.')
304
+ end
305
+
306
+ if @name.nil?
307
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
308
+ end
309
+
310
+ if @name.to_s.length > 200
311
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 200.')
312
+ end
313
+
314
+ if !@description.nil? && @description.to_s.length > 5000
315
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 5000.')
316
+ end
317
+
318
+ if @workflow.nil?
319
+ invalid_properties.push('invalid value for "workflow", workflow cannot be nil.')
320
+ end
321
+
322
+ if @task.nil?
323
+ invalid_properties.push('invalid value for "task", task cannot be nil.')
324
+ end
325
+
326
+ if !@max_complete_executions.nil? && @max_complete_executions > 2147483647
327
+ invalid_properties.push('invalid value for "max_complete_executions", must be smaller than or equal to 2147483647.')
328
+ end
329
+
330
+ if !@max_complete_executions.nil? && @max_complete_executions < -2147483648
331
+ invalid_properties.push('invalid value for "max_complete_executions", must be greater than or equal to -2147483648.')
332
+ end
333
+
334
+ if !@condition_count_threshold.nil? && @condition_count_threshold > 2147483647
335
+ invalid_properties.push('invalid value for "condition_count_threshold", must be smaller than or equal to 2147483647.')
336
+ end
337
+
338
+ if !@condition_count_threshold.nil? && @condition_count_threshold < -2147483648
339
+ invalid_properties.push('invalid value for "condition_count_threshold", must be greater than or equal to -2147483648.')
340
+ end
341
+
342
+ if !@max_age_seconds.nil? && @max_age_seconds > 2147483647
343
+ invalid_properties.push('invalid value for "max_age_seconds", must be smaller than or equal to 2147483647.')
344
+ end
345
+
346
+ if !@max_age_seconds.nil? && @max_age_seconds < -2147483648
347
+ invalid_properties.push('invalid value for "max_age_seconds", must be greater than or equal to -2147483648.')
348
+ end
349
+
350
+ if !@default_max_retries.nil? && @default_max_retries > 2147483647
351
+ invalid_properties.push('invalid value for "default_max_retries", must be smaller than or equal to 2147483647.')
352
+ end
353
+
354
+ if !@default_max_retries.nil? && @default_max_retries < -2147483648
355
+ invalid_properties.push('invalid value for "default_max_retries", must be greater than or equal to -2147483648.')
356
+ end
357
+
358
+ if !@allocated_cpu_units.nil? && @allocated_cpu_units > 2147483647
359
+ invalid_properties.push('invalid value for "allocated_cpu_units", must be smaller than or equal to 2147483647.')
360
+ end
361
+
362
+ if !@allocated_cpu_units.nil? && @allocated_cpu_units < -2147483648
363
+ invalid_properties.push('invalid value for "allocated_cpu_units", must be greater than or equal to -2147483648.')
364
+ end
365
+
366
+ if !@allocated_memory_mb.nil? && @allocated_memory_mb > 2147483647
367
+ invalid_properties.push('invalid value for "allocated_memory_mb", must be smaller than or equal to 2147483647.')
368
+ end
369
+
370
+ if !@allocated_memory_mb.nil? && @allocated_memory_mb < -2147483648
371
+ invalid_properties.push('invalid value for "allocated_memory_mb", must be greater than or equal to -2147483648.')
372
+ end
373
+
374
+ if !@ui_color.nil? && @ui_color.to_s.length > 16
375
+ invalid_properties.push('invalid value for "ui_color", the character length must be smaller than or equal to 16.')
376
+ end
377
+
378
+ if !@ui_icon_type.nil? && @ui_icon_type.to_s.length > 50
379
+ invalid_properties.push('invalid value for "ui_icon_type", the character length must be smaller than or equal to 50.')
380
+ end
381
+
382
+ if @created_at.nil?
383
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
384
+ end
385
+
386
+ if @updated_at.nil?
387
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
388
+ end
389
+
390
+ invalid_properties
391
+ end
392
+
393
+ # Check to see if the all the properties in the model are valid
394
+ # @return true if the model is valid
395
+ def valid?
396
+ return false if @url.nil?
397
+ return false if @uuid.nil?
398
+ return false if @name.nil?
399
+ return false if @name.to_s.length > 200
400
+ return false if !@description.nil? && @description.to_s.length > 5000
401
+ return false if @workflow.nil?
402
+ return false if @task.nil?
403
+ return false if !@max_complete_executions.nil? && @max_complete_executions > 2147483647
404
+ return false if !@max_complete_executions.nil? && @max_complete_executions < -2147483648
405
+ return false if !@condition_count_threshold.nil? && @condition_count_threshold > 2147483647
406
+ return false if !@condition_count_threshold.nil? && @condition_count_threshold < -2147483648
407
+ return false if !@max_age_seconds.nil? && @max_age_seconds > 2147483647
408
+ return false if !@max_age_seconds.nil? && @max_age_seconds < -2147483648
409
+ return false if !@default_max_retries.nil? && @default_max_retries > 2147483647
410
+ return false if !@default_max_retries.nil? && @default_max_retries < -2147483648
411
+ return false if !@allocated_cpu_units.nil? && @allocated_cpu_units > 2147483647
412
+ return false if !@allocated_cpu_units.nil? && @allocated_cpu_units < -2147483648
413
+ return false if !@allocated_memory_mb.nil? && @allocated_memory_mb > 2147483647
414
+ return false if !@allocated_memory_mb.nil? && @allocated_memory_mb < -2147483648
415
+ return false if !@ui_color.nil? && @ui_color.to_s.length > 16
416
+ return false if !@ui_icon_type.nil? && @ui_icon_type.to_s.length > 50
417
+ return false if @created_at.nil?
418
+ return false if @updated_at.nil?
419
+ true
420
+ end
421
+
422
+ # Custom attribute writer method with validation
423
+ # @param [Object] name Value to be assigned
424
+ def name=(name)
425
+ if name.nil?
426
+ fail ArgumentError, 'name cannot be nil'
427
+ end
428
+
429
+ if name.to_s.length > 200
430
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 200.'
431
+ end
432
+
433
+ @name = name
434
+ end
435
+
436
+ # Custom attribute writer method with validation
437
+ # @param [Object] description Value to be assigned
438
+ def description=(description)
439
+ if !description.nil? && description.to_s.length > 5000
440
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 5000.'
441
+ end
442
+
443
+ @description = description
444
+ end
445
+
446
+ # Custom attribute writer method with validation
447
+ # @param [Object] max_complete_executions Value to be assigned
448
+ def max_complete_executions=(max_complete_executions)
449
+ if !max_complete_executions.nil? && max_complete_executions > 2147483647
450
+ fail ArgumentError, 'invalid value for "max_complete_executions", must be smaller than or equal to 2147483647.'
451
+ end
452
+
453
+ if !max_complete_executions.nil? && max_complete_executions < -2147483648
454
+ fail ArgumentError, 'invalid value for "max_complete_executions", must be greater than or equal to -2147483648.'
455
+ end
456
+
457
+ @max_complete_executions = max_complete_executions
458
+ end
459
+
460
+ # Custom attribute writer method with validation
461
+ # @param [Object] condition_count_threshold Value to be assigned
462
+ def condition_count_threshold=(condition_count_threshold)
463
+ if !condition_count_threshold.nil? && condition_count_threshold > 2147483647
464
+ fail ArgumentError, 'invalid value for "condition_count_threshold", must be smaller than or equal to 2147483647.'
465
+ end
466
+
467
+ if !condition_count_threshold.nil? && condition_count_threshold < -2147483648
468
+ fail ArgumentError, 'invalid value for "condition_count_threshold", must be greater than or equal to -2147483648.'
469
+ end
470
+
471
+ @condition_count_threshold = condition_count_threshold
472
+ end
473
+
474
+ # Custom attribute writer method with validation
475
+ # @param [Object] max_age_seconds Value to be assigned
476
+ def max_age_seconds=(max_age_seconds)
477
+ if !max_age_seconds.nil? && max_age_seconds > 2147483647
478
+ fail ArgumentError, 'invalid value for "max_age_seconds", must be smaller than or equal to 2147483647.'
479
+ end
480
+
481
+ if !max_age_seconds.nil? && max_age_seconds < -2147483648
482
+ fail ArgumentError, 'invalid value for "max_age_seconds", must be greater than or equal to -2147483648.'
483
+ end
484
+
485
+ @max_age_seconds = max_age_seconds
486
+ end
487
+
488
+ # Custom attribute writer method with validation
489
+ # @param [Object] default_max_retries Value to be assigned
490
+ def default_max_retries=(default_max_retries)
491
+ if !default_max_retries.nil? && default_max_retries > 2147483647
492
+ fail ArgumentError, 'invalid value for "default_max_retries", must be smaller than or equal to 2147483647.'
493
+ end
494
+
495
+ if !default_max_retries.nil? && default_max_retries < -2147483648
496
+ fail ArgumentError, 'invalid value for "default_max_retries", must be greater than or equal to -2147483648.'
497
+ end
498
+
499
+ @default_max_retries = default_max_retries
500
+ end
501
+
502
+ # Custom attribute writer method with validation
503
+ # @param [Object] allocated_cpu_units Value to be assigned
504
+ def allocated_cpu_units=(allocated_cpu_units)
505
+ if !allocated_cpu_units.nil? && allocated_cpu_units > 2147483647
506
+ fail ArgumentError, 'invalid value for "allocated_cpu_units", must be smaller than or equal to 2147483647.'
507
+ end
508
+
509
+ if !allocated_cpu_units.nil? && allocated_cpu_units < -2147483648
510
+ fail ArgumentError, 'invalid value for "allocated_cpu_units", must be greater than or equal to -2147483648.'
511
+ end
512
+
513
+ @allocated_cpu_units = allocated_cpu_units
514
+ end
515
+
516
+ # Custom attribute writer method with validation
517
+ # @param [Object] allocated_memory_mb Value to be assigned
518
+ def allocated_memory_mb=(allocated_memory_mb)
519
+ if !allocated_memory_mb.nil? && allocated_memory_mb > 2147483647
520
+ fail ArgumentError, 'invalid value for "allocated_memory_mb", must be smaller than or equal to 2147483647.'
521
+ end
522
+
523
+ if !allocated_memory_mb.nil? && allocated_memory_mb < -2147483648
524
+ fail ArgumentError, 'invalid value for "allocated_memory_mb", must be greater than or equal to -2147483648.'
525
+ end
526
+
527
+ @allocated_memory_mb = allocated_memory_mb
528
+ end
529
+
530
+ # Custom attribute writer method with validation
531
+ # @param [Object] ui_color Value to be assigned
532
+ def ui_color=(ui_color)
533
+ if !ui_color.nil? && ui_color.to_s.length > 16
534
+ fail ArgumentError, 'invalid value for "ui_color", the character length must be smaller than or equal to 16.'
535
+ end
536
+
537
+ @ui_color = ui_color
538
+ end
539
+
540
+ # Custom attribute writer method with validation
541
+ # @param [Object] ui_icon_type Value to be assigned
542
+ def ui_icon_type=(ui_icon_type)
543
+ if !ui_icon_type.nil? && ui_icon_type.to_s.length > 50
544
+ fail ArgumentError, 'invalid value for "ui_icon_type", the character length must be smaller than or equal to 50.'
545
+ end
546
+
547
+ @ui_icon_type = ui_icon_type
548
+ end
549
+
550
+ # Checks equality by comparing each attribute.
551
+ # @param [Object] Object to be compared
552
+ def ==(o)
553
+ return true if self.equal?(o)
554
+ self.class == o.class &&
555
+ url == o.url &&
556
+ uuid == o.uuid &&
557
+ name == o.name &&
558
+ description == o.description &&
559
+ workflow == o.workflow &&
560
+ task == o.task &&
561
+ start_transition_condition == o.start_transition_condition &&
562
+ max_complete_executions == o.max_complete_executions &&
563
+ should_eval_transitions_after_first_execution == o.should_eval_transitions_after_first_execution &&
564
+ condition_count_threshold == o.condition_count_threshold &&
565
+ condition_ratio_threshold == o.condition_ratio_threshold &&
566
+ max_age_seconds == o.max_age_seconds &&
567
+ default_max_retries == o.default_max_retries &&
568
+ failure_behavior == o.failure_behavior &&
569
+ allow_workflow_execution_after_failure == o.allow_workflow_execution_after_failure &&
570
+ timeout_behavior == o.timeout_behavior &&
571
+ allow_workflow_execution_after_timeout == o.allow_workflow_execution_after_timeout &&
572
+ environment_variables_overrides == o.environment_variables_overrides &&
573
+ allocated_cpu_units == o.allocated_cpu_units &&
574
+ allocated_memory_mb == o.allocated_memory_mb &&
575
+ use_task_alert_methods == o.use_task_alert_methods &&
576
+ ui_color == o.ui_color &&
577
+ ui_icon_type == o.ui_icon_type &&
578
+ ui_scale == o.ui_scale &&
579
+ ui_center_margin_top == o.ui_center_margin_top &&
580
+ ui_center_margin_left == o.ui_center_margin_left &&
581
+ created_at == o.created_at &&
582
+ updated_at == o.updated_at
583
+ end
584
+
585
+ # @see the `==` method
586
+ # @param [Object] Object to be compared
587
+ def eql?(o)
588
+ self == o
589
+ end
590
+
591
+ # Calculates hash code according to all attributes.
592
+ # @return [Integer] Hash code
593
+ def hash
594
+ [url, uuid, name, description, workflow, task, start_transition_condition, max_complete_executions, should_eval_transitions_after_first_execution, condition_count_threshold, condition_ratio_threshold, max_age_seconds, default_max_retries, failure_behavior, allow_workflow_execution_after_failure, timeout_behavior, allow_workflow_execution_after_timeout, environment_variables_overrides, allocated_cpu_units, allocated_memory_mb, use_task_alert_methods, ui_color, ui_icon_type, ui_scale, ui_center_margin_top, ui_center_margin_left, created_at, updated_at].hash
595
+ end
596
+
597
+ # Builds the object from hash
598
+ # @param [Hash] attributes Model attributes in the form of hash
599
+ # @return [Object] Returns the model itself
600
+ def self.build_from_hash(attributes)
601
+ new.build_from_hash(attributes)
602
+ end
603
+
604
+ # Builds the object from hash
605
+ # @param [Hash] attributes Model attributes in the form of hash
606
+ # @return [Object] Returns the model itself
607
+ def build_from_hash(attributes)
608
+ return nil unless attributes.is_a?(Hash)
609
+ self.class.openapi_types.each_pair do |key, type|
610
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
611
+ self.send("#{key}=", nil)
612
+ elsif type =~ /\AArray<(.*)>/i
613
+ # check to ensure the input is an array given that the attribute
614
+ # is documented as an array but the input is not
615
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
616
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
617
+ end
618
+ elsif !attributes[self.class.attribute_map[key]].nil?
619
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
620
+ end
621
+ end
622
+
623
+ self
624
+ end
625
+
626
+ # Deserializes the data based on type
627
+ # @param string type Data type
628
+ # @param string value Value to be deserialized
629
+ # @return [Object] Deserialized data
630
+ def _deserialize(type, value)
631
+ case type.to_sym
632
+ when :Time
633
+ Time.parse(value)
634
+ when :Date
635
+ Date.parse(value)
636
+ when :String
637
+ value.to_s
638
+ when :Integer
639
+ value.to_i
640
+ when :Float
641
+ value.to_f
642
+ when :Boolean
643
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
644
+ true
645
+ else
646
+ false
647
+ end
648
+ when :Object
649
+ # generic object (usually a Hash), return directly
650
+ value
651
+ when /\AArray<(?<inner_type>.+)>\z/
652
+ inner_type = Regexp.last_match[:inner_type]
653
+ value.map { |v| _deserialize(inner_type, v) }
654
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
655
+ k_type = Regexp.last_match[:k_type]
656
+ v_type = Regexp.last_match[:v_type]
657
+ {}.tap do |hash|
658
+ value.each do |k, v|
659
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
660
+ end
661
+ end
662
+ else # model
663
+ # models (e.g. Pet) or oneOf
664
+ klass = CloudReactorAPIClient.const_get(type)
665
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
666
+ end
667
+ end
668
+
669
+ # Returns the string representation of the object
670
+ # @return [String] String presentation of the object
671
+ def to_s
672
+ to_hash.to_s
673
+ end
674
+
675
+ # to_body is an alias to to_hash (backward compatibility)
676
+ # @return [Hash] Returns the object in the form of hash
677
+ def to_body
678
+ to_hash
679
+ end
680
+
681
+ # Returns the object in the form of hash
682
+ # @return [Hash] Returns the object in the form of hash
683
+ def to_hash
684
+ hash = {}
685
+ self.class.attribute_map.each_pair do |attr, param|
686
+ value = self.send(attr)
687
+ if value.nil?
688
+ is_nullable = self.class.openapi_nullable.include?(attr)
689
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
690
+ end
691
+
692
+ hash[param] = _to_hash(value)
693
+ end
694
+ hash
695
+ end
696
+
697
+ # Outputs non-array value in the form of hash
698
+ # For object, use to_hash. Otherwise, just return the value
699
+ # @param [Object] value Any valid value
700
+ # @return [Hash] Returns the value in the form of hash
701
+ def _to_hash(value)
702
+ if value.is_a?(Array)
703
+ value.compact.map { |v| _to_hash(v) }
704
+ elsif value.is_a?(Hash)
705
+ {}.tap do |hash|
706
+ value.each { |k, v| hash[k] = _to_hash(v) }
707
+ end
708
+ elsif value.respond_to? :to_hash
709
+ value.to_hash
710
+ else
711
+ value
712
+ end
713
+ end
714
+ end
715
+ end