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 MfaTotpDevice(object): 12 """ 13 Users can enable multi-factor authentication (MFA) for their own user accounts. After MFA is enabled, the 14 user is prompted for a time-based one-time password (TOTP) to authenticate before they can sign in to the 15 Console. To enable multi-factor authentication, the user must register a mobile device with a TOTP authenticator app 16 installed. The registration process creates the `MfaTotpDevice` object. The registration process requires 17 interaction with the Console and cannot be completed programmatically. For more information, see 18 `Managing Multi-Factor Authentication`__. 19 20 __ https://docs.cloud.oracle.com/Content/Identity/Tasks/usingmfa.htm 21 """ 22 23 #: A constant which can be used with the lifecycle_state property of a MfaTotpDevice. 24 #: This constant has a value of "CREATING" 25 LIFECYCLE_STATE_CREATING = "CREATING" 26 27 #: A constant which can be used with the lifecycle_state property of a MfaTotpDevice. 28 #: This constant has a value of "ACTIVE" 29 LIFECYCLE_STATE_ACTIVE = "ACTIVE" 30 31 #: A constant which can be used with the lifecycle_state property of a MfaTotpDevice. 32 #: This constant has a value of "INACTIVE" 33 LIFECYCLE_STATE_INACTIVE = "INACTIVE" 34 35 #: A constant which can be used with the lifecycle_state property of a MfaTotpDevice. 36 #: This constant has a value of "DELETING" 37 LIFECYCLE_STATE_DELETING = "DELETING" 38 39 #: A constant which can be used with the lifecycle_state property of a MfaTotpDevice. 40 #: This constant has a value of "DELETED" 41 LIFECYCLE_STATE_DELETED = "DELETED" 42 43 def __init__(self, **kwargs): 44 """ 45 Initializes a new MfaTotpDevice object with values from keyword arguments. 46 The following keyword arguments are supported (corresponding to the getters/setters of this class): 47 48 :param id: 49 The value to assign to the id property of this MfaTotpDevice. 50 :type id: str 51 52 :param seed: 53 The value to assign to the seed property of this MfaTotpDevice. 54 :type seed: str 55 56 :param user_id: 57 The value to assign to the user_id property of this MfaTotpDevice. 58 :type user_id: str 59 60 :param time_created: 61 The value to assign to the time_created property of this MfaTotpDevice. 62 :type time_created: datetime 63 64 :param time_expires: 65 The value to assign to the time_expires property of this MfaTotpDevice. 66 :type time_expires: datetime 67 68 :param lifecycle_state: 69 The value to assign to the lifecycle_state property of this MfaTotpDevice. 70 Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'. 71 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 72 :type lifecycle_state: str 73 74 :param inactive_status: 75 The value to assign to the inactive_status property of this MfaTotpDevice. 76 :type inactive_status: int 77 78 :param is_activated: 79 The value to assign to the is_activated property of this MfaTotpDevice. 80 :type is_activated: bool 81 82 """ 83 self.swagger_types = { 84 'id': 'str', 85 'seed': 'str', 86 'user_id': 'str', 87 'time_created': 'datetime', 88 'time_expires': 'datetime', 89 'lifecycle_state': 'str', 90 'inactive_status': 'int', 91 'is_activated': 'bool' 92 } 93 94 self.attribute_map = { 95 'id': 'id', 96 'seed': 'seed', 97 'user_id': 'userId', 98 'time_created': 'timeCreated', 99 'time_expires': 'timeExpires', 100 'lifecycle_state': 'lifecycleState', 101 'inactive_status': 'inactiveStatus', 102 'is_activated': 'isActivated' 103 } 104 105 self._id = None 106 self._seed = None 107 self._user_id = None 108 self._time_created = None 109 self._time_expires = None 110 self._lifecycle_state = None 111 self._inactive_status = None 112 self._is_activated = None 113 114 @property 115 def id(self): 116 """ 117 **[Required]** Gets the id of this MfaTotpDevice. 118 The OCID of the MFA TOTP device. 119 120 121 :return: The id of this MfaTotpDevice. 122 :rtype: str 123 """ 124 return self._id 125 126 @id.setter 127 def id(self, id): 128 """ 129 Sets the id of this MfaTotpDevice. 130 The OCID of the MFA TOTP device. 131 132 133 :param id: The id of this MfaTotpDevice. 134 :type: str 135 """ 136 self._id = id 137 138 @property 139 def seed(self): 140 """ 141 **[Required]** Gets the seed of this MfaTotpDevice. 142 The seed for the MFA TOTP device (Base32 encoded). 143 144 145 :return: The seed of this MfaTotpDevice. 146 :rtype: str 147 """ 148 return self._seed 149 150 @seed.setter 151 def seed(self, seed): 152 """ 153 Sets the seed of this MfaTotpDevice. 154 The seed for the MFA TOTP device (Base32 encoded). 155 156 157 :param seed: The seed of this MfaTotpDevice. 158 :type: str 159 """ 160 self._seed = seed 161 162 @property 163 def user_id(self): 164 """ 165 **[Required]** Gets the user_id of this MfaTotpDevice. 166 The OCID of the user the MFA TOTP device belongs to. 167 168 169 :return: The user_id of this MfaTotpDevice. 170 :rtype: str 171 """ 172 return self._user_id 173 174 @user_id.setter 175 def user_id(self, user_id): 176 """ 177 Sets the user_id of this MfaTotpDevice. 178 The OCID of the user the MFA TOTP device belongs to. 179 180 181 :param user_id: The user_id of this MfaTotpDevice. 182 :type: str 183 """ 184 self._user_id = user_id 185 186 @property 187 def time_created(self): 188 """ 189 **[Required]** Gets the time_created of this MfaTotpDevice. 190 Date and time the `MfaTotpDevice` object was created, in the format defined by RFC3339. 191 192 Example: `2016-08-25T21:10:29.600Z` 193 194 195 :return: The time_created of this MfaTotpDevice. 196 :rtype: datetime 197 """ 198 return self._time_created 199 200 @time_created.setter 201 def time_created(self, time_created): 202 """ 203 Sets the time_created of this MfaTotpDevice. 204 Date and time the `MfaTotpDevice` object was created, in the format defined by RFC3339. 205 206 Example: `2016-08-25T21:10:29.600Z` 207 208 209 :param time_created: The time_created of this MfaTotpDevice. 210 :type: datetime 211 """ 212 self._time_created = time_created 213 214 @property 215 def time_expires(self): 216 """ 217 Gets the time_expires of this MfaTotpDevice. 218 Date and time when this MFA TOTP device will expire, in the format defined by RFC3339. 219 Null if it never expires. 220 221 Example: `2016-08-25T21:10:29.600Z` 222 223 224 :return: The time_expires of this MfaTotpDevice. 225 :rtype: datetime 226 """ 227 return self._time_expires 228 229 @time_expires.setter 230 def time_expires(self, time_expires): 231 """ 232 Sets the time_expires of this MfaTotpDevice. 233 Date and time when this MFA TOTP device will expire, in the format defined by RFC3339. 234 Null if it never expires. 235 236 Example: `2016-08-25T21:10:29.600Z` 237 238 239 :param time_expires: The time_expires of this MfaTotpDevice. 240 :type: datetime 241 """ 242 self._time_expires = time_expires 243 244 @property 245 def lifecycle_state(self): 246 """ 247 **[Required]** Gets the lifecycle_state of this MfaTotpDevice. 248 The MFA TOTP device's current state. After creating the MFA TOTP device, make sure its `lifecycleState` changes from 249 CREATING to ACTIVE before using it. 250 251 Allowed values for this property are: "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'. 252 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 253 254 255 :return: The lifecycle_state of this MfaTotpDevice. 256 :rtype: str 257 """ 258 return self._lifecycle_state 259 260 @lifecycle_state.setter 261 def lifecycle_state(self, lifecycle_state): 262 """ 263 Sets the lifecycle_state of this MfaTotpDevice. 264 The MFA TOTP device's current state. After creating the MFA TOTP device, make sure its `lifecycleState` changes from 265 CREATING to ACTIVE before using it. 266 267 268 :param lifecycle_state: The lifecycle_state of this MfaTotpDevice. 269 :type: str 270 """ 271 allowed_values = ["CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED"] 272 if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): 273 lifecycle_state = 'UNKNOWN_ENUM_VALUE' 274 self._lifecycle_state = lifecycle_state 275 276 @property 277 def inactive_status(self): 278 """ 279 Gets the inactive_status of this MfaTotpDevice. 280 The detailed status of INACTIVE lifecycleState. 281 Allowed values are: 282 - 1 - SUSPENDED 283 - 2 - DISABLED 284 - 4 - BLOCKED 285 - 8 - LOCKED 286 287 288 :return: The inactive_status of this MfaTotpDevice. 289 :rtype: int 290 """ 291 return self._inactive_status 292 293 @inactive_status.setter 294 def inactive_status(self, inactive_status): 295 """ 296 Sets the inactive_status of this MfaTotpDevice. 297 The detailed status of INACTIVE lifecycleState. 298 Allowed values are: 299 - 1 - SUSPENDED 300 - 2 - DISABLED 301 - 4 - BLOCKED 302 - 8 - LOCKED 303 304 305 :param inactive_status: The inactive_status of this MfaTotpDevice. 306 :type: int 307 """ 308 self._inactive_status = inactive_status 309 310 @property 311 def is_activated(self): 312 """ 313 **[Required]** Gets the is_activated of this MfaTotpDevice. 314 Flag to indicate if the MFA TOTP device has been activated. 315 316 317 :return: The is_activated of this MfaTotpDevice. 318 :rtype: bool 319 """ 320 return self._is_activated 321 322 @is_activated.setter 323 def is_activated(self, is_activated): 324 """ 325 Sets the is_activated of this MfaTotpDevice. 326 Flag to indicate if the MFA TOTP device has been activated. 327 328 329 :param is_activated: The is_activated of this MfaTotpDevice. 330 :type: bool 331 """ 332 self._is_activated = is_activated 333 334 def __repr__(self): 335 return formatted_flat_dict(self) 336 337 def __eq__(self, other): 338 if other is None: 339 return False 340 341 return self.__dict__ == other.__dict__ 342 343 def __ne__(self, other): 344 return not self == other 345