|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + Identity Security Cloud V2025 API |
| 5 | +
|
| 6 | + Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. |
| 7 | +
|
| 8 | + The version of the OpenAPI document: v2025 |
| 9 | + Generated by OpenAPI Generator (https://openapi-generator.tech) |
| 10 | +
|
| 11 | + Do not edit the class manually. |
| 12 | +""" # noqa: E501 |
| 13 | + |
| 14 | + |
| 15 | +from __future__ import annotations |
| 16 | +import pprint |
| 17 | +import re # noqa: F401 |
| 18 | +import json |
| 19 | +import warnings |
| 20 | + |
| 21 | +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr |
| 22 | +from typing import Any, ClassVar, Dict, List, Optional |
| 23 | +from typing import Optional, Set |
| 24 | +from typing_extensions import Self |
| 25 | + |
| 26 | +class DimensionAttribute(BaseModel): |
| 27 | + """ |
| 28 | + A dimension attribute |
| 29 | + """ # noqa: E501 |
| 30 | + name: Optional[StrictStr] = Field(default=None, description="Name of the attribute") |
| 31 | + display_name: Optional[StrictStr] = Field(default=None, description="Display name of the attribute", alias="displayName") |
| 32 | + derived: Optional[StrictBool] = Field(default=True, description="If an attribute is derived, its value comes from the identity. Otherwise, it can be provided with access request") |
| 33 | + __properties: ClassVar[List[str]] = ["name", "displayName", "derived"] |
| 34 | + |
| 35 | + model_config = ConfigDict( |
| 36 | + populate_by_name=True, |
| 37 | + validate_assignment=True, |
| 38 | + protected_namespaces=(), |
| 39 | + ) |
| 40 | + |
| 41 | + |
| 42 | + def to_str(self) -> str: |
| 43 | + """Returns the string representation of the model using alias""" |
| 44 | + return pprint.pformat(self.model_dump(by_alias=True)) |
| 45 | + |
| 46 | + def to_json(self) -> str: |
| 47 | + """Returns the JSON representation of the model using alias""" |
| 48 | + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead |
| 49 | + return json.dumps(self.to_dict()) |
| 50 | + |
| 51 | + @classmethod |
| 52 | + def from_json(cls, json_str: str) -> Optional[Self]: |
| 53 | + """Create an instance of DimensionAttribute from a JSON string""" |
| 54 | + return cls.from_dict(json.loads(json_str)) |
| 55 | + |
| 56 | + def to_dict(self) -> Dict[str, Any]: |
| 57 | + """Return the dictionary representation of the model using alias. |
| 58 | +
|
| 59 | + This has the following differences from calling pydantic's |
| 60 | + `self.model_dump(by_alias=True)`: |
| 61 | +
|
| 62 | + * `None` is only added to the output dict for nullable fields that |
| 63 | + were set at model initialization. Other fields with value `None` |
| 64 | + are ignored. |
| 65 | + """ |
| 66 | + excluded_fields: Set[str] = set([ |
| 67 | + ]) |
| 68 | + |
| 69 | + _dict = self.model_dump( |
| 70 | + by_alias=True, |
| 71 | + exclude=excluded_fields, |
| 72 | + exclude_none=True, |
| 73 | + ) |
| 74 | + return _dict |
| 75 | + |
| 76 | + @classmethod |
| 77 | + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: |
| 78 | + """Create an instance of DimensionAttribute from a dict""" |
| 79 | + if obj is None: |
| 80 | + return None |
| 81 | + |
| 82 | + if not isinstance(obj, dict): |
| 83 | + return cls.model_validate(obj) |
| 84 | + |
| 85 | + _obj = cls.model_validate({ |
| 86 | + "name": obj.get("name"), |
| 87 | + "displayName": obj.get("displayName"), |
| 88 | + "derived": obj.get("derived") if obj.get("derived") is not None else True |
| 89 | + }) |
| 90 | + return _obj |
| 91 | + |
| 92 | + |
0 commit comments