RIC-642 related changes: REST subscription, rnib enhancements, symptomdata, rest...
[ric-plt/xapp-frame-py.git] / ricxappframe / subsclient / models / subscription_instance.py
1 # coding: utf-8
2
3 """
4     RIC subscription
5
6     This is the initial REST API for RIC subscription  # noqa: E501
7
8     OpenAPI spec version: 0.0.4
9     
10     Generated by: https://github.com/swagger-api/swagger-codegen.git
11 """
12
13
14 import pprint
15 import re  # noqa: F401
16
17 import six
18
19 from ricxappframe.subsclient.configuration import Configuration
20
21
22 class SubscriptionInstance(object):
23     """NOTE: This class is auto generated by the swagger code generator program.
24
25     Do not edit the class manually.
26     """
27
28     """
29     Attributes:
30       swagger_types (dict): The key is attribute name
31                             and the value is attribute type.
32       attribute_map (dict): The key is attribute name
33                             and the value is json key in definition.
34     """
35     swagger_types = {
36         'xapp_event_instance_id': 'int',
37         'e2_event_instance_id': 'int',
38         'error_cause': 'str',
39         'error_source': 'str',
40         'timeout_type': 'str'
41     }
42
43     attribute_map = {
44         'xapp_event_instance_id': 'XappEventInstanceId',
45         'e2_event_instance_id': 'E2EventInstanceId',
46         'error_cause': 'ErrorCause',
47         'error_source': 'ErrorSource',
48         'timeout_type': 'TimeoutType'
49     }
50
51     def __init__(self, xapp_event_instance_id=None, e2_event_instance_id=None, error_cause=None, error_source=None, timeout_type=None, _configuration=None):  # noqa: E501
52         """SubscriptionInstance - a model defined in Swagger"""  # noqa: E501
53         if _configuration is None:
54             _configuration = Configuration()
55         self._configuration = _configuration
56
57         self._xapp_event_instance_id = None
58         self._e2_event_instance_id = None
59         self._error_cause = None
60         self._error_source = None
61         self._timeout_type = None
62         self.discriminator = None
63
64         self.xapp_event_instance_id = xapp_event_instance_id
65         self.e2_event_instance_id = e2_event_instance_id
66         if error_cause is not None:
67             self.error_cause = error_cause
68         if error_source is not None:
69             self.error_source = error_source
70         if timeout_type is not None:
71             self.timeout_type = timeout_type
72
73     @property
74     def xapp_event_instance_id(self):
75         """Gets the xapp_event_instance_id of this SubscriptionInstance.  # noqa: E501
76
77
78         :return: The xapp_event_instance_id of this SubscriptionInstance.  # noqa: E501
79         :rtype: int
80         """
81         return self._xapp_event_instance_id
82
83     @xapp_event_instance_id.setter
84     def xapp_event_instance_id(self, xapp_event_instance_id):
85         """Sets the xapp_event_instance_id of this SubscriptionInstance.
86
87
88         :param xapp_event_instance_id: The xapp_event_instance_id of this SubscriptionInstance.  # noqa: E501
89         :type: int
90         """
91         if self._configuration.client_side_validation and xapp_event_instance_id is None:
92             raise ValueError("Invalid value for `xapp_event_instance_id`, must not be `None`")  # noqa: E501
93         if (self._configuration.client_side_validation and
94                 xapp_event_instance_id is not None and xapp_event_instance_id > 65535):  # noqa: E501
95             raise ValueError("Invalid value for `xapp_event_instance_id`, must be a value less than or equal to `65535`")  # noqa: E501
96         if (self._configuration.client_side_validation and
97                 xapp_event_instance_id is not None and xapp_event_instance_id < 0):  # noqa: E501
98             raise ValueError("Invalid value for `xapp_event_instance_id`, must be a value greater than or equal to `0`")  # noqa: E501
99
100         self._xapp_event_instance_id = xapp_event_instance_id
101
102     @property
103     def e2_event_instance_id(self):
104         """Gets the e2_event_instance_id of this SubscriptionInstance.  # noqa: E501
105
106
107         :return: The e2_event_instance_id of this SubscriptionInstance.  # noqa: E501
108         :rtype: int
109         """
110         return self._e2_event_instance_id
111
112     @e2_event_instance_id.setter
113     def e2_event_instance_id(self, e2_event_instance_id):
114         """Sets the e2_event_instance_id of this SubscriptionInstance.
115
116
117         :param e2_event_instance_id: The e2_event_instance_id of this SubscriptionInstance.  # noqa: E501
118         :type: int
119         """
120         if self._configuration.client_side_validation and e2_event_instance_id is None:
121             raise ValueError("Invalid value for `e2_event_instance_id`, must not be `None`")  # noqa: E501
122         if (self._configuration.client_side_validation and
123                 e2_event_instance_id is not None and e2_event_instance_id > 65535):  # noqa: E501
124             raise ValueError("Invalid value for `e2_event_instance_id`, must be a value less than or equal to `65535`")  # noqa: E501
125         if (self._configuration.client_side_validation and
126                 e2_event_instance_id is not None and e2_event_instance_id < 0):  # noqa: E501
127             raise ValueError("Invalid value for `e2_event_instance_id`, must be a value greater than or equal to `0`")  # noqa: E501
128
129         self._e2_event_instance_id = e2_event_instance_id
130
131     @property
132     def error_cause(self):
133         """Gets the error_cause of this SubscriptionInstance.  # noqa: E501
134
135         Descriptive error cause. Empty string when no error.  # noqa: E501
136
137         :return: The error_cause of this SubscriptionInstance.  # noqa: E501
138         :rtype: str
139         """
140         return self._error_cause
141
142     @error_cause.setter
143     def error_cause(self, error_cause):
144         """Sets the error_cause of this SubscriptionInstance.
145
146         Descriptive error cause. Empty string when no error.  # noqa: E501
147
148         :param error_cause: The error_cause of this SubscriptionInstance.  # noqa: E501
149         :type: str
150         """
151
152         self._error_cause = error_cause
153
154     @property
155     def error_source(self):
156         """Gets the error_source of this SubscriptionInstance.  # noqa: E501
157
158         Source of error cause.  # noqa: E501
159
160         :return: The error_source of this SubscriptionInstance.  # noqa: E501
161         :rtype: str
162         """
163         return self._error_source
164
165     @error_source.setter
166     def error_source(self, error_source):
167         """Sets the error_source of this SubscriptionInstance.
168
169         Source of error cause.  # noqa: E501
170
171         :param error_source: The error_source of this SubscriptionInstance.  # noqa: E501
172         :type: str
173         """
174         allowed_values = ["SUBMGR", "RTMGR", "DBAAS", "ASN1", "E2Node"]  # noqa: E501
175         if (self._configuration.client_side_validation and
176                 error_source not in allowed_values):
177             raise ValueError(
178                 "Invalid value for `error_source` ({0}), must be one of {1}"  # noqa: E501
179                 .format(error_source, allowed_values)
180             )
181
182         self._error_source = error_source
183
184     @property
185     def timeout_type(self):
186         """Gets the timeout_type of this SubscriptionInstance.  # noqa: E501
187
188         Type timeout. xApp should retry if timeout occurs.  # noqa: E501
189
190         :return: The timeout_type of this SubscriptionInstance.  # noqa: E501
191         :rtype: str
192         """
193         return self._timeout_type
194
195     @timeout_type.setter
196     def timeout_type(self, timeout_type):
197         """Sets the timeout_type of this SubscriptionInstance.
198
199         Type timeout. xApp should retry if timeout occurs.  # noqa: E501
200
201         :param timeout_type: The timeout_type of this SubscriptionInstance.  # noqa: E501
202         :type: str
203         """
204         allowed_values = ["E2-Timeout", "RTMGR-Timeout", "DBAAS-Timeout"]  # noqa: E501
205         if (self._configuration.client_side_validation and
206                 timeout_type not in allowed_values):
207             raise ValueError(
208                 "Invalid value for `timeout_type` ({0}), must be one of {1}"  # noqa: E501
209                 .format(timeout_type, allowed_values)
210             )
211
212         self._timeout_type = timeout_type
213
214     def to_dict(self):
215         """Returns the model properties as a dict"""
216         result = {}
217
218         for attr, _ in six.iteritems(self.swagger_types):
219             value = getattr(self, attr)
220             if isinstance(value, list):
221                 result[attr] = list(map(
222                     lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
223                     value
224                 ))
225             elif hasattr(value, "to_dict"):
226                 result[attr] = value.to_dict()
227             elif isinstance(value, dict):
228                 result[attr] = dict(map(
229                     lambda item: (item[0], item[1].to_dict())
230                     if hasattr(item[1], "to_dict") else item,
231                     value.items()
232                 ))
233             else:
234                 result[attr] = value
235         if issubclass(SubscriptionInstance, dict):
236             for key, value in self.items():
237                 result[key] = value
238
239         return result
240
241     def to_str(self):
242         """Returns the string representation of the model"""
243         return pprint.pformat(self.to_dict())
244
245     def __repr__(self):
246         """For `print` and `pprint`"""
247         return self.to_str()
248
249     def __eq__(self, other):
250         """Returns true if both objects are equal"""
251         if not isinstance(other, SubscriptionInstance):
252             return False
253
254         return self.to_dict() == other.to_dict()
255
256     def __ne__(self, other):
257         """Returns true if both objects are not equal"""
258         if not isinstance(other, SubscriptionInstance):
259             return True
260
261         return self.to_dict() != other.to_dict()