# coding: utf-8

"""
    Onshape REST API

    The Onshape REST API consumed by all client. # Authorization The simplest way to authorize and enable the **Try it out** functionality is to sign in to Onshape and use the current session. The **Authorize** button enables other authorization techniques. To ensure the current session isn't used when trying other authentication techniques, make sure to remove the Onshape cookie as per the instructions for your particular browser. Alternatively, a private or incognito window may be used. Here's [how to remove a specific cookie on Chrome](https://support.google.com/chrome/answer/95647#zippy=%2Cdelete-cookies-from-a-site). - **Current Session** authorization is enabled by default if the browser is already signed in to [Onshape](/). - **OAuth2** authorization uses an Onshape OAuth2 app created on the [Onshape Developer Portal](https://dev-portal.onshape.com/oauthApps). The redirect URL field should include `https://cad.onshape.com/glassworks/explorer/oauth2-redirect.html`. - **API Key** authorization using basic authentication is also available. The keys can be generated in the [Onshape Developer Portal](https://dev-portal.onshape.com/keys). In the authentication dialog, enter the access key in the `Username` field, and enter the secret key in the `Password` field. Basic authentication should only be used during the development process since sharing API Keys provides the same level of access as a username and password.  # noqa: E501

    The version of the OpenAPI document: 1.148.5096-9e2122142227
    Contact: api-support@onshape.zendesk.com
    Generated by: https://openapi-generator.tech
"""

import re  # noqa: F401
import sys  # noqa: F401
import typing  # noqa: F401

from frozendict import frozendict  # noqa: F401

import decimal  # noqa: F401
from datetime import date, datetime  # noqa: F401
from frozendict import frozendict  # noqa: F401

from openapi_client.schemas import (  # noqa: F401
    AnyTypeSchema,
    ComposedSchema,
    DictSchema,
    ListSchema,
    StrSchema,
    IntSchema,
    Int32Schema,
    Int64Schema,
    Float32Schema,
    Float64Schema,
    NumberSchema,
    DateSchema,
    DateTimeSchema,
    DecimalSchema,
    BoolSchema,
    BinarySchema,
    NoneSchema,
    none_type,
    InstantiationMetadata,
    Unset,
    unset,
    ComposedBase,
    ListBase,
    DictBase,
    NoneBase,
    StrBase,
    IntBase,
    Int32Base,
    Int64Base,
    Float32Base,
    Float64Base,
    NumberBase,
    DateBase,
    DateTimeBase,
    BoolBase,
    BinaryBase,
    Schema,
    _SchemaValidator,
    _SchemaTypeChecker,
    _SchemaEnumMaker
)


class BTUserOAuth2SummaryInfo(
    DictSchema
):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """
    clientId = StrSchema

    @classmethod
    @property
    def company(cls) -> typing.Type['BTCompanySummaryInfo']:
        return BTCompanySummaryInfo
    companyPlan = BoolSchema
    documentationName = StrSchema
    documentationNameOverride = StrSchema
    email = StrSchema
    firstName = StrSchema

    @classmethod
    @property
    def globalPermissions(cls) -> typing.Type['GlobalPermissionInfo']:
        return GlobalPermissionInfo
    href = StrSchema
    id = StrSchema
    image = StrSchema
    isGuest = BoolSchema
    isLight = BoolSchema
    lastLoginTime = DateTimeSchema
    lastName = StrSchema
    name = StrSchema
    oauth2Scopes = Int64Schema
    personalMessageAllowed = BoolSchema
    planGroup = StrSchema
    role = Int32Schema
    
    
    class roles(
        _SchemaValidator(
            unique_items=True,
        ),
        ListSchema
    ):
        
        
        class _items(
            _SchemaEnumMaker(
                enum_value_to_name={
                    "ANONYMOUS": "ANONYMOUS",
                    "TOTPPENDINGUSER": "TOTPPENDINGUSER",
                    "USER": "USER",
                    "DEVELOPER": "DEVELOPER",
                    "PARTNER": "PARTNER",
                    "ONSHAPECOMPANYUSER": "ONSHAPECOMPANYUSER",
                    "ADMIN": "ADMIN",
                    "SERVICE": "SERVICE",
                }
            ),
            StrSchema
        ):
            
            @classmethod
            @property
            def ANONYMOUS(cls):
                return cls._enum_by_value["ANONYMOUS"]("ANONYMOUS")
            
            @classmethod
            @property
            def TOTPPENDINGUSER(cls):
                return cls._enum_by_value["TOTPPENDINGUSER"]("TOTPPENDINGUSER")
            
            @classmethod
            @property
            def USER(cls):
                return cls._enum_by_value["USER"]("USER")
            
            @classmethod
            @property
            def DEVELOPER(cls):
                return cls._enum_by_value["DEVELOPER"]("DEVELOPER")
            
            @classmethod
            @property
            def PARTNER(cls):
                return cls._enum_by_value["PARTNER"]("PARTNER")
            
            @classmethod
            @property
            def ONSHAPECOMPANYUSER(cls):
                return cls._enum_by_value["ONSHAPECOMPANYUSER"]("ONSHAPECOMPANYUSER")
            
            @classmethod
            @property
            def ADMIN(cls):
                return cls._enum_by_value["ADMIN"]("ADMIN")
            
            @classmethod
            @property
            def SERVICE(cls):
                return cls._enum_by_value["SERVICE"]("SERVICE")
    source = Int32Schema
    state = Int32Schema
    viewRef = StrSchema


    def __new__(
        cls,
        *args: typing.Union[dict, frozendict, ],
        clientId: typing.Union[clientId, Unset] = unset,
        company: typing.Union['BTCompanySummaryInfo', Unset] = unset,
        companyPlan: typing.Union[companyPlan, Unset] = unset,
        documentationName: typing.Union[documentationName, Unset] = unset,
        documentationNameOverride: typing.Union[documentationNameOverride, Unset] = unset,
        email: typing.Union[email, Unset] = unset,
        firstName: typing.Union[firstName, Unset] = unset,
        globalPermissions: typing.Union['GlobalPermissionInfo', Unset] = unset,
        href: typing.Union[href, Unset] = unset,
        id: typing.Union[id, Unset] = unset,
        image: typing.Union[image, Unset] = unset,
        isGuest: typing.Union[isGuest, Unset] = unset,
        isLight: typing.Union[isLight, Unset] = unset,
        lastLoginTime: typing.Union[lastLoginTime, Unset] = unset,
        lastName: typing.Union[lastName, Unset] = unset,
        name: typing.Union[name, Unset] = unset,
        oauth2Scopes: typing.Union[oauth2Scopes, Unset] = unset,
        personalMessageAllowed: typing.Union[personalMessageAllowed, Unset] = unset,
        planGroup: typing.Union[planGroup, Unset] = unset,
        role: typing.Union[role, Unset] = unset,
        roles: typing.Union[roles, Unset] = unset,
        source: typing.Union[source, Unset] = unset,
        state: typing.Union[state, Unset] = unset,
        viewRef: typing.Union[viewRef, Unset] = unset,
        _instantiation_metadata: typing.Optional[InstantiationMetadata] = None,
        **kwargs: typing.Type[Schema],
    ) -> 'BTUserOAuth2SummaryInfo':
        return super().__new__(
            cls,
            *args,
            clientId=clientId,
            company=company,
            companyPlan=companyPlan,
            documentationName=documentationName,
            documentationNameOverride=documentationNameOverride,
            email=email,
            firstName=firstName,
            globalPermissions=globalPermissions,
            href=href,
            id=id,
            image=image,
            isGuest=isGuest,
            isLight=isLight,
            lastLoginTime=lastLoginTime,
            lastName=lastName,
            name=name,
            oauth2Scopes=oauth2Scopes,
            personalMessageAllowed=personalMessageAllowed,
            planGroup=planGroup,
            role=role,
            roles=roles,
            source=source,
            state=state,
            viewRef=viewRef,
            _instantiation_metadata=_instantiation_metadata,
            **kwargs,
        )

from openapi_client.model.bt_company_summary_info import BTCompanySummaryInfo
from openapi_client.model.global_permission_info import GlobalPermissionInfo
