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