# coding: utf-8

"""
    OidcVpAdapterBackend

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 1.0.0
    Contact: info@affinidi.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

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


from __future__ import annotations
import pprint
import re  # noqa: F401
import json


from typing import List, Optional
from pydantic import BaseModel, Field, StrictStr, conlist
from affinidi_tdk_login_configuration_client.models.create_login_configuration_output_auth import CreateLoginConfigurationOutputAuth
from affinidi_tdk_login_configuration_client.models.login_configuration_client_metadata_output import LoginConfigurationClientMetadataOutput

class CreateLoginConfigurationOutput(BaseModel):
    """
    CreateLoginConfigurationOutput
    """
    ari: StrictStr = Field(default=..., description="Configuration ari")
    project_id: StrictStr = Field(default=..., alias="projectId", description="Project id")
    configuration_id: Optional[StrictStr] = Field(default=None, alias="configurationId", description="Configuration id")
    name: StrictStr = Field(default=..., description="User defined login configuration name")
    auth: CreateLoginConfigurationOutputAuth = Field(...)
    redirect_uris: conlist(StrictStr) = Field(default=..., alias="redirectUris", description="OAuth 2.0 Redirect URIs")
    client_metadata: LoginConfigurationClientMetadataOutput = Field(default=..., alias="clientMetadata")
    creation_date: StrictStr = Field(default=..., alias="creationDate", description="OAuth 2.0 Client Creation Date")
    post_logout_redirect_uris: Optional[conlist(StrictStr)] = Field(default=None, alias="postLogoutRedirectUris", description="Post Logout Redirect URIs, Used to redirect the user's browser to a specified URL after the logout process is complete. Must match the domain, port, scheme of at least one of the registered redirect URIs")
    __properties = ["ari", "projectId", "configurationId", "name", "auth", "redirectUris", "clientMetadata", "creationDate", "postLogoutRedirectUris"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

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

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

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

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        # override the default output from pydantic by calling `to_dict()` of auth
        if self.auth:
            _dict['auth'] = self.auth.to_dict()
        # override the default output from pydantic by calling `to_dict()` of client_metadata
        if self.client_metadata:
            _dict['clientMetadata'] = self.client_metadata.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> CreateLoginConfigurationOutput:
        """Create an instance of CreateLoginConfigurationOutput from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return CreateLoginConfigurationOutput.parse_obj(obj)

        _obj = CreateLoginConfigurationOutput.parse_obj({
            "ari": obj.get("ari"),
            "project_id": obj.get("projectId"),
            "configuration_id": obj.get("configurationId"),
            "name": obj.get("name"),
            "auth": CreateLoginConfigurationOutputAuth.from_dict(obj.get("auth")) if obj.get("auth") is not None else None,
            "redirect_uris": obj.get("redirectUris"),
            "client_metadata": LoginConfigurationClientMetadataOutput.from_dict(obj.get("clientMetadata")) if obj.get("clientMetadata") is not None else None,
            "creation_date": obj.get("creationDate"),
            "post_logout_redirect_uris": obj.get("postLogoutRedirectUris")
        })
        return _obj


