|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +# ----------------------------------------------------------------------------------- |
| 4 | +# <copyright company="Aspose Pty Ltd" file="LicenseInfo.py"> |
| 5 | +# Copyright (c) 2003-2023 Aspose Pty Ltd |
| 6 | +# </copyright> |
| 7 | +# <summary> |
| 8 | +# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 | +# of this software and associated documentation files (the "Software"), to deal |
| 10 | +# in the Software without restriction, including without limitation the rights |
| 11 | +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 12 | +# copies of the Software, and to permit persons to whom the Software is |
| 13 | +# furnished to do so, subject to the following conditions: |
| 14 | +# |
| 15 | +# The above copyright notice and this permission notice shall be included in all |
| 16 | +# copies or substantial portions of the Software. |
| 17 | +# |
| 18 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 21 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 23 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 24 | +# SOFTWARE. |
| 25 | +# </summary> |
| 26 | +# ----------------------------------------------------------------------------------- |
| 27 | + |
| 28 | +import pprint |
| 29 | +import re # noqa: F401 |
| 30 | + |
| 31 | +import six |
| 32 | + |
| 33 | +class LicenseInfo(object): |
| 34 | + """ |
| 35 | + Current license information |
| 36 | + """ |
| 37 | + |
| 38 | + """ |
| 39 | + Attributes: |
| 40 | + swagger_types (dict): The key is attribute name |
| 41 | + and the value is attribute type. |
| 42 | + attribute_map (dict): The key is attribute name |
| 43 | + and the value is json key in definition. |
| 44 | + """ |
| 45 | + swagger_types = { |
| 46 | + 'is_licensed': 'bool' |
| 47 | + } |
| 48 | + |
| 49 | + attribute_map = { |
| 50 | + 'is_licensed': 'IsLicensed' |
| 51 | + } |
| 52 | + |
| 53 | + def __init__(self, is_licensed=None, **kwargs): # noqa: E501 |
| 54 | + """Initializes new instance of LicenseInfo""" # noqa: E501 |
| 55 | + |
| 56 | + self._is_licensed = None |
| 57 | + |
| 58 | + if is_licensed is not None: |
| 59 | + self.is_licensed = is_licensed |
| 60 | + |
| 61 | + @property |
| 62 | + def is_licensed(self): |
| 63 | + """ |
| 64 | + Gets the is_licensed. # noqa: E501 |
| 65 | +
|
| 66 | + True, if license was applied and valid, otherwise False # noqa: E501 |
| 67 | +
|
| 68 | + :return: The is_licensed. # noqa: E501 |
| 69 | + :rtype: bool |
| 70 | + """ |
| 71 | + return self._is_licensed |
| 72 | + |
| 73 | + @is_licensed.setter |
| 74 | + def is_licensed(self, is_licensed): |
| 75 | + """ |
| 76 | + Sets the is_licensed. |
| 77 | +
|
| 78 | + True, if license was applied and valid, otherwise False # noqa: E501 |
| 79 | +
|
| 80 | + :param is_licensed: The is_licensed. # noqa: E501 |
| 81 | + :type: bool |
| 82 | + """ |
| 83 | + if is_licensed is None: |
| 84 | + raise ValueError("Invalid value for `is_licensed`, must not be `None`") # noqa: E501 |
| 85 | + self._is_licensed = is_licensed |
| 86 | + |
| 87 | + def to_dict(self): |
| 88 | + """Returns the model properties as a dict""" |
| 89 | + result = {} |
| 90 | + |
| 91 | + for attr, _ in six.iteritems(self.swagger_types): |
| 92 | + value = getattr(self, attr) |
| 93 | + if isinstance(value, list): |
| 94 | + result[attr] = list(map( |
| 95 | + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, |
| 96 | + value |
| 97 | + )) |
| 98 | + elif hasattr(value, "to_dict"): |
| 99 | + result[attr] = value.to_dict() |
| 100 | + elif isinstance(value, dict): |
| 101 | + result[attr] = dict(map( |
| 102 | + lambda item: (item[0], item[1].to_dict()) |
| 103 | + if hasattr(item[1], "to_dict") else item, |
| 104 | + value.items() |
| 105 | + )) |
| 106 | + else: |
| 107 | + result[attr] = value |
| 108 | + |
| 109 | + return result |
| 110 | + |
| 111 | + def to_str(self): |
| 112 | + """Returns the string representation of the model""" |
| 113 | + return pprint.pformat(self.to_dict()) |
| 114 | + |
| 115 | + def __repr__(self): |
| 116 | + """For `print` and `pprint`""" |
| 117 | + return self.to_str() |
| 118 | + |
| 119 | + def __eq__(self, other): |
| 120 | + """Returns true if both objects are equal""" |
| 121 | + if not isinstance(other, LicenseInfo): |
| 122 | + return False |
| 123 | + |
| 124 | + return self.__dict__ == other.__dict__ |
| 125 | + |
| 126 | + def __ne__(self, other): |
| 127 | + """Returns true if both objects are not equal""" |
| 128 | + return not self == other |
0 commit comments