|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +# |
| 4 | +# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 5 | +# |
| 6 | +# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file |
| 7 | +# except in compliance with the License. A copy of the License is located at |
| 8 | +# |
| 9 | +# http://aws.amazon.com/apache2.0/ |
| 10 | +# |
| 11 | +# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for |
| 13 | +# the specific language governing permissions and limitations under the License. |
| 14 | +# |
| 15 | + |
| 16 | +import pprint |
| 17 | +import re # noqa: F401 |
| 18 | +import six |
| 19 | +import typing |
| 20 | +from enum import Enum |
| 21 | + |
| 22 | + |
| 23 | +if typing.TYPE_CHECKING: |
| 24 | + from typing import Dict, List, Optional |
| 25 | + from datetime import datetime |
| 26 | + from ask_sdk_model.interfaces.alexa.presentation.apl.runtime import Runtime |
| 27 | + |
| 28 | + |
| 29 | +class AlexaPresentationAplInterface(object): |
| 30 | + """ |
| 31 | +
|
| 32 | + :param runtime: |
| 33 | + :type runtime: (optional) ask_sdk_model.interfaces.alexa.presentation.apl.runtime.Runtime |
| 34 | +
|
| 35 | + """ |
| 36 | + deserialized_types = { |
| 37 | + 'runtime': 'ask_sdk_model.interfaces.alexa.presentation.apl.runtime.Runtime' |
| 38 | + } |
| 39 | + |
| 40 | + attribute_map = { |
| 41 | + 'runtime': 'runtime' |
| 42 | + } |
| 43 | + |
| 44 | + def __init__(self, runtime=None): |
| 45 | + # type: (Optional[Runtime]) -> None |
| 46 | + """ |
| 47 | +
|
| 48 | + :param runtime: |
| 49 | + :type runtime: (optional) ask_sdk_model.interfaces.alexa.presentation.apl.runtime.Runtime |
| 50 | + """ |
| 51 | + self.__discriminator_value = None |
| 52 | + |
| 53 | + self.runtime = runtime |
| 54 | + |
| 55 | + def to_dict(self): |
| 56 | + # type: () -> Dict[str, object] |
| 57 | + """Returns the model properties as a dict""" |
| 58 | + result = {} |
| 59 | + |
| 60 | + for attr, _ in six.iteritems(self.deserialized_types): |
| 61 | + value = getattr(self, attr) |
| 62 | + if isinstance(value, list): |
| 63 | + result[attr] = list(map( |
| 64 | + lambda x: x.to_dict() if hasattr(x, "to_dict") else |
| 65 | + x.value if isinstance(x, Enum) else x, |
| 66 | + value |
| 67 | + )) |
| 68 | + elif isinstance(value, Enum): |
| 69 | + result[attr] = value.value |
| 70 | + elif hasattr(value, "to_dict"): |
| 71 | + result[attr] = value.to_dict() |
| 72 | + elif isinstance(value, dict): |
| 73 | + result[attr] = dict(map( |
| 74 | + lambda item: (item[0], item[1].to_dict()) |
| 75 | + if hasattr(item[1], "to_dict") else |
| 76 | + (item[0], item[1].value) |
| 77 | + if isinstance(item[1], Enum) else item, |
| 78 | + value.items() |
| 79 | + )) |
| 80 | + else: |
| 81 | + result[attr] = value |
| 82 | + |
| 83 | + return result |
| 84 | + |
| 85 | + def to_str(self): |
| 86 | + # type: () -> str |
| 87 | + """Returns the string representation of the model""" |
| 88 | + return pprint.pformat(self.to_dict()) |
| 89 | + |
| 90 | + def __repr__(self): |
| 91 | + # type: () -> str |
| 92 | + """For `print` and `pprint`""" |
| 93 | + return self.to_str() |
| 94 | + |
| 95 | + def __eq__(self, other): |
| 96 | + # type: (object) -> bool |
| 97 | + """Returns true if both objects are equal""" |
| 98 | + if not isinstance(other, AlexaPresentationAplInterface): |
| 99 | + return False |
| 100 | + |
| 101 | + return self.__dict__ == other.__dict__ |
| 102 | + |
| 103 | + def __ne__(self, other): |
| 104 | + # type: (object) -> bool |
| 105 | + """Returns true if both objects are not equal""" |
| 106 | + return not self == other |
0 commit comments