Mercurial > repos > shellac > guppy_basecaller
comparison env/lib/python3.7/site-packages/boto/beanstalk/response.py @ 2:6af9afd405e9 draft
"planemo upload commit 0a63dd5f4d38a1f6944587f52a8cd79874177fc1"
author | shellac |
---|---|
date | Thu, 14 May 2020 14:56:58 -0400 |
parents | 26e78fe6e8c4 |
children |
comparison
equal
deleted
inserted
replaced
1:75ca89e9b81c | 2:6af9afd405e9 |
---|---|
1 """Classify responses from layer1 and strict type values.""" | |
2 from datetime import datetime | |
3 from boto.compat import six | |
4 | |
5 | |
6 class BaseObject(object): | |
7 | |
8 def __repr__(self): | |
9 result = self.__class__.__name__ + '{ ' | |
10 counter = 0 | |
11 for key, value in six.iteritems(self.__dict__): | |
12 # first iteration no comma | |
13 counter += 1 | |
14 if counter > 1: | |
15 result += ', ' | |
16 result += key + ': ' | |
17 result += self._repr_by_type(value) | |
18 result += ' }' | |
19 return result | |
20 | |
21 def _repr_by_type(self, value): | |
22 # Everything is either a 'Response', 'list', or 'None/str/int/bool'. | |
23 result = '' | |
24 if isinstance(value, Response): | |
25 result += value.__repr__() | |
26 elif isinstance(value, list): | |
27 result += self._repr_list(value) | |
28 else: | |
29 result += str(value) | |
30 return result | |
31 | |
32 def _repr_list(self, array): | |
33 result = '[' | |
34 for value in array: | |
35 result += ' ' + self._repr_by_type(value) + ',' | |
36 # Check for trailing comma with a space. | |
37 if len(result) > 1: | |
38 result = result[:-1] + ' ' | |
39 result += ']' | |
40 return result | |
41 | |
42 | |
43 class Response(BaseObject): | |
44 def __init__(self, response): | |
45 super(Response, self).__init__() | |
46 | |
47 if response['ResponseMetadata']: | |
48 self.response_metadata = ResponseMetadata(response['ResponseMetadata']) | |
49 else: | |
50 self.response_metadata = None | |
51 | |
52 | |
53 class ResponseMetadata(BaseObject): | |
54 def __init__(self, response): | |
55 super(ResponseMetadata, self).__init__() | |
56 | |
57 self.request_id = str(response['RequestId']) | |
58 | |
59 | |
60 class ApplicationDescription(BaseObject): | |
61 def __init__(self, response): | |
62 super(ApplicationDescription, self).__init__() | |
63 | |
64 self.application_name = str(response['ApplicationName']) | |
65 self.configuration_templates = [] | |
66 if response['ConfigurationTemplates']: | |
67 for member in response['ConfigurationTemplates']: | |
68 configuration_template = str(member) | |
69 self.configuration_templates.append(configuration_template) | |
70 self.date_created = datetime.fromtimestamp(response['DateCreated']) | |
71 self.date_updated = datetime.fromtimestamp(response['DateUpdated']) | |
72 self.description = str(response['Description']) | |
73 self.versions = [] | |
74 if response['Versions']: | |
75 for member in response['Versions']: | |
76 version = str(member) | |
77 self.versions.append(version) | |
78 | |
79 | |
80 class ApplicationVersionDescription(BaseObject): | |
81 def __init__(self, response): | |
82 super(ApplicationVersionDescription, self).__init__() | |
83 | |
84 self.application_name = str(response['ApplicationName']) | |
85 self.date_created = datetime.fromtimestamp(response['DateCreated']) | |
86 self.date_updated = datetime.fromtimestamp(response['DateUpdated']) | |
87 self.description = str(response['Description']) | |
88 if response['SourceBundle']: | |
89 self.source_bundle = S3Location(response['SourceBundle']) | |
90 else: | |
91 self.source_bundle = None | |
92 self.version_label = str(response['VersionLabel']) | |
93 | |
94 | |
95 class AutoScalingGroup(BaseObject): | |
96 def __init__(self, response): | |
97 super(AutoScalingGroup, self).__init__() | |
98 | |
99 self.name = str(response['Name']) | |
100 | |
101 | |
102 class ConfigurationOptionDescription(BaseObject): | |
103 def __init__(self, response): | |
104 super(ConfigurationOptionDescription, self).__init__() | |
105 | |
106 self.change_severity = str(response['ChangeSeverity']) | |
107 self.default_value = str(response['DefaultValue']) | |
108 self.max_length = int(response['MaxLength']) if response['MaxLength'] else None | |
109 self.max_value = int(response['MaxValue']) if response['MaxValue'] else None | |
110 self.min_value = int(response['MinValue']) if response['MinValue'] else None | |
111 self.name = str(response['Name']) | |
112 self.namespace = str(response['Namespace']) | |
113 if response['Regex']: | |
114 self.regex = OptionRestrictionRegex(response['Regex']) | |
115 else: | |
116 self.regex = None | |
117 self.user_defined = str(response['UserDefined']) | |
118 self.value_options = [] | |
119 if response['ValueOptions']: | |
120 for member in response['ValueOptions']: | |
121 value_option = str(member) | |
122 self.value_options.append(value_option) | |
123 self.value_type = str(response['ValueType']) | |
124 | |
125 | |
126 class ConfigurationOptionSetting(BaseObject): | |
127 def __init__(self, response): | |
128 super(ConfigurationOptionSetting, self).__init__() | |
129 | |
130 self.namespace = str(response['Namespace']) | |
131 self.option_name = str(response['OptionName']) | |
132 self.value = str(response['Value']) | |
133 | |
134 | |
135 class ConfigurationSettingsDescription(BaseObject): | |
136 def __init__(self, response): | |
137 super(ConfigurationSettingsDescription, self).__init__() | |
138 | |
139 self.application_name = str(response['ApplicationName']) | |
140 self.date_created = datetime.fromtimestamp(response['DateCreated']) | |
141 self.date_updated = datetime.fromtimestamp(response['DateUpdated']) | |
142 self.deployment_status = str(response['DeploymentStatus']) | |
143 self.description = str(response['Description']) | |
144 self.environment_name = str(response['EnvironmentName']) | |
145 self.option_settings = [] | |
146 if response['OptionSettings']: | |
147 for member in response['OptionSettings']: | |
148 option_setting = ConfigurationOptionSetting(member) | |
149 self.option_settings.append(option_setting) | |
150 self.solution_stack_name = str(response['SolutionStackName']) | |
151 self.template_name = str(response['TemplateName']) | |
152 | |
153 | |
154 class EnvironmentDescription(BaseObject): | |
155 def __init__(self, response): | |
156 super(EnvironmentDescription, self).__init__() | |
157 | |
158 self.application_name = str(response['ApplicationName']) | |
159 self.cname = str(response['CNAME']) | |
160 self.date_created = datetime.fromtimestamp(response['DateCreated']) | |
161 self.date_updated = datetime.fromtimestamp(response['DateUpdated']) | |
162 self.description = str(response['Description']) | |
163 self.endpoint_url = str(response['EndpointURL']) | |
164 self.environment_id = str(response['EnvironmentId']) | |
165 self.environment_name = str(response['EnvironmentName']) | |
166 self.health = str(response['Health']) | |
167 if response['Resources']: | |
168 self.resources = EnvironmentResourcesDescription(response['Resources']) | |
169 else: | |
170 self.resources = None | |
171 self.solution_stack_name = str(response['SolutionStackName']) | |
172 self.status = str(response['Status']) | |
173 self.template_name = str(response['TemplateName']) | |
174 self.version_label = str(response['VersionLabel']) | |
175 | |
176 | |
177 class EnvironmentInfoDescription(BaseObject): | |
178 def __init__(self, response): | |
179 super(EnvironmentInfoDescription, self).__init__() | |
180 | |
181 self.ec2_instance_id = str(response['Ec2InstanceId']) | |
182 self.info_type = str(response['InfoType']) | |
183 self.message = str(response['Message']) | |
184 self.sample_timestamp = datetime.fromtimestamp(response['SampleTimestamp']) | |
185 | |
186 | |
187 class EnvironmentResourceDescription(BaseObject): | |
188 def __init__(self, response): | |
189 super(EnvironmentResourceDescription, self).__init__() | |
190 | |
191 self.auto_scaling_groups = [] | |
192 if response['AutoScalingGroups']: | |
193 for member in response['AutoScalingGroups']: | |
194 auto_scaling_group = AutoScalingGroup(member) | |
195 self.auto_scaling_groups.append(auto_scaling_group) | |
196 self.environment_name = str(response['EnvironmentName']) | |
197 self.instances = [] | |
198 if response['Instances']: | |
199 for member in response['Instances']: | |
200 instance = Instance(member) | |
201 self.instances.append(instance) | |
202 self.launch_configurations = [] | |
203 if response['LaunchConfigurations']: | |
204 for member in response['LaunchConfigurations']: | |
205 launch_configuration = LaunchConfiguration(member) | |
206 self.launch_configurations.append(launch_configuration) | |
207 self.load_balancers = [] | |
208 if response['LoadBalancers']: | |
209 for member in response['LoadBalancers']: | |
210 load_balancer = LoadBalancer(member) | |
211 self.load_balancers.append(load_balancer) | |
212 self.triggers = [] | |
213 if response['Triggers']: | |
214 for member in response['Triggers']: | |
215 trigger = Trigger(member) | |
216 self.triggers.append(trigger) | |
217 | |
218 | |
219 class EnvironmentResourcesDescription(BaseObject): | |
220 def __init__(self, response): | |
221 super(EnvironmentResourcesDescription, self).__init__() | |
222 | |
223 if response['LoadBalancer']: | |
224 self.load_balancer = LoadBalancerDescription(response['LoadBalancer']) | |
225 else: | |
226 self.load_balancer = None | |
227 | |
228 | |
229 class EventDescription(BaseObject): | |
230 def __init__(self, response): | |
231 super(EventDescription, self).__init__() | |
232 | |
233 self.application_name = str(response['ApplicationName']) | |
234 self.environment_name = str(response['EnvironmentName']) | |
235 self.event_date = datetime.fromtimestamp(response['EventDate']) | |
236 self.message = str(response['Message']) | |
237 self.request_id = str(response['RequestId']) | |
238 self.severity = str(response['Severity']) | |
239 self.template_name = str(response['TemplateName']) | |
240 self.version_label = str(response['VersionLabel']) | |
241 | |
242 | |
243 class Instance(BaseObject): | |
244 def __init__(self, response): | |
245 super(Instance, self).__init__() | |
246 | |
247 self.id = str(response['Id']) | |
248 | |
249 | |
250 class LaunchConfiguration(BaseObject): | |
251 def __init__(self, response): | |
252 super(LaunchConfiguration, self).__init__() | |
253 | |
254 self.name = str(response['Name']) | |
255 | |
256 | |
257 class Listener(BaseObject): | |
258 def __init__(self, response): | |
259 super(Listener, self).__init__() | |
260 | |
261 self.port = int(response['Port']) if response['Port'] else None | |
262 self.protocol = str(response['Protocol']) | |
263 | |
264 | |
265 class LoadBalancer(BaseObject): | |
266 def __init__(self, response): | |
267 super(LoadBalancer, self).__init__() | |
268 | |
269 self.name = str(response['Name']) | |
270 | |
271 | |
272 class LoadBalancerDescription(BaseObject): | |
273 def __init__(self, response): | |
274 super(LoadBalancerDescription, self).__init__() | |
275 | |
276 self.domain = str(response['Domain']) | |
277 self.listeners = [] | |
278 if response['Listeners']: | |
279 for member in response['Listeners']: | |
280 listener = Listener(member) | |
281 self.listeners.append(listener) | |
282 self.load_balancer_name = str(response['LoadBalancerName']) | |
283 | |
284 | |
285 class OptionRestrictionRegex(BaseObject): | |
286 def __init__(self, response): | |
287 super(OptionRestrictionRegex, self).__init__() | |
288 | |
289 self.label = response['Label'] | |
290 self.pattern = response['Pattern'] | |
291 | |
292 | |
293 class SolutionStackDescription(BaseObject): | |
294 def __init__(self, response): | |
295 super(SolutionStackDescription, self).__init__() | |
296 | |
297 self.permitted_file_types = [] | |
298 if response['PermittedFileTypes']: | |
299 for member in response['PermittedFileTypes']: | |
300 permitted_file_type = str(member) | |
301 self.permitted_file_types.append(permitted_file_type) | |
302 self.solution_stack_name = str(response['SolutionStackName']) | |
303 | |
304 | |
305 class S3Location(BaseObject): | |
306 def __init__(self, response): | |
307 super(S3Location, self).__init__() | |
308 | |
309 self.s3_bucket = str(response['S3Bucket']) | |
310 self.s3_key = str(response['S3Key']) | |
311 | |
312 | |
313 class Trigger(BaseObject): | |
314 def __init__(self, response): | |
315 super(Trigger, self).__init__() | |
316 | |
317 self.name = str(response['Name']) | |
318 | |
319 | |
320 class ValidationMessage(BaseObject): | |
321 def __init__(self, response): | |
322 super(ValidationMessage, self).__init__() | |
323 | |
324 self.message = str(response['Message']) | |
325 self.namespace = str(response['Namespace']) | |
326 self.option_name = str(response['OptionName']) | |
327 self.severity = str(response['Severity']) | |
328 | |
329 | |
330 # These are the response objects layer2 uses, one for each layer1 api call. | |
331 class CheckDNSAvailabilityResponse(Response): | |
332 def __init__(self, response): | |
333 response = response['CheckDNSAvailabilityResponse'] | |
334 super(CheckDNSAvailabilityResponse, self).__init__(response) | |
335 | |
336 response = response['CheckDNSAvailabilityResult'] | |
337 self.fully_qualified_cname = str(response['FullyQualifiedCNAME']) | |
338 self.available = bool(response['Available']) | |
339 | |
340 | |
341 # Our naming convension produces this class name but api names it with more | |
342 # capitals. | |
343 class CheckDnsAvailabilityResponse(CheckDNSAvailabilityResponse): pass | |
344 | |
345 | |
346 class CreateApplicationResponse(Response): | |
347 def __init__(self, response): | |
348 response = response['CreateApplicationResponse'] | |
349 super(CreateApplicationResponse, self).__init__(response) | |
350 | |
351 response = response['CreateApplicationResult'] | |
352 if response['Application']: | |
353 self.application = ApplicationDescription(response['Application']) | |
354 else: | |
355 self.application = None | |
356 | |
357 | |
358 class CreateApplicationVersionResponse(Response): | |
359 def __init__(self, response): | |
360 response = response['CreateApplicationVersionResponse'] | |
361 super(CreateApplicationVersionResponse, self).__init__(response) | |
362 | |
363 response = response['CreateApplicationVersionResult'] | |
364 if response['ApplicationVersion']: | |
365 self.application_version = ApplicationVersionDescription(response['ApplicationVersion']) | |
366 else: | |
367 self.application_version = None | |
368 | |
369 | |
370 class CreateConfigurationTemplateResponse(Response): | |
371 def __init__(self, response): | |
372 response = response['CreateConfigurationTemplateResponse'] | |
373 super(CreateConfigurationTemplateResponse, self).__init__(response) | |
374 | |
375 response = response['CreateConfigurationTemplateResult'] | |
376 self.application_name = str(response['ApplicationName']) | |
377 self.date_created = datetime.fromtimestamp(response['DateCreated']) | |
378 self.date_updated = datetime.fromtimestamp(response['DateUpdated']) | |
379 self.deployment_status = str(response['DeploymentStatus']) | |
380 self.description = str(response['Description']) | |
381 self.environment_name = str(response['EnvironmentName']) | |
382 self.option_settings = [] | |
383 if response['OptionSettings']: | |
384 for member in response['OptionSettings']: | |
385 option_setting = ConfigurationOptionSetting(member) | |
386 self.option_settings.append(option_setting) | |
387 self.solution_stack_name = str(response['SolutionStackName']) | |
388 self.template_name = str(response['TemplateName']) | |
389 | |
390 | |
391 class CreateEnvironmentResponse(Response): | |
392 def __init__(self, response): | |
393 response = response['CreateEnvironmentResponse'] | |
394 super(CreateEnvironmentResponse, self).__init__(response) | |
395 | |
396 response = response['CreateEnvironmentResult'] | |
397 self.application_name = str(response['ApplicationName']) | |
398 self.cname = str(response['CNAME']) | |
399 self.date_created = datetime.fromtimestamp(response['DateCreated']) | |
400 self.date_updated = datetime.fromtimestamp(response['DateUpdated']) | |
401 self.description = str(response['Description']) | |
402 self.endpoint_url = str(response['EndpointURL']) | |
403 self.environment_id = str(response['EnvironmentId']) | |
404 self.environment_name = str(response['EnvironmentName']) | |
405 self.health = str(response['Health']) | |
406 if response['Resources']: | |
407 self.resources = EnvironmentResourcesDescription(response['Resources']) | |
408 else: | |
409 self.resources = None | |
410 self.solution_stack_name = str(response['SolutionStackName']) | |
411 self.status = str(response['Status']) | |
412 self.template_name = str(response['TemplateName']) | |
413 self.version_label = str(response['VersionLabel']) | |
414 | |
415 | |
416 class CreateStorageLocationResponse(Response): | |
417 def __init__(self, response): | |
418 response = response['CreateStorageLocationResponse'] | |
419 super(CreateStorageLocationResponse, self).__init__(response) | |
420 | |
421 response = response['CreateStorageLocationResult'] | |
422 self.s3_bucket = str(response['S3Bucket']) | |
423 | |
424 | |
425 class DeleteApplicationResponse(Response): | |
426 def __init__(self, response): | |
427 response = response['DeleteApplicationResponse'] | |
428 super(DeleteApplicationResponse, self).__init__(response) | |
429 | |
430 | |
431 class DeleteApplicationVersionResponse(Response): | |
432 def __init__(self, response): | |
433 response = response['DeleteApplicationVersionResponse'] | |
434 super(DeleteApplicationVersionResponse, self).__init__(response) | |
435 | |
436 | |
437 class DeleteConfigurationTemplateResponse(Response): | |
438 def __init__(self, response): | |
439 response = response['DeleteConfigurationTemplateResponse'] | |
440 super(DeleteConfigurationTemplateResponse, self).__init__(response) | |
441 | |
442 | |
443 class DeleteEnvironmentConfigurationResponse(Response): | |
444 def __init__(self, response): | |
445 response = response['DeleteEnvironmentConfigurationResponse'] | |
446 super(DeleteEnvironmentConfigurationResponse, self).__init__(response) | |
447 | |
448 | |
449 class DescribeApplicationVersionsResponse(Response): | |
450 def __init__(self, response): | |
451 response = response['DescribeApplicationVersionsResponse'] | |
452 super(DescribeApplicationVersionsResponse, self).__init__(response) | |
453 | |
454 response = response['DescribeApplicationVersionsResult'] | |
455 self.application_versions = [] | |
456 if response['ApplicationVersions']: | |
457 for member in response['ApplicationVersions']: | |
458 application_version = ApplicationVersionDescription(member) | |
459 self.application_versions.append(application_version) | |
460 | |
461 | |
462 class DescribeApplicationsResponse(Response): | |
463 def __init__(self, response): | |
464 response = response['DescribeApplicationsResponse'] | |
465 super(DescribeApplicationsResponse, self).__init__(response) | |
466 | |
467 response = response['DescribeApplicationsResult'] | |
468 self.applications = [] | |
469 if response['Applications']: | |
470 for member in response['Applications']: | |
471 application = ApplicationDescription(member) | |
472 self.applications.append(application) | |
473 | |
474 | |
475 class DescribeConfigurationOptionsResponse(Response): | |
476 def __init__(self, response): | |
477 response = response['DescribeConfigurationOptionsResponse'] | |
478 super(DescribeConfigurationOptionsResponse, self).__init__(response) | |
479 | |
480 response = response['DescribeConfigurationOptionsResult'] | |
481 self.options = [] | |
482 if response['Options']: | |
483 for member in response['Options']: | |
484 option = ConfigurationOptionDescription(member) | |
485 self.options.append(option) | |
486 self.solution_stack_name = str(response['SolutionStackName']) | |
487 | |
488 | |
489 class DescribeConfigurationSettingsResponse(Response): | |
490 def __init__(self, response): | |
491 response = response['DescribeConfigurationSettingsResponse'] | |
492 super(DescribeConfigurationSettingsResponse, self).__init__(response) | |
493 | |
494 response = response['DescribeConfigurationSettingsResult'] | |
495 self.configuration_settings = [] | |
496 if response['ConfigurationSettings']: | |
497 for member in response['ConfigurationSettings']: | |
498 configuration_setting = ConfigurationSettingsDescription(member) | |
499 self.configuration_settings.append(configuration_setting) | |
500 | |
501 | |
502 class DescribeEnvironmentResourcesResponse(Response): | |
503 def __init__(self, response): | |
504 response = response['DescribeEnvironmentResourcesResponse'] | |
505 super(DescribeEnvironmentResourcesResponse, self).__init__(response) | |
506 | |
507 response = response['DescribeEnvironmentResourcesResult'] | |
508 if response['EnvironmentResources']: | |
509 self.environment_resources = EnvironmentResourceDescription(response['EnvironmentResources']) | |
510 else: | |
511 self.environment_resources = None | |
512 | |
513 | |
514 class DescribeEnvironmentsResponse(Response): | |
515 def __init__(self, response): | |
516 response = response['DescribeEnvironmentsResponse'] | |
517 super(DescribeEnvironmentsResponse, self).__init__(response) | |
518 | |
519 response = response['DescribeEnvironmentsResult'] | |
520 self.environments = [] | |
521 if response['Environments']: | |
522 for member in response['Environments']: | |
523 environment = EnvironmentDescription(member) | |
524 self.environments.append(environment) | |
525 | |
526 | |
527 class DescribeEventsResponse(Response): | |
528 def __init__(self, response): | |
529 response = response['DescribeEventsResponse'] | |
530 super(DescribeEventsResponse, self).__init__(response) | |
531 | |
532 response = response['DescribeEventsResult'] | |
533 self.events = [] | |
534 if response['Events']: | |
535 for member in response['Events']: | |
536 event = EventDescription(member) | |
537 self.events.append(event) | |
538 self.next_tokent = str(response['NextToken']) | |
539 | |
540 | |
541 class ListAvailableSolutionStacksResponse(Response): | |
542 def __init__(self, response): | |
543 response = response['ListAvailableSolutionStacksResponse'] | |
544 super(ListAvailableSolutionStacksResponse, self).__init__(response) | |
545 | |
546 response = response['ListAvailableSolutionStacksResult'] | |
547 self.solution_stack_details = [] | |
548 if response['SolutionStackDetails']: | |
549 for member in response['SolutionStackDetails']: | |
550 solution_stack_detail = SolutionStackDescription(member) | |
551 self.solution_stack_details.append(solution_stack_detail) | |
552 self.solution_stacks = [] | |
553 if response['SolutionStacks']: | |
554 for member in response['SolutionStacks']: | |
555 solution_stack = str(member) | |
556 self.solution_stacks.append(solution_stack) | |
557 | |
558 | |
559 class RebuildEnvironmentResponse(Response): | |
560 def __init__(self, response): | |
561 response = response['RebuildEnvironmentResponse'] | |
562 super(RebuildEnvironmentResponse, self).__init__(response) | |
563 | |
564 | |
565 class RequestEnvironmentInfoResponse(Response): | |
566 def __init__(self, response): | |
567 response = response['RequestEnvironmentInfoResponse'] | |
568 super(RequestEnvironmentInfoResponse, self).__init__(response) | |
569 | |
570 | |
571 class RestartAppServerResponse(Response): | |
572 def __init__(self, response): | |
573 response = response['RestartAppServerResponse'] | |
574 super(RestartAppServerResponse, self).__init__(response) | |
575 | |
576 | |
577 class RetrieveEnvironmentInfoResponse(Response): | |
578 def __init__(self, response): | |
579 response = response['RetrieveEnvironmentInfoResponse'] | |
580 super(RetrieveEnvironmentInfoResponse, self).__init__(response) | |
581 | |
582 response = response['RetrieveEnvironmentInfoResult'] | |
583 self.environment_info = [] | |
584 if response['EnvironmentInfo']: | |
585 for member in response['EnvironmentInfo']: | |
586 environment_info = EnvironmentInfoDescription(member) | |
587 self.environment_info.append(environment_info) | |
588 | |
589 | |
590 class SwapEnvironmentCNAMEsResponse(Response): | |
591 def __init__(self, response): | |
592 response = response['SwapEnvironmentCNAMEsResponse'] | |
593 super(SwapEnvironmentCNAMEsResponse, self).__init__(response) | |
594 | |
595 | |
596 class SwapEnvironmentCnamesResponse(SwapEnvironmentCNAMEsResponse): pass | |
597 | |
598 | |
599 class TerminateEnvironmentResponse(Response): | |
600 def __init__(self, response): | |
601 response = response['TerminateEnvironmentResponse'] | |
602 super(TerminateEnvironmentResponse, self).__init__(response) | |
603 | |
604 response = response['TerminateEnvironmentResult'] | |
605 self.application_name = str(response['ApplicationName']) | |
606 self.cname = str(response['CNAME']) | |
607 self.date_created = datetime.fromtimestamp(response['DateCreated']) | |
608 self.date_updated = datetime.fromtimestamp(response['DateUpdated']) | |
609 self.description = str(response['Description']) | |
610 self.endpoint_url = str(response['EndpointURL']) | |
611 self.environment_id = str(response['EnvironmentId']) | |
612 self.environment_name = str(response['EnvironmentName']) | |
613 self.health = str(response['Health']) | |
614 if response['Resources']: | |
615 self.resources = EnvironmentResourcesDescription(response['Resources']) | |
616 else: | |
617 self.resources = None | |
618 self.solution_stack_name = str(response['SolutionStackName']) | |
619 self.status = str(response['Status']) | |
620 self.template_name = str(response['TemplateName']) | |
621 self.version_label = str(response['VersionLabel']) | |
622 | |
623 | |
624 class UpdateApplicationResponse(Response): | |
625 def __init__(self, response): | |
626 response = response['UpdateApplicationResponse'] | |
627 super(UpdateApplicationResponse, self).__init__(response) | |
628 | |
629 response = response['UpdateApplicationResult'] | |
630 if response['Application']: | |
631 self.application = ApplicationDescription(response['Application']) | |
632 else: | |
633 self.application = None | |
634 | |
635 | |
636 class UpdateApplicationVersionResponse(Response): | |
637 def __init__(self, response): | |
638 response = response['UpdateApplicationVersionResponse'] | |
639 super(UpdateApplicationVersionResponse, self).__init__(response) | |
640 | |
641 response = response['UpdateApplicationVersionResult'] | |
642 if response['ApplicationVersion']: | |
643 self.application_version = ApplicationVersionDescription(response['ApplicationVersion']) | |
644 else: | |
645 self.application_version = None | |
646 | |
647 | |
648 class UpdateConfigurationTemplateResponse(Response): | |
649 def __init__(self, response): | |
650 response = response['UpdateConfigurationTemplateResponse'] | |
651 super(UpdateConfigurationTemplateResponse, self).__init__(response) | |
652 | |
653 response = response['UpdateConfigurationTemplateResult'] | |
654 self.application_name = str(response['ApplicationName']) | |
655 self.date_created = datetime.fromtimestamp(response['DateCreated']) | |
656 self.date_updated = datetime.fromtimestamp(response['DateUpdated']) | |
657 self.deployment_status = str(response['DeploymentStatus']) | |
658 self.description = str(response['Description']) | |
659 self.environment_name = str(response['EnvironmentName']) | |
660 self.option_settings = [] | |
661 if response['OptionSettings']: | |
662 for member in response['OptionSettings']: | |
663 option_setting = ConfigurationOptionSetting(member) | |
664 self.option_settings.append(option_setting) | |
665 self.solution_stack_name = str(response['SolutionStackName']) | |
666 self.template_name = str(response['TemplateName']) | |
667 | |
668 | |
669 class UpdateEnvironmentResponse(Response): | |
670 def __init__(self, response): | |
671 response = response['UpdateEnvironmentResponse'] | |
672 super(UpdateEnvironmentResponse, self).__init__(response) | |
673 | |
674 response = response['UpdateEnvironmentResult'] | |
675 self.application_name = str(response['ApplicationName']) | |
676 self.cname = str(response['CNAME']) | |
677 self.date_created = datetime.fromtimestamp(response['DateCreated']) | |
678 self.date_updated = datetime.fromtimestamp(response['DateUpdated']) | |
679 self.description = str(response['Description']) | |
680 self.endpoint_url = str(response['EndpointURL']) | |
681 self.environment_id = str(response['EnvironmentId']) | |
682 self.environment_name = str(response['EnvironmentName']) | |
683 self.health = str(response['Health']) | |
684 if response['Resources']: | |
685 self.resources = EnvironmentResourcesDescription(response['Resources']) | |
686 else: | |
687 self.resources = None | |
688 self.solution_stack_name = str(response['SolutionStackName']) | |
689 self.status = str(response['Status']) | |
690 self.template_name = str(response['TemplateName']) | |
691 self.version_label = str(response['VersionLabel']) | |
692 | |
693 | |
694 class ValidateConfigurationSettingsResponse(Response): | |
695 def __init__(self, response): | |
696 response = response['ValidateConfigurationSettingsResponse'] | |
697 super(ValidateConfigurationSettingsResponse, self).__init__(response) | |
698 | |
699 response = response['ValidateConfigurationSettingsResult'] | |
700 self.messages = [] | |
701 if response['Messages']: | |
702 for member in response['Messages']: | |
703 message = ValidationMessage(member) | |
704 self.messages.append(message) |