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