# 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, StrictBool, StrictStr
from typing_extensions import Self


class SignInPageAllOfWidgetCustomizations(BaseModel):
    """
    SignInPageAllOfWidgetCustomizations
    """  # noqa: E501

    sign_in_label: Optional[StrictStr] = Field(default=None, alias="signInLabel")
    username_label: Optional[StrictStr] = Field(default=None, alias="usernameLabel")
    username_info_tip: Optional[StrictStr] = Field(
        default=None, alias="usernameInfoTip"
    )
    password_label: Optional[StrictStr] = Field(default=None, alias="passwordLabel")
    password_info_tip: Optional[StrictStr] = Field(
        default=None, alias="passwordInfoTip"
    )
    show_password_visibility_toggle: Optional[StrictBool] = Field(
        default=None, alias="showPasswordVisibilityToggle"
    )
    show_user_identifier: Optional[StrictBool] = Field(
        default=None, alias="showUserIdentifier"
    )
    forgot_password_label: Optional[StrictStr] = Field(
        default=None, alias="forgotPasswordLabel"
    )
    forgot_password_url: Optional[StrictStr] = Field(
        default=None, alias="forgotPasswordUrl"
    )
    unlock_account_label: Optional[StrictStr] = Field(
        default=None, alias="unlockAccountLabel"
    )
    unlock_account_url: Optional[StrictStr] = Field(
        default=None, alias="unlockAccountUrl"
    )
    help_label: Optional[StrictStr] = Field(default=None, alias="helpLabel")
    help_url: Optional[StrictStr] = Field(default=None, alias="helpUrl")
    custom_link1_label: Optional[StrictStr] = Field(
        default=None, alias="customLink1Label"
    )
    custom_link1_url: Optional[StrictStr] = Field(default=None, alias="customLink1Url")
    custom_link2_label: Optional[StrictStr] = Field(
        default=None, alias="customLink2Label"
    )
    custom_link2_url: Optional[StrictStr] = Field(default=None, alias="customLink2Url")
    authenticator_page_custom_link_label: Optional[StrictStr] = Field(
        default=None, alias="authenticatorPageCustomLinkLabel"
    )
    authenticator_page_custom_link_url: Optional[StrictStr] = Field(
        default=None, alias="authenticatorPageCustomLinkUrl"
    )
    classic_recovery_flow_email_or_username_label: Optional[StrictStr] = Field(
        default=None, alias="classicRecoveryFlowEmailOrUsernameLabel"
    )
    __properties: ClassVar[List[str]] = [
        "signInLabel",
        "usernameLabel",
        "usernameInfoTip",
        "passwordLabel",
        "passwordInfoTip",
        "showPasswordVisibilityToggle",
        "showUserIdentifier",
        "forgotPasswordLabel",
        "forgotPasswordUrl",
        "unlockAccountLabel",
        "unlockAccountUrl",
        "helpLabel",
        "helpUrl",
        "customLink1Label",
        "customLink1Url",
        "customLink2Label",
        "customLink2Url",
        "authenticatorPageCustomLinkLabel",
        "authenticatorPageCustomLinkUrl",
        "classicRecoveryFlowEmailOrUsernameLabel",
    ]

    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 SignInPageAllOfWidgetCustomizations 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 SignInPageAllOfWidgetCustomizations from a dict"""
        if obj is None:
            return None

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

        _obj = cls.model_validate(
            {
                "signInLabel": obj.get("signInLabel"),
                "usernameLabel": obj.get("usernameLabel"),
                "usernameInfoTip": obj.get("usernameInfoTip"),
                "passwordLabel": obj.get("passwordLabel"),
                "passwordInfoTip": obj.get("passwordInfoTip"),
                "showPasswordVisibilityToggle": obj.get("showPasswordVisibilityToggle"),
                "showUserIdentifier": obj.get("showUserIdentifier"),
                "forgotPasswordLabel": obj.get("forgotPasswordLabel"),
                "forgotPasswordUrl": obj.get("forgotPasswordUrl"),
                "unlockAccountLabel": obj.get("unlockAccountLabel"),
                "unlockAccountUrl": obj.get("unlockAccountUrl"),
                "helpLabel": obj.get("helpLabel"),
                "helpUrl": obj.get("helpUrl"),
                "customLink1Label": obj.get("customLink1Label"),
                "customLink1Url": obj.get("customLink1Url"),
                "customLink2Label": obj.get("customLink2Label"),
                "customLink2Url": obj.get("customLink2Url"),
                "authenticatorPageCustomLinkLabel": obj.get(
                    "authenticatorPageCustomLinkLabel"
                ),
                "authenticatorPageCustomLinkUrl": obj.get(
                    "authenticatorPageCustomLinkUrl"
                ),
                "classicRecoveryFlowEmailOrUsernameLabel": obj.get(
                    "classicRecoveryFlowEmailOrUsernameLabel"
                ),
            }
        )
        return _obj
