Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/User.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Name | Type | Description | Notes
**status** | [**UserStatus**](UserStatus.md) | | [optional]
**status_changed** | **datetime** | The timestamp when the status of the user last changed | [optional] [readonly]
**transitioning_to_status** | **str** | The target status of an in-progress asynchronous status transition. This property is only returned if the user's state is transitioning. | [optional] [readonly]
**type** | [**UserType**](UserType.md) | | [optional]
**type** | [**UserTypeRef**](UserTypeRef.md) | | [optional]
**embedded** | **Dict[str, object]** | Embedded resources related to the user using the [JSON Hypertext Application Language](https://datatracker.ietf.org/doc/html/draft-kelly-json-hal-06) specification | [optional] [readonly]
**links** | [**UserLinks**](UserLinks.md) | | [optional]

Expand Down
2 changes: 1 addition & 1 deletion docs/UserGetSingleton.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Name | Type | Description | Notes
**status** | [**UserStatus**](UserStatus.md) | | [optional]
**status_changed** | **datetime** | The timestamp when the status of the user last changed | [optional] [readonly]
**transitioning_to_status** | **str** | The target status of an in-progress asynchronous status transition. This property is only returned if the user's state is transitioning. | [optional] [readonly]
**type** | [**UserType**](UserType.md) | | [optional]
**type** | [**UserTypeRef**](UserTypeRef.md) | | [optional]
**embedded** | [**UserGetSingletonAllOfEmbedded**](UserGetSingletonAllOfEmbedded.md) | | [optional]
**links** | [**UserLinks**](UserLinks.md) | | [optional]

Expand Down
12 changes: 10 additions & 2 deletions docs/UserType.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# UserType

The user type that determines the schema for the user's profile. The `type` property is a map that identifies the [User Types](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/UserType/#tag/UserType). Currently it contains a single element, `id`. It can be specified when creating a new user, and can be updated by an admin on a full replace of an existing user (but not a partial update).

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | The ID of the user type | [optional]
**created** | **datetime** | A timestamp from when the user type was created | [optional] [readonly]
**created_by** | **str** | The user ID of the account that created the user type | [optional] [readonly]
**default** | **bool** | A boolean value to indicate if this is the default user type | [optional] [readonly]
**description** | **str** | The human-readable description of the user type | [optional]
**display_name** | **str** | The human-readable name of the user type |
**id** | **str** | The unique key for the user type | [optional] [readonly]
**last_updated** | **datetime** | A timestamp from when the user type was most recently updated | [optional] [readonly]
**last_updated_by** | **str** | The user ID of the most recent account to edit the user type | [optional] [readonly]
**name** | **str** | The name of the user type. The name must start with A-Z or a-z and contain only A-Z, a-z, 0-9, or underscore (_) characters. This value becomes read-only after creation and can't be updated. |
**links** | [**UserTypeLinks**](UserTypeLinks.md) | | [optional]

## Example

Expand Down
30 changes: 30 additions & 0 deletions docs/UserTypeRef.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# UserTypeRef

The user type that determines the schema for the user's profile...

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | The ID of the user type | [optional]

## Example

```python
from okta.models.user_type_ref import UserTypeRef

# TODO update the JSON string below
json = "{}"
# create an instance of UserTypeRef from a JSON string
user_type_ref_instance = UserTypeRef.from_json(json)
# print the JSON string representation of the object
print(UserTypeRef.to_json())

# convert the object into a dict
user_type_ref_dict = user_type_ref_instance.to_dict()
# create an instance of UserTypeRef from a dict
user_type_ref_from_dict = UserTypeRef.from_dict(user_type_ref_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions okta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1898,6 +1898,7 @@
"UserTypeLinksAllOfSchema": "okta.models.user_type_links_all_of_schema",
"UserTypePostRequest": "okta.models.user_type_post_request",
"UserTypePutRequest": "okta.models.user_type_put_request",
"UserTypeRef": "okta.models.user_type_ref",
"UserVerificationEnum": "okta.models.user_verification_enum",
"UsersLink": "okta.models.users_link",
"UsersUpdateRequestSchema": "okta.models.users_update_request_schema",
Expand Down
1 change: 1 addition & 0 deletions okta/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,7 @@
"UserTypeLinksAllOfSchema": "okta.models.user_type_links_all_of_schema",
"UserTypePostRequest": "okta.models.user_type_post_request",
"UserTypePutRequest": "okta.models.user_type_put_request",
"UserTypeRef": "okta.models.user_type_ref",
"UserVerificationEnum": "okta.models.user_verification_enum",
"UsersLink": "okta.models.users_link",
"UsersUpdateRequestSchema": "okta.models.users_update_request_schema",
Expand Down
6 changes: 3 additions & 3 deletions okta/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from okta.models.user_links import UserLinks
from okta.models.user_profile import UserProfile
from okta.models.user_status import UserStatus
from okta.models.user_type import UserType
from okta.models.user_type_ref import UserTypeRef


class User(BaseModel):
Expand Down Expand Up @@ -87,7 +87,7 @@ class User(BaseModel):
"the user's state is transitioning.",
alias="transitioningToStatus",
)
type: Optional[UserType] = None
type: Optional[UserTypeRef] = None
embedded: Optional[Dict[str, Dict[str, Any]]] = Field(
default=None,
description="Embedded resources related to the user using the [JSON Hypertext Application Language]("
Expand Down Expand Up @@ -278,7 +278,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"statusChanged": obj.get("statusChanged"),
"transitioningToStatus": obj.get("transitioningToStatus"),
"type": (
UserType.from_dict(obj["type"])
UserTypeRef.from_dict(obj["type"])
if obj.get("type") is not None
else None
),
Expand Down
6 changes: 3 additions & 3 deletions okta/models/user_get_singleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from okta.models.user_links import UserLinks
from okta.models.user_profile import UserProfile
from okta.models.user_status import UserStatus
from okta.models.user_type import UserType
from okta.models.user_type_ref import UserTypeRef


class UserGetSingleton(BaseModel):
Expand Down Expand Up @@ -88,7 +88,7 @@ class UserGetSingleton(BaseModel):
"the user's state is transitioning.",
alias="transitioningToStatus",
)
type: Optional[UserType] = None
type: Optional[UserTypeRef] = None
embedded: Optional[UserGetSingletonAllOfEmbedded] = Field(
default=None, alias="_embedded"
)
Expand Down Expand Up @@ -281,7 +281,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"statusChanged": obj.get("statusChanged"),
"transitioningToStatus": obj.get("transitioningToStatus"),
"type": (
UserType.from_dict(obj["type"])
UserTypeRef.from_dict(obj["type"])
if obj.get("type") is not None
else None
),
Expand Down
97 changes: 88 additions & 9 deletions okta/models/user_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,69 @@
import json
import pprint
import re # noqa: F401
from datetime import datetime
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing_extensions import Self

from okta.models.user_type_links import UserTypeLinks


class UserType(BaseModel):
"""
The user type that determines the schema for the user's profile. The `type` property is a map that identifies the [User
Types](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/UserType/#tag/UserType). Currently it
contains a single element, `id`. It can be specified when creating a new user, and can be updated by an admin on a full
replace of an existing user (but not a partial update).
UserType
""" # noqa: E501

id: Optional[StrictStr] = Field(default=None, description="The ID of the user type")
__properties: ClassVar[List[str]] = ["id"]
created: Optional[datetime] = Field(
default=None, description="A timestamp from when the user type was created"
)
created_by: Optional[StrictStr] = Field(
default=None,
description="The user ID of the account that created the user type",
alias="createdBy",
)
default: Optional[StrictBool] = Field(
default=None,
description="A boolean value to indicate if this is the default user type",
)
description: Optional[StrictStr] = Field(
default=None, description="The human-readable description of the user type"
)
display_name: StrictStr = Field(
description="The human-readable name of the user type", alias="displayName"
)
id: Optional[StrictStr] = Field(
default=None, description="The unique key for the user type"
)
last_updated: Optional[datetime] = Field(
default=None,
description="A timestamp from when the user type was most recently updated",
alias="lastUpdated",
)
last_updated_by: Optional[StrictStr] = Field(
default=None,
description="The user ID of the most recent account to edit the user type",
alias="lastUpdatedBy",
)
name: StrictStr = Field(
description="The name of the user type. The name must start with A-Z or a-z and contain only A-Z, a-z, 0-9, "
"or underscore (_) characters. This value becomes read-only after creation and can't be updated."
)
links: Optional[UserTypeLinks] = Field(default=None, alias="_links")
__properties: ClassVar[List[str]] = [
"created",
"createdBy",
"default",
"description",
"displayName",
"id",
"lastUpdated",
"lastUpdatedBy",
"name",
"_links",
]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -73,13 +119,29 @@ def to_dict(self) -> Dict[str, Any]:
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])
excluded_fields: Set[str] = set(
[
"created",
"created_by",
"default",
"id",
"last_updated",
"last_updated_by",
]
)

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of links
if self.links:
if not isinstance(self.links, dict):
_dict["_links"] = self.links.to_dict()
else:
_dict["_links"] = self.links

return _dict

@classmethod
Expand All @@ -91,5 +153,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({"id": obj.get("id")})
_obj = cls.model_validate(
{
"created": obj.get("created"),
"createdBy": obj.get("createdBy"),
"default": obj.get("default"),
"description": obj.get("description"),
"displayName": obj.get("displayName"),
"id": obj.get("id"),
"lastUpdated": obj.get("lastUpdated"),
"lastUpdatedBy": obj.get("lastUpdatedBy"),
"name": obj.get("name"),
"_links": (
UserTypeLinks.from_dict(obj["_links"])
if obj.get("_links") is not None
else None
),
}
)
return _obj
92 changes: 92 additions & 0 deletions okta/models/user_type_ref.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# The Okta software accompanied by this notice is provided pursuant to the following terms:
# Copyright © 2025-Present, Okta, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
# License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS
# IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.
# coding: utf-8

"""
Okta Admin Management

Allows customers to easily access the Okta Management APIs

The version of the OpenAPI document: 5.1.0
Contact: devex-public@okta.com
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501

from __future__ import annotations

import json
import pprint
import re # noqa: F401
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing_extensions import Self


class UserTypeRef(BaseModel):
"""
The user type that determines the schema for the user's profile...
""" # noqa: E501

id: Optional[StrictStr] = Field(default=None, description="The ID of the user type")
__properties: ClassVar[List[str]] = ["id"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of UserTypeRef from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of UserTypeRef from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({"id": obj.get("id")})
return _obj
17 changes: 8 additions & 9 deletions openapi/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80711,6 +80711,13 @@ components:
id:
type: string
description: The ID of the user type
UserTypeRef:
type: object
description: The user type that determines the schema for the user's profile...
properties:
id:
type: string
description: The ID of the user type
User:
type: object
properties:
Expand Down Expand Up @@ -80773,15 +80780,7 @@ components:
- DEPROVISIONED
- PROVISIONED
type:
type: object
description: |-
The user type that determines the schema for the user's profile. The `type` property is a map that identifies the [User Types](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/UserType/#tag/UserType).

Currently it contains a single element, `id`. It can be specified when creating a new user, and can be updated by an admin on a full replace of an existing user (but not a partial update).
properties:
id:
type: string
description: The ID of the user type
$ref: '#/components/schemas/UserTypeRef'
_embedded:
type: object
description: Embedded resources related to the user using the [JSON Hypertext Application Language](https://datatracker.ietf.org/doc/html/draft-kelly-json-hal-06) specification
Expand Down
Loading