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