1# coding: utf-8 2# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. 3# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. 4 5 6from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 7from oci.decorators import init_model_state_from_kwargs 8 9 10@init_model_state_from_kwargs 11class SubscriptionMapping(object): 12 """ 13 Subscription mapping information. 14 """ 15 16 #: A constant which can be used with the lifecycle_state property of a SubscriptionMapping. 17 #: This constant has a value of "CREATING" 18 LIFECYCLE_STATE_CREATING = "CREATING" 19 20 #: A constant which can be used with the lifecycle_state property of a SubscriptionMapping. 21 #: This constant has a value of "ACTIVE" 22 LIFECYCLE_STATE_ACTIVE = "ACTIVE" 23 24 #: A constant which can be used with the lifecycle_state property of a SubscriptionMapping. 25 #: This constant has a value of "INACTIVE" 26 LIFECYCLE_STATE_INACTIVE = "INACTIVE" 27 28 #: A constant which can be used with the lifecycle_state property of a SubscriptionMapping. 29 #: This constant has a value of "UPDATING" 30 LIFECYCLE_STATE_UPDATING = "UPDATING" 31 32 #: A constant which can be used with the lifecycle_state property of a SubscriptionMapping. 33 #: This constant has a value of "DELETING" 34 LIFECYCLE_STATE_DELETING = "DELETING" 35 36 #: A constant which can be used with the lifecycle_state property of a SubscriptionMapping. 37 #: This constant has a value of "DELETED" 38 LIFECYCLE_STATE_DELETED = "DELETED" 39 40 #: A constant which can be used with the lifecycle_state property of a SubscriptionMapping. 41 #: This constant has a value of "FAILED" 42 LIFECYCLE_STATE_FAILED = "FAILED" 43 44 def __init__(self, **kwargs): 45 """ 46 Initializes a new SubscriptionMapping object with values from keyword arguments. 47 The following keyword arguments are supported (corresponding to the getters/setters of this class): 48 49 :param id: 50 The value to assign to the id property of this SubscriptionMapping. 51 :type id: str 52 53 :param subscription_id: 54 The value to assign to the subscription_id property of this SubscriptionMapping. 55 :type subscription_id: str 56 57 :param compartment_id: 58 The value to assign to the compartment_id property of this SubscriptionMapping. 59 :type compartment_id: str 60 61 :param is_explicitly_assigned: 62 The value to assign to the is_explicitly_assigned property of this SubscriptionMapping. 63 :type is_explicitly_assigned: bool 64 65 :param lifecycle_state: 66 The value to assign to the lifecycle_state property of this SubscriptionMapping. 67 Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. 68 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 69 :type lifecycle_state: str 70 71 :param time_terminated: 72 The value to assign to the time_terminated property of this SubscriptionMapping. 73 :type time_terminated: datetime 74 75 :param time_created: 76 The value to assign to the time_created property of this SubscriptionMapping. 77 :type time_created: datetime 78 79 :param time_updated: 80 The value to assign to the time_updated property of this SubscriptionMapping. 81 :type time_updated: datetime 82 83 """ 84 self.swagger_types = { 85 'id': 'str', 86 'subscription_id': 'str', 87 'compartment_id': 'str', 88 'is_explicitly_assigned': 'bool', 89 'lifecycle_state': 'str', 90 'time_terminated': 'datetime', 91 'time_created': 'datetime', 92 'time_updated': 'datetime' 93 } 94 95 self.attribute_map = { 96 'id': 'id', 97 'subscription_id': 'subscriptionId', 98 'compartment_id': 'compartmentId', 99 'is_explicitly_assigned': 'isExplicitlyAssigned', 100 'lifecycle_state': 'lifecycleState', 101 'time_terminated': 'timeTerminated', 102 'time_created': 'timeCreated', 103 'time_updated': 'timeUpdated' 104 } 105 106 self._id = None 107 self._subscription_id = None 108 self._compartment_id = None 109 self._is_explicitly_assigned = None 110 self._lifecycle_state = None 111 self._time_terminated = None 112 self._time_created = None 113 self._time_updated = None 114 115 @property 116 def id(self): 117 """ 118 **[Required]** Gets the id of this SubscriptionMapping. 119 OCID of the mapping between subscription and compartment identified by the tenancy. 120 121 122 :return: The id of this SubscriptionMapping. 123 :rtype: str 124 """ 125 return self._id 126 127 @id.setter 128 def id(self, id): 129 """ 130 Sets the id of this SubscriptionMapping. 131 OCID of the mapping between subscription and compartment identified by the tenancy. 132 133 134 :param id: The id of this SubscriptionMapping. 135 :type: str 136 """ 137 self._id = id 138 139 @property 140 def subscription_id(self): 141 """ 142 **[Required]** Gets the subscription_id of this SubscriptionMapping. 143 OCID of the subscription. 144 145 146 :return: The subscription_id of this SubscriptionMapping. 147 :rtype: str 148 """ 149 return self._subscription_id 150 151 @subscription_id.setter 152 def subscription_id(self, subscription_id): 153 """ 154 Sets the subscription_id of this SubscriptionMapping. 155 OCID of the subscription. 156 157 158 :param subscription_id: The subscription_id of this SubscriptionMapping. 159 :type: str 160 """ 161 self._subscription_id = subscription_id 162 163 @property 164 def compartment_id(self): 165 """ 166 **[Required]** Gets the compartment_id of this SubscriptionMapping. 167 OCID of the compartment. Always a tenancy OCID. 168 169 170 :return: The compartment_id of this SubscriptionMapping. 171 :rtype: str 172 """ 173 return self._compartment_id 174 175 @compartment_id.setter 176 def compartment_id(self, compartment_id): 177 """ 178 Sets the compartment_id of this SubscriptionMapping. 179 OCID of the compartment. Always a tenancy OCID. 180 181 182 :param compartment_id: The compartment_id of this SubscriptionMapping. 183 :type: str 184 """ 185 self._compartment_id = compartment_id 186 187 @property 188 def is_explicitly_assigned(self): 189 """ 190 **[Required]** Gets the is_explicitly_assigned of this SubscriptionMapping. 191 Denotes if the subscription is explicity assigned to the root compartment or tenancy. 192 193 194 :return: The is_explicitly_assigned of this SubscriptionMapping. 195 :rtype: bool 196 """ 197 return self._is_explicitly_assigned 198 199 @is_explicitly_assigned.setter 200 def is_explicitly_assigned(self, is_explicitly_assigned): 201 """ 202 Sets the is_explicitly_assigned of this SubscriptionMapping. 203 Denotes if the subscription is explicity assigned to the root compartment or tenancy. 204 205 206 :param is_explicitly_assigned: The is_explicitly_assigned of this SubscriptionMapping. 207 :type: bool 208 """ 209 self._is_explicitly_assigned = is_explicitly_assigned 210 211 @property 212 def lifecycle_state(self): 213 """ 214 **[Required]** Gets the lifecycle_state of this SubscriptionMapping. 215 Lifecycle state of the subscription mapping. 216 217 Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. 218 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 219 220 221 :return: The lifecycle_state of this SubscriptionMapping. 222 :rtype: str 223 """ 224 return self._lifecycle_state 225 226 @lifecycle_state.setter 227 def lifecycle_state(self, lifecycle_state): 228 """ 229 Sets the lifecycle_state of this SubscriptionMapping. 230 Lifecycle state of the subscription mapping. 231 232 233 :param lifecycle_state: The lifecycle_state of this SubscriptionMapping. 234 :type: str 235 """ 236 allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"] 237 if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): 238 lifecycle_state = 'UNKNOWN_ENUM_VALUE' 239 self._lifecycle_state = lifecycle_state 240 241 @property 242 def time_terminated(self): 243 """ 244 Gets the time_terminated of this SubscriptionMapping. 245 Date-time when subscription mapping was terminated. 246 247 248 :return: The time_terminated of this SubscriptionMapping. 249 :rtype: datetime 250 """ 251 return self._time_terminated 252 253 @time_terminated.setter 254 def time_terminated(self, time_terminated): 255 """ 256 Sets the time_terminated of this SubscriptionMapping. 257 Date-time when subscription mapping was terminated. 258 259 260 :param time_terminated: The time_terminated of this SubscriptionMapping. 261 :type: datetime 262 """ 263 self._time_terminated = time_terminated 264 265 @property 266 def time_created(self): 267 """ 268 **[Required]** Gets the time_created of this SubscriptionMapping. 269 Date-time when subscription mapping was created. 270 271 272 :return: The time_created of this SubscriptionMapping. 273 :rtype: datetime 274 """ 275 return self._time_created 276 277 @time_created.setter 278 def time_created(self, time_created): 279 """ 280 Sets the time_created of this SubscriptionMapping. 281 Date-time when subscription mapping was created. 282 283 284 :param time_created: The time_created of this SubscriptionMapping. 285 :type: datetime 286 """ 287 self._time_created = time_created 288 289 @property 290 def time_updated(self): 291 """ 292 **[Required]** Gets the time_updated of this SubscriptionMapping. 293 Date-time when subscription mapping was updated. 294 295 296 :return: The time_updated of this SubscriptionMapping. 297 :rtype: datetime 298 """ 299 return self._time_updated 300 301 @time_updated.setter 302 def time_updated(self, time_updated): 303 """ 304 Sets the time_updated of this SubscriptionMapping. 305 Date-time when subscription mapping was updated. 306 307 308 :param time_updated: The time_updated of this SubscriptionMapping. 309 :type: datetime 310 """ 311 self._time_updated = time_updated 312 313 def __repr__(self): 314 return formatted_flat_dict(self) 315 316 def __eq__(self, other): 317 if other is None: 318 return False 319 320 return self.__dict__ == other.__dict__ 321 322 def __ne__(self, other): 323 return not self == other 324