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,556 @@
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
+ # Workflows are Tasks arranged in a directed graph. Configured Tasks are held by WorkflowTaskInstances, and WorkflowTransitions connect WorkflowTaskInstances together.
18
+ class Workflow
19
+ attr_accessor :url
20
+
21
+ attr_accessor :uuid
22
+
23
+ attr_accessor :name
24
+
25
+ attr_accessor :description
26
+
27
+ attr_accessor :dashboard_url
28
+
29
+ attr_accessor :schedule
30
+
31
+ attr_accessor :max_concurrency
32
+
33
+ attr_accessor :max_age_seconds
34
+
35
+ attr_accessor :default_max_retries
36
+
37
+ attr_accessor :latest_workflow_execution
38
+
39
+ # Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
40
+ attr_accessor :created_by_user
41
+
42
+ attr_accessor :created_by_group
43
+
44
+ attr_accessor :run_environment
45
+
46
+ attr_accessor :enabled
47
+
48
+ attr_accessor :created_at
49
+
50
+ attr_accessor :updated_at
51
+
52
+ attr_accessor :alert_methods
53
+
54
+ attr_accessor :workflow_task_instances
55
+
56
+ attr_accessor :workflow_transitions
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'url' => :'url',
62
+ :'uuid' => :'uuid',
63
+ :'name' => :'name',
64
+ :'description' => :'description',
65
+ :'dashboard_url' => :'dashboard_url',
66
+ :'schedule' => :'schedule',
67
+ :'max_concurrency' => :'max_concurrency',
68
+ :'max_age_seconds' => :'max_age_seconds',
69
+ :'default_max_retries' => :'default_max_retries',
70
+ :'latest_workflow_execution' => :'latest_workflow_execution',
71
+ :'created_by_user' => :'created_by_user',
72
+ :'created_by_group' => :'created_by_group',
73
+ :'run_environment' => :'run_environment',
74
+ :'enabled' => :'enabled',
75
+ :'created_at' => :'created_at',
76
+ :'updated_at' => :'updated_at',
77
+ :'alert_methods' => :'alert_methods',
78
+ :'workflow_task_instances' => :'workflow_task_instances',
79
+ :'workflow_transitions' => :'workflow_transitions'
80
+ }
81
+ end
82
+
83
+ # Returns all the JSON keys this model knows about
84
+ def self.acceptable_attributes
85
+ attribute_map.values
86
+ end
87
+
88
+ # Attribute type mapping.
89
+ def self.openapi_types
90
+ {
91
+ :'url' => :'String',
92
+ :'uuid' => :'String',
93
+ :'name' => :'String',
94
+ :'description' => :'String',
95
+ :'dashboard_url' => :'String',
96
+ :'schedule' => :'String',
97
+ :'max_concurrency' => :'Integer',
98
+ :'max_age_seconds' => :'Integer',
99
+ :'default_max_retries' => :'Integer',
100
+ :'latest_workflow_execution' => :'WorkflowExecutionSummary',
101
+ :'created_by_user' => :'String',
102
+ :'created_by_group' => :'Group',
103
+ :'run_environment' => :'NameAndUuid',
104
+ :'enabled' => :'Boolean',
105
+ :'created_at' => :'Time',
106
+ :'updated_at' => :'Time',
107
+ :'alert_methods' => :'Array<NameAndUuid>',
108
+ :'workflow_task_instances' => :'Array<WorkflowTaskInstance>',
109
+ :'workflow_transitions' => :'Array<WorkflowTransition>'
110
+ }
111
+ end
112
+
113
+ # List of attributes with nullable: true
114
+ def self.openapi_nullable
115
+ Set.new([
116
+ :'max_concurrency',
117
+ :'max_age_seconds',
118
+ :'created_by_group',
119
+ :'run_environment',
120
+ ])
121
+ end
122
+
123
+ # Initializes the object
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ def initialize(attributes = {})
126
+ if (!attributes.is_a?(Hash))
127
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CloudReactorAPIClient::Workflow` initialize method"
128
+ end
129
+
130
+ # check to see if the attribute exists and convert string to symbol for hash key
131
+ attributes = attributes.each_with_object({}) { |(k, v), h|
132
+ if (!self.class.attribute_map.key?(k.to_sym))
133
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CloudReactorAPIClient::Workflow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
134
+ end
135
+ h[k.to_sym] = v
136
+ }
137
+
138
+ if attributes.key?(:'url')
139
+ self.url = attributes[:'url']
140
+ end
141
+
142
+ if attributes.key?(:'uuid')
143
+ self.uuid = attributes[:'uuid']
144
+ end
145
+
146
+ if attributes.key?(:'name')
147
+ self.name = attributes[:'name']
148
+ end
149
+
150
+ if attributes.key?(:'description')
151
+ self.description = attributes[:'description']
152
+ end
153
+
154
+ if attributes.key?(:'dashboard_url')
155
+ self.dashboard_url = attributes[:'dashboard_url']
156
+ end
157
+
158
+ if attributes.key?(:'schedule')
159
+ self.schedule = attributes[:'schedule']
160
+ end
161
+
162
+ if attributes.key?(:'max_concurrency')
163
+ self.max_concurrency = attributes[:'max_concurrency']
164
+ end
165
+
166
+ if attributes.key?(:'max_age_seconds')
167
+ self.max_age_seconds = attributes[:'max_age_seconds']
168
+ end
169
+
170
+ if attributes.key?(:'default_max_retries')
171
+ self.default_max_retries = attributes[:'default_max_retries']
172
+ end
173
+
174
+ if attributes.key?(:'latest_workflow_execution')
175
+ self.latest_workflow_execution = attributes[:'latest_workflow_execution']
176
+ end
177
+
178
+ if attributes.key?(:'created_by_user')
179
+ self.created_by_user = attributes[:'created_by_user']
180
+ end
181
+
182
+ if attributes.key?(:'created_by_group')
183
+ self.created_by_group = attributes[:'created_by_group']
184
+ end
185
+
186
+ if attributes.key?(:'run_environment')
187
+ self.run_environment = attributes[:'run_environment']
188
+ end
189
+
190
+ if attributes.key?(:'enabled')
191
+ self.enabled = attributes[:'enabled']
192
+ end
193
+
194
+ if attributes.key?(:'created_at')
195
+ self.created_at = attributes[:'created_at']
196
+ end
197
+
198
+ if attributes.key?(:'updated_at')
199
+ self.updated_at = attributes[:'updated_at']
200
+ end
201
+
202
+ if attributes.key?(:'alert_methods')
203
+ if (value = attributes[:'alert_methods']).is_a?(Array)
204
+ self.alert_methods = value
205
+ end
206
+ end
207
+
208
+ if attributes.key?(:'workflow_task_instances')
209
+ if (value = attributes[:'workflow_task_instances']).is_a?(Array)
210
+ self.workflow_task_instances = value
211
+ end
212
+ end
213
+
214
+ if attributes.key?(:'workflow_transitions')
215
+ if (value = attributes[:'workflow_transitions']).is_a?(Array)
216
+ self.workflow_transitions = value
217
+ end
218
+ end
219
+ end
220
+
221
+ # Show invalid properties with the reasons. Usually used together with valid?
222
+ # @return Array for valid properties with the reasons
223
+ def list_invalid_properties
224
+ invalid_properties = Array.new
225
+ if @url.nil?
226
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
227
+ end
228
+
229
+ if @uuid.nil?
230
+ invalid_properties.push('invalid value for "uuid", uuid cannot be nil.')
231
+ end
232
+
233
+ if @name.nil?
234
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
235
+ end
236
+
237
+ if @name.to_s.length > 200
238
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 200.')
239
+ end
240
+
241
+ if !@description.nil? && @description.to_s.length > 5000
242
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 5000.')
243
+ end
244
+
245
+ if @dashboard_url.nil?
246
+ invalid_properties.push('invalid value for "dashboard_url", dashboard_url cannot be nil.')
247
+ end
248
+
249
+ if !@schedule.nil? && @schedule.to_s.length > 1000
250
+ invalid_properties.push('invalid value for "schedule", the character length must be smaller than or equal to 1000.')
251
+ end
252
+
253
+ if !@max_concurrency.nil? && @max_concurrency > 2147483647
254
+ invalid_properties.push('invalid value for "max_concurrency", must be smaller than or equal to 2147483647.')
255
+ end
256
+
257
+ if !@max_concurrency.nil? && @max_concurrency < -2147483648
258
+ invalid_properties.push('invalid value for "max_concurrency", must be greater than or equal to -2147483648.')
259
+ end
260
+
261
+ if !@max_age_seconds.nil? && @max_age_seconds > 2147483647
262
+ invalid_properties.push('invalid value for "max_age_seconds", must be smaller than or equal to 2147483647.')
263
+ end
264
+
265
+ if !@max_age_seconds.nil? && @max_age_seconds < -2147483648
266
+ invalid_properties.push('invalid value for "max_age_seconds", must be greater than or equal to -2147483648.')
267
+ end
268
+
269
+ if !@default_max_retries.nil? && @default_max_retries > 2147483647
270
+ invalid_properties.push('invalid value for "default_max_retries", must be smaller than or equal to 2147483647.')
271
+ end
272
+
273
+ if !@default_max_retries.nil? && @default_max_retries < -2147483648
274
+ invalid_properties.push('invalid value for "default_max_retries", must be greater than or equal to -2147483648.')
275
+ end
276
+
277
+ if @created_by_user.nil?
278
+ invalid_properties.push('invalid value for "created_by_user", created_by_user cannot be nil.')
279
+ end
280
+
281
+ if @created_at.nil?
282
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
283
+ end
284
+
285
+ if @updated_at.nil?
286
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
287
+ end
288
+
289
+ if @workflow_task_instances.nil?
290
+ invalid_properties.push('invalid value for "workflow_task_instances", workflow_task_instances cannot be nil.')
291
+ end
292
+
293
+ if @workflow_transitions.nil?
294
+ invalid_properties.push('invalid value for "workflow_transitions", workflow_transitions cannot be nil.')
295
+ end
296
+
297
+ invalid_properties
298
+ end
299
+
300
+ # Check to see if the all the properties in the model are valid
301
+ # @return true if the model is valid
302
+ def valid?
303
+ return false if @url.nil?
304
+ return false if @uuid.nil?
305
+ return false if @name.nil?
306
+ return false if @name.to_s.length > 200
307
+ return false if !@description.nil? && @description.to_s.length > 5000
308
+ return false if @dashboard_url.nil?
309
+ return false if !@schedule.nil? && @schedule.to_s.length > 1000
310
+ return false if !@max_concurrency.nil? && @max_concurrency > 2147483647
311
+ return false if !@max_concurrency.nil? && @max_concurrency < -2147483648
312
+ return false if !@max_age_seconds.nil? && @max_age_seconds > 2147483647
313
+ return false if !@max_age_seconds.nil? && @max_age_seconds < -2147483648
314
+ return false if !@default_max_retries.nil? && @default_max_retries > 2147483647
315
+ return false if !@default_max_retries.nil? && @default_max_retries < -2147483648
316
+ return false if @created_by_user.nil?
317
+ return false if @created_at.nil?
318
+ return false if @updated_at.nil?
319
+ return false if @workflow_task_instances.nil?
320
+ return false if @workflow_transitions.nil?
321
+ true
322
+ end
323
+
324
+ # Custom attribute writer method with validation
325
+ # @param [Object] name Value to be assigned
326
+ def name=(name)
327
+ if name.nil?
328
+ fail ArgumentError, 'name cannot be nil'
329
+ end
330
+
331
+ if name.to_s.length > 200
332
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 200.'
333
+ end
334
+
335
+ @name = name
336
+ end
337
+
338
+ # Custom attribute writer method with validation
339
+ # @param [Object] description Value to be assigned
340
+ def description=(description)
341
+ if !description.nil? && description.to_s.length > 5000
342
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 5000.'
343
+ end
344
+
345
+ @description = description
346
+ end
347
+
348
+ # Custom attribute writer method with validation
349
+ # @param [Object] schedule Value to be assigned
350
+ def schedule=(schedule)
351
+ if !schedule.nil? && schedule.to_s.length > 1000
352
+ fail ArgumentError, 'invalid value for "schedule", the character length must be smaller than or equal to 1000.'
353
+ end
354
+
355
+ @schedule = schedule
356
+ end
357
+
358
+ # Custom attribute writer method with validation
359
+ # @param [Object] max_concurrency Value to be assigned
360
+ def max_concurrency=(max_concurrency)
361
+ if !max_concurrency.nil? && max_concurrency > 2147483647
362
+ fail ArgumentError, 'invalid value for "max_concurrency", must be smaller than or equal to 2147483647.'
363
+ end
364
+
365
+ if !max_concurrency.nil? && max_concurrency < -2147483648
366
+ fail ArgumentError, 'invalid value for "max_concurrency", must be greater than or equal to -2147483648.'
367
+ end
368
+
369
+ @max_concurrency = max_concurrency
370
+ end
371
+
372
+ # Custom attribute writer method with validation
373
+ # @param [Object] max_age_seconds Value to be assigned
374
+ def max_age_seconds=(max_age_seconds)
375
+ if !max_age_seconds.nil? && max_age_seconds > 2147483647
376
+ fail ArgumentError, 'invalid value for "max_age_seconds", must be smaller than or equal to 2147483647.'
377
+ end
378
+
379
+ if !max_age_seconds.nil? && max_age_seconds < -2147483648
380
+ fail ArgumentError, 'invalid value for "max_age_seconds", must be greater than or equal to -2147483648.'
381
+ end
382
+
383
+ @max_age_seconds = max_age_seconds
384
+ end
385
+
386
+ # Custom attribute writer method with validation
387
+ # @param [Object] default_max_retries Value to be assigned
388
+ def default_max_retries=(default_max_retries)
389
+ if !default_max_retries.nil? && default_max_retries > 2147483647
390
+ fail ArgumentError, 'invalid value for "default_max_retries", must be smaller than or equal to 2147483647.'
391
+ end
392
+
393
+ if !default_max_retries.nil? && default_max_retries < -2147483648
394
+ fail ArgumentError, 'invalid value for "default_max_retries", must be greater than or equal to -2147483648.'
395
+ end
396
+
397
+ @default_max_retries = default_max_retries
398
+ end
399
+
400
+ # Checks equality by comparing each attribute.
401
+ # @param [Object] Object to be compared
402
+ def ==(o)
403
+ return true if self.equal?(o)
404
+ self.class == o.class &&
405
+ url == o.url &&
406
+ uuid == o.uuid &&
407
+ name == o.name &&
408
+ description == o.description &&
409
+ dashboard_url == o.dashboard_url &&
410
+ schedule == o.schedule &&
411
+ max_concurrency == o.max_concurrency &&
412
+ max_age_seconds == o.max_age_seconds &&
413
+ default_max_retries == o.default_max_retries &&
414
+ latest_workflow_execution == o.latest_workflow_execution &&
415
+ created_by_user == o.created_by_user &&
416
+ created_by_group == o.created_by_group &&
417
+ run_environment == o.run_environment &&
418
+ enabled == o.enabled &&
419
+ created_at == o.created_at &&
420
+ updated_at == o.updated_at &&
421
+ alert_methods == o.alert_methods &&
422
+ workflow_task_instances == o.workflow_task_instances &&
423
+ workflow_transitions == o.workflow_transitions
424
+ end
425
+
426
+ # @see the `==` method
427
+ # @param [Object] Object to be compared
428
+ def eql?(o)
429
+ self == o
430
+ end
431
+
432
+ # Calculates hash code according to all attributes.
433
+ # @return [Integer] Hash code
434
+ def hash
435
+ [url, uuid, name, description, dashboard_url, schedule, max_concurrency, max_age_seconds, default_max_retries, latest_workflow_execution, created_by_user, created_by_group, run_environment, enabled, created_at, updated_at, alert_methods, workflow_task_instances, workflow_transitions].hash
436
+ end
437
+
438
+ # Builds the object from hash
439
+ # @param [Hash] attributes Model attributes in the form of hash
440
+ # @return [Object] Returns the model itself
441
+ def self.build_from_hash(attributes)
442
+ new.build_from_hash(attributes)
443
+ end
444
+
445
+ # Builds the object from hash
446
+ # @param [Hash] attributes Model attributes in the form of hash
447
+ # @return [Object] Returns the model itself
448
+ def build_from_hash(attributes)
449
+ return nil unless attributes.is_a?(Hash)
450
+ self.class.openapi_types.each_pair do |key, type|
451
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
452
+ self.send("#{key}=", nil)
453
+ elsif type =~ /\AArray<(.*)>/i
454
+ # check to ensure the input is an array given that the attribute
455
+ # is documented as an array but the input is not
456
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
457
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
458
+ end
459
+ elsif !attributes[self.class.attribute_map[key]].nil?
460
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
461
+ end
462
+ end
463
+
464
+ self
465
+ end
466
+
467
+ # Deserializes the data based on type
468
+ # @param string type Data type
469
+ # @param string value Value to be deserialized
470
+ # @return [Object] Deserialized data
471
+ def _deserialize(type, value)
472
+ case type.to_sym
473
+ when :Time
474
+ Time.parse(value)
475
+ when :Date
476
+ Date.parse(value)
477
+ when :String
478
+ value.to_s
479
+ when :Integer
480
+ value.to_i
481
+ when :Float
482
+ value.to_f
483
+ when :Boolean
484
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
485
+ true
486
+ else
487
+ false
488
+ end
489
+ when :Object
490
+ # generic object (usually a Hash), return directly
491
+ value
492
+ when /\AArray<(?<inner_type>.+)>\z/
493
+ inner_type = Regexp.last_match[:inner_type]
494
+ value.map { |v| _deserialize(inner_type, v) }
495
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
496
+ k_type = Regexp.last_match[:k_type]
497
+ v_type = Regexp.last_match[:v_type]
498
+ {}.tap do |hash|
499
+ value.each do |k, v|
500
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
501
+ end
502
+ end
503
+ else # model
504
+ # models (e.g. Pet) or oneOf
505
+ klass = CloudReactorAPIClient.const_get(type)
506
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
507
+ end
508
+ end
509
+
510
+ # Returns the string representation of the object
511
+ # @return [String] String presentation of the object
512
+ def to_s
513
+ to_hash.to_s
514
+ end
515
+
516
+ # to_body is an alias to to_hash (backward compatibility)
517
+ # @return [Hash] Returns the object in the form of hash
518
+ def to_body
519
+ to_hash
520
+ end
521
+
522
+ # Returns the object in the form of hash
523
+ # @return [Hash] Returns the object in the form of hash
524
+ def to_hash
525
+ hash = {}
526
+ self.class.attribute_map.each_pair do |attr, param|
527
+ value = self.send(attr)
528
+ if value.nil?
529
+ is_nullable = self.class.openapi_nullable.include?(attr)
530
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
531
+ end
532
+
533
+ hash[param] = _to_hash(value)
534
+ end
535
+ hash
536
+ end
537
+
538
+ # Outputs non-array value in the form of hash
539
+ # For object, use to_hash. Otherwise, just return the value
540
+ # @param [Object] value Any valid value
541
+ # @return [Hash] Returns the value in the form of hash
542
+ def _to_hash(value)
543
+ if value.is_a?(Array)
544
+ value.compact.map { |v| _to_hash(v) }
545
+ elsif value.is_a?(Hash)
546
+ {}.tap do |hash|
547
+ value.each { |k, v| hash[k] = _to_hash(v) }
548
+ end
549
+ elsif value.respond_to? :to_hash
550
+ value.to_hash
551
+ else
552
+ value
553
+ end
554
+ end
555
+ end
556
+ end