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,676 @@
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 PatchedWorkflowTaskInstance
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::PatchedWorkflowTaskInstance` 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::PatchedWorkflowTaskInstance`. 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 !@name.nil? && @name.to_s.length > 200
299
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 200.')
300
+ end
301
+
302
+ if !@description.nil? && @description.to_s.length > 5000
303
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 5000.')
304
+ end
305
+
306
+ if !@max_complete_executions.nil? && @max_complete_executions > 2147483647
307
+ invalid_properties.push('invalid value for "max_complete_executions", must be smaller than or equal to 2147483647.')
308
+ end
309
+
310
+ if !@max_complete_executions.nil? && @max_complete_executions < -2147483648
311
+ invalid_properties.push('invalid value for "max_complete_executions", must be greater than or equal to -2147483648.')
312
+ end
313
+
314
+ if !@condition_count_threshold.nil? && @condition_count_threshold > 2147483647
315
+ invalid_properties.push('invalid value for "condition_count_threshold", must be smaller than or equal to 2147483647.')
316
+ end
317
+
318
+ if !@condition_count_threshold.nil? && @condition_count_threshold < -2147483648
319
+ invalid_properties.push('invalid value for "condition_count_threshold", must be greater than or equal to -2147483648.')
320
+ end
321
+
322
+ if !@max_age_seconds.nil? && @max_age_seconds > 2147483647
323
+ invalid_properties.push('invalid value for "max_age_seconds", must be smaller than or equal to 2147483647.')
324
+ end
325
+
326
+ if !@max_age_seconds.nil? && @max_age_seconds < -2147483648
327
+ invalid_properties.push('invalid value for "max_age_seconds", must be greater than or equal to -2147483648.')
328
+ end
329
+
330
+ if !@default_max_retries.nil? && @default_max_retries > 2147483647
331
+ invalid_properties.push('invalid value for "default_max_retries", must be smaller than or equal to 2147483647.')
332
+ end
333
+
334
+ if !@default_max_retries.nil? && @default_max_retries < -2147483648
335
+ invalid_properties.push('invalid value for "default_max_retries", must be greater than or equal to -2147483648.')
336
+ end
337
+
338
+ if !@allocated_cpu_units.nil? && @allocated_cpu_units > 2147483647
339
+ invalid_properties.push('invalid value for "allocated_cpu_units", must be smaller than or equal to 2147483647.')
340
+ end
341
+
342
+ if !@allocated_cpu_units.nil? && @allocated_cpu_units < -2147483648
343
+ invalid_properties.push('invalid value for "allocated_cpu_units", must be greater than or equal to -2147483648.')
344
+ end
345
+
346
+ if !@allocated_memory_mb.nil? && @allocated_memory_mb > 2147483647
347
+ invalid_properties.push('invalid value for "allocated_memory_mb", must be smaller than or equal to 2147483647.')
348
+ end
349
+
350
+ if !@allocated_memory_mb.nil? && @allocated_memory_mb < -2147483648
351
+ invalid_properties.push('invalid value for "allocated_memory_mb", must be greater than or equal to -2147483648.')
352
+ end
353
+
354
+ if !@ui_color.nil? && @ui_color.to_s.length > 16
355
+ invalid_properties.push('invalid value for "ui_color", the character length must be smaller than or equal to 16.')
356
+ end
357
+
358
+ if !@ui_icon_type.nil? && @ui_icon_type.to_s.length > 50
359
+ invalid_properties.push('invalid value for "ui_icon_type", the character length must be smaller than or equal to 50.')
360
+ end
361
+
362
+ invalid_properties
363
+ end
364
+
365
+ # Check to see if the all the properties in the model are valid
366
+ # @return true if the model is valid
367
+ def valid?
368
+ return false if !@name.nil? && @name.to_s.length > 200
369
+ return false if !@description.nil? && @description.to_s.length > 5000
370
+ return false if !@max_complete_executions.nil? && @max_complete_executions > 2147483647
371
+ return false if !@max_complete_executions.nil? && @max_complete_executions < -2147483648
372
+ return false if !@condition_count_threshold.nil? && @condition_count_threshold > 2147483647
373
+ return false if !@condition_count_threshold.nil? && @condition_count_threshold < -2147483648
374
+ return false if !@max_age_seconds.nil? && @max_age_seconds > 2147483647
375
+ return false if !@max_age_seconds.nil? && @max_age_seconds < -2147483648
376
+ return false if !@default_max_retries.nil? && @default_max_retries > 2147483647
377
+ return false if !@default_max_retries.nil? && @default_max_retries < -2147483648
378
+ return false if !@allocated_cpu_units.nil? && @allocated_cpu_units > 2147483647
379
+ return false if !@allocated_cpu_units.nil? && @allocated_cpu_units < -2147483648
380
+ return false if !@allocated_memory_mb.nil? && @allocated_memory_mb > 2147483647
381
+ return false if !@allocated_memory_mb.nil? && @allocated_memory_mb < -2147483648
382
+ return false if !@ui_color.nil? && @ui_color.to_s.length > 16
383
+ return false if !@ui_icon_type.nil? && @ui_icon_type.to_s.length > 50
384
+ true
385
+ end
386
+
387
+ # Custom attribute writer method with validation
388
+ # @param [Object] name Value to be assigned
389
+ def name=(name)
390
+ if !name.nil? && name.to_s.length > 200
391
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 200.'
392
+ end
393
+
394
+ @name = name
395
+ end
396
+
397
+ # Custom attribute writer method with validation
398
+ # @param [Object] description Value to be assigned
399
+ def description=(description)
400
+ if !description.nil? && description.to_s.length > 5000
401
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 5000.'
402
+ end
403
+
404
+ @description = description
405
+ end
406
+
407
+ # Custom attribute writer method with validation
408
+ # @param [Object] max_complete_executions Value to be assigned
409
+ def max_complete_executions=(max_complete_executions)
410
+ if !max_complete_executions.nil? && max_complete_executions > 2147483647
411
+ fail ArgumentError, 'invalid value for "max_complete_executions", must be smaller than or equal to 2147483647.'
412
+ end
413
+
414
+ if !max_complete_executions.nil? && max_complete_executions < -2147483648
415
+ fail ArgumentError, 'invalid value for "max_complete_executions", must be greater than or equal to -2147483648.'
416
+ end
417
+
418
+ @max_complete_executions = max_complete_executions
419
+ end
420
+
421
+ # Custom attribute writer method with validation
422
+ # @param [Object] condition_count_threshold Value to be assigned
423
+ def condition_count_threshold=(condition_count_threshold)
424
+ if !condition_count_threshold.nil? && condition_count_threshold > 2147483647
425
+ fail ArgumentError, 'invalid value for "condition_count_threshold", must be smaller than or equal to 2147483647.'
426
+ end
427
+
428
+ if !condition_count_threshold.nil? && condition_count_threshold < -2147483648
429
+ fail ArgumentError, 'invalid value for "condition_count_threshold", must be greater than or equal to -2147483648.'
430
+ end
431
+
432
+ @condition_count_threshold = condition_count_threshold
433
+ end
434
+
435
+ # Custom attribute writer method with validation
436
+ # @param [Object] max_age_seconds Value to be assigned
437
+ def max_age_seconds=(max_age_seconds)
438
+ if !max_age_seconds.nil? && max_age_seconds > 2147483647
439
+ fail ArgumentError, 'invalid value for "max_age_seconds", must be smaller than or equal to 2147483647.'
440
+ end
441
+
442
+ if !max_age_seconds.nil? && max_age_seconds < -2147483648
443
+ fail ArgumentError, 'invalid value for "max_age_seconds", must be greater than or equal to -2147483648.'
444
+ end
445
+
446
+ @max_age_seconds = max_age_seconds
447
+ end
448
+
449
+ # Custom attribute writer method with validation
450
+ # @param [Object] default_max_retries Value to be assigned
451
+ def default_max_retries=(default_max_retries)
452
+ if !default_max_retries.nil? && default_max_retries > 2147483647
453
+ fail ArgumentError, 'invalid value for "default_max_retries", must be smaller than or equal to 2147483647.'
454
+ end
455
+
456
+ if !default_max_retries.nil? && default_max_retries < -2147483648
457
+ fail ArgumentError, 'invalid value for "default_max_retries", must be greater than or equal to -2147483648.'
458
+ end
459
+
460
+ @default_max_retries = default_max_retries
461
+ end
462
+
463
+ # Custom attribute writer method with validation
464
+ # @param [Object] allocated_cpu_units Value to be assigned
465
+ def allocated_cpu_units=(allocated_cpu_units)
466
+ if !allocated_cpu_units.nil? && allocated_cpu_units > 2147483647
467
+ fail ArgumentError, 'invalid value for "allocated_cpu_units", must be smaller than or equal to 2147483647.'
468
+ end
469
+
470
+ if !allocated_cpu_units.nil? && allocated_cpu_units < -2147483648
471
+ fail ArgumentError, 'invalid value for "allocated_cpu_units", must be greater than or equal to -2147483648.'
472
+ end
473
+
474
+ @allocated_cpu_units = allocated_cpu_units
475
+ end
476
+
477
+ # Custom attribute writer method with validation
478
+ # @param [Object] allocated_memory_mb Value to be assigned
479
+ def allocated_memory_mb=(allocated_memory_mb)
480
+ if !allocated_memory_mb.nil? && allocated_memory_mb > 2147483647
481
+ fail ArgumentError, 'invalid value for "allocated_memory_mb", must be smaller than or equal to 2147483647.'
482
+ end
483
+
484
+ if !allocated_memory_mb.nil? && allocated_memory_mb < -2147483648
485
+ fail ArgumentError, 'invalid value for "allocated_memory_mb", must be greater than or equal to -2147483648.'
486
+ end
487
+
488
+ @allocated_memory_mb = allocated_memory_mb
489
+ end
490
+
491
+ # Custom attribute writer method with validation
492
+ # @param [Object] ui_color Value to be assigned
493
+ def ui_color=(ui_color)
494
+ if !ui_color.nil? && ui_color.to_s.length > 16
495
+ fail ArgumentError, 'invalid value for "ui_color", the character length must be smaller than or equal to 16.'
496
+ end
497
+
498
+ @ui_color = ui_color
499
+ end
500
+
501
+ # Custom attribute writer method with validation
502
+ # @param [Object] ui_icon_type Value to be assigned
503
+ def ui_icon_type=(ui_icon_type)
504
+ if !ui_icon_type.nil? && ui_icon_type.to_s.length > 50
505
+ fail ArgumentError, 'invalid value for "ui_icon_type", the character length must be smaller than or equal to 50.'
506
+ end
507
+
508
+ @ui_icon_type = ui_icon_type
509
+ end
510
+
511
+ # Checks equality by comparing each attribute.
512
+ # @param [Object] Object to be compared
513
+ def ==(o)
514
+ return true if self.equal?(o)
515
+ self.class == o.class &&
516
+ url == o.url &&
517
+ uuid == o.uuid &&
518
+ name == o.name &&
519
+ description == o.description &&
520
+ workflow == o.workflow &&
521
+ task == o.task &&
522
+ start_transition_condition == o.start_transition_condition &&
523
+ max_complete_executions == o.max_complete_executions &&
524
+ should_eval_transitions_after_first_execution == o.should_eval_transitions_after_first_execution &&
525
+ condition_count_threshold == o.condition_count_threshold &&
526
+ condition_ratio_threshold == o.condition_ratio_threshold &&
527
+ max_age_seconds == o.max_age_seconds &&
528
+ default_max_retries == o.default_max_retries &&
529
+ failure_behavior == o.failure_behavior &&
530
+ allow_workflow_execution_after_failure == o.allow_workflow_execution_after_failure &&
531
+ timeout_behavior == o.timeout_behavior &&
532
+ allow_workflow_execution_after_timeout == o.allow_workflow_execution_after_timeout &&
533
+ environment_variables_overrides == o.environment_variables_overrides &&
534
+ allocated_cpu_units == o.allocated_cpu_units &&
535
+ allocated_memory_mb == o.allocated_memory_mb &&
536
+ use_task_alert_methods == o.use_task_alert_methods &&
537
+ ui_color == o.ui_color &&
538
+ ui_icon_type == o.ui_icon_type &&
539
+ ui_scale == o.ui_scale &&
540
+ ui_center_margin_top == o.ui_center_margin_top &&
541
+ ui_center_margin_left == o.ui_center_margin_left &&
542
+ created_at == o.created_at &&
543
+ updated_at == o.updated_at
544
+ end
545
+
546
+ # @see the `==` method
547
+ # @param [Object] Object to be compared
548
+ def eql?(o)
549
+ self == o
550
+ end
551
+
552
+ # Calculates hash code according to all attributes.
553
+ # @return [Integer] Hash code
554
+ def hash
555
+ [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
556
+ end
557
+
558
+ # Builds the object from hash
559
+ # @param [Hash] attributes Model attributes in the form of hash
560
+ # @return [Object] Returns the model itself
561
+ def self.build_from_hash(attributes)
562
+ new.build_from_hash(attributes)
563
+ end
564
+
565
+ # Builds the object from hash
566
+ # @param [Hash] attributes Model attributes in the form of hash
567
+ # @return [Object] Returns the model itself
568
+ def build_from_hash(attributes)
569
+ return nil unless attributes.is_a?(Hash)
570
+ self.class.openapi_types.each_pair do |key, type|
571
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
572
+ self.send("#{key}=", nil)
573
+ elsif type =~ /\AArray<(.*)>/i
574
+ # check to ensure the input is an array given that the attribute
575
+ # is documented as an array but the input is not
576
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
577
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
578
+ end
579
+ elsif !attributes[self.class.attribute_map[key]].nil?
580
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
581
+ end
582
+ end
583
+
584
+ self
585
+ end
586
+
587
+ # Deserializes the data based on type
588
+ # @param string type Data type
589
+ # @param string value Value to be deserialized
590
+ # @return [Object] Deserialized data
591
+ def _deserialize(type, value)
592
+ case type.to_sym
593
+ when :Time
594
+ Time.parse(value)
595
+ when :Date
596
+ Date.parse(value)
597
+ when :String
598
+ value.to_s
599
+ when :Integer
600
+ value.to_i
601
+ when :Float
602
+ value.to_f
603
+ when :Boolean
604
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
605
+ true
606
+ else
607
+ false
608
+ end
609
+ when :Object
610
+ # generic object (usually a Hash), return directly
611
+ value
612
+ when /\AArray<(?<inner_type>.+)>\z/
613
+ inner_type = Regexp.last_match[:inner_type]
614
+ value.map { |v| _deserialize(inner_type, v) }
615
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
616
+ k_type = Regexp.last_match[:k_type]
617
+ v_type = Regexp.last_match[:v_type]
618
+ {}.tap do |hash|
619
+ value.each do |k, v|
620
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
621
+ end
622
+ end
623
+ else # model
624
+ # models (e.g. Pet) or oneOf
625
+ klass = CloudReactorAPIClient.const_get(type)
626
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
627
+ end
628
+ end
629
+
630
+ # Returns the string representation of the object
631
+ # @return [String] String presentation of the object
632
+ def to_s
633
+ to_hash.to_s
634
+ end
635
+
636
+ # to_body is an alias to to_hash (backward compatibility)
637
+ # @return [Hash] Returns the object in the form of hash
638
+ def to_body
639
+ to_hash
640
+ end
641
+
642
+ # Returns the object in the form of hash
643
+ # @return [Hash] Returns the object in the form of hash
644
+ def to_hash
645
+ hash = {}
646
+ self.class.attribute_map.each_pair do |attr, param|
647
+ value = self.send(attr)
648
+ if value.nil?
649
+ is_nullable = self.class.openapi_nullable.include?(attr)
650
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
651
+ end
652
+
653
+ hash[param] = _to_hash(value)
654
+ end
655
+ hash
656
+ end
657
+
658
+ # Outputs non-array value in the form of hash
659
+ # For object, use to_hash. Otherwise, just return the value
660
+ # @param [Object] value Any valid value
661
+ # @return [Hash] Returns the value in the form of hash
662
+ def _to_hash(value)
663
+ if value.is_a?(Array)
664
+ value.compact.map { |v| _to_hash(v) }
665
+ elsif value.is_a?(Hash)
666
+ {}.tap do |hash|
667
+ value.each { |k, v| hash[k] = _to_hash(v) }
668
+ end
669
+ elsif value.respond_to? :to_hash
670
+ value.to_hash
671
+ else
672
+ value
673
+ end
674
+ end
675
+ end
676
+ end