# generated by datamodel-codegen:
#   filename:  swagger.json
#   timestamp: 2023-03-19T19:24:29+00:00

from __future__ import annotations

from enum import Enum
from typing import List, Optional

from pydantic import Field

import cherwell_pydantic_api.types as ct
from cherwell_pydantic_api.generated_api_utils import ApiBaseModel, HttpStatusCode


class DeleteApiClientSettingsResponse(ApiBaseModel):
    errorCode: Optional[str] = None
    errorMessage: Optional[str] = None
    hasError: Optional[bool] = None
    httpStatusCode: Optional[HttpStatusCode] = None


import cherwell_pydantic_api.types as ct


class GetApiClientSettingsResponseItem(ApiBaseModel):
    name: Optional[str] = None
    standInKey: Optional[str] = None


import cherwell_pydantic_api.types as ct


class ApiClientSettingResponse(ApiBaseModel):
    name: Optional[str] = None
    description: Optional[str] = None
    culture: Optional[str] = None
    clientKey: Optional[str] = None
    tokenLifespanMinutes: Optional[int] = None
    refreshTokenLifespanMinutes: Optional[int] = None
    apiAccessIsEnabled: Optional[bool] = None
    allowAnonymousAccess: Optional[bool] = None
    standInKey: Optional[str] = None
    errorCode: Optional[str] = None
    errorMessage: Optional[str] = None
    hasError: Optional[bool] = None
    httpStatusCode: Optional[HttpStatusCode] = None


import cherwell_pydantic_api.types as ct


class ClientSecuritySettingsResponse(ApiBaseModel):
    internalLoginAllowed: Optional[bool] = None
    ldapLoginAllowed: Optional[bool] = None
    samlLoginAllowed: Optional[bool] = None
    windowsLoginAllowed: Optional[bool] = None


import cherwell_pydantic_api.types as ct


class MobileCredentialsModeResponse(ApiBaseModel):
    credentialsMode: Optional[int] = None
    errorCode: Optional[str] = None
    errorMessage: Optional[str] = None
    hasError: Optional[bool] = None
    httpStatusCode: Optional[HttpStatusCode] = None


import cherwell_pydantic_api.types as ct


class Role(ApiBaseModel):
    browserClientCustomViewId: Optional[str] = None
    businessObjectExcludeList: Optional[List[str]] = None
    culture: Optional[str] = None
    description: Optional[str] = None
    mobileClientCustomViewId: Optional[str] = None
    primaryBusObId: Optional[ct.BusObID] = None
    roleId: Optional[str] = None
    roleName: Optional[str] = None
    smartClientCustomViewId: Optional[str] = None


import cherwell_pydantic_api.types as ct


class RoleReadV2Response(ApiBaseModel):
    roles: Optional[List[Role]] = None
    errorCode: Optional[str] = None
    errorMessage: Optional[str] = None
    hasError: Optional[bool] = None
    httpStatusCode: Optional[HttpStatusCode] = None


import cherwell_pydantic_api.types as ct


class FieldPermission(ApiBaseModel):
    departmentMemberEdit: Optional[bool] = None
    departmentMemberView: Optional[bool] = None
    edit: Optional[bool] = None
    fieldId: Optional[str] = None
    fieldName: Optional[str] = None
    managerOfOwnerEdit: Optional[bool] = None
    managerOfOwnerView: Optional[bool] = None
    ownerEdit: Optional[bool] = None
    ownerView: Optional[bool] = None
    teamEdit: Optional[bool] = None
    teamManagerOfOwnerEdit: Optional[bool] = None
    teamManagerOfOwnerView: Optional[bool] = None
    teamView: Optional[bool] = None
    view: Optional[bool] = None


import cherwell_pydantic_api.types as ct


class RightCategory(ApiBaseModel):
    categoryDescription: Optional[str] = None
    categoryId: Optional[str] = None
    categoryName: Optional[str] = None


import cherwell_pydantic_api.types as ct


class SecurityRightCategoriesResponse(ApiBaseModel):
    rightCategories: Optional[List[RightCategory]] = None
    errorCode: Optional[str] = None
    errorMessage: Optional[str] = None
    hasError: Optional[bool] = None
    httpStatusCode: Optional[HttpStatusCode] = None


import cherwell_pydantic_api.types as ct


class Right(ApiBaseModel):
    add: Optional[bool] = None
    allow: Optional[bool] = None
    categoryDescription: Optional[str] = None
    categoryId: Optional[str] = None
    categoryName: Optional[str] = None
    delete: Optional[bool] = None
    edit: Optional[bool] = None
    isYesNoRight: Optional[bool] = None
    nonScopeOwnerAdd: Optional[bool] = None
    nonScopeOwnerDelete: Optional[bool] = None
    nonScopeOwnerEdit: Optional[bool] = None
    nonScopeOwnerView: Optional[bool] = None
    rightId: Optional[str] = None
    rightName: Optional[str] = None
    standardRightName: Optional[str] = None
    viewRunOpen: Optional[bool] = None


import cherwell_pydantic_api.types as ct


class SecurityRightsResponse(ApiBaseModel):
    rights: Optional[List[Right]] = None
    errorCode: Optional[str] = None
    errorMessage: Optional[str] = None
    hasError: Optional[bool] = None
    httpStatusCode: Optional[HttpStatusCode] = None


import cherwell_pydantic_api.types as ct


class SecurityGroup(ApiBaseModel):
    description: Optional[str] = None
    groupId: Optional[str] = None
    groupName: Optional[str] = None


import cherwell_pydantic_api.types as ct


class SecurityGroupV2Response(ApiBaseModel):
    securityGroups: Optional[List[SecurityGroup]] = None
    errorCode: Optional[str] = None
    errorMessage: Optional[str] = None
    hasError: Optional[bool] = None
    httpStatusCode: Optional[HttpStatusCode] = None


import cherwell_pydantic_api.types as ct


class SaveApiClientSettingRequest(ApiBaseModel):
    allowAnonymousAccess: Optional[bool] = None
    apiAccessIsEnabled: Optional[bool] = None
    createNewClientKey: Optional[bool] = None
    culture: Optional[str] = None
    description: Optional[str] = None
    name: Optional[str] = None
    refreshTokenLifespanMinutes: Optional[int] = None
    standInKey: Optional[str] = None
    tokenLifespanMinutes: Optional[int] = None


import cherwell_pydantic_api.types as ct


class CloneSecurityGroupRequest(ApiBaseModel):
    securityGroupName: Optional[str] = None
    sourceSecurityGroupNameOrId: Optional[str] = None


import cherwell_pydantic_api.types as ct


class CloneSecurityGroupResponse(ApiBaseModel):
    securityGroupId: Optional[str] = None
    errorCode: Optional[str] = None
    errorMessage: Optional[str] = None
    hasError: Optional[bool] = None
    httpStatusCode: Optional[HttpStatusCode] = None


import cherwell_pydantic_api.types as ct


class TokenResponse(ApiBaseModel):
    access_token: Optional[str] = None
    as_client_id: Optional[str] = Field(None, alias='as:client_id')
    field_expires: Optional[str] = Field(None, alias='.expires')
    expires_in: Optional[int] = None
    field_issued: Optional[str] = Field(None, alias='.issued')
    refresh_token: Optional[str] = None
    token_type: Optional[str] = None
    username: Optional[str] = None


import cherwell_pydantic_api.types as ct


class GetApiClientSettingsResponse(ApiBaseModel):
    settings: Optional[List[GetApiClientSettingsResponseItem]] = None
    errorCode: Optional[str] = None
    errorMessage: Optional[str] = None
    hasError: Optional[bool] = None
    httpStatusCode: Optional[HttpStatusCode] = None


import cherwell_pydantic_api.types as ct


class RoleReadResponse(ApiBaseModel):
    error: Optional[str] = None
    errorCode: Optional[str] = None
    hasError: Optional[bool] = None
    roles: Optional[List[Role]] = None


import cherwell_pydantic_api.types as ct


class BusinessObjectPermission(ApiBaseModel):
    busObId: Optional[ct.BusObID] = None
    busObName: Optional[str] = None
    departmentMemberEdit: Optional[bool] = None
    departmentMemberView: Optional[bool] = None
    edit: Optional[bool] = None
    fieldPermissions: Optional[List[FieldPermission]] = None
    managerOfOwnerEdit: Optional[bool] = None
    managerOfOwnerView: Optional[bool] = None
    ownerEdit: Optional[bool] = None
    ownerView: Optional[bool] = None
    teamEdit: Optional[bool] = None
    teamManagerOfOwnerEdit: Optional[bool] = None
    teamManagerOfOwnerView: Optional[bool] = None
    teamView: Optional[bool] = None
    view: Optional[bool] = None


import cherwell_pydantic_api.types as ct


class GetSecurityGroupBusinessObjectPermissionsResponse(ApiBaseModel):
    businessObjectPermissions: Optional[List[BusinessObjectPermission]] = None
    errorCode: Optional[str] = None
    errorMessage: Optional[str] = None
    hasError: Optional[bool] = None
    httpStatusCode: Optional[HttpStatusCode] = None


import cherwell_pydantic_api.types as ct


class SecurityGroupResponse(ApiBaseModel):
    securityGroups: Optional[List[SecurityGroup]] = None
