6 This is the initial REST API for RIC subscription # noqa: E501
8 OpenAPI spec version: 0.0.4
10 Generated by: https://github.com/swagger-api/swagger-codegen.git
15 import re # noqa: F401
19 from ricxappframe.subsclient.configuration import Configuration
22 class SubscriptionInstance(object):
23 """NOTE: This class is auto generated by the swagger code generator program.
25 Do not edit the class manually.
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.
36 'xapp_event_instance_id': 'int',
37 'e2_event_instance_id': 'int',
39 'error_source': 'str',
44 'xapp_event_instance_id': 'XappEventInstanceId',
45 'e2_event_instance_id': 'E2EventInstanceId',
46 'error_cause': 'ErrorCause',
47 'error_source': 'ErrorSource',
48 'timeout_type': 'TimeoutType'
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
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
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
74 def xapp_event_instance_id(self):
75 """Gets the xapp_event_instance_id of this SubscriptionInstance. # noqa: E501
78 :return: The xapp_event_instance_id of this SubscriptionInstance. # noqa: E501
81 return self._xapp_event_instance_id
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.
88 :param xapp_event_instance_id: The xapp_event_instance_id of this SubscriptionInstance. # noqa: E501
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
100 self._xapp_event_instance_id = xapp_event_instance_id
103 def e2_event_instance_id(self):
104 """Gets the e2_event_instance_id of this SubscriptionInstance. # noqa: E501
107 :return: The e2_event_instance_id of this SubscriptionInstance. # noqa: E501
110 return self._e2_event_instance_id
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.
117 :param e2_event_instance_id: The e2_event_instance_id of this SubscriptionInstance. # noqa: E501
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
129 self._e2_event_instance_id = e2_event_instance_id
132 def error_cause(self):
133 """Gets the error_cause of this SubscriptionInstance. # noqa: E501
135 Descriptive error cause. Empty string when no error. # noqa: E501
137 :return: The error_cause of this SubscriptionInstance. # noqa: E501
140 return self._error_cause
143 def error_cause(self, error_cause):
144 """Sets the error_cause of this SubscriptionInstance.
146 Descriptive error cause. Empty string when no error. # noqa: E501
148 :param error_cause: The error_cause of this SubscriptionInstance. # noqa: E501
152 self._error_cause = error_cause
155 def error_source(self):
156 """Gets the error_source of this SubscriptionInstance. # noqa: E501
158 Source of error cause. # noqa: E501
160 :return: The error_source of this SubscriptionInstance. # noqa: E501
163 return self._error_source
166 def error_source(self, error_source):
167 """Sets the error_source of this SubscriptionInstance.
169 Source of error cause. # noqa: E501
171 :param error_source: The error_source of this SubscriptionInstance. # noqa: E501
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):
178 "Invalid value for `error_source` ({0}), must be one of {1}" # noqa: E501
179 .format(error_source, allowed_values)
182 self._error_source = error_source
185 def timeout_type(self):
186 """Gets the timeout_type of this SubscriptionInstance. # noqa: E501
188 Type timeout. xApp should retry if timeout occurs. # noqa: E501
190 :return: The timeout_type of this SubscriptionInstance. # noqa: E501
193 return self._timeout_type
196 def timeout_type(self, timeout_type):
197 """Sets the timeout_type of this SubscriptionInstance.
199 Type timeout. xApp should retry if timeout occurs. # noqa: E501
201 :param timeout_type: The timeout_type of this SubscriptionInstance. # noqa: E501
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):
208 "Invalid value for `timeout_type` ({0}), must be one of {1}" # noqa: E501
209 .format(timeout_type, allowed_values)
212 self._timeout_type = timeout_type
215 """Returns the model properties as a dict"""
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,
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,
235 if issubclass(SubscriptionInstance, dict):
236 for key, value in self.items():
242 """Returns the string representation of the model"""
243 return pprint.pformat(self.to_dict())
246 """For `print` and `pprint`"""
249 def __eq__(self, other):
250 """Returns true if both objects are equal"""
251 if not isinstance(other, SubscriptionInstance):
254 return self.to_dict() == other.to_dict()
256 def __ne__(self, other):
257 """Returns true if both objects are not equal"""
258 if not isinstance(other, SubscriptionInstance):
261 return self.to_dict() != other.to_dict()