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 Identity(object): 12 """ 13 A container object for identity attributes. 14 """ 15 16 def __init__(self, **kwargs): 17 """ 18 Initializes a new Identity object with values from keyword arguments. 19 The following keyword arguments are supported (corresponding to the getters/setters of this class): 20 21 :param principal_name: 22 The value to assign to the principal_name property of this Identity. 23 :type principal_name: str 24 25 :param principal_id: 26 The value to assign to the principal_id property of this Identity. 27 :type principal_id: str 28 29 :param auth_type: 30 The value to assign to the auth_type property of this Identity. 31 :type auth_type: str 32 33 :param caller_name: 34 The value to assign to the caller_name property of this Identity. 35 :type caller_name: str 36 37 :param caller_id: 38 The value to assign to the caller_id property of this Identity. 39 :type caller_id: str 40 41 :param tenant_id: 42 The value to assign to the tenant_id property of this Identity. 43 :type tenant_id: str 44 45 :param ip_address: 46 The value to assign to the ip_address property of this Identity. 47 :type ip_address: str 48 49 :param credentials: 50 The value to assign to the credentials property of this Identity. 51 :type credentials: str 52 53 :param user_agent: 54 The value to assign to the user_agent property of this Identity. 55 :type user_agent: str 56 57 :param console_session_id: 58 The value to assign to the console_session_id property of this Identity. 59 :type console_session_id: str 60 61 """ 62 self.swagger_types = { 63 'principal_name': 'str', 64 'principal_id': 'str', 65 'auth_type': 'str', 66 'caller_name': 'str', 67 'caller_id': 'str', 68 'tenant_id': 'str', 69 'ip_address': 'str', 70 'credentials': 'str', 71 'user_agent': 'str', 72 'console_session_id': 'str' 73 } 74 75 self.attribute_map = { 76 'principal_name': 'principalName', 77 'principal_id': 'principalId', 78 'auth_type': 'authType', 79 'caller_name': 'callerName', 80 'caller_id': 'callerId', 81 'tenant_id': 'tenantId', 82 'ip_address': 'ipAddress', 83 'credentials': 'credentials', 84 'user_agent': 'userAgent', 85 'console_session_id': 'consoleSessionId' 86 } 87 88 self._principal_name = None 89 self._principal_id = None 90 self._auth_type = None 91 self._caller_name = None 92 self._caller_id = None 93 self._tenant_id = None 94 self._ip_address = None 95 self._credentials = None 96 self._user_agent = None 97 self._console_session_id = None 98 99 @property 100 def principal_name(self): 101 """ 102 Gets the principal_name of this Identity. 103 The name of the user or service. This value is the friendly name associated with `principalId`. 104 105 Example: `ExampleName` 106 107 108 :return: The principal_name of this Identity. 109 :rtype: str 110 """ 111 return self._principal_name 112 113 @principal_name.setter 114 def principal_name(self, principal_name): 115 """ 116 Sets the principal_name of this Identity. 117 The name of the user or service. This value is the friendly name associated with `principalId`. 118 119 Example: `ExampleName` 120 121 122 :param principal_name: The principal_name of this Identity. 123 :type: str 124 """ 125 self._principal_name = principal_name 126 127 @property 128 def principal_id(self): 129 """ 130 Gets the principal_id of this Identity. 131 The `OCID`__ of the principal. 132 133 __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm 134 135 136 :return: The principal_id of this Identity. 137 :rtype: str 138 """ 139 return self._principal_id 140 141 @principal_id.setter 142 def principal_id(self, principal_id): 143 """ 144 Sets the principal_id of this Identity. 145 The `OCID`__ of the principal. 146 147 __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm 148 149 150 :param principal_id: The principal_id of this Identity. 151 :type: str 152 """ 153 self._principal_id = principal_id 154 155 @property 156 def auth_type(self): 157 """ 158 Gets the auth_type of this Identity. 159 The type of authentication used. 160 161 Example: `natv` 162 163 164 :return: The auth_type of this Identity. 165 :rtype: str 166 """ 167 return self._auth_type 168 169 @auth_type.setter 170 def auth_type(self, auth_type): 171 """ 172 Sets the auth_type of this Identity. 173 The type of authentication used. 174 175 Example: `natv` 176 177 178 :param auth_type: The auth_type of this Identity. 179 :type: str 180 """ 181 self._auth_type = auth_type 182 183 @property 184 def caller_name(self): 185 """ 186 Gets the caller_name of this Identity. 187 The name of the user or service. This value is the friendly name associated with `callerId`. 188 189 190 :return: The caller_name of this Identity. 191 :rtype: str 192 """ 193 return self._caller_name 194 195 @caller_name.setter 196 def caller_name(self, caller_name): 197 """ 198 Sets the caller_name of this Identity. 199 The name of the user or service. This value is the friendly name associated with `callerId`. 200 201 202 :param caller_name: The caller_name of this Identity. 203 :type: str 204 """ 205 self._caller_name = caller_name 206 207 @property 208 def caller_id(self): 209 """ 210 Gets the caller_id of this Identity. 211 The `OCID`__ of the caller. The caller that made a 212 request on behalf of the prinicpal. 213 214 __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm 215 216 217 :return: The caller_id of this Identity. 218 :rtype: str 219 """ 220 return self._caller_id 221 222 @caller_id.setter 223 def caller_id(self, caller_id): 224 """ 225 Sets the caller_id of this Identity. 226 The `OCID`__ of the caller. The caller that made a 227 request on behalf of the prinicpal. 228 229 __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm 230 231 232 :param caller_id: The caller_id of this Identity. 233 :type: str 234 """ 235 self._caller_id = caller_id 236 237 @property 238 def tenant_id(self): 239 """ 240 Gets the tenant_id of this Identity. 241 The `OCID`__ of the tenant. 242 243 __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm 244 245 246 :return: The tenant_id of this Identity. 247 :rtype: str 248 """ 249 return self._tenant_id 250 251 @tenant_id.setter 252 def tenant_id(self, tenant_id): 253 """ 254 Sets the tenant_id of this Identity. 255 The `OCID`__ of the tenant. 256 257 __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm 258 259 260 :param tenant_id: The tenant_id of this Identity. 261 :type: str 262 """ 263 self._tenant_id = tenant_id 264 265 @property 266 def ip_address(self): 267 """ 268 Gets the ip_address of this Identity. 269 The IP address of the source of the request. 270 271 Example: `172.24.80.88` 272 273 274 :return: The ip_address of this Identity. 275 :rtype: str 276 """ 277 return self._ip_address 278 279 @ip_address.setter 280 def ip_address(self, ip_address): 281 """ 282 Sets the ip_address of this Identity. 283 The IP address of the source of the request. 284 285 Example: `172.24.80.88` 286 287 288 :param ip_address: The ip_address of this Identity. 289 :type: str 290 """ 291 self._ip_address = ip_address 292 293 @property 294 def credentials(self): 295 """ 296 Gets the credentials of this Identity. 297 The credential ID of the user. This value is extracted from the HTTP 'Authorization' request 298 header. It consists of the tenantId, userId, and user fingerprint, all delimited by a slash (/). 299 300 301 :return: The credentials of this Identity. 302 :rtype: str 303 """ 304 return self._credentials 305 306 @credentials.setter 307 def credentials(self, credentials): 308 """ 309 Sets the credentials of this Identity. 310 The credential ID of the user. This value is extracted from the HTTP 'Authorization' request 311 header. It consists of the tenantId, userId, and user fingerprint, all delimited by a slash (/). 312 313 314 :param credentials: The credentials of this Identity. 315 :type: str 316 """ 317 self._credentials = credentials 318 319 @property 320 def user_agent(self): 321 """ 322 Gets the user_agent of this Identity. 323 The user agent of the client that made the request. 324 325 Example: `Jersey/2.23 (HttpUrlConnection 1.8.0_212)` 326 327 328 :return: The user_agent of this Identity. 329 :rtype: str 330 """ 331 return self._user_agent 332 333 @user_agent.setter 334 def user_agent(self, user_agent): 335 """ 336 Sets the user_agent of this Identity. 337 The user agent of the client that made the request. 338 339 Example: `Jersey/2.23 (HttpUrlConnection 1.8.0_212)` 340 341 342 :param user_agent: The user_agent of this Identity. 343 :type: str 344 """ 345 self._user_agent = user_agent 346 347 @property 348 def console_session_id(self): 349 """ 350 Gets the console_session_id of this Identity. 351 This value identifies any Console session associated with this request. 352 353 354 :return: The console_session_id of this Identity. 355 :rtype: str 356 """ 357 return self._console_session_id 358 359 @console_session_id.setter 360 def console_session_id(self, console_session_id): 361 """ 362 Sets the console_session_id of this Identity. 363 This value identifies any Console session associated with this request. 364 365 366 :param console_session_id: The console_session_id of this Identity. 367 :type: str 368 """ 369 self._console_session_id = console_session_id 370 371 def __repr__(self): 372 return formatted_flat_dict(self) 373 374 def __eq__(self, other): 375 if other is None: 376 return False 377 378 return self.__dict__ == other.__dict__ 379 380 def __ne__(self, other): 381 return not self == other 382