// This file is auto-generated by @hey-api/openapi-ts

export type ClientOptions = {
  baseUrl: `${string}://${string}` | (string & {})
}

export type Account = {
  id?: string
  email?: string
  name?: string
}

export type AccountDetail = {
  account?: Account
  status?: string
  createdAt?: string
  lastActiveAt?: string
  workspaces?: Array<AccountInWorkspace>
  groups?: Array<AccountDetailGroup>
}

export type AccountDetailGroup = {
  id?: string
  name?: string
}

export type AccountInWorkspace = {
  workspaceId?: string
  workspaceName?: string
  role?: string
}

export type AddGroupAppsRequest = {
  id?: string
  app_ids?: Array<string>
}

export type AuthSettingsReply = {
  userSsoSettings?: SsoSettings
  webSsoSettings?: SsoSettings
  dashboardSsoSettings?: SsoSettings
  userSsoSamlAcsUrl?: string
  userSsoOidcCallbackUrl?: string
  userSsoOauth2CallbackUrl?: string
  webSsoSamlAcsUrl?: string
  webSsoOidcCallbackUrl?: string
  webSsoOauth2CallbackUrl?: string
  webSsoMembersSamlAcsUrl?: string
  webSsoMembersOidcCallbackUrl?: string
  webSsoMembersOauth2CallbackUrl?: string
  dashboardSsoSamlAcsUrl?: string
  dashboardSsoOidcCallbackUrl?: string
  dashboardSsoOauth2CallbackUrl?: string
}

export type AuthSettingsReq = {
  ssoType?: string
  ssoSettings?: SsoSettings
}

export type BrandingInfo = {
  enabled?: boolean
  applicationTitle?: string
  loginPageLogo?: string
  workspaceLogo?: string
  favicon?: string
}

export type CheckPasswordStatusReply = {
  requirePasswordChange?: boolean
  changeReason?: number
  daysToExpire?: number
  message?: string
}

export type ClearDefaultWorkspaceReply = {
  [key: string]: unknown
}

export type CreateBearerTokenResponse = {
  token?: string
}

export type CreateMemberReply = {
  id?: string
  password?: string
}

export type CreateMemberReq = {
  name?: string
  email?: string
  status?: string
}

export type CreateNewGroupsReq = {
  groups?: Array<CreateNewGroupsReqGroup>
}

export type CreateNewGroupsReqGroup = {
  name?: string
}

export type CreateNewGroupsRes = {
  groups?: Array<SubjectGroupData>
}

export type CreateResourceGroupRequest = {
  name?: string
  description?: string
}

export type CreateSecretKeyReply = {
  id?: string
  name?: string
  secretKey?: string
  createdAt?: string
  lastActive?: string
}

export type CreateSecretKeyReq = {
  name?: string
}

export type CreateUserReply = {
  id?: string
  password?: string
}

export type CreateUserReq = {
  name?: string
  email?: string
  status?: string
}

export type CreateWorkspaceReply = {
  workspace?: Workspace
}

export type CreateWorkspaceReq = {
  name?: string
  email?: string
  status?: string
}

export type CurrentUserReply = {
  id?: string
  name?: string
  email?: string
  interfaceLanguage?: string
  timezone?: string
}

export type DashboardSsooidcLoginReply = {
  url?: string
  state?: string
}

export type DashboardSsoOauth2LoginReply = {
  url?: string
  state?: string
}

export type DashboardSsosamlLoginReply = {
  url?: string
}

export type DeleteGroupsRes = {
  message?: string
}

export type DeleteMemberReply = {
  account?: Account
}

export type DeleteSecretKeyReply = {
  message?: string
}

export type DeleteUserReply = {
  account?: Account
}

export type DeleteWorkspaceReply = {
  [key: string]: unknown
}

export type EndpointReply = {
  mode?: number
  metricsEndpoint?: OtelExporterEndpoint
  tracesEndpoint?: OtelExporterEndpoint
}

export type EnterpriseSystemUserSettingReply = {
  ssoEnforcedForSignin?: boolean
  ssoEnforcedForSigninProtocol?: string
  enableEmailPasswordLogin?: boolean
}

export type GetBearerTokenResponse = {
  maskedToken?: string
}

export type GetClusterInfoReply = {
  mode?: string
  clusterId?: string
  verifyMode?: string
}

export type GetDefaultWorkspaceReply = {
  workspaceId?: string
  workspace?: Workspace
}

export type GetGroupSubjectsRes = {
  subjects?: Array<Subject>
}

export type GetGroupsRes = {
  groups?: Array<SubjectGroupData>
}

export type GetJoinedGroupsRes = {
  groups?: Array<SubjectGroupData>
}

export type GetLicenseReply = {
  license?: LicenseInfo
}

export type GetLicenseStatusReply = {
  status?: string
}

export type GetMfaInfoReply = {
  userEnabled?: boolean
  userSetup?: boolean
  globalEnabled?: boolean
}

export type GetMemberReply = {
  account?: AccountDetail
}

export type GetUserReply = {
  account?: AccountDetail
}

export type GetWebAppAccessModeRes = {
  accessMode?: string
}

export type GetWebAppAuthInfoRes = {
  allowSso?: boolean
  allowEmailCodeLogin?: boolean
  allowEmailPasswordLogin?: boolean
}

export type GetWebAppWhitelistSubjectsRes = {
  groups?: Array<SubjectGroupData>
  members?: Array<GetWebAppWhitelistSubjectsResMember>
}

export type GetWebAppWhitelistSubjectsResMember = {
  id?: string
  name?: string
  email?: string
  avatar?: string
}

export type GetWorkspacePermissionReply = {
  permission?: WorkspacePermission
}

export type GetWorkspaceReply = {
  workspace?: Workspace
}

export type GroupAppItem = {
  app_id?: string
  app_name?: string
  workspace_id?: string
  workspace_name?: string
  app_status?: number
  token_usage?: string
  rpm?: string
  concurrency?: string
}

export type HealthzReply = {
  message?: string
  status?: string
}

export type InfoConfigReply = {
  SSOEnforcedForSignin?: boolean
  SSOEnforcedForSigninProtocol?: string
  SSOEnforcedForWeb?: boolean
  SSOEnforcedForWebProtocol?: string
  EnableEmailCodeLogin?: boolean
  EnableEmailPasswordLogin?: boolean
  IsAllowRegister?: boolean
  IsAllowCreateWorkspace?: boolean
  License?: LicenseStatus
  Branding?: BrandingInfo
  WebAppAuth?: WebAppAuthInfo
  PluginInstallationPermission?: PluginInstallationPermissionInfo
}

export type InnerAdmission = {
  marker?: string
  concurrencyGroupIds?: Array<string>
}

export type InnerBatchGetWebAppAccessModesByIdReq = {
  appIds?: Array<string>
}

export type InnerBatchGetWebAppAccessModesByIdRes = {
  accessModes?: {
    [key: string]: string
  }
}

export type InnerBatchIsUserAllowedToAccessWebAppReq = {
  userId?: string
  appIds?: Array<string>
}

export type InnerBatchIsUserAllowedToAccessWebAppRes = {
  permissions?: {
    [key: string]: boolean
  }
}

export type InnerCleanAppRes = {
  message?: string
}

export type InnerGetWebAppAccessModeByCodeRes = {
  accessMode?: string
}

export type InnerGetWebAppAccessModeByIdRes = {
  accessMode?: string
}

export type InnerGroupConfig = {
  id?: string
  enabled?: boolean
  membershipId?: string
  limits?: Array<LimitConfig>
}

export type InnerIsUserAllowedToAccessWebAppRes = {
  result?: boolean
}

export type InnerReleaseAdmissionRequest = {
  admission?: InnerAdmission
}

export type InnerReleaseAdmissionResponse = {
  [key: string]: unknown
}

export type InnerResolveResponse = {
  appId?: string
  groups?: Array<InnerGroupConfig>
  blocked?: boolean
  blockGroupId?: string
  blockReason?: string
  admission?: InnerAdmission
}

export type InnerTryAddAccountToDefaultWorkspaceReply = {
  workspaceId?: string
  joined?: boolean
  message?: string
}

export type InnerTryAddAccountToDefaultWorkspaceReq = {
  accountId?: string
}

export type IsUserAllowedToAccessWebAppRes = {
  result?: boolean
}

export type JoinWorkspaceReply = {
  message?: string
}

export type JoinWorkspaceReq = {
  id?: string
  email?: string
  role?: string
}

export type LicenseInfo = {
  uuid?: string
  expiredAt?: string
  clusterId?: string
  product?: string
  limits?: LimitFields
}

export type LicenseStatus = {
  status?: string
  expiredAt?: string
  workspaces?: ResourceQuota
}

export type LimitConfig = {
  type?: number
  threshold?: string
  action?: number
  reached?: boolean
}

export type LimitFields = {
  workspaceMembers?: number
  workspaces?: ResourceQuota
}

export type ListGroupAppsResponse = {
  items?: Array<GroupAppItem>
  total?: string
}

export type ListMembersReply = {
  data?: Array<AccountDetail>
  pagination?: Pagination
}

export type ListResourceGroupsResponse = {
  items?: Array<ResourceGroupItem>
  total?: string
}

export type ListSecretKeysReply = {
  data?: Array<SecretKey>
  pagination?: Pagination
}

export type ListUsersReply = {
  data?: Array<AccountDetail>
  pagination?: Pagination
}

export type ListWorkspacesReply = {
  data?: Array<Workspace>
  pagination?: Pagination
}

export type LoginTypesReply = {
  enabledEmailCodeLogin?: boolean
  enableEmailPasswordLogin?: boolean
  isAllowRegister?: boolean
  isAllowCreateWorkspace?: boolean
}

export type LoginTypesReq = {
  enabledEmailCodeLogin?: boolean
  enableEmailPasswordLogin?: boolean
  isAllowRegister?: boolean
  isAllowCreateWorkspace?: boolean
}

export type MfaBackupCodesRes = {
  codes?: Array<string>
  validCounts?: number
  createdAt?: string
}

export type MfaDeleteBackupCodesRes = {
  message?: string
}

export type MfaDeleteRes = {
  token?: string
}

export type MfaDownloadBackupCodesSummaryRes = {
  content?: string
}

export type MfaEnrollReq = {
  code?: string
}

export type MfaEnrollRes = {
  token?: string
}

export type MfaGetEnrollInfoRes = {
  qrCode?: string
  secret?: string
}

export type MfaModifyRes = {
  message?: string
}

export type OAuth2Config = {
  clientId?: string
  clientSecret?: string
  authUrl?: string
  tokenUrl?: string
  userinfoUrl?: string
  scopes?: string
  enablePkce?: boolean
}

export type OAuth2LoginReply = {
  url?: string
  state?: string
}

export type OidcConfig = {
  issuerUrl?: string
  clientId?: string
  clientSecret?: string
  enablePkce?: boolean
}

export type OidcReply = {
  url?: string
  state?: string
}

export type OtelExporterEndpoint = {
  endpoint?: string
  compression?: string
  protocol?: number
  timeout?: string
  headers?: {
    [key: string]: string
  }
  tlsCaPem?: string
  tlsInsecure?: boolean
  tlsClientCertPem?: string
  tlsClientKeyPem?: string
  enabled?: boolean
  tlsInsecureSkipVerify?: boolean
}

export type OtelExporterStatusReply = {
  connectedAt?: string
  bytesPushed?: string
  itemsInQueue?: string
  logs?: string
  status?: number
}

export type PasswordPolicyConfig = {
  minLength?: number
  requireDigit?: boolean
  requireLowercase?: boolean
  requireUppercase?: boolean
  requireSpecial?: boolean
  forbidRepeated?: boolean
  forbidSequential?: boolean
  expiryEnabled?: boolean
  expiryDays?: number
}

export type PasswordStrengthReply = {
  level?: number
}

export type PasswordStrengthReq = {
  password?: string
}

export type PluginInstallationPermissionInfo = {
  pluginInstallationScope?: string
  restrictToMarketplaceOnly?: boolean
}

export type PluginInstallationSettingsReply = {
  pluginInstallationScope?: number
  restrictToMarketplaceOnly?: boolean
}

export type ResetMemberPasswordReply = {
  id?: string
  password?: string
}

export type ResetMemberPasswordReq = {
  id?: string
}

export type ResetPasswordReply = {
  message?: string
}

export type ResetPasswordReq = {
  currentPassword?: string
  newPassword?: string
  confirmPassword?: string
}

export type ResetUserPasswordReply = {
  id?: string
  password?: string
}

export type ResetUserPasswordReq = {
  id?: string
}

export type ResourceGroupDetail = {
  id?: string
  name?: string
  description?: string
  enabled?: boolean
  rpm_limit?: number
  rpm_action?: number
  concurrency_limit?: number
  concurrency_action?: number
  token_quota?: string
  token_action?: number
  created_at?: string
  updated_at?: string
}

export type ResourceGroupItem = {
  id?: string
  name?: string
  description?: string
  enabled?: boolean
  rpm_limit?: number
  concurrency_limit?: number
  token_quota?: string
  token_usage?: string
  app_count?: string
  rpm_status?: number
  conc_status?: number
  created_at?: string
  updated_at?: string
}

export type ResourceQuota = {
  used?: number
  limit?: number
  enabled?: boolean
}

export type SamlConfig = {
  idpSsoUrl?: string
  certificate?: string
}

export type SamlLoginReply = {
  url?: string
}

export type SsoIdPProvider = {
  protocol?: string
  provider?: string
  samlConfig?: SamlConfig
  oidcConfig?: OidcConfig
  oauth2Config?: OAuth2Config
}

export type SsoSettings = {
  ssoEnforced?: boolean
  sessionTimeout?: number
  ssoIdpProvider?: SsoIdPProvider
}

export type SsoSettingsReply = {
  enabled?: boolean
}

export type ScimSettings = {
  enabled?: boolean
  lastSyncTime?: string
}

export type SearchAppItem = {
  app_id?: string
  app_name?: string
  workspace_id?: string
  workspace_name?: string
  app_status?: number
  icon?: string
  icon_type?: string
  icon_background?: string
  created_by_name?: string
}

export type SearchAppsResponse = {
  items?: Array<SearchAppItem>
  total?: string
}

export type SearchForWhilteListCandidatesRes = {
  subjects?: Array<Subject>
  currPage?: number
  hasMore?: boolean
}

export type SecretKey = {
  id?: string
  name?: string
  secretKeyMasked?: string
  createdAt?: string
  lastActive?: string
}

export type SetDefaultWorkspaceReply = {
  workspaceId?: string
}

export type SetDefaultWorkspaceReq = {
  id?: string
}

export type Subject = {
  subjectId?: string
  subjectType?: string
  accountData?: SubjectAccountData
  groupData?: SubjectGroupData
}

export type SubjectAccountData = {
  id?: string
  name?: string
  email?: string
  avatar?: string
}

export type SubjectGroupData = {
  id?: string
  name?: string
  groupSize?: number
}

export type SystemUserSettingReply = {
  isAllowRegister?: boolean
  enableEmailPasswordLogin?: boolean
}

export type SystemUserSettingReq = {
  isAllowRegister?: boolean
  enableEmailPasswordLogin?: boolean
}

export type TestConnectionReply = {
  success?: boolean
  error?: string
}

export type ToggleEndpointRequest = {
  enabled?: boolean
}

export type UpdateAccessModeReq = {
  appId?: string
  accessMode?: string
}

export type UpdateAccessModeRes = {
  message?: string
}

export type UpdateBrandingInfoReq = {
  enabled?: boolean
  applicationTitle?: string
  loginPageLogo?: string
  workspaceLogo?: string
  favicon?: string
}

export type UpdateGroupSubjectsReq = {
  groupId?: string
  subjects?: Array<Subject>
}

export type UpdateGroupSubjectsRes = {
  message?: string
}

export type UpdateGroupsReq = {
  groups?: Array<UpdateGroupsReqGroup>
}

export type UpdateGroupsReqGroup = {
  id?: string
  name?: string
}

export type UpdateGroupsRes = {
  groups?: Array<SubjectGroupData>
}

export type UpdateJoinedGroupsReq = {
  accountId?: string
  groupIds?: Array<string>
}

export type UpdateJoinedGroupsRes = {
  message?: string
}

export type UpdateLicenseReply = {
  message?: string
}

export type UpdateLicenseReq = {
  licenseId?: string
}

export type UpdateMfaStatusReq = {
  enabled?: boolean
}

export type UpdateMfaStatusRes = {
  message?: string
}

export type UpdateMemberReply = {
  account?: Account
}

export type UpdateMemberReq = {
  id?: string
  name?: string
  email?: string
  status?: string
}

export type UpdateMembersInGroupsReq = {
  groupId?: string
  accountIds?: Array<string>
}

export type UpdateMembersInGroupsRes = {
  message?: string
}

export type UpdateOfflineLicenseReply = {
  message?: string
}

export type UpdateOfflineLicenseReq = {
  offlineCode?: string
}

export type UpdatePluginInstallationSettingsRequest = {
  pluginInstallationScope?: number
  restrictToMarketplaceOnly?: boolean
}

export type UpdateResourceGroupRequest = {
  id?: string
  name?: string
  description?: string
  enabled?: boolean
  rpm_limit?: number
  rpm_action?: number
  concurrency_limit?: number
  concurrency_action?: number
  token_quota?: string
  token_action?: number
}

export type UpdateUserReply = {
  account?: AccountDetail
}

export type UpdateUserReq = {
  id?: string
  name?: string
  email?: string
  status?: string
}

export type UpdateWebAppAuthInfoReq = {
  allowSso?: boolean
  allowEmailCodeLogin?: boolean
  allowEmailPasswordLogin?: boolean
}

export type UpdateWebAppAuthInfoRes = {
  message?: string
}

export type UpdateWebAppWhitelistSubjectsReq = {
  appId?: string
  subjects?: Array<Subject>
  accessMode?: string
}

export type UpdateWebAppWhitelistSubjectsRes = {
  message?: string
}

export type UpdateWorkspacePermissionReply = {
  message?: string
  permission?: WorkspacePermission
}

export type UpdateWorkspacePermissionReq = {
  id?: string
  permission?: WorkspacePermission
}

export type UpdateWorkspaceReply = {
  workspace?: Workspace
}

export type UpdateWorkspaceReq = {
  id?: string
  name?: string
  email?: string
  status?: string
}

export type WebAppAuthInfo = {
  allowSso?: boolean
  allowEmailCodeLogin?: boolean
  allowEmailPasswordLogin?: boolean
}

export type WebOAuth2LoginReply = {
  url?: string
  state?: string
}

export type WebOidcLoginReply = {
  url?: string
}

export type WebSamlLoginReply = {
  url?: string
}

export type Workspace = {
  id?: string
  name?: string
  status?: string
  createdAt?: string
  owner?: Account
}

export type WorkspaceInfoReply = {
  WorkspaceMembers?: ResourceQuota
}

export type WorkspacePermission = {
  workspaceId?: string
  allowMemberInvite?: boolean
  allowOwnerTransfer?: boolean
}

export type Pagination = {
  totalCount?: number
  perPage?: number
  currentPage?: number
  totalPages?: number
}

export type ConsoleSsoOAuth2LoginData = {
  body?: never
  path?: never
  query?: never
  url: '/enterprise/sso/oauth2/login'
}

export type ConsoleSsoOAuth2LoginResponses = {
  200: OAuth2LoginReply
}

export type ConsoleSsoOAuth2LoginResponse
  = ConsoleSsoOAuth2LoginResponses[keyof ConsoleSsoOAuth2LoginResponses]

export type ConsoleSsoOidcLoginData = {
  body?: never
  path?: never
  query?: never
  url: '/enterprise/sso/oidc/login'
}

export type ConsoleSsoOidcLoginResponses = {
  200: OidcReply
}

export type ConsoleSsoOidcLoginResponse
  = ConsoleSsoOidcLoginResponses[keyof ConsoleSsoOidcLoginResponses]

export type ConsoleSsoSamlLoginData = {
  body?: never
  path?: never
  query?: never
  url: '/enterprise/sso/saml/login'
}

export type ConsoleSsoSamlLoginResponses = {
  200: SamlLoginReply
}

export type ConsoleSsoSamlLoginResponse
  = ConsoleSsoSamlLoginResponses[keyof ConsoleSsoSamlLoginResponses]

export type WebAppAuthGetWebAppAccessModeData = {
  body?: never
  path?: never
  query?: {
    appId?: string
  }
  url: '/enterprise/webapp/app/access-mode'
}

export type WebAppAuthGetWebAppAccessModeResponses = {
  200: GetWebAppAccessModeRes
}

export type WebAppAuthGetWebAppAccessModeResponse
  = WebAppAuthGetWebAppAccessModeResponses[keyof WebAppAuthGetWebAppAccessModeResponses]

export type WebAppAuthUpdateWebAppWhitelistSubjectsData = {
  body: UpdateWebAppWhitelistSubjectsReq
  path?: never
  query?: never
  url: '/enterprise/webapp/app/access-mode'
}

export type WebAppAuthUpdateWebAppWhitelistSubjectsResponses = {
  200: UpdateWebAppWhitelistSubjectsRes
}

export type WebAppAuthUpdateWebAppWhitelistSubjectsResponse
  = WebAppAuthUpdateWebAppWhitelistSubjectsResponses[keyof WebAppAuthUpdateWebAppWhitelistSubjectsResponses]

export type WebAppAuthSearchForWhilteListCandidatesData = {
  body?: never
  path?: never
  query?: {
    keyword?: string
    pageNumber?: number
    resultsPerPage?: number
    groupId?: string
  }
  url: '/enterprise/webapp/app/subject/search'
}

export type WebAppAuthSearchForWhilteListCandidatesResponses = {
  200: SearchForWhilteListCandidatesRes
}

export type WebAppAuthSearchForWhilteListCandidatesResponse
  = WebAppAuthSearchForWhilteListCandidatesResponses[keyof WebAppAuthSearchForWhilteListCandidatesResponses]

export type WebAppAuthGetWebAppWhitelistSubjectsData = {
  body?: never
  path?: never
  query?: {
    appId?: string
  }
  url: '/enterprise/webapp/app/subjects'
}

export type WebAppAuthGetWebAppWhitelistSubjectsResponses = {
  200: GetWebAppWhitelistSubjectsRes
}

export type WebAppAuthGetWebAppWhitelistSubjectsResponse
  = WebAppAuthGetWebAppWhitelistSubjectsResponses[keyof WebAppAuthGetWebAppWhitelistSubjectsResponses]

export type WebAppAuthGetGroupSubjectsData = {
  body?: never
  path?: never
  query?: {
    groupId?: string
  }
  url: '/enterprise/webapp/group/subjects'
}

export type WebAppAuthGetGroupSubjectsResponses = {
  200: GetGroupSubjectsRes
}

export type WebAppAuthGetGroupSubjectsResponse
  = WebAppAuthGetGroupSubjectsResponses[keyof WebAppAuthGetGroupSubjectsResponses]

export type WebAppAuthIsUserAllowedToAccessWebAppData = {
  body?: never
  path?: never
  query?: {
    appId?: string
  }
  url: '/enterprise/webapp/permission'
}

export type WebAppAuthIsUserAllowedToAccessWebAppResponses = {
  200: IsUserAllowedToAccessWebAppRes
}

export type WebAppAuthIsUserAllowedToAccessWebAppResponse
  = WebAppAuthIsUserAllowedToAccessWebAppResponses[keyof WebAppAuthIsUserAllowedToAccessWebAppResponses]
