From 5dda1ddcfa13e1cc0d7fd461fcfd9fee2afa7ac5 Mon Sep 17 00:00:00 2001 From: wangjun <510423039@qq.com> Date: Mon, 9 Oct 2023 17:03:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IIdentitySecurityLogAppService.cs | 9 + .../PagingIdentitySecurityLogInput.cs | 51 + .../PagingIdentitySecurityLogOutput.cs | 30 + ...cManagementPermissionDefinitionProvider.cs | 3 +- .../Permissions/BasicManagementPermissions.cs | 1 + ...cManagementApplicationAutoMapperProfile.cs | 2 + .../IdentitySecurityLogAppService.cs | 46 + .../Users/AccountAppService.cs | 20 +- .../Localization/BasicManagement/en.json | 1 + .../Localization/BasicManagement/zh-Hans.json | 1 + .../GlobalUsings.cs | 1 + .../Systems/IdentitySecurityLogController.cs | 19 + .../src/locales/lang/en/routes/admin.ts | 8 + .../src/locales/lang/zh-CN/routes/admin.ts | 8 + .../vben28/src/router/routes/modules/admin.ts | 10 + .../views/admin/identitySecurityLog/Index.ts | 80 + .../views/admin/identitySecurityLog/Index.vue | 45 + ...mpanyName.MyProjectName.Application.csproj | 2 +- .../src/locales/lang/en/routes/admin.ts | 8 + .../src/locales/lang/zh-CN/routes/admin.ts | 8 + .../vben28/src/router/routes/modules/admin.ts | 10 + .../views/admin/identitySecurityLog/Index.ts | 80 + .../views/admin/identitySecurityLog/Index.vue | 45 + vben28/src/locales/lang/en/routes/admin.ts | 8 + vben28/src/locales/lang/zh-CN/routes/admin.ts | 8 + vben28/src/router/routes/modules/admin.ts | 10 + vben28/src/services/ServiceProxies.ts | 30288 ++++++++-------- .../views/admin/identitySecurityLog/Index.ts | 80 + .../views/admin/identitySecurityLog/Index.vue | 45 + 29 files changed, 15790 insertions(+), 15137 deletions(-) create mode 100644 aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/IIdentitySecurityLogAppService.cs create mode 100644 aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/PagingIdentitySecurityLogInput.cs create mode 100644 aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/PagingIdentitySecurityLogOutput.cs create mode 100644 aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/IdentitySecurityLogs/IdentitySecurityLogAppService.cs create mode 100644 aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.HttpApi/Systems/IdentitySecurityLogController.cs create mode 100644 templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/identitySecurityLog/Index.ts create mode 100644 templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/identitySecurityLog/Index.vue create mode 100644 templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/identitySecurityLog/Index.ts create mode 100644 templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/identitySecurityLog/Index.vue create mode 100644 vben28/src/views/admin/identitySecurityLog/Index.ts create mode 100644 vben28/src/views/admin/identitySecurityLog/Index.vue diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/IIdentitySecurityLogAppService.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/IIdentitySecurityLogAppService.cs new file mode 100644 index 00000000..2c0ef9a2 --- /dev/null +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/IIdentitySecurityLogAppService.cs @@ -0,0 +1,9 @@ +namespace Lion.AbpPro.BasicManagement.IdentitySecurityLogs; + +public interface IIdentitySecurityLogAppService : IApplicationService +{ + /// + /// 分页获取登录日志 + /// + Task> GetListAsync(PagingIdentitySecurityLogInput input); +} \ No newline at end of file diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/PagingIdentitySecurityLogInput.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/PagingIdentitySecurityLogInput.cs new file mode 100644 index 00000000..a5629f2b --- /dev/null +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/PagingIdentitySecurityLogInput.cs @@ -0,0 +1,51 @@ +namespace Lion.AbpPro.BasicManagement.IdentitySecurityLogs; + +public class PagingIdentitySecurityLogInput: PagingBase +{ + /// + /// 排序 + /// + public string Sorting { get; set; } + + /// + /// 开始时间 + /// + public DateTime? StartTime { get; set; } + + /// + /// 结束时间 + /// + public DateTime? EndTime { get; set; } + + public string Identity { get; set; } + + /// + /// 请求地址 + /// + public string Action { get; set; } + + /// + /// 用户Id + /// + public Guid? UserId { get; set; } + + /// + /// 用户名 + /// + public string UserName { get; set; } + + /// + /// 应用程序名称 + /// + public string ApplicationName { get; set; } + + /// + /// RequestId + /// + public string CorrelationId { get; set; } + + /// + /// ClientId + /// + public string ClientId { get; set; } +} \ No newline at end of file diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/PagingIdentitySecurityLogOutput.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/PagingIdentitySecurityLogOutput.cs new file mode 100644 index 00000000..b9d965ad --- /dev/null +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/IdentitySecurityLogs/PagingIdentitySecurityLogOutput.cs @@ -0,0 +1,30 @@ +namespace Lion.AbpPro.BasicManagement.IdentitySecurityLogs; + +public class PagingIdentitySecurityLogOutput +{ + public Guid Id { get; set; } + + public Guid? TenantId { get; set; } + + public string ApplicationName { get; set; } + + public string Identity { get; set; } + + public string Action { get; set; } + + public Guid? UserId { get; set; } + + public string UserName { get; set; } + + public string TenantName { get; set; } + + public string ClientId { get; set; } + + public string CorrelationId { get; set; } + + public string ClientIpAddress { get; set; } + + public string BrowserInfo { get; set; } + + public DateTime CreationTime { get; set; } +} \ No newline at end of file diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissionDefinitionProvider.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissionDefinitionProvider.cs index 7c472e62..7ae78427 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissionDefinitionProvider.cs @@ -16,7 +16,8 @@ public class BasicManagementPermissionDefinitionProvider : PermissionDefinitionP var auditManagement = abpIdentityGroup.AddPermission(BasicManagementPermissions.SystemManagement.AuditLog, L("Permission:AuditLogManagement"), multiTenancySide: MultiTenancySides.Both); - var settingManagement = abpIdentityGroup.AddPermission(BasicManagementPermissions.SystemManagement.Setting, L("Permission:SettingManagement"), multiTenancySide: MultiTenancySides.Both); + abpIdentityGroup.AddPermission(BasicManagementPermissions.SystemManagement.Setting, L("Permission:SettingManagement"), multiTenancySide: MultiTenancySides.Both); + abpIdentityGroup.AddPermission(BasicManagementPermissions.SystemManagement.IdentitySecurityLog, L("Permission:IdentitySecurityLog"), multiTenancySide: MultiTenancySides.Both); var organizationUnitManagement = abpIdentityGroup.AddPermission(BasicManagementPermissions.SystemManagement.OrganizationUnit, L("Permission:OrganizationUnitManagement"), multiTenancySide: MultiTenancySides.Both); organizationUnitManagement.AddChild ( diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissions.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissions.cs index 1aa5b8e3..8c1b94fd 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissions.cs +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application.Contracts/Permissions/BasicManagementPermissions.cs @@ -14,6 +14,7 @@ public class BasicManagementPermissions public const string UserExport = Default + ".Users.Export"; public const string AuditLog = Default + ".AuditLog"; public const string Setting = Default + ".Setting"; + public const string IdentitySecurityLog = Default + ".IdentitySecurityLogs"; public const string OrganizationUnit = Default + ".OrganizationUnitManagement"; public static class OrganizationUnitManagement { diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/BasicManagementApplicationAutoMapperProfile.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/BasicManagementApplicationAutoMapperProfile.cs index 049e5b4a..eb39f113 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/BasicManagementApplicationAutoMapperProfile.cs +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/BasicManagementApplicationAutoMapperProfile.cs @@ -1,5 +1,6 @@ using AutoMapper; using Lion.AbpPro.BasicManagement.AuditLogs; +using Lion.AbpPro.BasicManagement.IdentitySecurityLogs; using Lion.AbpPro.BasicManagement.Users.Dtos; namespace Lion.AbpPro.BasicManagement; @@ -32,5 +33,6 @@ public class BasicManagementApplicationAutoMapperProfile : Profile CreateMap(); CreateMap(); CreateMap(); + CreateMap(); } } \ No newline at end of file diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/IdentitySecurityLogs/IdentitySecurityLogAppService.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/IdentitySecurityLogs/IdentitySecurityLogAppService.cs new file mode 100644 index 00000000..b1763433 --- /dev/null +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/IdentitySecurityLogs/IdentitySecurityLogAppService.cs @@ -0,0 +1,46 @@ +namespace Lion.AbpPro.BasicManagement.IdentitySecurityLogs; + +public class IdentitySecurityLogAppService : BasicManagementAppService, IIdentitySecurityLogAppService +{ + private readonly IIdentitySecurityLogRepository _identitySecurityLogRepository; + + public IdentitySecurityLogAppService(IIdentitySecurityLogRepository identitySecurityLogRepository) + { + _identitySecurityLogRepository = identitySecurityLogRepository; + } + + [Authorize(Policy = BasicManagementPermissions.SystemManagement.IdentitySecurityLog)] + public virtual async Task> GetListAsync(PagingIdentitySecurityLogInput input) + { + var totalCount = await _identitySecurityLogRepository.GetCountAsync( + input.StartTime, + input.EndTime, + input.ApplicationName, + input.Identity, + input.Action, + input.UserId, + input.UserName, + input.ClientId, + input.CorrelationId); + if (totalCount == 0) + { + return new PagedResultDto(); + } + + var list = await _identitySecurityLogRepository.GetListAsync( + input.Sorting, + input.PageSize, + input.SkipCount, + input.StartTime, + input.EndTime, + input.ApplicationName, + input.Identity, + input.Action, + input.UserId, + input.UserName, + input.ClientId, + input.CorrelationId); + + return new PagedResultDto(totalCount, ObjectMapper.Map, List>(list)); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/AccountAppService.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/AccountAppService.cs index f3ac2705..e0d138cf 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/AccountAppService.cs +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/AccountAppService.cs @@ -4,7 +4,9 @@ using System.Text; using IdentityModel; using Lion.AbpPro.BasicManagement.ConfigurationOptions; using Lion.AbpPro.BasicManagement.Users.Dtos; +using Microsoft.AspNetCore.Http; using Microsoft.IdentityModel.Tokens; +using Volo.Abp.Identity.AspNetCore; using Volo.Abp.Security.Claims; namespace Lion.AbpPro.BasicManagement.Users @@ -13,15 +15,20 @@ namespace Lion.AbpPro.BasicManagement.Users { private readonly IdentityUserManager _userManager; private readonly JwtOptions _jwtOptions; - private readonly Microsoft.AspNetCore.Identity.SignInManager _signInManager; - + //private readonly Microsoft.AspNetCore.Identity.SignInManager _signInManager; + private readonly IdentitySecurityLogManager _identitySecurityLogManager; + private readonly IHttpContextAccessor _httpContextAccessor; + private readonly AbpSignInManager _signInManager; public AccountAppService( IdentityUserManager userManager, IOptionsSnapshot jwtOptions, - Microsoft.AspNetCore.Identity.SignInManager signInManager) + IdentitySecurityLogManager identitySecurityLogManager, + IHttpContextAccessor httpContextAccessor, AbpSignInManager signInManager) { _userManager = userManager; _jwtOptions = jwtOptions.Value; + _identitySecurityLogManager = identitySecurityLogManager; + _httpContextAccessor = httpContextAccessor; _signInManager = signInManager; } @@ -41,6 +48,13 @@ namespace Lion.AbpPro.BasicManagement.Users } var user = await _userManager.FindByNameAsync(input.Name); + + await _identitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext() + { + Action = _httpContextAccessor.HttpContext?.Request.Path, + UserName = input.Name, + Identity = "Bearer" + }); return await BuildResult(user); } diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/Localization/BasicManagement/en.json b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/Localization/BasicManagement/en.json index 3f392926..95d02dfa 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/Localization/BasicManagement/en.json +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/Localization/BasicManagement/en.json @@ -13,6 +13,7 @@ "Permission:AuditLogManagement": "AuditLog", "Permission:HangfireManagement": "BackgroundTask", "Permission:SettingManagement": "SettingManagement", + "Permission:IdentitySecurityLog": "IdentitySecurityLog", "Permission:OrganizationUnitManagement": "OrganizationUnitManagement", "Setting.Group.System": "System", "Lion.AbpPro.BasicManagement:100001": "OrganizationUnit Not Exist", diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/Localization/BasicManagement/zh-Hans.json b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/Localization/BasicManagement/zh-Hans.json index 2ef44a17..8b3389f7 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/Localization/BasicManagement/zh-Hans.json +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Domain.Shared/Localization/BasicManagement/zh-Hans.json @@ -13,6 +13,7 @@ "Permission:SystemManagement": "系统管理", "Permission:HangfireManagement": "后台任务", "Permission:SettingManagement": "设置管理", + "Permission:IdentitySecurityLog": "登录日志", "Permission:OrganizationUnitManagement": "组织结构管理", "Setting.Group.System": "系统", diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.HttpApi/GlobalUsings.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.HttpApi/GlobalUsings.cs index 0f018541..d6dc6e12 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.HttpApi/GlobalUsings.cs +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.HttpApi/GlobalUsings.cs @@ -1,6 +1,7 @@ // Global using directives global using Lion.AbpPro.BasicManagement.AuditLogs; +global using Lion.AbpPro.BasicManagement.IdentitySecurityLogs; global using Lion.AbpPro.BasicManagement.OrganizationUnits; global using Lion.AbpPro.BasicManagement.OrganizationUnits.Dto; global using Lion.AbpPro.BasicManagement.Roles; diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.HttpApi/Systems/IdentitySecurityLogController.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.HttpApi/Systems/IdentitySecurityLogController.cs new file mode 100644 index 00000000..93df48d3 --- /dev/null +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.HttpApi/Systems/IdentitySecurityLogController.cs @@ -0,0 +1,19 @@ +namespace Lion.AbpPro.BasicManagement.Systems; + +[Route("IdentitySecurityLogs")] +public class IdentitySecurityLogController : BasicManagementController, IIdentitySecurityLogAppService +{ + private readonly IIdentitySecurityLogAppService _identitySecurityLogAppService; + + public IdentitySecurityLogController(IIdentitySecurityLogAppService identitySecurityLogAppService) + { + _identitySecurityLogAppService = identitySecurityLogAppService; + } + + [HttpPost("page")] + [SwaggerOperation(summary: "分页获取登录日志信息", Tags = new[] { "IdentitySecurityLogs" })] + public Task> GetListAsync(PagingIdentitySecurityLogInput input) + { + return _identitySecurityLogAppService.GetListAsync(input); + } +} \ No newline at end of file diff --git a/templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/en/routes/admin.ts b/templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/en/routes/admin.ts index b1983a9d..fc3c88a2 100644 --- a/templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/en/routes/admin.ts +++ b/templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/en/routes/admin.ts @@ -88,4 +88,12 @@ export default { organizationUnit: 'OrganizationUnit', member: 'Member', role: 'Role', + identitySecurityLog: 'IdentitySecurityLog', + identitySecurityLog_ApplicationName: 'ApplicationName', + identitySecurityLog_Identity: 'Identity', + identitySecurityLog_Action: 'Action', + identitySecurityLog_UserName: 'UserName', + identitySecurityLog_CorrelationId: 'CorrelationId', + identitySecurityLog_ClientIpAddress: 'ClientIpAddress', + identitySecurityLog_CreationTime: 'LoginTime', }; diff --git a/templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/zh-CN/routes/admin.ts b/templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/zh-CN/routes/admin.ts index f8ce76aa..c7b16b94 100644 --- a/templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/zh-CN/routes/admin.ts +++ b/templates/abp-vnext-pro-nuget-all/vben28/src/locales/lang/zh-CN/routes/admin.ts @@ -88,4 +88,12 @@ export default { organizationUnit: '组织机构', member: '成员', role: '角色', + identitySecurityLog: '登录日志', + identitySecurityLog_ApplicationName: '应用程序名称', + identitySecurityLog_Identity: '登录方式', + identitySecurityLog_Action: '登录地址', + identitySecurityLog_UserName: '用户名', + identitySecurityLog_CorrelationId: 'CorrelationId', + identitySecurityLog_ClientIpAddress: '客户端IP', + identitySecurityLog_CreationTime: '登录时间', }; diff --git a/templates/abp-vnext-pro-nuget-all/vben28/src/router/routes/modules/admin.ts b/templates/abp-vnext-pro-nuget-all/vben28/src/router/routes/modules/admin.ts index 525fe59f..b3d0a295 100644 --- a/templates/abp-vnext-pro-nuget-all/vben28/src/router/routes/modules/admin.ts +++ b/templates/abp-vnext-pro-nuget-all/vben28/src/router/routes/modules/admin.ts @@ -64,6 +64,16 @@ const admin: AppRouteModule = { icon: 'ant-design:snippets-twotone', }, }, + { + path: 'identitySecurityLogs', + name: 'IdentitySecurityLogs', + component: () => import('/@/views/admin/identitySecurityLog/Index.vue'), + meta: { + title: t('routes.admin.identitySecurityLog'), + policy: 'AbpIdentity.IdentitySecurityLogs', + icon: 'ant-design:file-protect-outlined', + }, + }, { path: 'dataDictionary', name: 'dataDictionary', diff --git a/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/identitySecurityLog/Index.ts b/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/identitySecurityLog/Index.ts new file mode 100644 index 00000000..19b72d1a --- /dev/null +++ b/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/identitySecurityLog/Index.ts @@ -0,0 +1,80 @@ +import {FormSchema} from '/src/components/Table'; +import {BasicColumn} from '/src/components/Table'; +import {useI18n} from '/src/hooks/web/useI18n'; +import { formatToDateTime, dateUtil } from '/src/utils/dateUtil'; +const {t} = useI18n(); +import { + IdentitySecurityLogsServiceProxy, + PageIdentitySecurityLogInput, +} from '/src/services/ServiceProxies'; + +// 分页表格登录日志 BasicColumn +export const tableColumns: BasicColumn[] = [ + { + title: t('routes.admin.identitySecurityLog_ApplicationName'), + dataIndex: 'applicationName', + }, + { + title: t('routes.admin.identitySecurityLog_Identity'), + dataIndex: 'identity', + }, + { + title: t('routes.admin.identitySecurityLog_Action'), + dataIndex: 'action', + }, + { + title: t('routes.admin.identitySecurityLog_UserName'), + dataIndex: 'userName', + }, + { + title: t('routes.admin.identitySecurityLog_CorrelationId'), + dataIndex: 'correlationId', + }, + { + title: t('routes.admin.identitySecurityLog_ClientIpAddress'), + dataIndex: 'clientIpAddress', + }, + { + title: t('routes.admin.identitySecurityLog_CreationTime'), + dataIndex: 'creationTime', + customRender: ({ text }) => { + return formatToDateTime(text); + }, + }, +]; + +// 分页查询登录日志 FormSchema +export const searchFormSchema: FormSchema[] = [ + { + field: 'time', + component: 'RangePicker', + label: t('routes.admin.audit_executeTime'), + colProps: { + span: 4, + }, + defaultValue: [dateUtil().subtract(7, 'days'), dateUtil().add(1, 'days')], + }, + { + field: 'userName', + label: t('routes.admin.identitySecurityLog_UserName'), + component: 'Input', + colProps: { span: 3 }, + }, + { + field: 'correlationId', + label: 'CorrelationId', + labelWidth: 95, + component: 'Input', + colProps: { span: 4 }, + } +]; + + +/** + * 分页查询登录日志 + */ +export async function pageAsync(params: PageIdentitySecurityLogInput, +) { + const identitySecurityLogServiceProxy = new IdentitySecurityLogsServiceProxy(); + return identitySecurityLogServiceProxy.page(params); +} diff --git a/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/identitySecurityLog/Index.vue b/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/identitySecurityLog/Index.vue new file mode 100644 index 00000000..a5fb9faa --- /dev/null +++ b/templates/abp-vnext-pro-nuget-all/vben28/src/views/admin/identitySecurityLog/Index.vue @@ -0,0 +1,45 @@ + + + diff --git a/templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj b/templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj index 6edb0ab6..28f65b6a 100644 --- a/templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj +++ b/templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj @@ -1,4 +1,4 @@ - + diff --git a/templates/abp-vnext-pro-nuget-simplify/vben28/src/locales/lang/en/routes/admin.ts b/templates/abp-vnext-pro-nuget-simplify/vben28/src/locales/lang/en/routes/admin.ts index b1983a9d..fc3c88a2 100644 --- a/templates/abp-vnext-pro-nuget-simplify/vben28/src/locales/lang/en/routes/admin.ts +++ b/templates/abp-vnext-pro-nuget-simplify/vben28/src/locales/lang/en/routes/admin.ts @@ -88,4 +88,12 @@ export default { organizationUnit: 'OrganizationUnit', member: 'Member', role: 'Role', + identitySecurityLog: 'IdentitySecurityLog', + identitySecurityLog_ApplicationName: 'ApplicationName', + identitySecurityLog_Identity: 'Identity', + identitySecurityLog_Action: 'Action', + identitySecurityLog_UserName: 'UserName', + identitySecurityLog_CorrelationId: 'CorrelationId', + identitySecurityLog_ClientIpAddress: 'ClientIpAddress', + identitySecurityLog_CreationTime: 'LoginTime', }; diff --git a/templates/abp-vnext-pro-nuget-simplify/vben28/src/locales/lang/zh-CN/routes/admin.ts b/templates/abp-vnext-pro-nuget-simplify/vben28/src/locales/lang/zh-CN/routes/admin.ts index f8ce76aa..c7b16b94 100644 --- a/templates/abp-vnext-pro-nuget-simplify/vben28/src/locales/lang/zh-CN/routes/admin.ts +++ b/templates/abp-vnext-pro-nuget-simplify/vben28/src/locales/lang/zh-CN/routes/admin.ts @@ -88,4 +88,12 @@ export default { organizationUnit: '组织机构', member: '成员', role: '角色', + identitySecurityLog: '登录日志', + identitySecurityLog_ApplicationName: '应用程序名称', + identitySecurityLog_Identity: '登录方式', + identitySecurityLog_Action: '登录地址', + identitySecurityLog_UserName: '用户名', + identitySecurityLog_CorrelationId: 'CorrelationId', + identitySecurityLog_ClientIpAddress: '客户端IP', + identitySecurityLog_CreationTime: '登录时间', }; diff --git a/templates/abp-vnext-pro-nuget-simplify/vben28/src/router/routes/modules/admin.ts b/templates/abp-vnext-pro-nuget-simplify/vben28/src/router/routes/modules/admin.ts index 525fe59f..b3d0a295 100644 --- a/templates/abp-vnext-pro-nuget-simplify/vben28/src/router/routes/modules/admin.ts +++ b/templates/abp-vnext-pro-nuget-simplify/vben28/src/router/routes/modules/admin.ts @@ -64,6 +64,16 @@ const admin: AppRouteModule = { icon: 'ant-design:snippets-twotone', }, }, + { + path: 'identitySecurityLogs', + name: 'IdentitySecurityLogs', + component: () => import('/@/views/admin/identitySecurityLog/Index.vue'), + meta: { + title: t('routes.admin.identitySecurityLog'), + policy: 'AbpIdentity.IdentitySecurityLogs', + icon: 'ant-design:file-protect-outlined', + }, + }, { path: 'dataDictionary', name: 'dataDictionary', diff --git a/templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/identitySecurityLog/Index.ts b/templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/identitySecurityLog/Index.ts new file mode 100644 index 00000000..19b72d1a --- /dev/null +++ b/templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/identitySecurityLog/Index.ts @@ -0,0 +1,80 @@ +import {FormSchema} from '/src/components/Table'; +import {BasicColumn} from '/src/components/Table'; +import {useI18n} from '/src/hooks/web/useI18n'; +import { formatToDateTime, dateUtil } from '/src/utils/dateUtil'; +const {t} = useI18n(); +import { + IdentitySecurityLogsServiceProxy, + PageIdentitySecurityLogInput, +} from '/src/services/ServiceProxies'; + +// 分页表格登录日志 BasicColumn +export const tableColumns: BasicColumn[] = [ + { + title: t('routes.admin.identitySecurityLog_ApplicationName'), + dataIndex: 'applicationName', + }, + { + title: t('routes.admin.identitySecurityLog_Identity'), + dataIndex: 'identity', + }, + { + title: t('routes.admin.identitySecurityLog_Action'), + dataIndex: 'action', + }, + { + title: t('routes.admin.identitySecurityLog_UserName'), + dataIndex: 'userName', + }, + { + title: t('routes.admin.identitySecurityLog_CorrelationId'), + dataIndex: 'correlationId', + }, + { + title: t('routes.admin.identitySecurityLog_ClientIpAddress'), + dataIndex: 'clientIpAddress', + }, + { + title: t('routes.admin.identitySecurityLog_CreationTime'), + dataIndex: 'creationTime', + customRender: ({ text }) => { + return formatToDateTime(text); + }, + }, +]; + +// 分页查询登录日志 FormSchema +export const searchFormSchema: FormSchema[] = [ + { + field: 'time', + component: 'RangePicker', + label: t('routes.admin.audit_executeTime'), + colProps: { + span: 4, + }, + defaultValue: [dateUtil().subtract(7, 'days'), dateUtil().add(1, 'days')], + }, + { + field: 'userName', + label: t('routes.admin.identitySecurityLog_UserName'), + component: 'Input', + colProps: { span: 3 }, + }, + { + field: 'correlationId', + label: 'CorrelationId', + labelWidth: 95, + component: 'Input', + colProps: { span: 4 }, + } +]; + + +/** + * 分页查询登录日志 + */ +export async function pageAsync(params: PageIdentitySecurityLogInput, +) { + const identitySecurityLogServiceProxy = new IdentitySecurityLogsServiceProxy(); + return identitySecurityLogServiceProxy.page(params); +} diff --git a/templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/identitySecurityLog/Index.vue b/templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/identitySecurityLog/Index.vue new file mode 100644 index 00000000..a5fb9faa --- /dev/null +++ b/templates/abp-vnext-pro-nuget-simplify/vben28/src/views/admin/identitySecurityLog/Index.vue @@ -0,0 +1,45 @@ + + + diff --git a/vben28/src/locales/lang/en/routes/admin.ts b/vben28/src/locales/lang/en/routes/admin.ts index b1983a9d..fc3c88a2 100644 --- a/vben28/src/locales/lang/en/routes/admin.ts +++ b/vben28/src/locales/lang/en/routes/admin.ts @@ -88,4 +88,12 @@ export default { organizationUnit: 'OrganizationUnit', member: 'Member', role: 'Role', + identitySecurityLog: 'IdentitySecurityLog', + identitySecurityLog_ApplicationName: 'ApplicationName', + identitySecurityLog_Identity: 'Identity', + identitySecurityLog_Action: 'Action', + identitySecurityLog_UserName: 'UserName', + identitySecurityLog_CorrelationId: 'CorrelationId', + identitySecurityLog_ClientIpAddress: 'ClientIpAddress', + identitySecurityLog_CreationTime: 'LoginTime', }; diff --git a/vben28/src/locales/lang/zh-CN/routes/admin.ts b/vben28/src/locales/lang/zh-CN/routes/admin.ts index f8ce76aa..c7b16b94 100644 --- a/vben28/src/locales/lang/zh-CN/routes/admin.ts +++ b/vben28/src/locales/lang/zh-CN/routes/admin.ts @@ -88,4 +88,12 @@ export default { organizationUnit: '组织机构', member: '成员', role: '角色', + identitySecurityLog: '登录日志', + identitySecurityLog_ApplicationName: '应用程序名称', + identitySecurityLog_Identity: '登录方式', + identitySecurityLog_Action: '登录地址', + identitySecurityLog_UserName: '用户名', + identitySecurityLog_CorrelationId: 'CorrelationId', + identitySecurityLog_ClientIpAddress: '客户端IP', + identitySecurityLog_CreationTime: '登录时间', }; diff --git a/vben28/src/router/routes/modules/admin.ts b/vben28/src/router/routes/modules/admin.ts index b8a5d318..c39daa10 100644 --- a/vben28/src/router/routes/modules/admin.ts +++ b/vben28/src/router/routes/modules/admin.ts @@ -64,6 +64,16 @@ const admin: AppRouteModule = { icon: 'ant-design:snippets-twotone', }, }, + { + path: 'identitySecurityLogs', + name: 'IdentitySecurityLogs', + component: () => import('/@/views/admin/identitySecurityLog/Index.vue'), + meta: { + title: t('routes.admin.identitySecurityLog'), + policy: 'AbpIdentity.IdentitySecurityLogs', + icon: 'ant-design:file-protect-outlined', + }, + }, { path: 'dataDictionary', name: 'dataDictionary', diff --git a/vben28/src/services/ServiceProxies.ts b/vben28/src/services/ServiceProxies.ts index e2415cb8..8b35851d 100644 --- a/vben28/src/services/ServiceProxies.ts +++ b/vben28/src/services/ServiceProxies.ts @@ -2,16493 +2,16517 @@ /* eslint-disable */ //---------------------- // -// Generated using the NSwag toolchain v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// Generated using the NSwag toolchain v13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) // //---------------------- // ReSharper disable InconsistentNaming -import { ServiceProxyBase } from './ServiceProxyBase'; -import axios, { - AxiosError, - AxiosInstance, - AxiosRequestConfig, - AxiosResponse, - CancelToken, -} from 'axios'; +import {ServiceProxyBase} from './ServiceProxyBase' +import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, CancelToken } from 'axios'; import dayjs from 'dayjs'; export class AbpApiDefinitionServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * @param includeTypes (optional) - * @return Success - */ - apiDefinition( - includeTypes: boolean | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/api/abp/api-definition?'; - if (includeTypes === null) throw new Error("The parameter 'includeTypes' cannot be null."); - else if (includeTypes !== undefined) - url_ += 'IncludeTypes=' + encodeURIComponent('' + includeTypes) + '&'; - url_ = url_.replace(/[?&]$/, ''); - - let options_ = { - method: 'GET', - url: url_, - headers: { - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processApiDefinition(_response), - ); - }); - } - - protected processApiDefinition(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = ApplicationApiDescriptionModel.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * @param includeTypes (optional) + * @return Success + */ + apiDefinition(includeTypes: boolean | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/api/abp/api-definition?"; + if (includeTypes === null) + throw new Error("The parameter 'includeTypes' cannot be null."); + else if (includeTypes !== undefined) + url_ += "IncludeTypes=" + encodeURIComponent("" + includeTypes) + "&"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ = { + method: "GET", + url: url_, + headers: { + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processApiDefinition(_response)); + }); + } + + protected processApiDefinition(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = ApplicationApiDescriptionModel.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class AbpApplicationConfigurationServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * @param includeLocalizationResources (optional) - * @return Success - */ - applicationConfiguration( - includeLocalizationResources: boolean | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/api/abp/application-configuration?'; - if (includeLocalizationResources === null) - throw new Error("The parameter 'includeLocalizationResources' cannot be null."); - else if (includeLocalizationResources !== undefined) - url_ += - 'IncludeLocalizationResources=' + - encodeURIComponent('' + includeLocalizationResources) + - '&'; - url_ = url_.replace(/[?&]$/, ''); - - let options_ = { - method: 'GET', - url: url_, - headers: { - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processApplicationConfiguration(_response), - ); - }); - } - - protected processApplicationConfiguration( - response: AxiosResponse, - ): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = ApplicationConfigurationDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * @param includeLocalizationResources (optional) + * @return Success + */ + applicationConfiguration(includeLocalizationResources: boolean | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/api/abp/application-configuration?"; + if (includeLocalizationResources === null) + throw new Error("The parameter 'includeLocalizationResources' cannot be null."); + else if (includeLocalizationResources !== undefined) + url_ += "IncludeLocalizationResources=" + encodeURIComponent("" + includeLocalizationResources) + "&"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ = { + method: "GET", + url: url_, + headers: { + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processApplicationConfiguration(_response)); + }); + } + + protected processApplicationConfiguration(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = ApplicationConfigurationDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class AbpApplicationLocalizationServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * @param onlyDynamics (optional) - * @return Success - */ - applicationLocalization( - cultureName: string, - onlyDynamics: boolean | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/api/abp/application-localization?'; - if (cultureName === undefined || cultureName === null) - throw new Error("The parameter 'cultureName' must be defined and cannot be null."); - else url_ += 'CultureName=' + encodeURIComponent('' + cultureName) + '&'; - if (onlyDynamics === null) throw new Error("The parameter 'onlyDynamics' cannot be null."); - else if (onlyDynamics !== undefined) - url_ += 'OnlyDynamics=' + encodeURIComponent('' + onlyDynamics) + '&'; - url_ = url_.replace(/[?&]$/, ''); - - let options_ = { - method: 'GET', - url: url_, - headers: { - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processApplicationLocalization(_response), - ); - }); - } - - protected processApplicationLocalization( - response: AxiosResponse, - ): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = ApplicationLocalizationDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * @param onlyDynamics (optional) + * @return Success + */ + applicationLocalization(cultureName: string, onlyDynamics: boolean | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/api/abp/application-localization?"; + if (cultureName === undefined || cultureName === null) + throw new Error("The parameter 'cultureName' must be defined and cannot be null."); + else + url_ += "CultureName=" + encodeURIComponent("" + cultureName) + "&"; + if (onlyDynamics === null) + throw new Error("The parameter 'onlyDynamics' cannot be null."); + else if (onlyDynamics !== undefined) + url_ += "OnlyDynamics=" + encodeURIComponent("" + onlyDynamics) + "&"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ = { + method: "GET", + url: url_, + headers: { + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processApplicationLocalization(_response)); + }); + } + + protected processApplicationLocalization(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = ApplicationLocalizationDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class AccountServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 登录 - * @param body (optional) - * @return Success - */ - login(body: LoginInput | undefined, cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/api/app/account/login'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processLogin(_response), - ); - }); - } - - protected processLogin(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = LoginOutput.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 登录 + * @param body (optional) + * @return Success + */ + login(body: LoginInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/api/app/account/login"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processLogin(_response)); + }); + } + + protected processLogin(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = LoginOutput.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class AuditLogsServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 分页获取审计日志信息 - * @param body (optional) - * @return Success - */ - page( - body: PagingAuditLogInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/AuditLogs/page'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processPage(_response), - ); - }); - } - - protected processPage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = PagingAuditLogOutputPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 分页获取审计日志信息 + * @param body (optional) + * @return Success + */ + page(body: PagingAuditLogInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/AuditLogs/page"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response)); + }); + } + + protected processPage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = PagingAuditLogOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class DataDictionaryServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 分页字典类型 - * @param body (optional) - * @return Success - */ - page( - body: PagingDataDictionaryInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/DataDictionary/page'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processPage(_response), - ); - }); - } - - protected processPage( - response: AxiosResponse, - ): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = PagingDataDictionaryOutputPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 分页字典明细 - * @param body (optional) - * @return Success - */ - pageDetail( - body: PagingDataDictionaryDetailInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/DataDictionary/pageDetail'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processPageDetail(_response), - ); - }); - } - - protected processPageDetail( - response: AxiosResponse, - ): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = PagingDataDictionaryDetailOutputPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 创建字典类型 - * @param body (optional) - * @return Success - */ - create( - body: CreateDataDictinaryInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/DataDictionary/create'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processCreate(_response), - ); - }); - } - - protected processCreate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 创建字典明细 - * @param body (optional) - * @return Success - */ - createDetail( - body: CreateDataDictinaryDetailInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/DataDictionary/createDetail'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processCreateDetail(_response), - ); - }); - } - - protected processCreateDetail(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 设置字典明细状态 - * @param body (optional) - * @return Success - */ - status( - body: SetDataDictinaryDetailInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/DataDictionary/status'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processStatus(_response), - ); - }); - } - - protected processStatus(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 更新字典明细 - * @param body (optional) - * @return Success - */ - updateDetail( - body: UpdateDetailInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/DataDictionary/updateDetail'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processUpdateDetail(_response), - ); - }); - } - - protected processUpdateDetail(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 删除字典明细 - * @param body (optional) - * @return Success - */ - delete( - body: DeleteDataDictionaryDetailInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/DataDictionary/delete'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processDelete(_response), - ); - }); - } - - protected processDelete(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 删除字典类型 - * @param body (optional) - * @return Success - */ - deleteDataDictionaryType( - body: IdInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/DataDictionary/deleteDataDictionaryType'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processDeleteDataDictionaryType(_response), - ); - }); - } - - protected processDeleteDataDictionaryType(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 修改字典类型 - * @param body (optional) - * @return Success - */ - update( - body: UpdateDataDictinaryInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/DataDictionary/update'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processUpdate(_response), - ); - }); - } - - protected processUpdate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 分页字典类型 + * @param body (optional) + * @return Success + */ + page(body: PagingDataDictionaryInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/DataDictionary/page"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response)); + }); + } + + protected processPage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = PagingDataDictionaryOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 分页字典明细 + * @param body (optional) + * @return Success + */ + pageDetail(body: PagingDataDictionaryDetailInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/DataDictionary/pageDetail"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPageDetail(_response)); + }); + } + + protected processPageDetail(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = PagingDataDictionaryDetailOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 创建字典类型 + * @param body (optional) + * @return Success + */ + create(body: CreateDataDictinaryInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/DataDictionary/create"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCreate(_response)); + }); + } + + protected processCreate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 创建字典明细 + * @param body (optional) + * @return Success + */ + createDetail(body: CreateDataDictinaryDetailInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/DataDictionary/createDetail"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCreateDetail(_response)); + }); + } + + protected processCreateDetail(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 设置字典明细状态 + * @param body (optional) + * @return Success + */ + status(body: SetDataDictinaryDetailInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/DataDictionary/status"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processStatus(_response)); + }); + } + + protected processStatus(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 更新字典明细 + * @param body (optional) + * @return Success + */ + updateDetail(body: UpdateDetailInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/DataDictionary/updateDetail"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdateDetail(_response)); + }); + } + + protected processUpdateDetail(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 删除字典明细 + * @param body (optional) + * @return Success + */ + delete(body: DeleteDataDictionaryDetailInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/DataDictionary/delete"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processDelete(_response)); + }); + } + + protected processDelete(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 删除字典类型 + * @param body (optional) + * @return Success + */ + deleteDataDictionaryType(body: IdInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/DataDictionary/deleteDataDictionaryType"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processDeleteDataDictionaryType(_response)); + }); + } + + protected processDeleteDataDictionaryType(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 修改字典类型 + * @param body (optional) + * @return Success + */ + update(body: UpdateDataDictinaryInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/DataDictionary/update"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + }); + } + + protected processUpdate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } +} + +export class IdentitySecurityLogsServiceProxy extends ServiceProxyBase { + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 分页获取登录日志信息 + * @param body (optional) + * @return Success + */ + page(body: PagingIdentitySecurityLogInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/IdentitySecurityLogs/page"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response)); + }); + } + + protected processPage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = PagingIdentitySecurityLogOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class LanguagesServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 获取所有语言 - * @return Success - */ - all(cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/Languages/All'; - url_ = url_.replace(/[?&]$/, ''); - - let options_ = { - method: 'POST', - url: url_, - headers: { - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processAll(_response), - ); - }); - } - - protected processAll(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) result200!.push(PageLanguageOutput.fromJS(item)); - } else { - result200 = null; - } - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 分页查询语言 - * @param body (optional) - * @return Success - */ - page( - body: PageLanguageInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Languages/Page'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processPage(_response), - ); - }); - } - - protected processPage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = PageLanguageOutputPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 创建语言 - * @param body (optional) - * @return Success - */ - create( - body: CreateLanguageInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Languages/Create'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processCreate(_response), - ); - }); - } - - protected processCreate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 编辑语言 - * @param body (optional) - * @return Success - */ - update( - body: UpdateLanguageInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Languages/Update'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processUpdate(_response), - ); - }); - } - - protected processUpdate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 删除语言 - * @param body (optional) - * @return Success - */ - delete( - body: DeleteLanguageInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Languages/Delete'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processDelete(_response), - ); - }); - } - - protected processDelete(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 设置默认语言 - * @param body (optional) - * @return Success - */ - setDefault(body: IdInput | undefined, cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/Languages/SetDefault'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processSetDefault(_response), - ); - }); - } - - protected processSetDefault(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 获取所有语言 + * @return Success + */ + all( cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Languages/All"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ = { + method: "POST", + url: url_, + headers: { + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processAll(_response)); + }); + } + + protected processAll(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + if (Array.isArray(resultData200)) { + result200 = [] as any; + for (let item of resultData200) + result200!.push(PageLanguageOutput.fromJS(item)); + } + else { + result200 = null; + } + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 分页查询语言 + * @param body (optional) + * @return Success + */ + page(body: PageLanguageInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Languages/Page"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response)); + }); + } + + protected processPage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = PageLanguageOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 创建语言 + * @param body (optional) + * @return Success + */ + create(body: CreateLanguageInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Languages/Create"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCreate(_response)); + }); + } + + protected processCreate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 编辑语言 + * @param body (optional) + * @return Success + */ + update(body: UpdateLanguageInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Languages/Update"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + }); + } + + protected processUpdate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 删除语言 + * @param body (optional) + * @return Success + */ + delete(body: DeleteLanguageInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Languages/Delete"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processDelete(_response)); + }); + } + + protected processDelete(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 设置默认语言 + * @param body (optional) + * @return Success + */ + setDefault(body: IdInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Languages/SetDefault"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processSetDefault(_response)); + }); + } + + protected processSetDefault(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class LanguageTextsServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 获取所有资源 - * @return Success - */ - allResource(cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/LanguageTexts/AllResource'; - url_ = url_.replace(/[?&]$/, ''); - - let options_ = { - method: 'POST', - url: url_, - headers: { - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processAllResource(_response), - ); - }); - } - - protected processAllResource(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) result200!.push(StringStringFromSelector.fromJS(item)); - } else { - result200 = null; - } - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 分页查询语言文本 - * @param body (optional) - * @return Success - */ - page( - body: PageLanguageTextInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/LanguageTexts/Page'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processPage(_response), - ); - }); - } - - protected processPage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = PageLanguageTextOutputPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 创建语言文本 - * @param body (optional) - * @return Success - */ - create( - body: CreateLanguageTextInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/LanguageTexts/Create'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processCreate(_response), - ); - }); - } - - protected processCreate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 编辑语言文本 - * @param body (optional) - * @return Success - */ - update( - body: UpdateLanguageTextInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/LanguageTexts/Update'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processUpdate(_response), - ); - }); - } - - protected processUpdate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 获取所有资源 + * @return Success + */ + allResource( cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/LanguageTexts/AllResource"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ = { + method: "POST", + url: url_, + headers: { + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processAllResource(_response)); + }); + } + + protected processAllResource(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + if (Array.isArray(resultData200)) { + result200 = [] as any; + for (let item of resultData200) + result200!.push(StringStringFromSelector.fromJS(item)); + } + else { + result200 = null; + } + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 分页查询语言文本 + * @param body (optional) + * @return Success + */ + page(body: PageLanguageTextInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/LanguageTexts/Page"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response)); + }); + } + + protected processPage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = PageLanguageTextOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 创建语言文本 + * @param body (optional) + * @return Success + */ + create(body: CreateLanguageTextInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/LanguageTexts/Create"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCreate(_response)); + }); + } + + protected processCreate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 编辑语言文本 + * @param body (optional) + * @return Success + */ + update(body: UpdateLanguageTextInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/LanguageTexts/Update"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + }); + } + + protected processUpdate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class NotificationServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 分页获取用户普通文本消息 - * @param body (optional) - * @return Success - */ - common( - body: PagingNotificationListInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Notification/Common'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processCommon(_response), - ); - }); - } - - protected processCommon( - response: AxiosResponse, - ): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = PagingNotificationListOutputPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 分页获取广播消息 - * @param body (optional) - * @return Success - */ - broadCast( - body: PagingNotificationListInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Notification/BroadCast'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processBroadCast(_response), - ); - }); - } - - protected processBroadCast( - response: AxiosResponse, - ): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = PagingNotificationListOutputPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 发送警告文本消息 - * @param body (optional) - * @return Success - */ - sendCommonWarningMessage( - body: SendCommonMessageInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Notification/SendCommonWarningMessage'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processSendCommonWarningMessage(_response), - ); - }); - } - - protected processSendCommonWarningMessage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 发送普通文本消息 - * @param body (optional) - * @return Success - */ - sendCommonInformationMessage( - body: SendCommonMessageInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Notification/SendCommonInformationMessage'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processSendCommonInformationMessage(_response), - ); - }); - } - - protected processSendCommonInformationMessage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 发送错误文本消息 - * @param body (optional) - * @return Success - */ - sendCommonErrorMessage( - body: SendCommonMessageInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Notification/SendCommonErrorMessage'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processSendCommonErrorMessage(_response), - ); - }); - } - - protected processSendCommonErrorMessage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 发送警告广播消息 - * @param body (optional) - * @return Success - */ - sendBroadCastWarningMessage( - body: SendBroadCastMessageInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Notification/SendBroadCastWarningMessage'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processSendBroadCastWarningMessage(_response), - ); - }); - } - - protected processSendBroadCastWarningMessage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 发送正常广播消息 - * @param body (optional) - * @return Success - */ - sendBroadCastInformationMessage( - body: SendBroadCastMessageInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Notification/SendBroadCastInformationMessage'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processSendBroadCastInformationMessage(_response), - ); - }); - } - - protected processSendBroadCastInformationMessage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 发送错误广播消息 - * @param body (optional) - * @return Success - */ - sendBroadCastErrorMessage( - body: SendBroadCastMessageInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Notification/SendBroadCastErrorMessage'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processSendBroadCastErrorMessage(_response), - ); - }); - } - - protected processSendBroadCastErrorMessage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 消息设置为已读 - * @param body (optional) - * @return Success - */ - read(body: SetReadInput | undefined, cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/Notification/Read'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processRead(_response), - ); - }); - } - - protected processRead(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 分页获取用户普通文本消息 + * @param body (optional) + * @return Success + */ + common(body: PagingNotificationListInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Notification/Common"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCommon(_response)); + }); + } + + protected processCommon(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = PagingNotificationListOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 分页获取广播消息 + * @param body (optional) + * @return Success + */ + broadCast(body: PagingNotificationListInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Notification/BroadCast"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processBroadCast(_response)); + }); + } + + protected processBroadCast(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = PagingNotificationListOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 发送警告文本消息 + * @param body (optional) + * @return Success + */ + sendCommonWarningMessage(body: SendCommonMessageInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Notification/SendCommonWarningMessage"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processSendCommonWarningMessage(_response)); + }); + } + + protected processSendCommonWarningMessage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 发送普通文本消息 + * @param body (optional) + * @return Success + */ + sendCommonInformationMessage(body: SendCommonMessageInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Notification/SendCommonInformationMessage"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processSendCommonInformationMessage(_response)); + }); + } + + protected processSendCommonInformationMessage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 发送错误文本消息 + * @param body (optional) + * @return Success + */ + sendCommonErrorMessage(body: SendCommonMessageInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Notification/SendCommonErrorMessage"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processSendCommonErrorMessage(_response)); + }); + } + + protected processSendCommonErrorMessage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 发送警告广播消息 + * @param body (optional) + * @return Success + */ + sendBroadCastWarningMessage(body: SendBroadCastMessageInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Notification/SendBroadCastWarningMessage"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processSendBroadCastWarningMessage(_response)); + }); + } + + protected processSendBroadCastWarningMessage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 发送正常广播消息 + * @param body (optional) + * @return Success + */ + sendBroadCastInformationMessage(body: SendBroadCastMessageInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Notification/SendBroadCastInformationMessage"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processSendBroadCastInformationMessage(_response)); + }); + } + + protected processSendBroadCastInformationMessage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 发送错误广播消息 + * @param body (optional) + * @return Success + */ + sendBroadCastErrorMessage(body: SendBroadCastMessageInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Notification/SendBroadCastErrorMessage"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processSendBroadCastErrorMessage(_response)); + }); + } + + protected processSendBroadCastErrorMessage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 消息设置为已读 + * @param body (optional) + * @return Success + */ + read(body: SetReadInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Notification/Read"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processRead(_response)); + }); + } + + protected processRead(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class OrganizationUnitsServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 获取组织机构树 - * @return Success - */ - tree(cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/tree'; - url_ = url_.replace(/[?&]$/, ''); - - let options_ = { - method: 'POST', - url: url_, - headers: { - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processTree(_response), - ); - }); - } - - protected processTree(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) result200!.push(TreeOutput.fromJS(item)); - } else { - result200 = null; - } - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 创建组织机构 - * @param body (optional) - * @return Success - */ - create( - body: CreateOrganizationUnitInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/create'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processCreate(_response), - ); - }); - } - - protected processCreate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 删除组织机构 - * @param body (optional) - * @return Success - */ - delete(body: IdInput | undefined, cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/delete'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processDelete(_response), - ); - }); - } - - protected processDelete(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 编辑组织机构 - * @param body (optional) - * @return Success - */ - update( - body: UpdateOrganizationUnitInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/update'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processUpdate(_response), - ); - }); - } - - protected processUpdate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 向组织机构添加角色 - * @param body (optional) - * @return Success - */ - addRoleToOrganizationUnit( - body: AddRoleToOrganizationUnitInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/addRoleToOrganizationUnitAsync'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processAddRoleToOrganizationUnit(_response), - ); - }); - } - - protected processAddRoleToOrganizationUnit(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 向组织机构删除角色 - * @param body (optional) - * @return Success - */ - removeRoleFromOrganizationUnit( - body: RemoveRoleToOrganizationUnitInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/removeRoleFromOrganizationUnitAsync'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processRemoveRoleFromOrganizationUnit(_response), - ); - }); - } - - protected processRemoveRoleFromOrganizationUnit(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 向组织机构添加用户 - * @param body (optional) - * @return Success - */ - addUserToOrganizationUnit( - body: AddUserToOrganizationUnitInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/addUserToOrganizationUnit'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processAddUserToOrganizationUnit(_response), - ); - }); - } - - protected processAddUserToOrganizationUnit(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 向组织机构删除用户 - * @param body (optional) - * @return Success - */ - removeUserFromOrganizationUnit( - body: RemoveUserToOrganizationUnitInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/removeUserFromOrganizationUnit'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processRemoveUserFromOrganizationUnit(_response), - ); - }); - } - - protected processRemoveUserFromOrganizationUnit(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 分页获取组织机构下用户 - * @param body (optional) - * @return Success - */ - getUsers( - body: GetOrganizationUnitUserInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/getUsers'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processGetUsers(_response), - ); - }); - } - - protected processGetUsers( - response: AxiosResponse, - ): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = GetOrganizationUnitUserOutputPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 分页获取组织机构下角色 - * @param body (optional) - * @return Success - */ - getRoles( - body: GetOrganizationUnitRoleInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/getRoles'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processGetRoles(_response), - ); - }); - } - - protected processGetRoles( - response: AxiosResponse, - ): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = GetOrganizationUnitRoleOutputPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 获取不在组织机构的用户 - * @param body (optional) - * @return Success - */ - getUnAddUsers( - body: GetUnAddUserInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/getUnAddUsers'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processGetUnAddUsers(_response), - ); - }); - } - - protected processGetUnAddUsers( - response: AxiosResponse, - ): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = GetUnAddUserOutputPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 获取不在组织机构的角色 - * @param body (optional) - * @return Success - */ - getUnAddRoles( - body: GetUnAddRoleInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/OrganizationUnits/getUnAddRoles'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processGetUnAddRoles(_response), - ); - }); - } - - protected processGetUnAddRoles( - response: AxiosResponse, - ): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = GetUnAddRoleOutputPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 获取组织机构树 + * @return Success + */ + tree( cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/tree"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ = { + method: "POST", + url: url_, + headers: { + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processTree(_response)); + }); + } + + protected processTree(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + if (Array.isArray(resultData200)) { + result200 = [] as any; + for (let item of resultData200) + result200!.push(TreeOutput.fromJS(item)); + } + else { + result200 = null; + } + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 创建组织机构 + * @param body (optional) + * @return Success + */ + create(body: CreateOrganizationUnitInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/create"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCreate(_response)); + }); + } + + protected processCreate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 删除组织机构 + * @param body (optional) + * @return Success + */ + delete(body: IdInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/delete"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processDelete(_response)); + }); + } + + protected processDelete(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 编辑组织机构 + * @param body (optional) + * @return Success + */ + update(body: UpdateOrganizationUnitInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/update"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + }); + } + + protected processUpdate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 向组织机构添加角色 + * @param body (optional) + * @return Success + */ + addRoleToOrganizationUnit(body: AddRoleToOrganizationUnitInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/addRoleToOrganizationUnitAsync"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processAddRoleToOrganizationUnit(_response)); + }); + } + + protected processAddRoleToOrganizationUnit(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 向组织机构删除角色 + * @param body (optional) + * @return Success + */ + removeRoleFromOrganizationUnit(body: RemoveRoleToOrganizationUnitInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/removeRoleFromOrganizationUnitAsync"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processRemoveRoleFromOrganizationUnit(_response)); + }); + } + + protected processRemoveRoleFromOrganizationUnit(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 向组织机构添加用户 + * @param body (optional) + * @return Success + */ + addUserToOrganizationUnit(body: AddUserToOrganizationUnitInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/addUserToOrganizationUnit"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processAddUserToOrganizationUnit(_response)); + }); + } + + protected processAddUserToOrganizationUnit(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 向组织机构删除用户 + * @param body (optional) + * @return Success + */ + removeUserFromOrganizationUnit(body: RemoveUserToOrganizationUnitInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/removeUserFromOrganizationUnit"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processRemoveUserFromOrganizationUnit(_response)); + }); + } + + protected processRemoveUserFromOrganizationUnit(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 分页获取组织机构下用户 + * @param body (optional) + * @return Success + */ + getUsers(body: GetOrganizationUnitUserInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/getUsers"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processGetUsers(_response)); + }); + } + + protected processGetUsers(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = GetOrganizationUnitUserOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 分页获取组织机构下角色 + * @param body (optional) + * @return Success + */ + getRoles(body: GetOrganizationUnitRoleInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/getRoles"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processGetRoles(_response)); + }); + } + + protected processGetRoles(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = GetOrganizationUnitRoleOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 获取不在组织机构的用户 + * @param body (optional) + * @return Success + */ + getUnAddUsers(body: GetUnAddUserInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/getUnAddUsers"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processGetUnAddUsers(_response)); + }); + } + + protected processGetUnAddUsers(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = GetUnAddUserOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 获取不在组织机构的角色 + * @param body (optional) + * @return Success + */ + getUnAddRoles(body: GetUnAddRoleInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/OrganizationUnits/getUnAddRoles"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processGetUnAddRoles(_response)); + }); + } + + protected processGetUnAddRoles(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = GetUnAddRoleOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class PermissionsServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 获取角色权限 - * @param body (optional) - * @return Success - */ - tree( - body: GetPermissionInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Permissions/tree'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processTree(_response), - ); - }); - } - - protected processTree(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = PermissionOutput.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 更新角色 - * @param body (optional) - * @return Success - */ - update( - body: UpdateRolePermissionsInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Permissions/update'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processUpdate(_response), - ); - }); - } - - protected processUpdate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 获取角色权限 + * @param body (optional) + * @return Success + */ + tree(body: GetPermissionInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Permissions/tree"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processTree(_response)); + }); + } + + protected processTree(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = PermissionOutput.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 更新角色 + * @param body (optional) + * @return Success + */ + update(body: UpdateRolePermissionsInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Permissions/update"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + }); + } + + protected processUpdate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class RolesServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 获取所有角色 - * @return Success - */ - all(cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/Roles/all'; - url_ = url_.replace(/[?&]$/, ''); - - let options_ = { - method: 'POST', - url: url_, - headers: { - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processAll(_response), - ); - }); - } - - protected processAll(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = IdentityRoleDtoListResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 分页获取角色 - * @param body (optional) - * @return Success - */ - page( - body: PagingRoleListInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Roles/page'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processPage(_response), - ); - }); - } - - protected processPage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = IdentityRoleDtoPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 创建角色 - * @param body (optional) - * @return Success - */ - create( - body: IdentityRoleCreateDto | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Roles/create'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processCreate(_response), - ); - }); - } - - protected processCreate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = IdentityRoleDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 更新角色 - * @param body (optional) - * @return Success - */ - update( - body: UpdateRoleInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Roles/update'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processUpdate(_response), - ); - }); - } - - protected processUpdate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = IdentityRoleDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 删除角色 - * @param body (optional) - * @return Success - */ - delete(body: IdInput | undefined, cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/Roles/delete'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processDelete(_response), - ); - }); - } - - protected processDelete(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 获取所有角色 + * @return Success + */ + all( cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Roles/all"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ = { + method: "POST", + url: url_, + headers: { + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processAll(_response)); + }); + } + + protected processAll(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = IdentityRoleDtoListResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 分页获取角色 + * @param body (optional) + * @return Success + */ + page(body: PagingRoleListInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Roles/page"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response)); + }); + } + + protected processPage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = IdentityRoleDtoPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 创建角色 + * @param body (optional) + * @return Success + */ + create(body: IdentityRoleCreateDto | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Roles/create"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCreate(_response)); + }); + } + + protected processCreate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = IdentityRoleDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 更新角色 + * @param body (optional) + * @return Success + */ + update(body: UpdateRoleInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Roles/update"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + }); + } + + protected processUpdate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = IdentityRoleDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 删除角色 + * @param body (optional) + * @return Success + */ + delete(body: IdInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Roles/delete"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processDelete(_response)); + }); + } + + protected processDelete(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class SettingsServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 获取所有Setting - * @return Success - */ - all(cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/Settings/all'; - url_ = url_.replace(/[?&]$/, ''); - - let options_ = { - method: 'POST', - url: url_, - headers: { - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processAll(_response), - ); - }); - } - - protected processAll(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) result200!.push(SettingOutput.fromJS(item)); - } else { - result200 = null; - } - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 更新Setting - * @param body (optional) - * @return Success - */ - update( - body: UpdateSettingInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Settings/update'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processUpdate(_response), - ); - }); - } - - protected processUpdate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 获取所有Setting + * @return Success + */ + all( cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Settings/all"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ = { + method: "POST", + url: url_, + headers: { + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processAll(_response)); + }); + } + + protected processAll(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + if (Array.isArray(resultData200)) { + result200 = [] as any; + for (let item of resultData200) + result200!.push(SettingOutput.fromJS(item)); + } + else { + result200 = null; + } + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 更新Setting + * @param body (optional) + * @return Success + */ + update(body: UpdateSettingInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Settings/update"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + }); + } + + protected processUpdate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class TenantsServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 通过名称获取租户信息 - * @param body (optional) - * @return Success - */ - find( - body: FindTenantByNameInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Tenants/find'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processFind(_response), - ); - }); - } - - protected processFind(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = FindTenantResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 分页获取租户信息 - * @param body (optional) - * @return Success - */ - page( - body: PagingTenantInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Tenants/page'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processPage(_response), - ); - }); - } - - protected processPage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = TenantDtoPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 创建租户 - * @param body (optional) - * @return Success - */ - create( - body: TenantCreateDto | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Tenants/create'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processCreate(_response), - ); - }); - } - - protected processCreate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = TenantDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 更新租户 - * @param body (optional) - * @return Success - */ - update( - body: UpdateTenantInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Tenants/update'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processUpdate(_response), - ); - }); - } - - protected processUpdate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = TenantDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 删除租户 - * @param body (optional) - * @return Success - */ - delete(body: IdInput | undefined, cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/Tenants/delete'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processDelete(_response), - ); - }); - } - - protected processDelete(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 获取租户连接字符串 - * @param body (optional) - * @return Success - */ - getConnectionString( - body: IdInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Tenants/getConnectionString'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processGetConnectionString(_response), - ); - }); - } - - protected processGetConnectionString(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = resultData200 !== undefined ? resultData200 : null; - - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 更新租户连接字符串 - * @param body (optional) - * @return Success - */ - updateConnectionString( - body: UpdateConnectionStringInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Tenants/updateConnectionString'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processUpdateConnectionString(_response), - ); - }); - } - - protected processUpdateConnectionString(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 删除租户连接字符串 - * @param body (optional) - * @return Success - */ - deleteConnectionString( - body: IdInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Tenants/deleteConnectionString'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processDeleteConnectionString(_response), - ); - }); - } - - protected processDeleteConnectionString(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 通过名称获取租户信息 + * @param body (optional) + * @return Success + */ + find(body: FindTenantByNameInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Tenants/find"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processFind(_response)); + }); + } + + protected processFind(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = FindTenantResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 分页获取租户信息 + * @param body (optional) + * @return Success + */ + page(body: PagingTenantInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Tenants/page"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response)); + }); + } + + protected processPage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = TenantDtoPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 创建租户 + * @param body (optional) + * @return Success + */ + create(body: TenantCreateDto | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Tenants/create"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCreate(_response)); + }); + } + + protected processCreate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = TenantDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 更新租户 + * @param body (optional) + * @return Success + */ + update(body: UpdateTenantInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Tenants/update"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + }); + } + + protected processUpdate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = TenantDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 删除租户 + * @param body (optional) + * @return Success + */ + delete(body: IdInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Tenants/delete"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processDelete(_response)); + }); + } + + protected processDelete(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 获取租户连接字符串 + * @param body (optional) + * @return Success + */ + getConnectionString(body: IdInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Tenants/getConnectionString"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processGetConnectionString(_response)); + }); + } + + protected processGetConnectionString(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = resultData200 !== undefined ? resultData200 : null; + + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 更新租户连接字符串 + * @param body (optional) + * @return Success + */ + updateConnectionString(body: UpdateConnectionStringInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Tenants/updateConnectionString"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdateConnectionString(_response)); + }); + } + + protected processUpdateConnectionString(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 删除租户连接字符串 + * @param body (optional) + * @return Success + */ + deleteConnectionString(body: IdInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Tenants/deleteConnectionString"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processDeleteConnectionString(_response)); + }); + } + + protected processDeleteConnectionString(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class UsersServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ''; - } - - /** - * 分页获取用户信息 - * @param body (optional) - * @return Success - */ - page( - body: PagingUserListInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Users/page'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processPage(_response), - ); - }); - } - - protected processPage(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = IdentityUserDtoPagedResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 导出用户列表 - * @param body (optional) - * @return Success - */ - export( - body: PagingUserListInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Users/export'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - responseType: 'blob', - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processExport(_response), - ); - }); - } - - protected processExport(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200 || status === 206) { - const contentDisposition = response.headers - ? response.headers['content-disposition'] - : undefined; - let fileNameMatch = contentDisposition - ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) - : undefined; - let fileName = - fileNameMatch && fileNameMatch.length > 1 - ? fileNameMatch[3] || fileNameMatch[2] - : undefined; - if (fileName) { - fileName = decodeURIComponent(fileName); - } else { - fileNameMatch = contentDisposition - ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) - : undefined; - fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined; - } - return Promise.resolve({ - fileName: fileName, - status: status, - data: new Blob([response.data], { type: response.headers['content-type'] }), - headers: _headers, - }); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 创建用户 - * @param body (optional) - * @return Success - */ - create( - body: IdentityUserCreateDto | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Users/create'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processCreate(_response), - ); - }); - } - - protected processCreate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = IdentityUserDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 编辑用户 - * @param body (optional) - * @return Success - */ - update( - body: UpdateUserInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Users/update'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processUpdate(_response), - ); - }); - } - - protected processUpdate(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = IdentityUserDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 删除用户 - * @param body (optional) - * @return Success - */ - delete(body: IdInput | undefined, cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/Users/delete'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processDelete(_response), - ); - }); - } - - protected processDelete(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 获取用户角色信息 - * @param body (optional) - * @return Success - */ - role( - body: IdInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Users/role'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processRole(_response), - ); - }); - } - - protected processRole(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = IdentityRoleDtoListResultDto.fromJS(resultData200); - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 修改当前用户密码 - * @param body (optional) - * @return Success - */ - changePassword( - body: ChangePasswordInput | undefined, - cancelToken?: CancelToken | undefined, - ): Promise { - let url_ = this.baseUrl + '/Users/changePassword'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - Accept: 'text/plain', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processChangePassword(_response), - ); - }); - } - - protected processChangePassword(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = resultData200 !== undefined ? resultData200 : null; - - return Promise.resolve(result200); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } - - /** - * 锁定用户 - * @param body (optional) - * @return Success - */ - lock(body: LockUserInput | undefined, cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + '/Users/lock'; - url_ = url_.replace(/[?&]$/, ''); - - const content_ = JSON.stringify(body); - - let options_ = { - data: content_, - method: 'POST', - url: url_, - headers: { - 'Content-Type': 'application/json', - }, - cancelToken, - }; - - return this.transformOptions(options_) - .then((transformedOptions_) => { - return this.instance.request(transformedOptions_); - }) - .catch((_error: any) => { - if (isAxiosError(_error) && _error.response) { - return _error.response; - } else { - throw _error; - } - }) - .then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => - this.processLock(_response), - ); - }); - } - - protected processLock(response: AxiosResponse): Promise { - const status = response.status; - let _headers: any = {}; - if (response.headers && typeof response.headers === 'object') { - for (let k in response.headers) { - if (response.headers.hasOwnProperty(k)) { - _headers[k] = response.headers[k]; - } - } - } - if (status === 200) { - const _responseText = response.data; - return Promise.resolve(null as any); - } else if (status === 403) { - const _responseText = response.data; - let result403: any = null; - let resultData403 = _responseText; - result403 = RemoteServiceErrorResponse.fromJS(resultData403); - return throwException('Forbidden', status, _responseText, _headers, result403); - } else if (status === 401) { - const _responseText = response.data; - let result401: any = null; - let resultData401 = _responseText; - result401 = RemoteServiceErrorResponse.fromJS(resultData401); - return throwException('Unauthorized', status, _responseText, _headers, result401); - } else if (status === 400) { - const _responseText = response.data; - let result400: any = null; - let resultData400 = _responseText; - result400 = RemoteServiceErrorResponse.fromJS(resultData400); - return throwException('Bad Request', status, _responseText, _headers, result400); - } else if (status === 404) { - const _responseText = response.data; - let result404: any = null; - let resultData404 = _responseText; - result404 = RemoteServiceErrorResponse.fromJS(resultData404); - return throwException('Not Found', status, _responseText, _headers, result404); - } else if (status === 501) { - const _responseText = response.data; - let result501: any = null; - let resultData501 = _responseText; - result501 = RemoteServiceErrorResponse.fromJS(resultData501); - return throwException('Server Error', status, _responseText, _headers, result501); - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText; - result500 = RemoteServiceErrorResponse.fromJS(resultData500); - return throwException('Server Error', status, _responseText, _headers, result500); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException( - 'An unexpected server error occurred.', - status, - _responseText, - _headers, - ); - } - return Promise.resolve(null as any); - } + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 分页获取用户信息 + * @param body (optional) + * @return Success + */ + page(body: PagingUserListInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Users/page"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response)); + }); + } + + protected processPage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = IdentityUserDtoPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 导出用户列表 + * @param body (optional) + * @return Success + */ + export(body: PagingUserListInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Users/export"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + responseType: "blob", + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processExport(_response)); + }); + } + + protected processExport(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200 || status === 206) { + const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined; + let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined; + let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined; + if (fileName) { + fileName = decodeURIComponent(fileName); + } else { + fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined; + fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined; + } + return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data], { type: response.headers["content-type"] }), headers: _headers }); + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 创建用户 + * @param body (optional) + * @return Success + */ + create(body: IdentityUserCreateDto | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Users/create"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCreate(_response)); + }); + } + + protected processCreate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = IdentityUserDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 编辑用户 + * @param body (optional) + * @return Success + */ + update(body: UpdateUserInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Users/update"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + }); + } + + protected processUpdate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = IdentityUserDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 删除用户 + * @param body (optional) + * @return Success + */ + delete(body: IdInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Users/delete"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processDelete(_response)); + }); + } + + protected processDelete(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 获取用户角色信息 + * @param body (optional) + * @return Success + */ + role(body: IdInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Users/role"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processRole(_response)); + }); + } + + protected processRole(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = IdentityRoleDtoListResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 修改当前用户密码 + * @param body (optional) + * @return Success + */ + changePassword(body: ChangePasswordInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Users/changePassword"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processChangePassword(_response)); + }); + } + + protected processChangePassword(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = resultData200 !== undefined ? resultData200 : null; + + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } + + /** + * 锁定用户 + * @param body (optional) + * @return Success + */ + lock(body: LockUserInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Users/lock"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processLock(_response)); + }); + } + + protected processLock(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null as any); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null as any); + } } export class AbpLoginResult implements IAbpLoginResult { - result!: LoginResultType; - readonly description!: string | undefined; - - constructor(data?: IAbpLoginResult) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + result!: LoginResultType; + readonly description!: string | undefined; + + constructor(data?: IAbpLoginResult) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.result = _data['result']; - (this).description = _data['description']; + init(_data?: any) { + if (_data) { + this.result = _data["result"]; + (this).description = _data["description"]; + } } - } - static fromJS(data: any): AbpLoginResult { - data = typeof data === 'object' ? data : {}; - let result = new AbpLoginResult(); - result.init(data); - return result; - } + static fromJS(data: any): AbpLoginResult { + data = typeof data === 'object' ? data : {}; + let result = new AbpLoginResult(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['result'] = this.result; - data['description'] = this.description; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["result"] = this.result; + data["description"] = this.description; + return data; + } } export interface IAbpLoginResult { - result: LoginResultType; - description: string | undefined; + result: LoginResultType; + description: string | undefined; } export class ActionApiDescriptionModel implements IActionApiDescriptionModel { - uniqueName!: string | undefined; - name!: string | undefined; - httpMethod!: string | undefined; - url!: string | undefined; - supportedVersions!: string[] | undefined; - parametersOnMethod!: MethodParameterApiDescriptionModel[] | undefined; - parameters!: ParameterApiDescriptionModel[] | undefined; - returnValue!: ReturnValueApiDescriptionModel; - allowAnonymous!: boolean | undefined; - implementFrom!: string | undefined; - - constructor(data?: IActionApiDescriptionModel) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.uniqueName = _data['uniqueName']; - this.name = _data['name']; - this.httpMethod = _data['httpMethod']; - this.url = _data['url']; - if (Array.isArray(_data['supportedVersions'])) { - this.supportedVersions = [] as any; - for (let item of _data['supportedVersions']) this.supportedVersions!.push(item); - } - if (Array.isArray(_data['parametersOnMethod'])) { - this.parametersOnMethod = [] as any; - for (let item of _data['parametersOnMethod']) - this.parametersOnMethod!.push(MethodParameterApiDescriptionModel.fromJS(item)); - } - if (Array.isArray(_data['parameters'])) { - this.parameters = [] as any; - for (let item of _data['parameters']) - this.parameters!.push(ParameterApiDescriptionModel.fromJS(item)); - } - this.returnValue = _data['returnValue'] - ? ReturnValueApiDescriptionModel.fromJS(_data['returnValue']) - : undefined; - this.allowAnonymous = _data['allowAnonymous']; - this.implementFrom = _data['implementFrom']; - } - } - - static fromJS(data: any): ActionApiDescriptionModel { - data = typeof data === 'object' ? data : {}; - let result = new ActionApiDescriptionModel(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['uniqueName'] = this.uniqueName; - data['name'] = this.name; - data['httpMethod'] = this.httpMethod; - data['url'] = this.url; - if (Array.isArray(this.supportedVersions)) { - data['supportedVersions'] = []; - for (let item of this.supportedVersions) data['supportedVersions'].push(item); - } - if (Array.isArray(this.parametersOnMethod)) { - data['parametersOnMethod'] = []; - for (let item of this.parametersOnMethod) data['parametersOnMethod'].push(item.toJSON()); - } - if (Array.isArray(this.parameters)) { - data['parameters'] = []; - for (let item of this.parameters) data['parameters'].push(item.toJSON()); - } - data['returnValue'] = this.returnValue ? this.returnValue.toJSON() : undefined; - data['allowAnonymous'] = this.allowAnonymous; - data['implementFrom'] = this.implementFrom; - return data; - } + uniqueName!: string | undefined; + name!: string | undefined; + httpMethod!: string | undefined; + url!: string | undefined; + supportedVersions!: string[] | undefined; + parametersOnMethod!: MethodParameterApiDescriptionModel[] | undefined; + parameters!: ParameterApiDescriptionModel[] | undefined; + returnValue!: ReturnValueApiDescriptionModel; + allowAnonymous!: boolean | undefined; + implementFrom!: string | undefined; + + constructor(data?: IActionApiDescriptionModel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.uniqueName = _data["uniqueName"]; + this.name = _data["name"]; + this.httpMethod = _data["httpMethod"]; + this.url = _data["url"]; + if (Array.isArray(_data["supportedVersions"])) { + this.supportedVersions = [] as any; + for (let item of _data["supportedVersions"]) + this.supportedVersions!.push(item); + } + if (Array.isArray(_data["parametersOnMethod"])) { + this.parametersOnMethod = [] as any; + for (let item of _data["parametersOnMethod"]) + this.parametersOnMethod!.push(MethodParameterApiDescriptionModel.fromJS(item)); + } + if (Array.isArray(_data["parameters"])) { + this.parameters = [] as any; + for (let item of _data["parameters"]) + this.parameters!.push(ParameterApiDescriptionModel.fromJS(item)); + } + this.returnValue = _data["returnValue"] ? ReturnValueApiDescriptionModel.fromJS(_data["returnValue"]) : undefined; + this.allowAnonymous = _data["allowAnonymous"]; + this.implementFrom = _data["implementFrom"]; + } + } + + static fromJS(data: any): ActionApiDescriptionModel { + data = typeof data === 'object' ? data : {}; + let result = new ActionApiDescriptionModel(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["uniqueName"] = this.uniqueName; + data["name"] = this.name; + data["httpMethod"] = this.httpMethod; + data["url"] = this.url; + if (Array.isArray(this.supportedVersions)) { + data["supportedVersions"] = []; + for (let item of this.supportedVersions) + data["supportedVersions"].push(item); + } + if (Array.isArray(this.parametersOnMethod)) { + data["parametersOnMethod"] = []; + for (let item of this.parametersOnMethod) + data["parametersOnMethod"].push(item.toJSON()); + } + if (Array.isArray(this.parameters)) { + data["parameters"] = []; + for (let item of this.parameters) + data["parameters"].push(item.toJSON()); + } + data["returnValue"] = this.returnValue ? this.returnValue.toJSON() : undefined; + data["allowAnonymous"] = this.allowAnonymous; + data["implementFrom"] = this.implementFrom; + return data; + } } export interface IActionApiDescriptionModel { - uniqueName: string | undefined; - name: string | undefined; - httpMethod: string | undefined; - url: string | undefined; - supportedVersions: string[] | undefined; - parametersOnMethod: MethodParameterApiDescriptionModel[] | undefined; - parameters: ParameterApiDescriptionModel[] | undefined; - returnValue: ReturnValueApiDescriptionModel; - allowAnonymous: boolean | undefined; - implementFrom: string | undefined; + uniqueName: string | undefined; + name: string | undefined; + httpMethod: string | undefined; + url: string | undefined; + supportedVersions: string[] | undefined; + parametersOnMethod: MethodParameterApiDescriptionModel[] | undefined; + parameters: ParameterApiDescriptionModel[] | undefined; + returnValue: ReturnValueApiDescriptionModel; + allowAnonymous: boolean | undefined; + implementFrom: string | undefined; } export class AddRoleToOrganizationUnitInput implements IAddRoleToOrganizationUnitInput { - roleId!: string[] | undefined; - organizationUnitId!: string; - - constructor(data?: IAddRoleToOrganizationUnitInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + roleId!: string[] | undefined; + organizationUnitId!: string; + + constructor(data?: IAddRoleToOrganizationUnitInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['roleId'])) { - this.roleId = [] as any; - for (let item of _data['roleId']) this.roleId!.push(item); - } - this.organizationUnitId = _data['organizationUnitId']; + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["roleId"])) { + this.roleId = [] as any; + for (let item of _data["roleId"]) + this.roleId!.push(item); + } + this.organizationUnitId = _data["organizationUnitId"]; + } } - } - static fromJS(data: any): AddRoleToOrganizationUnitInput { - data = typeof data === 'object' ? data : {}; - let result = new AddRoleToOrganizationUnitInput(); - result.init(data); - return result; - } + static fromJS(data: any): AddRoleToOrganizationUnitInput { + data = typeof data === 'object' ? data : {}; + let result = new AddRoleToOrganizationUnitInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.roleId)) { - data['roleId'] = []; - for (let item of this.roleId) data['roleId'].push(item); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.roleId)) { + data["roleId"] = []; + for (let item of this.roleId) + data["roleId"].push(item); + } + data["organizationUnitId"] = this.organizationUnitId; + return data; } - data['organizationUnitId'] = this.organizationUnitId; - return data; - } } export interface IAddRoleToOrganizationUnitInput { - roleId: string[] | undefined; - organizationUnitId: string; + roleId: string[] | undefined; + organizationUnitId: string; } export class AddUserToOrganizationUnitInput implements IAddUserToOrganizationUnitInput { - userId!: string[] | undefined; - organizationUnitId!: string; - - constructor(data?: IAddUserToOrganizationUnitInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + userId!: string[] | undefined; + organizationUnitId!: string; + + constructor(data?: IAddUserToOrganizationUnitInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['userId'])) { - this.userId = [] as any; - for (let item of _data['userId']) this.userId!.push(item); - } - this.organizationUnitId = _data['organizationUnitId']; + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["userId"])) { + this.userId = [] as any; + for (let item of _data["userId"]) + this.userId!.push(item); + } + this.organizationUnitId = _data["organizationUnitId"]; + } } - } - static fromJS(data: any): AddUserToOrganizationUnitInput { - data = typeof data === 'object' ? data : {}; - let result = new AddUserToOrganizationUnitInput(); - result.init(data); - return result; - } + static fromJS(data: any): AddUserToOrganizationUnitInput { + data = typeof data === 'object' ? data : {}; + let result = new AddUserToOrganizationUnitInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.userId)) { - data['userId'] = []; - for (let item of this.userId) data['userId'].push(item); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.userId)) { + data["userId"] = []; + for (let item of this.userId) + data["userId"].push(item); + } + data["organizationUnitId"] = this.organizationUnitId; + return data; } - data['organizationUnitId'] = this.organizationUnitId; - return data; - } } export interface IAddUserToOrganizationUnitInput { - userId: string[] | undefined; - organizationUnitId: string; + userId: string[] | undefined; + organizationUnitId: string; } export class AggregateRouteConfig implements IAggregateRouteConfig { - routeKey!: string | undefined; - parameter!: string | undefined; - jsonPath!: string | undefined; - - constructor(data?: IAggregateRouteConfig) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.routeKey = _data['routeKey']; - this.parameter = _data['parameter']; - this.jsonPath = _data['jsonPath']; - } - } - - static fromJS(data: any): AggregateRouteConfig { - data = typeof data === 'object' ? data : {}; - let result = new AggregateRouteConfig(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['routeKey'] = this.routeKey; - data['parameter'] = this.parameter; - data['jsonPath'] = this.jsonPath; - return data; - } + routeKey!: string | undefined; + parameter!: string | undefined; + jsonPath!: string | undefined; + + constructor(data?: IAggregateRouteConfig) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.routeKey = _data["routeKey"]; + this.parameter = _data["parameter"]; + this.jsonPath = _data["jsonPath"]; + } + } + + static fromJS(data: any): AggregateRouteConfig { + data = typeof data === 'object' ? data : {}; + let result = new AggregateRouteConfig(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["routeKey"] = this.routeKey; + data["parameter"] = this.parameter; + data["jsonPath"] = this.jsonPath; + return data; + } } export interface IAggregateRouteConfig { - routeKey: string | undefined; - parameter: string | undefined; - jsonPath: string | undefined; + routeKey: string | undefined; + parameter: string | undefined; + jsonPath: string | undefined; } export class ApplicationApiDescriptionModel implements IApplicationApiDescriptionModel { - modules!: { [key: string]: ModuleApiDescriptionModel } | undefined; - types!: { [key: string]: TypeApiDescriptionModel } | undefined; - - constructor(data?: IApplicationApiDescriptionModel) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['modules']) { - this.modules = {} as any; - for (let key in _data['modules']) { - if (_data['modules'].hasOwnProperty(key)) - (this.modules)![key] = _data['modules'][key] - ? ModuleApiDescriptionModel.fromJS(_data['modules'][key]) - : new ModuleApiDescriptionModel(); - } - } - if (_data['types']) { - this.types = {} as any; - for (let key in _data['types']) { - if (_data['types'].hasOwnProperty(key)) - (this.types)![key] = _data['types'][key] - ? TypeApiDescriptionModel.fromJS(_data['types'][key]) - : new TypeApiDescriptionModel(); - } - } - } - } - - static fromJS(data: any): ApplicationApiDescriptionModel { - data = typeof data === 'object' ? data : {}; - let result = new ApplicationApiDescriptionModel(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.modules) { - data['modules'] = {}; - for (let key in this.modules) { - if (this.modules.hasOwnProperty(key)) - (data['modules'])[key] = this.modules[key] - ? this.modules[key].toJSON() - : undefined; - } - } - if (this.types) { - data['types'] = {}; - for (let key in this.types) { - if (this.types.hasOwnProperty(key)) - (data['types'])[key] = this.types[key] ? this.types[key].toJSON() : undefined; - } - } - return data; - } + modules!: { [key: string]: ModuleApiDescriptionModel; } | undefined; + types!: { [key: string]: TypeApiDescriptionModel; } | undefined; + + constructor(data?: IApplicationApiDescriptionModel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["modules"]) { + this.modules = {} as any; + for (let key in _data["modules"]) { + if (_data["modules"].hasOwnProperty(key)) + (this.modules)![key] = _data["modules"][key] ? ModuleApiDescriptionModel.fromJS(_data["modules"][key]) : new ModuleApiDescriptionModel(); + } + } + if (_data["types"]) { + this.types = {} as any; + for (let key in _data["types"]) { + if (_data["types"].hasOwnProperty(key)) + (this.types)![key] = _data["types"][key] ? TypeApiDescriptionModel.fromJS(_data["types"][key]) : new TypeApiDescriptionModel(); + } + } + } + } + + static fromJS(data: any): ApplicationApiDescriptionModel { + data = typeof data === 'object' ? data : {}; + let result = new ApplicationApiDescriptionModel(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.modules) { + data["modules"] = {}; + for (let key in this.modules) { + if (this.modules.hasOwnProperty(key)) + (data["modules"])[key] = this.modules[key] ? this.modules[key].toJSON() : undefined; + } + } + if (this.types) { + data["types"] = {}; + for (let key in this.types) { + if (this.types.hasOwnProperty(key)) + (data["types"])[key] = this.types[key] ? this.types[key].toJSON() : undefined; + } + } + return data; + } } export interface IApplicationApiDescriptionModel { - modules: { [key: string]: ModuleApiDescriptionModel } | undefined; - types: { [key: string]: TypeApiDescriptionModel } | undefined; + modules: { [key: string]: ModuleApiDescriptionModel; } | undefined; + types: { [key: string]: TypeApiDescriptionModel; } | undefined; } export class ApplicationAuthConfigurationDto implements IApplicationAuthConfigurationDto { - grantedPolicies!: { [key: string]: boolean } | undefined; - - constructor(data?: IApplicationAuthConfigurationDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + grantedPolicies!: { [key: string]: boolean; } | undefined; + + constructor(data?: IApplicationAuthConfigurationDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (_data['grantedPolicies']) { - this.grantedPolicies = {} as any; - for (let key in _data['grantedPolicies']) { - if (_data['grantedPolicies'].hasOwnProperty(key)) - (this.grantedPolicies)![key] = _data['grantedPolicies'][key]; + init(_data?: any) { + if (_data) { + if (_data["grantedPolicies"]) { + this.grantedPolicies = {} as any; + for (let key in _data["grantedPolicies"]) { + if (_data["grantedPolicies"].hasOwnProperty(key)) + (this.grantedPolicies)![key] = _data["grantedPolicies"][key]; + } + } } - } } - } - static fromJS(data: any): ApplicationAuthConfigurationDto { - data = typeof data === 'object' ? data : {}; - let result = new ApplicationAuthConfigurationDto(); - result.init(data); - return result; - } + static fromJS(data: any): ApplicationAuthConfigurationDto { + data = typeof data === 'object' ? data : {}; + let result = new ApplicationAuthConfigurationDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.grantedPolicies) { - data['grantedPolicies'] = {}; - for (let key in this.grantedPolicies) { - if (this.grantedPolicies.hasOwnProperty(key)) - (data['grantedPolicies'])[key] = (this.grantedPolicies)[key]; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.grantedPolicies) { + data["grantedPolicies"] = {}; + for (let key in this.grantedPolicies) { + if (this.grantedPolicies.hasOwnProperty(key)) + (data["grantedPolicies"])[key] = (this.grantedPolicies)[key]; + } + } + return data; } - return data; - } } export interface IApplicationAuthConfigurationDto { - grantedPolicies: { [key: string]: boolean } | undefined; + grantedPolicies: { [key: string]: boolean; } | undefined; } export class ApplicationConfigurationDto implements IApplicationConfigurationDto { - localization!: ApplicationLocalizationConfigurationDto; - auth!: ApplicationAuthConfigurationDto; - setting!: ApplicationSettingConfigurationDto; - currentUser!: CurrentUserDto; - features!: ApplicationFeatureConfigurationDto; - globalFeatures!: ApplicationGlobalFeatureConfigurationDto; - multiTenancy!: MultiTenancyInfoDto; - currentTenant!: CurrentTenantDto; - timing!: TimingDto; - clock!: ClockDto; - objectExtensions!: ObjectExtensionsDto; - extraProperties!: { [key: string]: any } | undefined; - - constructor(data?: IApplicationConfigurationDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.localization = _data['localization'] - ? ApplicationLocalizationConfigurationDto.fromJS(_data['localization']) - : undefined; - this.auth = _data['auth'] - ? ApplicationAuthConfigurationDto.fromJS(_data['auth']) - : undefined; - this.setting = _data['setting'] - ? ApplicationSettingConfigurationDto.fromJS(_data['setting']) - : undefined; - this.currentUser = _data['currentUser'] - ? CurrentUserDto.fromJS(_data['currentUser']) - : undefined; - this.features = _data['features'] - ? ApplicationFeatureConfigurationDto.fromJS(_data['features']) - : undefined; - this.globalFeatures = _data['globalFeatures'] - ? ApplicationGlobalFeatureConfigurationDto.fromJS(_data['globalFeatures']) - : undefined; - this.multiTenancy = _data['multiTenancy'] - ? MultiTenancyInfoDto.fromJS(_data['multiTenancy']) - : undefined; - this.currentTenant = _data['currentTenant'] - ? CurrentTenantDto.fromJS(_data['currentTenant']) - : undefined; - this.timing = _data['timing'] ? TimingDto.fromJS(_data['timing']) : undefined; - this.clock = _data['clock'] ? ClockDto.fromJS(_data['clock']) : undefined; - this.objectExtensions = _data['objectExtensions'] - ? ObjectExtensionsDto.fromJS(_data['objectExtensions']) - : undefined; - if (_data['extraProperties']) { - this.extraProperties = {} as any; - for (let key in _data['extraProperties']) { - if (_data['extraProperties'].hasOwnProperty(key)) - (this.extraProperties)![key] = _data['extraProperties'][key]; - } - } - } - } - - static fromJS(data: any): ApplicationConfigurationDto { - data = typeof data === 'object' ? data : {}; - let result = new ApplicationConfigurationDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['localization'] = this.localization ? this.localization.toJSON() : undefined; - data['auth'] = this.auth ? this.auth.toJSON() : undefined; - data['setting'] = this.setting ? this.setting.toJSON() : undefined; - data['currentUser'] = this.currentUser ? this.currentUser.toJSON() : undefined; - data['features'] = this.features ? this.features.toJSON() : undefined; - data['globalFeatures'] = this.globalFeatures ? this.globalFeatures.toJSON() : undefined; - data['multiTenancy'] = this.multiTenancy ? this.multiTenancy.toJSON() : undefined; - data['currentTenant'] = this.currentTenant ? this.currentTenant.toJSON() : undefined; - data['timing'] = this.timing ? this.timing.toJSON() : undefined; - data['clock'] = this.clock ? this.clock.toJSON() : undefined; - data['objectExtensions'] = this.objectExtensions - ? this.objectExtensions.toJSON() - : undefined; - if (this.extraProperties) { - data['extraProperties'] = {}; - for (let key in this.extraProperties) { - if (this.extraProperties.hasOwnProperty(key)) - (data['extraProperties'])[key] = (this.extraProperties)[key]; - } - } - return data; - } + localization!: ApplicationLocalizationConfigurationDto; + auth!: ApplicationAuthConfigurationDto; + setting!: ApplicationSettingConfigurationDto; + currentUser!: CurrentUserDto; + features!: ApplicationFeatureConfigurationDto; + globalFeatures!: ApplicationGlobalFeatureConfigurationDto; + multiTenancy!: MultiTenancyInfoDto; + currentTenant!: CurrentTenantDto; + timing!: TimingDto; + clock!: ClockDto; + objectExtensions!: ObjectExtensionsDto; + extraProperties!: { [key: string]: any; } | undefined; + + constructor(data?: IApplicationConfigurationDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.localization = _data["localization"] ? ApplicationLocalizationConfigurationDto.fromJS(_data["localization"]) : undefined; + this.auth = _data["auth"] ? ApplicationAuthConfigurationDto.fromJS(_data["auth"]) : undefined; + this.setting = _data["setting"] ? ApplicationSettingConfigurationDto.fromJS(_data["setting"]) : undefined; + this.currentUser = _data["currentUser"] ? CurrentUserDto.fromJS(_data["currentUser"]) : undefined; + this.features = _data["features"] ? ApplicationFeatureConfigurationDto.fromJS(_data["features"]) : undefined; + this.globalFeatures = _data["globalFeatures"] ? ApplicationGlobalFeatureConfigurationDto.fromJS(_data["globalFeatures"]) : undefined; + this.multiTenancy = _data["multiTenancy"] ? MultiTenancyInfoDto.fromJS(_data["multiTenancy"]) : undefined; + this.currentTenant = _data["currentTenant"] ? CurrentTenantDto.fromJS(_data["currentTenant"]) : undefined; + this.timing = _data["timing"] ? TimingDto.fromJS(_data["timing"]) : undefined; + this.clock = _data["clock"] ? ClockDto.fromJS(_data["clock"]) : undefined; + this.objectExtensions = _data["objectExtensions"] ? ObjectExtensionsDto.fromJS(_data["objectExtensions"]) : undefined; + if (_data["extraProperties"]) { + this.extraProperties = {} as any; + for (let key in _data["extraProperties"]) { + if (_data["extraProperties"].hasOwnProperty(key)) + (this.extraProperties)![key] = _data["extraProperties"][key]; + } + } + } + } + + static fromJS(data: any): ApplicationConfigurationDto { + data = typeof data === 'object' ? data : {}; + let result = new ApplicationConfigurationDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["localization"] = this.localization ? this.localization.toJSON() : undefined; + data["auth"] = this.auth ? this.auth.toJSON() : undefined; + data["setting"] = this.setting ? this.setting.toJSON() : undefined; + data["currentUser"] = this.currentUser ? this.currentUser.toJSON() : undefined; + data["features"] = this.features ? this.features.toJSON() : undefined; + data["globalFeatures"] = this.globalFeatures ? this.globalFeatures.toJSON() : undefined; + data["multiTenancy"] = this.multiTenancy ? this.multiTenancy.toJSON() : undefined; + data["currentTenant"] = this.currentTenant ? this.currentTenant.toJSON() : undefined; + data["timing"] = this.timing ? this.timing.toJSON() : undefined; + data["clock"] = this.clock ? this.clock.toJSON() : undefined; + data["objectExtensions"] = this.objectExtensions ? this.objectExtensions.toJSON() : undefined; + if (this.extraProperties) { + data["extraProperties"] = {}; + for (let key in this.extraProperties) { + if (this.extraProperties.hasOwnProperty(key)) + (data["extraProperties"])[key] = (this.extraProperties)[key]; + } + } + return data; + } } export interface IApplicationConfigurationDto { - localization: ApplicationLocalizationConfigurationDto; - auth: ApplicationAuthConfigurationDto; - setting: ApplicationSettingConfigurationDto; - currentUser: CurrentUserDto; - features: ApplicationFeatureConfigurationDto; - globalFeatures: ApplicationGlobalFeatureConfigurationDto; - multiTenancy: MultiTenancyInfoDto; - currentTenant: CurrentTenantDto; - timing: TimingDto; - clock: ClockDto; - objectExtensions: ObjectExtensionsDto; - extraProperties: { [key: string]: any } | undefined; + localization: ApplicationLocalizationConfigurationDto; + auth: ApplicationAuthConfigurationDto; + setting: ApplicationSettingConfigurationDto; + currentUser: CurrentUserDto; + features: ApplicationFeatureConfigurationDto; + globalFeatures: ApplicationGlobalFeatureConfigurationDto; + multiTenancy: MultiTenancyInfoDto; + currentTenant: CurrentTenantDto; + timing: TimingDto; + clock: ClockDto; + objectExtensions: ObjectExtensionsDto; + extraProperties: { [key: string]: any; } | undefined; } export class ApplicationFeatureConfigurationDto implements IApplicationFeatureConfigurationDto { - values!: { [key: string]: string } | undefined; - - constructor(data?: IApplicationFeatureConfigurationDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + values!: { [key: string]: string; } | undefined; + + constructor(data?: IApplicationFeatureConfigurationDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (_data['values']) { - this.values = {} as any; - for (let key in _data['values']) { - if (_data['values'].hasOwnProperty(key)) (this.values)![key] = _data['values'][key]; + init(_data?: any) { + if (_data) { + if (_data["values"]) { + this.values = {} as any; + for (let key in _data["values"]) { + if (_data["values"].hasOwnProperty(key)) + (this.values)![key] = _data["values"][key]; + } + } } - } } - } - static fromJS(data: any): ApplicationFeatureConfigurationDto { - data = typeof data === 'object' ? data : {}; - let result = new ApplicationFeatureConfigurationDto(); - result.init(data); - return result; - } + static fromJS(data: any): ApplicationFeatureConfigurationDto { + data = typeof data === 'object' ? data : {}; + let result = new ApplicationFeatureConfigurationDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.values) { - data['values'] = {}; - for (let key in this.values) { - if (this.values.hasOwnProperty(key)) (data['values'])[key] = (this.values)[key]; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.values) { + data["values"] = {}; + for (let key in this.values) { + if (this.values.hasOwnProperty(key)) + (data["values"])[key] = (this.values)[key]; + } + } + return data; } - return data; - } } export interface IApplicationFeatureConfigurationDto { - values: { [key: string]: string } | undefined; + values: { [key: string]: string; } | undefined; } -export class ApplicationGlobalFeatureConfigurationDto - implements IApplicationGlobalFeatureConfigurationDto -{ - enabledFeatures!: string[] | undefined; +export class ApplicationGlobalFeatureConfigurationDto implements IApplicationGlobalFeatureConfigurationDto { + enabledFeatures!: string[] | undefined; - constructor(data?: IApplicationGlobalFeatureConfigurationDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + constructor(data?: IApplicationGlobalFeatureConfigurationDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['enabledFeatures'])) { - this.enabledFeatures = [] as any; - for (let item of _data['enabledFeatures']) this.enabledFeatures!.push(item); - } + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["enabledFeatures"])) { + this.enabledFeatures = [] as any; + for (let item of _data["enabledFeatures"]) + this.enabledFeatures!.push(item); + } + } } - } - static fromJS(data: any): ApplicationGlobalFeatureConfigurationDto { - data = typeof data === 'object' ? data : {}; - let result = new ApplicationGlobalFeatureConfigurationDto(); - result.init(data); - return result; - } + static fromJS(data: any): ApplicationGlobalFeatureConfigurationDto { + data = typeof data === 'object' ? data : {}; + let result = new ApplicationGlobalFeatureConfigurationDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.enabledFeatures)) { - data['enabledFeatures'] = []; - for (let item of this.enabledFeatures) data['enabledFeatures'].push(item); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.enabledFeatures)) { + data["enabledFeatures"] = []; + for (let item of this.enabledFeatures) + data["enabledFeatures"].push(item); + } + return data; } - return data; - } } export interface IApplicationGlobalFeatureConfigurationDto { - enabledFeatures: string[] | undefined; -} - -export class ApplicationLocalizationConfigurationDto - implements IApplicationLocalizationConfigurationDto -{ - values!: { [key: string]: { [key: string]: string } } | undefined; - resources!: { [key: string]: ApplicationLocalizationResourceDto } | undefined; - languages!: LanguageInfo[] | undefined; - currentCulture!: CurrentCultureDto; - defaultResourceName!: string | undefined; - languagesMap!: { [key: string]: NameValue[] } | undefined; - languageFilesMap!: { [key: string]: NameValue[] } | undefined; - - constructor(data?: IApplicationLocalizationConfigurationDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['values']) { - this.values = {} as any; - for (let key in _data['values']) { - if (_data['values'].hasOwnProperty(key)) (this.values)![key] = _data['values'][key]; - } - } - if (_data['resources']) { - this.resources = {} as any; - for (let key in _data['resources']) { - if (_data['resources'].hasOwnProperty(key)) - (this.resources)![key] = _data['resources'][key] - ? ApplicationLocalizationResourceDto.fromJS(_data['resources'][key]) - : new ApplicationLocalizationResourceDto(); - } - } - if (Array.isArray(_data['languages'])) { - this.languages = [] as any; - for (let item of _data['languages']) this.languages!.push(LanguageInfo.fromJS(item)); - } - this.currentCulture = _data['currentCulture'] - ? CurrentCultureDto.fromJS(_data['currentCulture']) - : undefined; - this.defaultResourceName = _data['defaultResourceName']; - if (_data['languagesMap']) { - this.languagesMap = {} as any; - for (let key in _data['languagesMap']) { - if (_data['languagesMap'].hasOwnProperty(key)) - (this.languagesMap)![key] = _data['languagesMap'][key] - ? _data['languagesMap'][key].map((i: any) => NameValue.fromJS(i)) - : undefined; - } - } - if (_data['languageFilesMap']) { - this.languageFilesMap = {} as any; - for (let key in _data['languageFilesMap']) { - if (_data['languageFilesMap'].hasOwnProperty(key)) - (this.languageFilesMap)![key] = _data['languageFilesMap'][key] - ? _data['languageFilesMap'][key].map((i: any) => NameValue.fromJS(i)) - : undefined; - } - } - } - } - - static fromJS(data: any): ApplicationLocalizationConfigurationDto { - data = typeof data === 'object' ? data : {}; - let result = new ApplicationLocalizationConfigurationDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.values) { - data['values'] = {}; - for (let key in this.values) { - if (this.values.hasOwnProperty(key)) (data['values'])[key] = (this.values)[key]; - } - } - if (this.resources) { - data['resources'] = {}; - for (let key in this.resources) { - if (this.resources.hasOwnProperty(key)) - (data['resources'])[key] = this.resources[key] - ? this.resources[key].toJSON() - : undefined; - } - } - if (Array.isArray(this.languages)) { - data['languages'] = []; - for (let item of this.languages) data['languages'].push(item.toJSON()); - } - data['currentCulture'] = this.currentCulture ? this.currentCulture.toJSON() : undefined; - data['defaultResourceName'] = this.defaultResourceName; - if (this.languagesMap) { - data['languagesMap'] = {}; - for (let key in this.languagesMap) { - if (this.languagesMap.hasOwnProperty(key)) - (data['languagesMap'])[key] = (this.languagesMap)[key]; - } - } - if (this.languageFilesMap) { - data['languageFilesMap'] = {}; - for (let key in this.languageFilesMap) { - if (this.languageFilesMap.hasOwnProperty(key)) - (data['languageFilesMap'])[key] = (this.languageFilesMap)[key]; - } - } - return data; - } + enabledFeatures: string[] | undefined; +} + +export class ApplicationLocalizationConfigurationDto implements IApplicationLocalizationConfigurationDto { + values!: { [key: string]: { [key: string]: string; }; } | undefined; + resources!: { [key: string]: ApplicationLocalizationResourceDto; } | undefined; + languages!: LanguageInfo[] | undefined; + currentCulture!: CurrentCultureDto; + defaultResourceName!: string | undefined; + languagesMap!: { [key: string]: NameValue[]; } | undefined; + languageFilesMap!: { [key: string]: NameValue[]; } | undefined; + + constructor(data?: IApplicationLocalizationConfigurationDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["values"]) { + this.values = {} as any; + for (let key in _data["values"]) { + if (_data["values"].hasOwnProperty(key)) + (this.values)![key] = _data["values"][key]; + } + } + if (_data["resources"]) { + this.resources = {} as any; + for (let key in _data["resources"]) { + if (_data["resources"].hasOwnProperty(key)) + (this.resources)![key] = _data["resources"][key] ? ApplicationLocalizationResourceDto.fromJS(_data["resources"][key]) : new ApplicationLocalizationResourceDto(); + } + } + if (Array.isArray(_data["languages"])) { + this.languages = [] as any; + for (let item of _data["languages"]) + this.languages!.push(LanguageInfo.fromJS(item)); + } + this.currentCulture = _data["currentCulture"] ? CurrentCultureDto.fromJS(_data["currentCulture"]) : undefined; + this.defaultResourceName = _data["defaultResourceName"]; + if (_data["languagesMap"]) { + this.languagesMap = {} as any; + for (let key in _data["languagesMap"]) { + if (_data["languagesMap"].hasOwnProperty(key)) + (this.languagesMap)![key] = _data["languagesMap"][key] ? _data["languagesMap"][key].map((i: any) => NameValue.fromJS(i)) : undefined; + } + } + if (_data["languageFilesMap"]) { + this.languageFilesMap = {} as any; + for (let key in _data["languageFilesMap"]) { + if (_data["languageFilesMap"].hasOwnProperty(key)) + (this.languageFilesMap)![key] = _data["languageFilesMap"][key] ? _data["languageFilesMap"][key].map((i: any) => NameValue.fromJS(i)) : undefined; + } + } + } + } + + static fromJS(data: any): ApplicationLocalizationConfigurationDto { + data = typeof data === 'object' ? data : {}; + let result = new ApplicationLocalizationConfigurationDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.values) { + data["values"] = {}; + for (let key in this.values) { + if (this.values.hasOwnProperty(key)) + (data["values"])[key] = (this.values)[key]; + } + } + if (this.resources) { + data["resources"] = {}; + for (let key in this.resources) { + if (this.resources.hasOwnProperty(key)) + (data["resources"])[key] = this.resources[key] ? this.resources[key].toJSON() : undefined; + } + } + if (Array.isArray(this.languages)) { + data["languages"] = []; + for (let item of this.languages) + data["languages"].push(item.toJSON()); + } + data["currentCulture"] = this.currentCulture ? this.currentCulture.toJSON() : undefined; + data["defaultResourceName"] = this.defaultResourceName; + if (this.languagesMap) { + data["languagesMap"] = {}; + for (let key in this.languagesMap) { + if (this.languagesMap.hasOwnProperty(key)) + (data["languagesMap"])[key] = (this.languagesMap)[key]; + } + } + if (this.languageFilesMap) { + data["languageFilesMap"] = {}; + for (let key in this.languageFilesMap) { + if (this.languageFilesMap.hasOwnProperty(key)) + (data["languageFilesMap"])[key] = (this.languageFilesMap)[key]; + } + } + return data; + } } export interface IApplicationLocalizationConfigurationDto { - values: { [key: string]: { [key: string]: string } } | undefined; - resources: { [key: string]: ApplicationLocalizationResourceDto } | undefined; - languages: LanguageInfo[] | undefined; - currentCulture: CurrentCultureDto; - defaultResourceName: string | undefined; - languagesMap: { [key: string]: NameValue[] } | undefined; - languageFilesMap: { [key: string]: NameValue[] } | undefined; + values: { [key: string]: { [key: string]: string; }; } | undefined; + resources: { [key: string]: ApplicationLocalizationResourceDto; } | undefined; + languages: LanguageInfo[] | undefined; + currentCulture: CurrentCultureDto; + defaultResourceName: string | undefined; + languagesMap: { [key: string]: NameValue[]; } | undefined; + languageFilesMap: { [key: string]: NameValue[]; } | undefined; } export class ApplicationLocalizationDto implements IApplicationLocalizationDto { - resources!: { [key: string]: ApplicationLocalizationResourceDto } | undefined; - - constructor(data?: IApplicationLocalizationDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['resources']) { - this.resources = {} as any; - for (let key in _data['resources']) { - if (_data['resources'].hasOwnProperty(key)) - (this.resources)![key] = _data['resources'][key] - ? ApplicationLocalizationResourceDto.fromJS(_data['resources'][key]) - : new ApplicationLocalizationResourceDto(); - } - } - } - } - - static fromJS(data: any): ApplicationLocalizationDto { - data = typeof data === 'object' ? data : {}; - let result = new ApplicationLocalizationDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.resources) { - data['resources'] = {}; - for (let key in this.resources) { - if (this.resources.hasOwnProperty(key)) - (data['resources'])[key] = this.resources[key] - ? this.resources[key].toJSON() - : undefined; - } - } - return data; - } + resources!: { [key: string]: ApplicationLocalizationResourceDto; } | undefined; + + constructor(data?: IApplicationLocalizationDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["resources"]) { + this.resources = {} as any; + for (let key in _data["resources"]) { + if (_data["resources"].hasOwnProperty(key)) + (this.resources)![key] = _data["resources"][key] ? ApplicationLocalizationResourceDto.fromJS(_data["resources"][key]) : new ApplicationLocalizationResourceDto(); + } + } + } + } + + static fromJS(data: any): ApplicationLocalizationDto { + data = typeof data === 'object' ? data : {}; + let result = new ApplicationLocalizationDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.resources) { + data["resources"] = {}; + for (let key in this.resources) { + if (this.resources.hasOwnProperty(key)) + (data["resources"])[key] = this.resources[key] ? this.resources[key].toJSON() : undefined; + } + } + return data; + } } export interface IApplicationLocalizationDto { - resources: { [key: string]: ApplicationLocalizationResourceDto } | undefined; + resources: { [key: string]: ApplicationLocalizationResourceDto; } | undefined; } export class ApplicationLocalizationResourceDto implements IApplicationLocalizationResourceDto { - texts!: { [key: string]: string } | undefined; - baseResources!: string[] | undefined; - - constructor(data?: IApplicationLocalizationResourceDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['texts']) { - this.texts = {} as any; - for (let key in _data['texts']) { - if (_data['texts'].hasOwnProperty(key)) (this.texts)![key] = _data['texts'][key]; - } - } - if (Array.isArray(_data['baseResources'])) { - this.baseResources = [] as any; - for (let item of _data['baseResources']) this.baseResources!.push(item); - } - } - } - - static fromJS(data: any): ApplicationLocalizationResourceDto { - data = typeof data === 'object' ? data : {}; - let result = new ApplicationLocalizationResourceDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.texts) { - data['texts'] = {}; - for (let key in this.texts) { - if (this.texts.hasOwnProperty(key)) (data['texts'])[key] = (this.texts)[key]; - } - } - if (Array.isArray(this.baseResources)) { - data['baseResources'] = []; - for (let item of this.baseResources) data['baseResources'].push(item); - } - return data; - } + texts!: { [key: string]: string; } | undefined; + baseResources!: string[] | undefined; + + constructor(data?: IApplicationLocalizationResourceDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["texts"]) { + this.texts = {} as any; + for (let key in _data["texts"]) { + if (_data["texts"].hasOwnProperty(key)) + (this.texts)![key] = _data["texts"][key]; + } + } + if (Array.isArray(_data["baseResources"])) { + this.baseResources = [] as any; + for (let item of _data["baseResources"]) + this.baseResources!.push(item); + } + } + } + + static fromJS(data: any): ApplicationLocalizationResourceDto { + data = typeof data === 'object' ? data : {}; + let result = new ApplicationLocalizationResourceDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.texts) { + data["texts"] = {}; + for (let key in this.texts) { + if (this.texts.hasOwnProperty(key)) + (data["texts"])[key] = (this.texts)[key]; + } + } + if (Array.isArray(this.baseResources)) { + data["baseResources"] = []; + for (let item of this.baseResources) + data["baseResources"].push(item); + } + return data; + } } export interface IApplicationLocalizationResourceDto { - texts: { [key: string]: string } | undefined; - baseResources: string[] | undefined; + texts: { [key: string]: string; } | undefined; + baseResources: string[] | undefined; } export class ApplicationSettingConfigurationDto implements IApplicationSettingConfigurationDto { - values!: { [key: string]: string } | undefined; - - constructor(data?: IApplicationSettingConfigurationDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + values!: { [key: string]: string; } | undefined; + + constructor(data?: IApplicationSettingConfigurationDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (_data['values']) { - this.values = {} as any; - for (let key in _data['values']) { - if (_data['values'].hasOwnProperty(key)) (this.values)![key] = _data['values'][key]; + init(_data?: any) { + if (_data) { + if (_data["values"]) { + this.values = {} as any; + for (let key in _data["values"]) { + if (_data["values"].hasOwnProperty(key)) + (this.values)![key] = _data["values"][key]; + } + } } - } } - } - static fromJS(data: any): ApplicationSettingConfigurationDto { - data = typeof data === 'object' ? data : {}; - let result = new ApplicationSettingConfigurationDto(); - result.init(data); - return result; - } + static fromJS(data: any): ApplicationSettingConfigurationDto { + data = typeof data === 'object' ? data : {}; + let result = new ApplicationSettingConfigurationDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.values) { - data['values'] = {}; - for (let key in this.values) { - if (this.values.hasOwnProperty(key)) (data['values'])[key] = (this.values)[key]; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.values) { + data["values"] = {}; + for (let key in this.values) { + if (this.values.hasOwnProperty(key)) + (data["values"])[key] = (this.values)[key]; + } + } + return data; } - return data; - } } export interface IApplicationSettingConfigurationDto { - values: { [key: string]: string } | undefined; + values: { [key: string]: string; } | undefined; } export class ChangePasswordInput implements IChangePasswordInput { - currentPassword!: string | undefined; - newPassword!: string; - - constructor(data?: IChangePasswordInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + currentPassword!: string | undefined; + newPassword!: string; + + constructor(data?: IChangePasswordInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.currentPassword = _data['currentPassword']; - this.newPassword = _data['newPassword']; + init(_data?: any) { + if (_data) { + this.currentPassword = _data["currentPassword"]; + this.newPassword = _data["newPassword"]; + } } - } - static fromJS(data: any): ChangePasswordInput { - data = typeof data === 'object' ? data : {}; - let result = new ChangePasswordInput(); - result.init(data); - return result; - } + static fromJS(data: any): ChangePasswordInput { + data = typeof data === 'object' ? data : {}; + let result = new ChangePasswordInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['currentPassword'] = this.currentPassword; - data['newPassword'] = this.newPassword; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["currentPassword"] = this.currentPassword; + data["newPassword"] = this.newPassword; + return data; + } } export interface IChangePasswordInput { - currentPassword: string | undefined; - newPassword: string; + currentPassword: string | undefined; + newPassword: string; } export class ClockDto implements IClockDto { - kind!: string | undefined; - - constructor(data?: IClockDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + kind!: string | undefined; + + constructor(data?: IClockDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.kind = _data['kind']; + init(_data?: any) { + if (_data) { + this.kind = _data["kind"]; + } } - } - static fromJS(data: any): ClockDto { - data = typeof data === 'object' ? data : {}; - let result = new ClockDto(); - result.init(data); - return result; - } + static fromJS(data: any): ClockDto { + data = typeof data === 'object' ? data : {}; + let result = new ClockDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['kind'] = this.kind; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["kind"] = this.kind; + return data; + } } export interface IClockDto { - kind: string | undefined; + kind: string | undefined; } export class ControllerApiDescriptionModel implements IControllerApiDescriptionModel { - controllerName!: string | undefined; - controllerGroupName!: string | undefined; - isRemoteService!: boolean; - isIntegrationService!: boolean; - apiVersion!: string | undefined; - type!: string | undefined; - interfaces!: ControllerInterfaceApiDescriptionModel[] | undefined; - actions!: { [key: string]: ActionApiDescriptionModel } | undefined; - - constructor(data?: IControllerApiDescriptionModel) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.controllerName = _data['controllerName']; - this.controllerGroupName = _data['controllerGroupName']; - this.isRemoteService = _data['isRemoteService']; - this.isIntegrationService = _data['isIntegrationService']; - this.apiVersion = _data['apiVersion']; - this.type = _data['type']; - if (Array.isArray(_data['interfaces'])) { - this.interfaces = [] as any; - for (let item of _data['interfaces']) - this.interfaces!.push(ControllerInterfaceApiDescriptionModel.fromJS(item)); - } - if (_data['actions']) { - this.actions = {} as any; - for (let key in _data['actions']) { - if (_data['actions'].hasOwnProperty(key)) - (this.actions)![key] = _data['actions'][key] - ? ActionApiDescriptionModel.fromJS(_data['actions'][key]) - : new ActionApiDescriptionModel(); - } - } - } - } - - static fromJS(data: any): ControllerApiDescriptionModel { - data = typeof data === 'object' ? data : {}; - let result = new ControllerApiDescriptionModel(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['controllerName'] = this.controllerName; - data['controllerGroupName'] = this.controllerGroupName; - data['isRemoteService'] = this.isRemoteService; - data['isIntegrationService'] = this.isIntegrationService; - data['apiVersion'] = this.apiVersion; - data['type'] = this.type; - if (Array.isArray(this.interfaces)) { - data['interfaces'] = []; - for (let item of this.interfaces) data['interfaces'].push(item.toJSON()); - } - if (this.actions) { - data['actions'] = {}; - for (let key in this.actions) { - if (this.actions.hasOwnProperty(key)) - (data['actions'])[key] = this.actions[key] - ? this.actions[key].toJSON() - : undefined; - } - } - return data; - } + controllerName!: string | undefined; + controllerGroupName!: string | undefined; + isRemoteService!: boolean; + isIntegrationService!: boolean; + apiVersion!: string | undefined; + type!: string | undefined; + interfaces!: ControllerInterfaceApiDescriptionModel[] | undefined; + actions!: { [key: string]: ActionApiDescriptionModel; } | undefined; + + constructor(data?: IControllerApiDescriptionModel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.controllerName = _data["controllerName"]; + this.controllerGroupName = _data["controllerGroupName"]; + this.isRemoteService = _data["isRemoteService"]; + this.isIntegrationService = _data["isIntegrationService"]; + this.apiVersion = _data["apiVersion"]; + this.type = _data["type"]; + if (Array.isArray(_data["interfaces"])) { + this.interfaces = [] as any; + for (let item of _data["interfaces"]) + this.interfaces!.push(ControllerInterfaceApiDescriptionModel.fromJS(item)); + } + if (_data["actions"]) { + this.actions = {} as any; + for (let key in _data["actions"]) { + if (_data["actions"].hasOwnProperty(key)) + (this.actions)![key] = _data["actions"][key] ? ActionApiDescriptionModel.fromJS(_data["actions"][key]) : new ActionApiDescriptionModel(); + } + } + } + } + + static fromJS(data: any): ControllerApiDescriptionModel { + data = typeof data === 'object' ? data : {}; + let result = new ControllerApiDescriptionModel(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["controllerName"] = this.controllerName; + data["controllerGroupName"] = this.controllerGroupName; + data["isRemoteService"] = this.isRemoteService; + data["isIntegrationService"] = this.isIntegrationService; + data["apiVersion"] = this.apiVersion; + data["type"] = this.type; + if (Array.isArray(this.interfaces)) { + data["interfaces"] = []; + for (let item of this.interfaces) + data["interfaces"].push(item.toJSON()); + } + if (this.actions) { + data["actions"] = {}; + for (let key in this.actions) { + if (this.actions.hasOwnProperty(key)) + (data["actions"])[key] = this.actions[key] ? this.actions[key].toJSON() : undefined; + } + } + return data; + } } export interface IControllerApiDescriptionModel { - controllerName: string | undefined; - controllerGroupName: string | undefined; - isRemoteService: boolean; - isIntegrationService: boolean; - apiVersion: string | undefined; - type: string | undefined; - interfaces: ControllerInterfaceApiDescriptionModel[] | undefined; - actions: { [key: string]: ActionApiDescriptionModel } | undefined; -} - -export class ControllerInterfaceApiDescriptionModel - implements IControllerInterfaceApiDescriptionModel -{ - type!: string | undefined; - name!: string | undefined; - methods!: InterfaceMethodApiDescriptionModel[] | undefined; - - constructor(data?: IControllerInterfaceApiDescriptionModel) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.type = _data['type']; - this.name = _data['name']; - if (Array.isArray(_data['methods'])) { - this.methods = [] as any; - for (let item of _data['methods']) - this.methods!.push(InterfaceMethodApiDescriptionModel.fromJS(item)); - } - } - } - - static fromJS(data: any): ControllerInterfaceApiDescriptionModel { - data = typeof data === 'object' ? data : {}; - let result = new ControllerInterfaceApiDescriptionModel(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['type'] = this.type; - data['name'] = this.name; - if (Array.isArray(this.methods)) { - data['methods'] = []; - for (let item of this.methods) data['methods'].push(item.toJSON()); - } - return data; - } + controllerName: string | undefined; + controllerGroupName: string | undefined; + isRemoteService: boolean; + isIntegrationService: boolean; + apiVersion: string | undefined; + type: string | undefined; + interfaces: ControllerInterfaceApiDescriptionModel[] | undefined; + actions: { [key: string]: ActionApiDescriptionModel; } | undefined; +} + +export class ControllerInterfaceApiDescriptionModel implements IControllerInterfaceApiDescriptionModel { + type!: string | undefined; + name!: string | undefined; + methods!: InterfaceMethodApiDescriptionModel[] | undefined; + + constructor(data?: IControllerInterfaceApiDescriptionModel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.type = _data["type"]; + this.name = _data["name"]; + if (Array.isArray(_data["methods"])) { + this.methods = [] as any; + for (let item of _data["methods"]) + this.methods!.push(InterfaceMethodApiDescriptionModel.fromJS(item)); + } + } + } + + static fromJS(data: any): ControllerInterfaceApiDescriptionModel { + data = typeof data === 'object' ? data : {}; + let result = new ControllerInterfaceApiDescriptionModel(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["type"] = this.type; + data["name"] = this.name; + if (Array.isArray(this.methods)) { + data["methods"] = []; + for (let item of this.methods) + data["methods"].push(item.toJSON()); + } + return data; + } } export interface IControllerInterfaceApiDescriptionModel { - type: string | undefined; - name: string | undefined; - methods: InterfaceMethodApiDescriptionModel[] | undefined; + type: string | undefined; + name: string | undefined; + methods: InterfaceMethodApiDescriptionModel[] | undefined; } export class CreateDataDictinaryDetailInput implements ICreateDataDictinaryDetailInput { - id!: string; - code!: string | undefined; - displayText!: string | undefined; - description!: string | undefined; - order!: number; - - constructor(data?: ICreateDataDictinaryDetailInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.code = _data['code']; - this.displayText = _data['displayText']; - this.description = _data['description']; - this.order = _data['order']; - } - } - - static fromJS(data: any): CreateDataDictinaryDetailInput { - data = typeof data === 'object' ? data : {}; - let result = new CreateDataDictinaryDetailInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['code'] = this.code; - data['displayText'] = this.displayText; - data['description'] = this.description; - data['order'] = this.order; - return data; - } + id!: string; + code!: string | undefined; + displayText!: string | undefined; + description!: string | undefined; + order!: number; + + constructor(data?: ICreateDataDictinaryDetailInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.code = _data["code"]; + this.displayText = _data["displayText"]; + this.description = _data["description"]; + this.order = _data["order"]; + } + } + + static fromJS(data: any): CreateDataDictinaryDetailInput { + data = typeof data === 'object' ? data : {}; + let result = new CreateDataDictinaryDetailInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["code"] = this.code; + data["displayText"] = this.displayText; + data["description"] = this.description; + data["order"] = this.order; + return data; + } } export interface ICreateDataDictinaryDetailInput { - id: string; - code: string | undefined; - displayText: string | undefined; - description: string | undefined; - order: number; + id: string; + code: string | undefined; + displayText: string | undefined; + description: string | undefined; + order: number; } export class CreateDataDictinaryInput implements ICreateDataDictinaryInput { - code!: string | undefined; - displayText!: string | undefined; - description!: string | undefined; - - constructor(data?: ICreateDataDictinaryInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.code = _data['code']; - this.displayText = _data['displayText']; - this.description = _data['description']; - } - } - - static fromJS(data: any): CreateDataDictinaryInput { - data = typeof data === 'object' ? data : {}; - let result = new CreateDataDictinaryInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['code'] = this.code; - data['displayText'] = this.displayText; - data['description'] = this.description; - return data; - } + code!: string | undefined; + displayText!: string | undefined; + description!: string | undefined; + + constructor(data?: ICreateDataDictinaryInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.code = _data["code"]; + this.displayText = _data["displayText"]; + this.description = _data["description"]; + } + } + + static fromJS(data: any): CreateDataDictinaryInput { + data = typeof data === 'object' ? data : {}; + let result = new CreateDataDictinaryInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["code"] = this.code; + data["displayText"] = this.displayText; + data["description"] = this.description; + return data; + } } export interface ICreateDataDictinaryInput { - code: string | undefined; - displayText: string | undefined; - description: string | undefined; + code: string | undefined; + displayText: string | undefined; + description: string | undefined; } /** 创建语言 */ export class CreateLanguageInput implements ICreateLanguageInput { - /** 语言名称 */ - cultureName!: string | undefined; - /** Ui语言名称 */ - uiCultureName!: string | undefined; - /** 显示名称 */ - displayName!: string | undefined; - /** 图标 */ - flagIcon!: string | undefined; - /** 是否启用 */ - isEnabled!: boolean; - - constructor(data?: ICreateLanguageInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.cultureName = _data['cultureName']; - this.uiCultureName = _data['uiCultureName']; - this.displayName = _data['displayName']; - this.flagIcon = _data['flagIcon']; - this.isEnabled = _data['isEnabled']; - } - } - - static fromJS(data: any): CreateLanguageInput { - data = typeof data === 'object' ? data : {}; - let result = new CreateLanguageInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['cultureName'] = this.cultureName; - data['uiCultureName'] = this.uiCultureName; - data['displayName'] = this.displayName; - data['flagIcon'] = this.flagIcon; - data['isEnabled'] = this.isEnabled; - return data; - } + /** 语言名称 */ + cultureName!: string | undefined; + /** Ui语言名称 */ + uiCultureName!: string | undefined; + /** 显示名称 */ + displayName!: string | undefined; + /** 图标 */ + flagIcon!: string | undefined; + /** 是否启用 */ + isEnabled!: boolean; + + constructor(data?: ICreateLanguageInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.cultureName = _data["cultureName"]; + this.uiCultureName = _data["uiCultureName"]; + this.displayName = _data["displayName"]; + this.flagIcon = _data["flagIcon"]; + this.isEnabled = _data["isEnabled"]; + } + } + + static fromJS(data: any): CreateLanguageInput { + data = typeof data === 'object' ? data : {}; + let result = new CreateLanguageInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["cultureName"] = this.cultureName; + data["uiCultureName"] = this.uiCultureName; + data["displayName"] = this.displayName; + data["flagIcon"] = this.flagIcon; + data["isEnabled"] = this.isEnabled; + return data; + } } /** 创建语言 */ export interface ICreateLanguageInput { - /** 语言名称 */ - cultureName: string | undefined; - /** Ui语言名称 */ - uiCultureName: string | undefined; - /** 显示名称 */ - displayName: string | undefined; - /** 图标 */ - flagIcon: string | undefined; - /** 是否启用 */ - isEnabled: boolean; + /** 语言名称 */ + cultureName: string | undefined; + /** Ui语言名称 */ + uiCultureName: string | undefined; + /** 显示名称 */ + displayName: string | undefined; + /** 图标 */ + flagIcon: string | undefined; + /** 是否启用 */ + isEnabled: boolean; } /** 创建语言文本 */ export class CreateLanguageTextInput implements ICreateLanguageTextInput { - /** 资源名称 */ - resourceName!: string | undefined; - /** 语言名称 */ - cultureName!: string | undefined; - /** 名称 */ - name!: string | undefined; - /** 值 */ - value!: string | undefined; - - constructor(data?: ICreateLanguageTextInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.resourceName = _data['resourceName']; - this.cultureName = _data['cultureName']; - this.name = _data['name']; - this.value = _data['value']; - } - } - - static fromJS(data: any): CreateLanguageTextInput { - data = typeof data === 'object' ? data : {}; - let result = new CreateLanguageTextInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['resourceName'] = this.resourceName; - data['cultureName'] = this.cultureName; - data['name'] = this.name; - data['value'] = this.value; - return data; - } + /** 资源名称 */ + resourceName!: string | undefined; + /** 语言名称 */ + cultureName!: string | undefined; + /** 名称 */ + name!: string | undefined; + /** 值 */ + value!: string | undefined; + + constructor(data?: ICreateLanguageTextInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.resourceName = _data["resourceName"]; + this.cultureName = _data["cultureName"]; + this.name = _data["name"]; + this.value = _data["value"]; + } + } + + static fromJS(data: any): CreateLanguageTextInput { + data = typeof data === 'object' ? data : {}; + let result = new CreateLanguageTextInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["resourceName"] = this.resourceName; + data["cultureName"] = this.cultureName; + data["name"] = this.name; + data["value"] = this.value; + return data; + } } /** 创建语言文本 */ export interface ICreateLanguageTextInput { - /** 资源名称 */ - resourceName: string | undefined; - /** 语言名称 */ - cultureName: string | undefined; - /** 名称 */ - name: string | undefined; - /** 值 */ - value: string | undefined; + /** 资源名称 */ + resourceName: string | undefined; + /** 语言名称 */ + cultureName: string | undefined; + /** 名称 */ + name: string | undefined; + /** 值 */ + value: string | undefined; } export class CreateOrganizationUnitInput implements ICreateOrganizationUnitInput { - displayName!: string | undefined; - parentId!: string | undefined; - - constructor(data?: ICreateOrganizationUnitInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + displayName!: string | undefined; + parentId!: string | undefined; + + constructor(data?: ICreateOrganizationUnitInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.displayName = _data['displayName']; - this.parentId = _data['parentId']; + init(_data?: any) { + if (_data) { + this.displayName = _data["displayName"]; + this.parentId = _data["parentId"]; + } } - } - static fromJS(data: any): CreateOrganizationUnitInput { - data = typeof data === 'object' ? data : {}; - let result = new CreateOrganizationUnitInput(); - result.init(data); - return result; - } + static fromJS(data: any): CreateOrganizationUnitInput { + data = typeof data === 'object' ? data : {}; + let result = new CreateOrganizationUnitInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['displayName'] = this.displayName; - data['parentId'] = this.parentId; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["displayName"] = this.displayName; + data["parentId"] = this.parentId; + return data; + } } export interface ICreateOrganizationUnitInput { - displayName: string | undefined; - parentId: string | undefined; + displayName: string | undefined; + parentId: string | undefined; } export class CurrentCultureDto implements ICurrentCultureDto { - displayName!: string | undefined; - englishName!: string | undefined; - threeLetterIsoLanguageName!: string | undefined; - twoLetterIsoLanguageName!: string | undefined; - isRightToLeft!: boolean; - cultureName!: string | undefined; - name!: string | undefined; - nativeName!: string | undefined; - dateTimeFormat!: DateTimeFormatDto; - - constructor(data?: ICurrentCultureDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.displayName = _data['displayName']; - this.englishName = _data['englishName']; - this.threeLetterIsoLanguageName = _data['threeLetterIsoLanguageName']; - this.twoLetterIsoLanguageName = _data['twoLetterIsoLanguageName']; - this.isRightToLeft = _data['isRightToLeft']; - this.cultureName = _data['cultureName']; - this.name = _data['name']; - this.nativeName = _data['nativeName']; - this.dateTimeFormat = _data['dateTimeFormat'] - ? DateTimeFormatDto.fromJS(_data['dateTimeFormat']) - : undefined; - } - } - - static fromJS(data: any): CurrentCultureDto { - data = typeof data === 'object' ? data : {}; - let result = new CurrentCultureDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['displayName'] = this.displayName; - data['englishName'] = this.englishName; - data['threeLetterIsoLanguageName'] = this.threeLetterIsoLanguageName; - data['twoLetterIsoLanguageName'] = this.twoLetterIsoLanguageName; - data['isRightToLeft'] = this.isRightToLeft; - data['cultureName'] = this.cultureName; - data['name'] = this.name; - data['nativeName'] = this.nativeName; - data['dateTimeFormat'] = this.dateTimeFormat ? this.dateTimeFormat.toJSON() : undefined; - return data; - } + displayName!: string | undefined; + englishName!: string | undefined; + threeLetterIsoLanguageName!: string | undefined; + twoLetterIsoLanguageName!: string | undefined; + isRightToLeft!: boolean; + cultureName!: string | undefined; + name!: string | undefined; + nativeName!: string | undefined; + dateTimeFormat!: DateTimeFormatDto; + + constructor(data?: ICurrentCultureDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.displayName = _data["displayName"]; + this.englishName = _data["englishName"]; + this.threeLetterIsoLanguageName = _data["threeLetterIsoLanguageName"]; + this.twoLetterIsoLanguageName = _data["twoLetterIsoLanguageName"]; + this.isRightToLeft = _data["isRightToLeft"]; + this.cultureName = _data["cultureName"]; + this.name = _data["name"]; + this.nativeName = _data["nativeName"]; + this.dateTimeFormat = _data["dateTimeFormat"] ? DateTimeFormatDto.fromJS(_data["dateTimeFormat"]) : undefined; + } + } + + static fromJS(data: any): CurrentCultureDto { + data = typeof data === 'object' ? data : {}; + let result = new CurrentCultureDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["displayName"] = this.displayName; + data["englishName"] = this.englishName; + data["threeLetterIsoLanguageName"] = this.threeLetterIsoLanguageName; + data["twoLetterIsoLanguageName"] = this.twoLetterIsoLanguageName; + data["isRightToLeft"] = this.isRightToLeft; + data["cultureName"] = this.cultureName; + data["name"] = this.name; + data["nativeName"] = this.nativeName; + data["dateTimeFormat"] = this.dateTimeFormat ? this.dateTimeFormat.toJSON() : undefined; + return data; + } } export interface ICurrentCultureDto { - displayName: string | undefined; - englishName: string | undefined; - threeLetterIsoLanguageName: string | undefined; - twoLetterIsoLanguageName: string | undefined; - isRightToLeft: boolean; - cultureName: string | undefined; - name: string | undefined; - nativeName: string | undefined; - dateTimeFormat: DateTimeFormatDto; + displayName: string | undefined; + englishName: string | undefined; + threeLetterIsoLanguageName: string | undefined; + twoLetterIsoLanguageName: string | undefined; + isRightToLeft: boolean; + cultureName: string | undefined; + name: string | undefined; + nativeName: string | undefined; + dateTimeFormat: DateTimeFormatDto; } export class CurrentTenantDto implements ICurrentTenantDto { - id!: string | undefined; - name!: string | undefined; - isAvailable!: boolean; - - constructor(data?: ICurrentTenantDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.name = _data['name']; - this.isAvailable = _data['isAvailable']; - } - } - - static fromJS(data: any): CurrentTenantDto { - data = typeof data === 'object' ? data : {}; - let result = new CurrentTenantDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['name'] = this.name; - data['isAvailable'] = this.isAvailable; - return data; - } + id!: string | undefined; + name!: string | undefined; + isAvailable!: boolean; + + constructor(data?: ICurrentTenantDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.name = _data["name"]; + this.isAvailable = _data["isAvailable"]; + } + } + + static fromJS(data: any): CurrentTenantDto { + data = typeof data === 'object' ? data : {}; + let result = new CurrentTenantDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["name"] = this.name; + data["isAvailable"] = this.isAvailable; + return data; + } } export interface ICurrentTenantDto { - id: string | undefined; - name: string | undefined; - isAvailable: boolean; + id: string | undefined; + name: string | undefined; + isAvailable: boolean; } export class CurrentUserDto implements ICurrentUserDto { - isAuthenticated!: boolean; - id!: string | undefined; - tenantId!: string | undefined; - impersonatorUserId!: string | undefined; - impersonatorTenantId!: string | undefined; - impersonatorUserName!: string | undefined; - impersonatorTenantName!: string | undefined; - userName!: string | undefined; - name!: string | undefined; - surName!: string | undefined; - email!: string | undefined; - emailVerified!: boolean; - phoneNumber!: string | undefined; - phoneNumberVerified!: boolean; - roles!: string[] | undefined; - - constructor(data?: ICurrentUserDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.isAuthenticated = _data['isAuthenticated']; - this.id = _data['id']; - this.tenantId = _data['tenantId']; - this.impersonatorUserId = _data['impersonatorUserId']; - this.impersonatorTenantId = _data['impersonatorTenantId']; - this.impersonatorUserName = _data['impersonatorUserName']; - this.impersonatorTenantName = _data['impersonatorTenantName']; - this.userName = _data['userName']; - this.name = _data['name']; - this.surName = _data['surName']; - this.email = _data['email']; - this.emailVerified = _data['emailVerified']; - this.phoneNumber = _data['phoneNumber']; - this.phoneNumberVerified = _data['phoneNumberVerified']; - if (Array.isArray(_data['roles'])) { - this.roles = [] as any; - for (let item of _data['roles']) this.roles!.push(item); - } - } - } - - static fromJS(data: any): CurrentUserDto { - data = typeof data === 'object' ? data : {}; - let result = new CurrentUserDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['isAuthenticated'] = this.isAuthenticated; - data['id'] = this.id; - data['tenantId'] = this.tenantId; - data['impersonatorUserId'] = this.impersonatorUserId; - data['impersonatorTenantId'] = this.impersonatorTenantId; - data['impersonatorUserName'] = this.impersonatorUserName; - data['impersonatorTenantName'] = this.impersonatorTenantName; - data['userName'] = this.userName; - data['name'] = this.name; - data['surName'] = this.surName; - data['email'] = this.email; - data['emailVerified'] = this.emailVerified; - data['phoneNumber'] = this.phoneNumber; - data['phoneNumberVerified'] = this.phoneNumberVerified; - if (Array.isArray(this.roles)) { - data['roles'] = []; - for (let item of this.roles) data['roles'].push(item); - } - return data; - } + isAuthenticated!: boolean; + id!: string | undefined; + tenantId!: string | undefined; + impersonatorUserId!: string | undefined; + impersonatorTenantId!: string | undefined; + impersonatorUserName!: string | undefined; + impersonatorTenantName!: string | undefined; + userName!: string | undefined; + name!: string | undefined; + surName!: string | undefined; + email!: string | undefined; + emailVerified!: boolean; + phoneNumber!: string | undefined; + phoneNumberVerified!: boolean; + roles!: string[] | undefined; + + constructor(data?: ICurrentUserDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.isAuthenticated = _data["isAuthenticated"]; + this.id = _data["id"]; + this.tenantId = _data["tenantId"]; + this.impersonatorUserId = _data["impersonatorUserId"]; + this.impersonatorTenantId = _data["impersonatorTenantId"]; + this.impersonatorUserName = _data["impersonatorUserName"]; + this.impersonatorTenantName = _data["impersonatorTenantName"]; + this.userName = _data["userName"]; + this.name = _data["name"]; + this.surName = _data["surName"]; + this.email = _data["email"]; + this.emailVerified = _data["emailVerified"]; + this.phoneNumber = _data["phoneNumber"]; + this.phoneNumberVerified = _data["phoneNumberVerified"]; + if (Array.isArray(_data["roles"])) { + this.roles = [] as any; + for (let item of _data["roles"]) + this.roles!.push(item); + } + } + } + + static fromJS(data: any): CurrentUserDto { + data = typeof data === 'object' ? data : {}; + let result = new CurrentUserDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["isAuthenticated"] = this.isAuthenticated; + data["id"] = this.id; + data["tenantId"] = this.tenantId; + data["impersonatorUserId"] = this.impersonatorUserId; + data["impersonatorTenantId"] = this.impersonatorTenantId; + data["impersonatorUserName"] = this.impersonatorUserName; + data["impersonatorTenantName"] = this.impersonatorTenantName; + data["userName"] = this.userName; + data["name"] = this.name; + data["surName"] = this.surName; + data["email"] = this.email; + data["emailVerified"] = this.emailVerified; + data["phoneNumber"] = this.phoneNumber; + data["phoneNumberVerified"] = this.phoneNumberVerified; + if (Array.isArray(this.roles)) { + data["roles"] = []; + for (let item of this.roles) + data["roles"].push(item); + } + return data; + } } export interface ICurrentUserDto { - isAuthenticated: boolean; - id: string | undefined; - tenantId: string | undefined; - impersonatorUserId: string | undefined; - impersonatorTenantId: string | undefined; - impersonatorUserName: string | undefined; - impersonatorTenantName: string | undefined; - userName: string | undefined; - name: string | undefined; - surName: string | undefined; - email: string | undefined; - emailVerified: boolean; - phoneNumber: string | undefined; - phoneNumberVerified: boolean; - roles: string[] | undefined; + isAuthenticated: boolean; + id: string | undefined; + tenantId: string | undefined; + impersonatorUserId: string | undefined; + impersonatorTenantId: string | undefined; + impersonatorUserName: string | undefined; + impersonatorTenantName: string | undefined; + userName: string | undefined; + name: string | undefined; + surName: string | undefined; + email: string | undefined; + emailVerified: boolean; + phoneNumber: string | undefined; + phoneNumberVerified: boolean; + roles: string[] | undefined; } export class DateTimeFormatDto implements IDateTimeFormatDto { - calendarAlgorithmType!: string | undefined; - dateTimeFormatLong!: string | undefined; - shortDatePattern!: string | undefined; - fullDateTimePattern!: string | undefined; - dateSeparator!: string | undefined; - shortTimePattern!: string | undefined; - longTimePattern!: string | undefined; - - constructor(data?: IDateTimeFormatDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.calendarAlgorithmType = _data['calendarAlgorithmType']; - this.dateTimeFormatLong = _data['dateTimeFormatLong']; - this.shortDatePattern = _data['shortDatePattern']; - this.fullDateTimePattern = _data['fullDateTimePattern']; - this.dateSeparator = _data['dateSeparator']; - this.shortTimePattern = _data['shortTimePattern']; - this.longTimePattern = _data['longTimePattern']; - } - } - - static fromJS(data: any): DateTimeFormatDto { - data = typeof data === 'object' ? data : {}; - let result = new DateTimeFormatDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['calendarAlgorithmType'] = this.calendarAlgorithmType; - data['dateTimeFormatLong'] = this.dateTimeFormatLong; - data['shortDatePattern'] = this.shortDatePattern; - data['fullDateTimePattern'] = this.fullDateTimePattern; - data['dateSeparator'] = this.dateSeparator; - data['shortTimePattern'] = this.shortTimePattern; - data['longTimePattern'] = this.longTimePattern; - return data; - } + calendarAlgorithmType!: string | undefined; + dateTimeFormatLong!: string | undefined; + shortDatePattern!: string | undefined; + fullDateTimePattern!: string | undefined; + dateSeparator!: string | undefined; + shortTimePattern!: string | undefined; + longTimePattern!: string | undefined; + + constructor(data?: IDateTimeFormatDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.calendarAlgorithmType = _data["calendarAlgorithmType"]; + this.dateTimeFormatLong = _data["dateTimeFormatLong"]; + this.shortDatePattern = _data["shortDatePattern"]; + this.fullDateTimePattern = _data["fullDateTimePattern"]; + this.dateSeparator = _data["dateSeparator"]; + this.shortTimePattern = _data["shortTimePattern"]; + this.longTimePattern = _data["longTimePattern"]; + } + } + + static fromJS(data: any): DateTimeFormatDto { + data = typeof data === 'object' ? data : {}; + let result = new DateTimeFormatDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["calendarAlgorithmType"] = this.calendarAlgorithmType; + data["dateTimeFormatLong"] = this.dateTimeFormatLong; + data["shortDatePattern"] = this.shortDatePattern; + data["fullDateTimePattern"] = this.fullDateTimePattern; + data["dateSeparator"] = this.dateSeparator; + data["shortTimePattern"] = this.shortTimePattern; + data["longTimePattern"] = this.longTimePattern; + return data; + } } export interface IDateTimeFormatDto { - calendarAlgorithmType: string | undefined; - dateTimeFormatLong: string | undefined; - shortDatePattern: string | undefined; - fullDateTimePattern: string | undefined; - dateSeparator: string | undefined; - shortTimePattern: string | undefined; - longTimePattern: string | undefined; + calendarAlgorithmType: string | undefined; + dateTimeFormatLong: string | undefined; + shortDatePattern: string | undefined; + fullDateTimePattern: string | undefined; + dateSeparator: string | undefined; + shortTimePattern: string | undefined; + longTimePattern: string | undefined; } export class DeleteDataDictionaryDetailInput implements IDeleteDataDictionaryDetailInput { - dataDictionaryId!: string; - dataDictionayDetailId!: string; - - constructor(data?: IDeleteDataDictionaryDetailInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + dataDictionaryId!: string; + dataDictionayDetailId!: string; + + constructor(data?: IDeleteDataDictionaryDetailInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.dataDictionaryId = _data['dataDictionaryId']; - this.dataDictionayDetailId = _data['dataDictionayDetailId']; + init(_data?: any) { + if (_data) { + this.dataDictionaryId = _data["dataDictionaryId"]; + this.dataDictionayDetailId = _data["dataDictionayDetailId"]; + } } - } - static fromJS(data: any): DeleteDataDictionaryDetailInput { - data = typeof data === 'object' ? data : {}; - let result = new DeleteDataDictionaryDetailInput(); - result.init(data); - return result; - } + static fromJS(data: any): DeleteDataDictionaryDetailInput { + data = typeof data === 'object' ? data : {}; + let result = new DeleteDataDictionaryDetailInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['dataDictionaryId'] = this.dataDictionaryId; - data['dataDictionayDetailId'] = this.dataDictionayDetailId; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["dataDictionaryId"] = this.dataDictionaryId; + data["dataDictionayDetailId"] = this.dataDictionayDetailId; + return data; + } } export interface IDeleteDataDictionaryDetailInput { - dataDictionaryId: string; - dataDictionayDetailId: string; + dataDictionaryId: string; + dataDictionayDetailId: string; } /** 删除语言 */ export class DeleteLanguageInput implements IDeleteLanguageInput { - /** 语言Id */ - id!: string; - - constructor(data?: IDeleteLanguageInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + /** 语言Id */ + id!: string; + + constructor(data?: IDeleteLanguageInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.id = _data['id']; + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + } } - } - static fromJS(data: any): DeleteLanguageInput { - data = typeof data === 'object' ? data : {}; - let result = new DeleteLanguageInput(); - result.init(data); - return result; - } + static fromJS(data: any): DeleteLanguageInput { + data = typeof data === 'object' ? data : {}; + let result = new DeleteLanguageInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + return data; + } } /** 删除语言 */ export interface IDeleteLanguageInput { - /** 语言Id */ - id: string; + /** 语言Id */ + id: string; } export enum EntityChangeType { - Created = 0, - Updated = 1, - Deleted = 2, + Created = 0, + Updated = 1, + Deleted = 2, } export class EntityExtensionDto implements IEntityExtensionDto { - properties!: { [key: string]: ExtensionPropertyDto } | undefined; - configuration!: { [key: string]: any } | undefined; - - constructor(data?: IEntityExtensionDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['properties']) { - this.properties = {} as any; - for (let key in _data['properties']) { - if (_data['properties'].hasOwnProperty(key)) - (this.properties)![key] = _data['properties'][key] - ? ExtensionPropertyDto.fromJS(_data['properties'][key]) - : new ExtensionPropertyDto(); - } - } - if (_data['configuration']) { - this.configuration = {} as any; - for (let key in _data['configuration']) { - if (_data['configuration'].hasOwnProperty(key)) - (this.configuration)![key] = _data['configuration'][key]; - } - } - } - } - - static fromJS(data: any): EntityExtensionDto { - data = typeof data === 'object' ? data : {}; - let result = new EntityExtensionDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.properties) { - data['properties'] = {}; - for (let key in this.properties) { - if (this.properties.hasOwnProperty(key)) - (data['properties'])[key] = this.properties[key] - ? this.properties[key].toJSON() - : undefined; - } - } - if (this.configuration) { - data['configuration'] = {}; - for (let key in this.configuration) { - if (this.configuration.hasOwnProperty(key)) - (data['configuration'])[key] = (this.configuration)[key]; - } - } - return data; - } + properties!: { [key: string]: ExtensionPropertyDto; } | undefined; + configuration!: { [key: string]: any; } | undefined; + + constructor(data?: IEntityExtensionDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["properties"]) { + this.properties = {} as any; + for (let key in _data["properties"]) { + if (_data["properties"].hasOwnProperty(key)) + (this.properties)![key] = _data["properties"][key] ? ExtensionPropertyDto.fromJS(_data["properties"][key]) : new ExtensionPropertyDto(); + } + } + if (_data["configuration"]) { + this.configuration = {} as any; + for (let key in _data["configuration"]) { + if (_data["configuration"].hasOwnProperty(key)) + (this.configuration)![key] = _data["configuration"][key]; + } + } + } + } + + static fromJS(data: any): EntityExtensionDto { + data = typeof data === 'object' ? data : {}; + let result = new EntityExtensionDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.properties) { + data["properties"] = {}; + for (let key in this.properties) { + if (this.properties.hasOwnProperty(key)) + (data["properties"])[key] = this.properties[key] ? this.properties[key].toJSON() : undefined; + } + } + if (this.configuration) { + data["configuration"] = {}; + for (let key in this.configuration) { + if (this.configuration.hasOwnProperty(key)) + (data["configuration"])[key] = (this.configuration)[key]; + } + } + return data; + } } export interface IEntityExtensionDto { - properties: { [key: string]: ExtensionPropertyDto } | undefined; - configuration: { [key: string]: any } | undefined; + properties: { [key: string]: ExtensionPropertyDto; } | undefined; + configuration: { [key: string]: any; } | undefined; } export class ExtensionEnumDto implements IExtensionEnumDto { - fields!: ExtensionEnumFieldDto[] | undefined; - localizationResource!: string | undefined; - - constructor(data?: IExtensionEnumDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + fields!: ExtensionEnumFieldDto[] | undefined; + localizationResource!: string | undefined; + + constructor(data?: IExtensionEnumDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['fields'])) { - this.fields = [] as any; - for (let item of _data['fields']) this.fields!.push(ExtensionEnumFieldDto.fromJS(item)); - } - this.localizationResource = _data['localizationResource']; + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["fields"])) { + this.fields = [] as any; + for (let item of _data["fields"]) + this.fields!.push(ExtensionEnumFieldDto.fromJS(item)); + } + this.localizationResource = _data["localizationResource"]; + } } - } - static fromJS(data: any): ExtensionEnumDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionEnumDto(); - result.init(data); - return result; - } + static fromJS(data: any): ExtensionEnumDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionEnumDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.fields)) { - data['fields'] = []; - for (let item of this.fields) data['fields'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.fields)) { + data["fields"] = []; + for (let item of this.fields) + data["fields"].push(item.toJSON()); + } + data["localizationResource"] = this.localizationResource; + return data; } - data['localizationResource'] = this.localizationResource; - return data; - } } export interface IExtensionEnumDto { - fields: ExtensionEnumFieldDto[] | undefined; - localizationResource: string | undefined; + fields: ExtensionEnumFieldDto[] | undefined; + localizationResource: string | undefined; } export class ExtensionEnumFieldDto implements IExtensionEnumFieldDto { - name!: string | undefined; - value!: any | undefined; - - constructor(data?: IExtensionEnumFieldDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + name!: string | undefined; + value!: any | undefined; + + constructor(data?: IExtensionEnumFieldDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.name = _data['name']; - this.value = _data['value']; + init(_data?: any) { + if (_data) { + this.name = _data["name"]; + this.value = _data["value"]; + } } - } - static fromJS(data: any): ExtensionEnumFieldDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionEnumFieldDto(); - result.init(data); - return result; - } + static fromJS(data: any): ExtensionEnumFieldDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionEnumFieldDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['name'] = this.name; - data['value'] = this.value; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + data["value"] = this.value; + return data; + } } export interface IExtensionEnumFieldDto { - name: string | undefined; - value: any | undefined; + name: string | undefined; + value: any | undefined; } export class ExtensionPropertyApiCreateDto implements IExtensionPropertyApiCreateDto { - isAvailable!: boolean; - - constructor(data?: IExtensionPropertyApiCreateDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + isAvailable!: boolean; + + constructor(data?: IExtensionPropertyApiCreateDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.isAvailable = _data['isAvailable']; + init(_data?: any) { + if (_data) { + this.isAvailable = _data["isAvailable"]; + } } - } - static fromJS(data: any): ExtensionPropertyApiCreateDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionPropertyApiCreateDto(); - result.init(data); - return result; - } + static fromJS(data: any): ExtensionPropertyApiCreateDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionPropertyApiCreateDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['isAvailable'] = this.isAvailable; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["isAvailable"] = this.isAvailable; + return data; + } } export interface IExtensionPropertyApiCreateDto { - isAvailable: boolean; + isAvailable: boolean; } export class ExtensionPropertyApiDto implements IExtensionPropertyApiDto { - onGet!: ExtensionPropertyApiGetDto; - onCreate!: ExtensionPropertyApiCreateDto; - onUpdate!: ExtensionPropertyApiUpdateDto; - - constructor(data?: IExtensionPropertyApiDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.onGet = _data['onGet'] - ? ExtensionPropertyApiGetDto.fromJS(_data['onGet']) - : undefined; - this.onCreate = _data['onCreate'] - ? ExtensionPropertyApiCreateDto.fromJS(_data['onCreate']) - : undefined; - this.onUpdate = _data['onUpdate'] - ? ExtensionPropertyApiUpdateDto.fromJS(_data['onUpdate']) - : undefined; - } - } - - static fromJS(data: any): ExtensionPropertyApiDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionPropertyApiDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['onGet'] = this.onGet ? this.onGet.toJSON() : undefined; - data['onCreate'] = this.onCreate ? this.onCreate.toJSON() : undefined; - data['onUpdate'] = this.onUpdate ? this.onUpdate.toJSON() : undefined; - return data; - } + onGet!: ExtensionPropertyApiGetDto; + onCreate!: ExtensionPropertyApiCreateDto; + onUpdate!: ExtensionPropertyApiUpdateDto; + + constructor(data?: IExtensionPropertyApiDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.onGet = _data["onGet"] ? ExtensionPropertyApiGetDto.fromJS(_data["onGet"]) : undefined; + this.onCreate = _data["onCreate"] ? ExtensionPropertyApiCreateDto.fromJS(_data["onCreate"]) : undefined; + this.onUpdate = _data["onUpdate"] ? ExtensionPropertyApiUpdateDto.fromJS(_data["onUpdate"]) : undefined; + } + } + + static fromJS(data: any): ExtensionPropertyApiDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionPropertyApiDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["onGet"] = this.onGet ? this.onGet.toJSON() : undefined; + data["onCreate"] = this.onCreate ? this.onCreate.toJSON() : undefined; + data["onUpdate"] = this.onUpdate ? this.onUpdate.toJSON() : undefined; + return data; + } } export interface IExtensionPropertyApiDto { - onGet: ExtensionPropertyApiGetDto; - onCreate: ExtensionPropertyApiCreateDto; - onUpdate: ExtensionPropertyApiUpdateDto; + onGet: ExtensionPropertyApiGetDto; + onCreate: ExtensionPropertyApiCreateDto; + onUpdate: ExtensionPropertyApiUpdateDto; } export class ExtensionPropertyApiGetDto implements IExtensionPropertyApiGetDto { - isAvailable!: boolean; - - constructor(data?: IExtensionPropertyApiGetDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + isAvailable!: boolean; + + constructor(data?: IExtensionPropertyApiGetDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.isAvailable = _data['isAvailable']; + init(_data?: any) { + if (_data) { + this.isAvailable = _data["isAvailable"]; + } } - } - static fromJS(data: any): ExtensionPropertyApiGetDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionPropertyApiGetDto(); - result.init(data); - return result; - } + static fromJS(data: any): ExtensionPropertyApiGetDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionPropertyApiGetDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['isAvailable'] = this.isAvailable; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["isAvailable"] = this.isAvailable; + return data; + } } export interface IExtensionPropertyApiGetDto { - isAvailable: boolean; + isAvailable: boolean; } export class ExtensionPropertyApiUpdateDto implements IExtensionPropertyApiUpdateDto { - isAvailable!: boolean; - - constructor(data?: IExtensionPropertyApiUpdateDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + isAvailable!: boolean; + + constructor(data?: IExtensionPropertyApiUpdateDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.isAvailable = _data['isAvailable']; + init(_data?: any) { + if (_data) { + this.isAvailable = _data["isAvailable"]; + } } - } - static fromJS(data: any): ExtensionPropertyApiUpdateDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionPropertyApiUpdateDto(); - result.init(data); - return result; - } + static fromJS(data: any): ExtensionPropertyApiUpdateDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionPropertyApiUpdateDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['isAvailable'] = this.isAvailable; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["isAvailable"] = this.isAvailable; + return data; + } } export interface IExtensionPropertyApiUpdateDto { - isAvailable: boolean; + isAvailable: boolean; } export class ExtensionPropertyAttributeDto implements IExtensionPropertyAttributeDto { - typeSimple!: string | undefined; - config!: { [key: string]: any } | undefined; - - constructor(data?: IExtensionPropertyAttributeDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + typeSimple!: string | undefined; + config!: { [key: string]: any; } | undefined; + + constructor(data?: IExtensionPropertyAttributeDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.typeSimple = _data['typeSimple']; - if (_data['config']) { - this.config = {} as any; - for (let key in _data['config']) { - if (_data['config'].hasOwnProperty(key)) (this.config)![key] = _data['config'][key]; + init(_data?: any) { + if (_data) { + this.typeSimple = _data["typeSimple"]; + if (_data["config"]) { + this.config = {} as any; + for (let key in _data["config"]) { + if (_data["config"].hasOwnProperty(key)) + (this.config)![key] = _data["config"][key]; + } + } } - } } - } - static fromJS(data: any): ExtensionPropertyAttributeDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionPropertyAttributeDto(); - result.init(data); - return result; - } + static fromJS(data: any): ExtensionPropertyAttributeDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionPropertyAttributeDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['typeSimple'] = this.typeSimple; - if (this.config) { - data['config'] = {}; - for (let key in this.config) { - if (this.config.hasOwnProperty(key)) (data['config'])[key] = (this.config)[key]; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["typeSimple"] = this.typeSimple; + if (this.config) { + data["config"] = {}; + for (let key in this.config) { + if (this.config.hasOwnProperty(key)) + (data["config"])[key] = (this.config)[key]; + } + } + return data; } - return data; - } } export interface IExtensionPropertyAttributeDto { - typeSimple: string | undefined; - config: { [key: string]: any } | undefined; + typeSimple: string | undefined; + config: { [key: string]: any; } | undefined; } export class ExtensionPropertyDto implements IExtensionPropertyDto { - type!: string | undefined; - typeSimple!: string | undefined; - displayName!: LocalizableStringDto; - api!: ExtensionPropertyApiDto; - ui!: ExtensionPropertyUiDto; - attributes!: ExtensionPropertyAttributeDto[] | undefined; - configuration!: { [key: string]: any } | undefined; - defaultValue!: any | undefined; - - constructor(data?: IExtensionPropertyDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.type = _data['type']; - this.typeSimple = _data['typeSimple']; - this.displayName = _data['displayName'] - ? LocalizableStringDto.fromJS(_data['displayName']) - : undefined; - this.api = _data['api'] ? ExtensionPropertyApiDto.fromJS(_data['api']) : undefined; - this.ui = _data['ui'] ? ExtensionPropertyUiDto.fromJS(_data['ui']) : undefined; - if (Array.isArray(_data['attributes'])) { - this.attributes = [] as any; - for (let item of _data['attributes']) - this.attributes!.push(ExtensionPropertyAttributeDto.fromJS(item)); - } - if (_data['configuration']) { - this.configuration = {} as any; - for (let key in _data['configuration']) { - if (_data['configuration'].hasOwnProperty(key)) - (this.configuration)![key] = _data['configuration'][key]; - } - } - this.defaultValue = _data['defaultValue']; - } - } - - static fromJS(data: any): ExtensionPropertyDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionPropertyDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['type'] = this.type; - data['typeSimple'] = this.typeSimple; - data['displayName'] = this.displayName ? this.displayName.toJSON() : undefined; - data['api'] = this.api ? this.api.toJSON() : undefined; - data['ui'] = this.ui ? this.ui.toJSON() : undefined; - if (Array.isArray(this.attributes)) { - data['attributes'] = []; - for (let item of this.attributes) data['attributes'].push(item.toJSON()); - } - if (this.configuration) { - data['configuration'] = {}; - for (let key in this.configuration) { - if (this.configuration.hasOwnProperty(key)) - (data['configuration'])[key] = (this.configuration)[key]; - } - } - data['defaultValue'] = this.defaultValue; - return data; - } + type!: string | undefined; + typeSimple!: string | undefined; + displayName!: LocalizableStringDto; + api!: ExtensionPropertyApiDto; + ui!: ExtensionPropertyUiDto; + attributes!: ExtensionPropertyAttributeDto[] | undefined; + configuration!: { [key: string]: any; } | undefined; + defaultValue!: any | undefined; + + constructor(data?: IExtensionPropertyDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.type = _data["type"]; + this.typeSimple = _data["typeSimple"]; + this.displayName = _data["displayName"] ? LocalizableStringDto.fromJS(_data["displayName"]) : undefined; + this.api = _data["api"] ? ExtensionPropertyApiDto.fromJS(_data["api"]) : undefined; + this.ui = _data["ui"] ? ExtensionPropertyUiDto.fromJS(_data["ui"]) : undefined; + if (Array.isArray(_data["attributes"])) { + this.attributes = [] as any; + for (let item of _data["attributes"]) + this.attributes!.push(ExtensionPropertyAttributeDto.fromJS(item)); + } + if (_data["configuration"]) { + this.configuration = {} as any; + for (let key in _data["configuration"]) { + if (_data["configuration"].hasOwnProperty(key)) + (this.configuration)![key] = _data["configuration"][key]; + } + } + this.defaultValue = _data["defaultValue"]; + } + } + + static fromJS(data: any): ExtensionPropertyDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionPropertyDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["type"] = this.type; + data["typeSimple"] = this.typeSimple; + data["displayName"] = this.displayName ? this.displayName.toJSON() : undefined; + data["api"] = this.api ? this.api.toJSON() : undefined; + data["ui"] = this.ui ? this.ui.toJSON() : undefined; + if (Array.isArray(this.attributes)) { + data["attributes"] = []; + for (let item of this.attributes) + data["attributes"].push(item.toJSON()); + } + if (this.configuration) { + data["configuration"] = {}; + for (let key in this.configuration) { + if (this.configuration.hasOwnProperty(key)) + (data["configuration"])[key] = (this.configuration)[key]; + } + } + data["defaultValue"] = this.defaultValue; + return data; + } } export interface IExtensionPropertyDto { - type: string | undefined; - typeSimple: string | undefined; - displayName: LocalizableStringDto; - api: ExtensionPropertyApiDto; - ui: ExtensionPropertyUiDto; - attributes: ExtensionPropertyAttributeDto[] | undefined; - configuration: { [key: string]: any } | undefined; - defaultValue: any | undefined; + type: string | undefined; + typeSimple: string | undefined; + displayName: LocalizableStringDto; + api: ExtensionPropertyApiDto; + ui: ExtensionPropertyUiDto; + attributes: ExtensionPropertyAttributeDto[] | undefined; + configuration: { [key: string]: any; } | undefined; + defaultValue: any | undefined; } export class ExtensionPropertyUiDto implements IExtensionPropertyUiDto { - onTable!: ExtensionPropertyUiTableDto; - onCreateForm!: ExtensionPropertyUiFormDto; - onEditForm!: ExtensionPropertyUiFormDto; - lookup!: ExtensionPropertyUiLookupDto; - - constructor(data?: IExtensionPropertyUiDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.onTable = _data['onTable'] - ? ExtensionPropertyUiTableDto.fromJS(_data['onTable']) - : undefined; - this.onCreateForm = _data['onCreateForm'] - ? ExtensionPropertyUiFormDto.fromJS(_data['onCreateForm']) - : undefined; - this.onEditForm = _data['onEditForm'] - ? ExtensionPropertyUiFormDto.fromJS(_data['onEditForm']) - : undefined; - this.lookup = _data['lookup'] - ? ExtensionPropertyUiLookupDto.fromJS(_data['lookup']) - : undefined; - } - } - - static fromJS(data: any): ExtensionPropertyUiDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionPropertyUiDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['onTable'] = this.onTable ? this.onTable.toJSON() : undefined; - data['onCreateForm'] = this.onCreateForm ? this.onCreateForm.toJSON() : undefined; - data['onEditForm'] = this.onEditForm ? this.onEditForm.toJSON() : undefined; - data['lookup'] = this.lookup ? this.lookup.toJSON() : undefined; - return data; - } + onTable!: ExtensionPropertyUiTableDto; + onCreateForm!: ExtensionPropertyUiFormDto; + onEditForm!: ExtensionPropertyUiFormDto; + lookup!: ExtensionPropertyUiLookupDto; + + constructor(data?: IExtensionPropertyUiDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.onTable = _data["onTable"] ? ExtensionPropertyUiTableDto.fromJS(_data["onTable"]) : undefined; + this.onCreateForm = _data["onCreateForm"] ? ExtensionPropertyUiFormDto.fromJS(_data["onCreateForm"]) : undefined; + this.onEditForm = _data["onEditForm"] ? ExtensionPropertyUiFormDto.fromJS(_data["onEditForm"]) : undefined; + this.lookup = _data["lookup"] ? ExtensionPropertyUiLookupDto.fromJS(_data["lookup"]) : undefined; + } + } + + static fromJS(data: any): ExtensionPropertyUiDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionPropertyUiDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["onTable"] = this.onTable ? this.onTable.toJSON() : undefined; + data["onCreateForm"] = this.onCreateForm ? this.onCreateForm.toJSON() : undefined; + data["onEditForm"] = this.onEditForm ? this.onEditForm.toJSON() : undefined; + data["lookup"] = this.lookup ? this.lookup.toJSON() : undefined; + return data; + } } export interface IExtensionPropertyUiDto { - onTable: ExtensionPropertyUiTableDto; - onCreateForm: ExtensionPropertyUiFormDto; - onEditForm: ExtensionPropertyUiFormDto; - lookup: ExtensionPropertyUiLookupDto; + onTable: ExtensionPropertyUiTableDto; + onCreateForm: ExtensionPropertyUiFormDto; + onEditForm: ExtensionPropertyUiFormDto; + lookup: ExtensionPropertyUiLookupDto; } export class ExtensionPropertyUiFormDto implements IExtensionPropertyUiFormDto { - isVisible!: boolean; - - constructor(data?: IExtensionPropertyUiFormDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + isVisible!: boolean; + + constructor(data?: IExtensionPropertyUiFormDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.isVisible = _data['isVisible']; + init(_data?: any) { + if (_data) { + this.isVisible = _data["isVisible"]; + } } - } - static fromJS(data: any): ExtensionPropertyUiFormDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionPropertyUiFormDto(); - result.init(data); - return result; - } + static fromJS(data: any): ExtensionPropertyUiFormDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionPropertyUiFormDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['isVisible'] = this.isVisible; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["isVisible"] = this.isVisible; + return data; + } } export interface IExtensionPropertyUiFormDto { - isVisible: boolean; + isVisible: boolean; } export class ExtensionPropertyUiLookupDto implements IExtensionPropertyUiLookupDto { - url!: string | undefined; - resultListPropertyName!: string | undefined; - displayPropertyName!: string | undefined; - valuePropertyName!: string | undefined; - filterParamName!: string | undefined; - - constructor(data?: IExtensionPropertyUiLookupDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.url = _data['url']; - this.resultListPropertyName = _data['resultListPropertyName']; - this.displayPropertyName = _data['displayPropertyName']; - this.valuePropertyName = _data['valuePropertyName']; - this.filterParamName = _data['filterParamName']; - } - } - - static fromJS(data: any): ExtensionPropertyUiLookupDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionPropertyUiLookupDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['url'] = this.url; - data['resultListPropertyName'] = this.resultListPropertyName; - data['displayPropertyName'] = this.displayPropertyName; - data['valuePropertyName'] = this.valuePropertyName; - data['filterParamName'] = this.filterParamName; - return data; - } + url!: string | undefined; + resultListPropertyName!: string | undefined; + displayPropertyName!: string | undefined; + valuePropertyName!: string | undefined; + filterParamName!: string | undefined; + + constructor(data?: IExtensionPropertyUiLookupDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.url = _data["url"]; + this.resultListPropertyName = _data["resultListPropertyName"]; + this.displayPropertyName = _data["displayPropertyName"]; + this.valuePropertyName = _data["valuePropertyName"]; + this.filterParamName = _data["filterParamName"]; + } + } + + static fromJS(data: any): ExtensionPropertyUiLookupDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionPropertyUiLookupDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["url"] = this.url; + data["resultListPropertyName"] = this.resultListPropertyName; + data["displayPropertyName"] = this.displayPropertyName; + data["valuePropertyName"] = this.valuePropertyName; + data["filterParamName"] = this.filterParamName; + return data; + } } export interface IExtensionPropertyUiLookupDto { - url: string | undefined; - resultListPropertyName: string | undefined; - displayPropertyName: string | undefined; - valuePropertyName: string | undefined; - filterParamName: string | undefined; + url: string | undefined; + resultListPropertyName: string | undefined; + displayPropertyName: string | undefined; + valuePropertyName: string | undefined; + filterParamName: string | undefined; } export class ExtensionPropertyUiTableDto implements IExtensionPropertyUiTableDto { - isVisible!: boolean; - - constructor(data?: IExtensionPropertyUiTableDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + isVisible!: boolean; + + constructor(data?: IExtensionPropertyUiTableDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.isVisible = _data['isVisible']; + init(_data?: any) { + if (_data) { + this.isVisible = _data["isVisible"]; + } } - } - static fromJS(data: any): ExtensionPropertyUiTableDto { - data = typeof data === 'object' ? data : {}; - let result = new ExtensionPropertyUiTableDto(); - result.init(data); - return result; - } + static fromJS(data: any): ExtensionPropertyUiTableDto { + data = typeof data === 'object' ? data : {}; + let result = new ExtensionPropertyUiTableDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['isVisible'] = this.isVisible; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["isVisible"] = this.isVisible; + return data; + } } export interface IExtensionPropertyUiTableDto { - isVisible: boolean; + isVisible: boolean; } export class FileAggregateRoute implements IFileAggregateRoute { - routeKeys!: string[] | undefined; - routeKeysConfig!: AggregateRouteConfig[] | undefined; - upstreamPathTemplate!: string | undefined; - upstreamHost!: string | undefined; - routeIsCaseSensitive!: boolean; - aggregator!: string | undefined; - readonly upstreamHttpMethod!: string[] | undefined; - priority!: number; - - constructor(data?: IFileAggregateRoute) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['routeKeys'])) { - this.routeKeys = [] as any; - for (let item of _data['routeKeys']) this.routeKeys!.push(item); - } - if (Array.isArray(_data['routeKeysConfig'])) { - this.routeKeysConfig = [] as any; - for (let item of _data['routeKeysConfig']) - this.routeKeysConfig!.push(AggregateRouteConfig.fromJS(item)); - } - this.upstreamPathTemplate = _data['upstreamPathTemplate']; - this.upstreamHost = _data['upstreamHost']; - this.routeIsCaseSensitive = _data['routeIsCaseSensitive']; - this.aggregator = _data['aggregator']; - if (Array.isArray(_data['upstreamHttpMethod'])) { - (this).upstreamHttpMethod = [] as any; - for (let item of _data['upstreamHttpMethod']) (this).upstreamHttpMethod!.push(item); - } - this.priority = _data['priority']; - } - } - - static fromJS(data: any): FileAggregateRoute { - data = typeof data === 'object' ? data : {}; - let result = new FileAggregateRoute(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.routeKeys)) { - data['routeKeys'] = []; - for (let item of this.routeKeys) data['routeKeys'].push(item); - } - if (Array.isArray(this.routeKeysConfig)) { - data['routeKeysConfig'] = []; - for (let item of this.routeKeysConfig) data['routeKeysConfig'].push(item.toJSON()); - } - data['upstreamPathTemplate'] = this.upstreamPathTemplate; - data['upstreamHost'] = this.upstreamHost; - data['routeIsCaseSensitive'] = this.routeIsCaseSensitive; - data['aggregator'] = this.aggregator; - if (Array.isArray(this.upstreamHttpMethod)) { - data['upstreamHttpMethod'] = []; - for (let item of this.upstreamHttpMethod) data['upstreamHttpMethod'].push(item); - } - data['priority'] = this.priority; - return data; - } + routeKeys!: string[] | undefined; + routeKeysConfig!: AggregateRouteConfig[] | undefined; + upstreamPathTemplate!: string | undefined; + upstreamHost!: string | undefined; + routeIsCaseSensitive!: boolean; + aggregator!: string | undefined; + readonly upstreamHttpMethod!: string[] | undefined; + priority!: number; + + constructor(data?: IFileAggregateRoute) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["routeKeys"])) { + this.routeKeys = [] as any; + for (let item of _data["routeKeys"]) + this.routeKeys!.push(item); + } + if (Array.isArray(_data["routeKeysConfig"])) { + this.routeKeysConfig = [] as any; + for (let item of _data["routeKeysConfig"]) + this.routeKeysConfig!.push(AggregateRouteConfig.fromJS(item)); + } + this.upstreamPathTemplate = _data["upstreamPathTemplate"]; + this.upstreamHost = _data["upstreamHost"]; + this.routeIsCaseSensitive = _data["routeIsCaseSensitive"]; + this.aggregator = _data["aggregator"]; + if (Array.isArray(_data["upstreamHttpMethod"])) { + (this).upstreamHttpMethod = [] as any; + for (let item of _data["upstreamHttpMethod"]) + (this).upstreamHttpMethod!.push(item); + } + this.priority = _data["priority"]; + } + } + + static fromJS(data: any): FileAggregateRoute { + data = typeof data === 'object' ? data : {}; + let result = new FileAggregateRoute(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.routeKeys)) { + data["routeKeys"] = []; + for (let item of this.routeKeys) + data["routeKeys"].push(item); + } + if (Array.isArray(this.routeKeysConfig)) { + data["routeKeysConfig"] = []; + for (let item of this.routeKeysConfig) + data["routeKeysConfig"].push(item.toJSON()); + } + data["upstreamPathTemplate"] = this.upstreamPathTemplate; + data["upstreamHost"] = this.upstreamHost; + data["routeIsCaseSensitive"] = this.routeIsCaseSensitive; + data["aggregator"] = this.aggregator; + if (Array.isArray(this.upstreamHttpMethod)) { + data["upstreamHttpMethod"] = []; + for (let item of this.upstreamHttpMethod) + data["upstreamHttpMethod"].push(item); + } + data["priority"] = this.priority; + return data; + } } export interface IFileAggregateRoute { - routeKeys: string[] | undefined; - routeKeysConfig: AggregateRouteConfig[] | undefined; - upstreamPathTemplate: string | undefined; - upstreamHost: string | undefined; - routeIsCaseSensitive: boolean; - aggregator: string | undefined; - upstreamHttpMethod: string[] | undefined; - priority: number; + routeKeys: string[] | undefined; + routeKeysConfig: AggregateRouteConfig[] | undefined; + upstreamPathTemplate: string | undefined; + upstreamHost: string | undefined; + routeIsCaseSensitive: boolean; + aggregator: string | undefined; + upstreamHttpMethod: string[] | undefined; + priority: number; } export class FileAuthenticationOptions implements IFileAuthenticationOptions { - authenticationProviderKey!: string | undefined; - allowedScopes!: string[] | undefined; - - constructor(data?: IFileAuthenticationOptions) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + authenticationProviderKey!: string | undefined; + allowedScopes!: string[] | undefined; + + constructor(data?: IFileAuthenticationOptions) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.authenticationProviderKey = _data['authenticationProviderKey']; - if (Array.isArray(_data['allowedScopes'])) { - this.allowedScopes = [] as any; - for (let item of _data['allowedScopes']) this.allowedScopes!.push(item); - } + init(_data?: any) { + if (_data) { + this.authenticationProviderKey = _data["authenticationProviderKey"]; + if (Array.isArray(_data["allowedScopes"])) { + this.allowedScopes = [] as any; + for (let item of _data["allowedScopes"]) + this.allowedScopes!.push(item); + } + } } - } - static fromJS(data: any): FileAuthenticationOptions { - data = typeof data === 'object' ? data : {}; - let result = new FileAuthenticationOptions(); - result.init(data); - return result; - } + static fromJS(data: any): FileAuthenticationOptions { + data = typeof data === 'object' ? data : {}; + let result = new FileAuthenticationOptions(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['authenticationProviderKey'] = this.authenticationProviderKey; - if (Array.isArray(this.allowedScopes)) { - data['allowedScopes'] = []; - for (let item of this.allowedScopes) data['allowedScopes'].push(item); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["authenticationProviderKey"] = this.authenticationProviderKey; + if (Array.isArray(this.allowedScopes)) { + data["allowedScopes"] = []; + for (let item of this.allowedScopes) + data["allowedScopes"].push(item); + } + return data; } - return data; - } } export interface IFileAuthenticationOptions { - authenticationProviderKey: string | undefined; - allowedScopes: string[] | undefined; + authenticationProviderKey: string | undefined; + allowedScopes: string[] | undefined; } export class FileCacheOptions implements IFileCacheOptions { - ttlSeconds!: number; - region!: string | undefined; - - constructor(data?: IFileCacheOptions) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + ttlSeconds!: number; + region!: string | undefined; + + constructor(data?: IFileCacheOptions) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.ttlSeconds = _data['ttlSeconds']; - this.region = _data['region']; + init(_data?: any) { + if (_data) { + this.ttlSeconds = _data["ttlSeconds"]; + this.region = _data["region"]; + } } - } - static fromJS(data: any): FileCacheOptions { - data = typeof data === 'object' ? data : {}; - let result = new FileCacheOptions(); - result.init(data); - return result; - } + static fromJS(data: any): FileCacheOptions { + data = typeof data === 'object' ? data : {}; + let result = new FileCacheOptions(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['ttlSeconds'] = this.ttlSeconds; - data['region'] = this.region; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["ttlSeconds"] = this.ttlSeconds; + data["region"] = this.region; + return data; + } } export interface IFileCacheOptions { - ttlSeconds: number; - region: string | undefined; + ttlSeconds: number; + region: string | undefined; } export class FileConfiguration implements IFileConfiguration { - routes!: FileRoute[] | undefined; - dynamicRoutes!: FileDynamicRoute[] | undefined; - aggregates!: FileAggregateRoute[] | undefined; - globalConfiguration!: FileGlobalConfiguration; - - constructor(data?: IFileConfiguration) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['routes'])) { - this.routes = [] as any; - for (let item of _data['routes']) this.routes!.push(FileRoute.fromJS(item)); - } - if (Array.isArray(_data['dynamicRoutes'])) { - this.dynamicRoutes = [] as any; - for (let item of _data['dynamicRoutes']) - this.dynamicRoutes!.push(FileDynamicRoute.fromJS(item)); - } - if (Array.isArray(_data['aggregates'])) { - this.aggregates = [] as any; - for (let item of _data['aggregates']) - this.aggregates!.push(FileAggregateRoute.fromJS(item)); - } - this.globalConfiguration = _data['globalConfiguration'] - ? FileGlobalConfiguration.fromJS(_data['globalConfiguration']) - : undefined; - } - } - - static fromJS(data: any): FileConfiguration { - data = typeof data === 'object' ? data : {}; - let result = new FileConfiguration(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.routes)) { - data['routes'] = []; - for (let item of this.routes) data['routes'].push(item.toJSON()); - } - if (Array.isArray(this.dynamicRoutes)) { - data['dynamicRoutes'] = []; - for (let item of this.dynamicRoutes) data['dynamicRoutes'].push(item.toJSON()); - } - if (Array.isArray(this.aggregates)) { - data['aggregates'] = []; - for (let item of this.aggregates) data['aggregates'].push(item.toJSON()); - } - data['globalConfiguration'] = this.globalConfiguration - ? this.globalConfiguration.toJSON() - : undefined; - return data; - } + routes!: FileRoute[] | undefined; + dynamicRoutes!: FileDynamicRoute[] | undefined; + aggregates!: FileAggregateRoute[] | undefined; + globalConfiguration!: FileGlobalConfiguration; + + constructor(data?: IFileConfiguration) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["routes"])) { + this.routes = [] as any; + for (let item of _data["routes"]) + this.routes!.push(FileRoute.fromJS(item)); + } + if (Array.isArray(_data["dynamicRoutes"])) { + this.dynamicRoutes = [] as any; + for (let item of _data["dynamicRoutes"]) + this.dynamicRoutes!.push(FileDynamicRoute.fromJS(item)); + } + if (Array.isArray(_data["aggregates"])) { + this.aggregates = [] as any; + for (let item of _data["aggregates"]) + this.aggregates!.push(FileAggregateRoute.fromJS(item)); + } + this.globalConfiguration = _data["globalConfiguration"] ? FileGlobalConfiguration.fromJS(_data["globalConfiguration"]) : undefined; + } + } + + static fromJS(data: any): FileConfiguration { + data = typeof data === 'object' ? data : {}; + let result = new FileConfiguration(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.routes)) { + data["routes"] = []; + for (let item of this.routes) + data["routes"].push(item.toJSON()); + } + if (Array.isArray(this.dynamicRoutes)) { + data["dynamicRoutes"] = []; + for (let item of this.dynamicRoutes) + data["dynamicRoutes"].push(item.toJSON()); + } + if (Array.isArray(this.aggregates)) { + data["aggregates"] = []; + for (let item of this.aggregates) + data["aggregates"].push(item.toJSON()); + } + data["globalConfiguration"] = this.globalConfiguration ? this.globalConfiguration.toJSON() : undefined; + return data; + } } export interface IFileConfiguration { - routes: FileRoute[] | undefined; - dynamicRoutes: FileDynamicRoute[] | undefined; - aggregates: FileAggregateRoute[] | undefined; - globalConfiguration: FileGlobalConfiguration; + routes: FileRoute[] | undefined; + dynamicRoutes: FileDynamicRoute[] | undefined; + aggregates: FileAggregateRoute[] | undefined; + globalConfiguration: FileGlobalConfiguration; } export class FileDynamicRoute implements IFileDynamicRoute { - serviceName!: string | undefined; - rateLimitRule!: FileRateLimitRule; - downstreamHttpVersion!: string | undefined; - - constructor(data?: IFileDynamicRoute) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.serviceName = _data['serviceName']; - this.rateLimitRule = _data['rateLimitRule'] - ? FileRateLimitRule.fromJS(_data['rateLimitRule']) - : undefined; - this.downstreamHttpVersion = _data['downstreamHttpVersion']; - } - } - - static fromJS(data: any): FileDynamicRoute { - data = typeof data === 'object' ? data : {}; - let result = new FileDynamicRoute(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['serviceName'] = this.serviceName; - data['rateLimitRule'] = this.rateLimitRule ? this.rateLimitRule.toJSON() : undefined; - data['downstreamHttpVersion'] = this.downstreamHttpVersion; - return data; - } + serviceName!: string | undefined; + rateLimitRule!: FileRateLimitRule; + downstreamHttpVersion!: string | undefined; + + constructor(data?: IFileDynamicRoute) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.serviceName = _data["serviceName"]; + this.rateLimitRule = _data["rateLimitRule"] ? FileRateLimitRule.fromJS(_data["rateLimitRule"]) : undefined; + this.downstreamHttpVersion = _data["downstreamHttpVersion"]; + } + } + + static fromJS(data: any): FileDynamicRoute { + data = typeof data === 'object' ? data : {}; + let result = new FileDynamicRoute(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["serviceName"] = this.serviceName; + data["rateLimitRule"] = this.rateLimitRule ? this.rateLimitRule.toJSON() : undefined; + data["downstreamHttpVersion"] = this.downstreamHttpVersion; + return data; + } } export interface IFileDynamicRoute { - serviceName: string | undefined; - rateLimitRule: FileRateLimitRule; - downstreamHttpVersion: string | undefined; + serviceName: string | undefined; + rateLimitRule: FileRateLimitRule; + downstreamHttpVersion: string | undefined; } export class FileGlobalConfiguration implements IFileGlobalConfiguration { - requestIdKey!: string | undefined; - serviceDiscoveryProvider!: FileServiceDiscoveryProvider; - rateLimitOptions!: FileRateLimitOptions; - qoSOptions!: FileQoSOptions; - baseUrl!: string | undefined; - loadBalancerOptions!: FileLoadBalancerOptions; - downstreamScheme!: string | undefined; - httpHandlerOptions!: FileHttpHandlerOptions; - downstreamHttpVersion!: string | undefined; - - constructor(data?: IFileGlobalConfiguration) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.requestIdKey = _data['requestIdKey']; - this.serviceDiscoveryProvider = _data['serviceDiscoveryProvider'] - ? FileServiceDiscoveryProvider.fromJS(_data['serviceDiscoveryProvider']) - : undefined; - this.rateLimitOptions = _data['rateLimitOptions'] - ? FileRateLimitOptions.fromJS(_data['rateLimitOptions']) - : undefined; - this.qoSOptions = _data['qoSOptions'] - ? FileQoSOptions.fromJS(_data['qoSOptions']) - : undefined; - this.baseUrl = _data['baseUrl']; - this.loadBalancerOptions = _data['loadBalancerOptions'] - ? FileLoadBalancerOptions.fromJS(_data['loadBalancerOptions']) - : undefined; - this.downstreamScheme = _data['downstreamScheme']; - this.httpHandlerOptions = _data['httpHandlerOptions'] - ? FileHttpHandlerOptions.fromJS(_data['httpHandlerOptions']) - : undefined; - this.downstreamHttpVersion = _data['downstreamHttpVersion']; - } - } - - static fromJS(data: any): FileGlobalConfiguration { - data = typeof data === 'object' ? data : {}; - let result = new FileGlobalConfiguration(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['requestIdKey'] = this.requestIdKey; - data['serviceDiscoveryProvider'] = this.serviceDiscoveryProvider - ? this.serviceDiscoveryProvider.toJSON() - : undefined; - data['rateLimitOptions'] = this.rateLimitOptions - ? this.rateLimitOptions.toJSON() - : undefined; - data['qoSOptions'] = this.qoSOptions ? this.qoSOptions.toJSON() : undefined; - data['baseUrl'] = this.baseUrl; - data['loadBalancerOptions'] = this.loadBalancerOptions - ? this.loadBalancerOptions.toJSON() - : undefined; - data['downstreamScheme'] = this.downstreamScheme; - data['httpHandlerOptions'] = this.httpHandlerOptions - ? this.httpHandlerOptions.toJSON() - : undefined; - data['downstreamHttpVersion'] = this.downstreamHttpVersion; - return data; - } + requestIdKey!: string | undefined; + serviceDiscoveryProvider!: FileServiceDiscoveryProvider; + rateLimitOptions!: FileRateLimitOptions; + qoSOptions!: FileQoSOptions; + baseUrl!: string | undefined; + loadBalancerOptions!: FileLoadBalancerOptions; + downstreamScheme!: string | undefined; + httpHandlerOptions!: FileHttpHandlerOptions; + downstreamHttpVersion!: string | undefined; + + constructor(data?: IFileGlobalConfiguration) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.requestIdKey = _data["requestIdKey"]; + this.serviceDiscoveryProvider = _data["serviceDiscoveryProvider"] ? FileServiceDiscoveryProvider.fromJS(_data["serviceDiscoveryProvider"]) : undefined; + this.rateLimitOptions = _data["rateLimitOptions"] ? FileRateLimitOptions.fromJS(_data["rateLimitOptions"]) : undefined; + this.qoSOptions = _data["qoSOptions"] ? FileQoSOptions.fromJS(_data["qoSOptions"]) : undefined; + this.baseUrl = _data["baseUrl"]; + this.loadBalancerOptions = _data["loadBalancerOptions"] ? FileLoadBalancerOptions.fromJS(_data["loadBalancerOptions"]) : undefined; + this.downstreamScheme = _data["downstreamScheme"]; + this.httpHandlerOptions = _data["httpHandlerOptions"] ? FileHttpHandlerOptions.fromJS(_data["httpHandlerOptions"]) : undefined; + this.downstreamHttpVersion = _data["downstreamHttpVersion"]; + } + } + + static fromJS(data: any): FileGlobalConfiguration { + data = typeof data === 'object' ? data : {}; + let result = new FileGlobalConfiguration(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["requestIdKey"] = this.requestIdKey; + data["serviceDiscoveryProvider"] = this.serviceDiscoveryProvider ? this.serviceDiscoveryProvider.toJSON() : undefined; + data["rateLimitOptions"] = this.rateLimitOptions ? this.rateLimitOptions.toJSON() : undefined; + data["qoSOptions"] = this.qoSOptions ? this.qoSOptions.toJSON() : undefined; + data["baseUrl"] = this.baseUrl; + data["loadBalancerOptions"] = this.loadBalancerOptions ? this.loadBalancerOptions.toJSON() : undefined; + data["downstreamScheme"] = this.downstreamScheme; + data["httpHandlerOptions"] = this.httpHandlerOptions ? this.httpHandlerOptions.toJSON() : undefined; + data["downstreamHttpVersion"] = this.downstreamHttpVersion; + return data; + } } export interface IFileGlobalConfiguration { - requestIdKey: string | undefined; - serviceDiscoveryProvider: FileServiceDiscoveryProvider; - rateLimitOptions: FileRateLimitOptions; - qoSOptions: FileQoSOptions; - baseUrl: string | undefined; - loadBalancerOptions: FileLoadBalancerOptions; - downstreamScheme: string | undefined; - httpHandlerOptions: FileHttpHandlerOptions; - downstreamHttpVersion: string | undefined; + requestIdKey: string | undefined; + serviceDiscoveryProvider: FileServiceDiscoveryProvider; + rateLimitOptions: FileRateLimitOptions; + qoSOptions: FileQoSOptions; + baseUrl: string | undefined; + loadBalancerOptions: FileLoadBalancerOptions; + downstreamScheme: string | undefined; + httpHandlerOptions: FileHttpHandlerOptions; + downstreamHttpVersion: string | undefined; } export class FileHostAndPort implements IFileHostAndPort { - host!: string | undefined; - port!: number; - - constructor(data?: IFileHostAndPort) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + host!: string | undefined; + port!: number; + + constructor(data?: IFileHostAndPort) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.host = _data['host']; - this.port = _data['port']; + init(_data?: any) { + if (_data) { + this.host = _data["host"]; + this.port = _data["port"]; + } } - } - static fromJS(data: any): FileHostAndPort { - data = typeof data === 'object' ? data : {}; - let result = new FileHostAndPort(); - result.init(data); - return result; - } + static fromJS(data: any): FileHostAndPort { + data = typeof data === 'object' ? data : {}; + let result = new FileHostAndPort(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['host'] = this.host; - data['port'] = this.port; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["host"] = this.host; + data["port"] = this.port; + return data; + } } export interface IFileHostAndPort { - host: string | undefined; - port: number; + host: string | undefined; + port: number; } export class FileHttpHandlerOptions implements IFileHttpHandlerOptions { - allowAutoRedirect!: boolean; - useCookieContainer!: boolean; - useTracing!: boolean; - useProxy!: boolean; - maxConnectionsPerServer!: number; - - constructor(data?: IFileHttpHandlerOptions) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.allowAutoRedirect = _data['allowAutoRedirect']; - this.useCookieContainer = _data['useCookieContainer']; - this.useTracing = _data['useTracing']; - this.useProxy = _data['useProxy']; - this.maxConnectionsPerServer = _data['maxConnectionsPerServer']; - } - } - - static fromJS(data: any): FileHttpHandlerOptions { - data = typeof data === 'object' ? data : {}; - let result = new FileHttpHandlerOptions(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['allowAutoRedirect'] = this.allowAutoRedirect; - data['useCookieContainer'] = this.useCookieContainer; - data['useTracing'] = this.useTracing; - data['useProxy'] = this.useProxy; - data['maxConnectionsPerServer'] = this.maxConnectionsPerServer; - return data; - } + allowAutoRedirect!: boolean; + useCookieContainer!: boolean; + useTracing!: boolean; + useProxy!: boolean; + maxConnectionsPerServer!: number; + + constructor(data?: IFileHttpHandlerOptions) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.allowAutoRedirect = _data["allowAutoRedirect"]; + this.useCookieContainer = _data["useCookieContainer"]; + this.useTracing = _data["useTracing"]; + this.useProxy = _data["useProxy"]; + this.maxConnectionsPerServer = _data["maxConnectionsPerServer"]; + } + } + + static fromJS(data: any): FileHttpHandlerOptions { + data = typeof data === 'object' ? data : {}; + let result = new FileHttpHandlerOptions(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["allowAutoRedirect"] = this.allowAutoRedirect; + data["useCookieContainer"] = this.useCookieContainer; + data["useTracing"] = this.useTracing; + data["useProxy"] = this.useProxy; + data["maxConnectionsPerServer"] = this.maxConnectionsPerServer; + return data; + } } export interface IFileHttpHandlerOptions { - allowAutoRedirect: boolean; - useCookieContainer: boolean; - useTracing: boolean; - useProxy: boolean; - maxConnectionsPerServer: number; + allowAutoRedirect: boolean; + useCookieContainer: boolean; + useTracing: boolean; + useProxy: boolean; + maxConnectionsPerServer: number; } export class FileLoadBalancerOptions implements IFileLoadBalancerOptions { - type!: string | undefined; - key!: string | undefined; - expiry!: number; - - constructor(data?: IFileLoadBalancerOptions) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.type = _data['type']; - this.key = _data['key']; - this.expiry = _data['expiry']; - } - } - - static fromJS(data: any): FileLoadBalancerOptions { - data = typeof data === 'object' ? data : {}; - let result = new FileLoadBalancerOptions(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['type'] = this.type; - data['key'] = this.key; - data['expiry'] = this.expiry; - return data; - } + type!: string | undefined; + key!: string | undefined; + expiry!: number; + + constructor(data?: IFileLoadBalancerOptions) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.type = _data["type"]; + this.key = _data["key"]; + this.expiry = _data["expiry"]; + } + } + + static fromJS(data: any): FileLoadBalancerOptions { + data = typeof data === 'object' ? data : {}; + let result = new FileLoadBalancerOptions(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["type"] = this.type; + data["key"] = this.key; + data["expiry"] = this.expiry; + return data; + } } export interface IFileLoadBalancerOptions { - type: string | undefined; - key: string | undefined; - expiry: number; + type: string | undefined; + key: string | undefined; + expiry: number; } export class FileQoSOptions implements IFileQoSOptions { - exceptionsAllowedBeforeBreaking!: number; - durationOfBreak!: number; - timeoutValue!: number; - - constructor(data?: IFileQoSOptions) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.exceptionsAllowedBeforeBreaking = _data['exceptionsAllowedBeforeBreaking']; - this.durationOfBreak = _data['durationOfBreak']; - this.timeoutValue = _data['timeoutValue']; - } - } - - static fromJS(data: any): FileQoSOptions { - data = typeof data === 'object' ? data : {}; - let result = new FileQoSOptions(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['exceptionsAllowedBeforeBreaking'] = this.exceptionsAllowedBeforeBreaking; - data['durationOfBreak'] = this.durationOfBreak; - data['timeoutValue'] = this.timeoutValue; - return data; - } + exceptionsAllowedBeforeBreaking!: number; + durationOfBreak!: number; + timeoutValue!: number; + + constructor(data?: IFileQoSOptions) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.exceptionsAllowedBeforeBreaking = _data["exceptionsAllowedBeforeBreaking"]; + this.durationOfBreak = _data["durationOfBreak"]; + this.timeoutValue = _data["timeoutValue"]; + } + } + + static fromJS(data: any): FileQoSOptions { + data = typeof data === 'object' ? data : {}; + let result = new FileQoSOptions(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["exceptionsAllowedBeforeBreaking"] = this.exceptionsAllowedBeforeBreaking; + data["durationOfBreak"] = this.durationOfBreak; + data["timeoutValue"] = this.timeoutValue; + return data; + } } export interface IFileQoSOptions { - exceptionsAllowedBeforeBreaking: number; - durationOfBreak: number; - timeoutValue: number; + exceptionsAllowedBeforeBreaking: number; + durationOfBreak: number; + timeoutValue: number; } export class FileRateLimitOptions implements IFileRateLimitOptions { - clientIdHeader!: string | undefined; - quotaExceededMessage!: string | undefined; - rateLimitCounterPrefix!: string | undefined; - disableRateLimitHeaders!: boolean; - httpStatusCode!: number; - - constructor(data?: IFileRateLimitOptions) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.clientIdHeader = _data['clientIdHeader']; - this.quotaExceededMessage = _data['quotaExceededMessage']; - this.rateLimitCounterPrefix = _data['rateLimitCounterPrefix']; - this.disableRateLimitHeaders = _data['disableRateLimitHeaders']; - this.httpStatusCode = _data['httpStatusCode']; - } - } - - static fromJS(data: any): FileRateLimitOptions { - data = typeof data === 'object' ? data : {}; - let result = new FileRateLimitOptions(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['clientIdHeader'] = this.clientIdHeader; - data['quotaExceededMessage'] = this.quotaExceededMessage; - data['rateLimitCounterPrefix'] = this.rateLimitCounterPrefix; - data['disableRateLimitHeaders'] = this.disableRateLimitHeaders; - data['httpStatusCode'] = this.httpStatusCode; - return data; - } + clientIdHeader!: string | undefined; + quotaExceededMessage!: string | undefined; + rateLimitCounterPrefix!: string | undefined; + disableRateLimitHeaders!: boolean; + httpStatusCode!: number; + + constructor(data?: IFileRateLimitOptions) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.clientIdHeader = _data["clientIdHeader"]; + this.quotaExceededMessage = _data["quotaExceededMessage"]; + this.rateLimitCounterPrefix = _data["rateLimitCounterPrefix"]; + this.disableRateLimitHeaders = _data["disableRateLimitHeaders"]; + this.httpStatusCode = _data["httpStatusCode"]; + } + } + + static fromJS(data: any): FileRateLimitOptions { + data = typeof data === 'object' ? data : {}; + let result = new FileRateLimitOptions(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["clientIdHeader"] = this.clientIdHeader; + data["quotaExceededMessage"] = this.quotaExceededMessage; + data["rateLimitCounterPrefix"] = this.rateLimitCounterPrefix; + data["disableRateLimitHeaders"] = this.disableRateLimitHeaders; + data["httpStatusCode"] = this.httpStatusCode; + return data; + } } export interface IFileRateLimitOptions { - clientIdHeader: string | undefined; - quotaExceededMessage: string | undefined; - rateLimitCounterPrefix: string | undefined; - disableRateLimitHeaders: boolean; - httpStatusCode: number; + clientIdHeader: string | undefined; + quotaExceededMessage: string | undefined; + rateLimitCounterPrefix: string | undefined; + disableRateLimitHeaders: boolean; + httpStatusCode: number; } export class FileRateLimitRule implements IFileRateLimitRule { - clientWhitelist!: string[] | undefined; - enableRateLimiting!: boolean; - period!: string | undefined; - periodTimespan!: number; - limit!: number; - - constructor(data?: IFileRateLimitRule) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['clientWhitelist'])) { - this.clientWhitelist = [] as any; - for (let item of _data['clientWhitelist']) this.clientWhitelist!.push(item); - } - this.enableRateLimiting = _data['enableRateLimiting']; - this.period = _data['period']; - this.periodTimespan = _data['periodTimespan']; - this.limit = _data['limit']; - } - } - - static fromJS(data: any): FileRateLimitRule { - data = typeof data === 'object' ? data : {}; - let result = new FileRateLimitRule(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.clientWhitelist)) { - data['clientWhitelist'] = []; - for (let item of this.clientWhitelist) data['clientWhitelist'].push(item); - } - data['enableRateLimiting'] = this.enableRateLimiting; - data['period'] = this.period; - data['periodTimespan'] = this.periodTimespan; - data['limit'] = this.limit; - return data; - } + clientWhitelist!: string[] | undefined; + enableRateLimiting!: boolean; + period!: string | undefined; + periodTimespan!: number; + limit!: number; + + constructor(data?: IFileRateLimitRule) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["clientWhitelist"])) { + this.clientWhitelist = [] as any; + for (let item of _data["clientWhitelist"]) + this.clientWhitelist!.push(item); + } + this.enableRateLimiting = _data["enableRateLimiting"]; + this.period = _data["period"]; + this.periodTimespan = _data["periodTimespan"]; + this.limit = _data["limit"]; + } + } + + static fromJS(data: any): FileRateLimitRule { + data = typeof data === 'object' ? data : {}; + let result = new FileRateLimitRule(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.clientWhitelist)) { + data["clientWhitelist"] = []; + for (let item of this.clientWhitelist) + data["clientWhitelist"].push(item); + } + data["enableRateLimiting"] = this.enableRateLimiting; + data["period"] = this.period; + data["periodTimespan"] = this.periodTimespan; + data["limit"] = this.limit; + return data; + } } export interface IFileRateLimitRule { - clientWhitelist: string[] | undefined; - enableRateLimiting: boolean; - period: string | undefined; - periodTimespan: number; - limit: number; + clientWhitelist: string[] | undefined; + enableRateLimiting: boolean; + period: string | undefined; + periodTimespan: number; + limit: number; } export class FileRoute implements IFileRoute { - downstreamPathTemplate!: string | undefined; - upstreamPathTemplate!: string | undefined; - upstreamHttpMethod!: string[] | undefined; - downstreamHttpMethod!: string | undefined; - addHeadersToRequest!: { [key: string]: string } | undefined; - upstreamHeaderTransform!: { [key: string]: string } | undefined; - downstreamHeaderTransform!: { [key: string]: string } | undefined; - addClaimsToRequest!: { [key: string]: string } | undefined; - routeClaimsRequirement!: { [key: string]: string } | undefined; - addQueriesToRequest!: { [key: string]: string } | undefined; - changeDownstreamPathTemplate!: { [key: string]: string } | undefined; - requestIdKey!: string | undefined; - fileCacheOptions!: FileCacheOptions; - routeIsCaseSensitive!: boolean; - serviceName!: string | undefined; - serviceNamespace!: string | undefined; - downstreamScheme!: string | undefined; - qoSOptions!: FileQoSOptions; - loadBalancerOptions!: FileLoadBalancerOptions; - rateLimitOptions!: FileRateLimitRule; - authenticationOptions!: FileAuthenticationOptions; - httpHandlerOptions!: FileHttpHandlerOptions; - downstreamHostAndPorts!: FileHostAndPort[] | undefined; - upstreamHost!: string | undefined; - key!: string | undefined; - delegatingHandlers!: string[] | undefined; - priority!: number; - timeout!: number; - dangerousAcceptAnyServerCertificateValidator!: boolean; - securityOptions!: FileSecurityOptions; - downstreamHttpVersion!: string | undefined; - - constructor(data?: IFileRoute) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.downstreamPathTemplate = _data['downstreamPathTemplate']; - this.upstreamPathTemplate = _data['upstreamPathTemplate']; - if (Array.isArray(_data['upstreamHttpMethod'])) { - this.upstreamHttpMethod = [] as any; - for (let item of _data['upstreamHttpMethod']) this.upstreamHttpMethod!.push(item); - } - this.downstreamHttpMethod = _data['downstreamHttpMethod']; - if (_data['addHeadersToRequest']) { - this.addHeadersToRequest = {} as any; - for (let key in _data['addHeadersToRequest']) { - if (_data['addHeadersToRequest'].hasOwnProperty(key)) - (this.addHeadersToRequest)![key] = _data['addHeadersToRequest'][key]; - } - } - if (_data['upstreamHeaderTransform']) { - this.upstreamHeaderTransform = {} as any; - for (let key in _data['upstreamHeaderTransform']) { - if (_data['upstreamHeaderTransform'].hasOwnProperty(key)) - (this.upstreamHeaderTransform)![key] = _data['upstreamHeaderTransform'][key]; - } - } - if (_data['downstreamHeaderTransform']) { - this.downstreamHeaderTransform = {} as any; - for (let key in _data['downstreamHeaderTransform']) { - if (_data['downstreamHeaderTransform'].hasOwnProperty(key)) - (this.downstreamHeaderTransform)![key] = _data['downstreamHeaderTransform'][key]; - } - } - if (_data['addClaimsToRequest']) { - this.addClaimsToRequest = {} as any; - for (let key in _data['addClaimsToRequest']) { - if (_data['addClaimsToRequest'].hasOwnProperty(key)) - (this.addClaimsToRequest)![key] = _data['addClaimsToRequest'][key]; - } - } - if (_data['routeClaimsRequirement']) { - this.routeClaimsRequirement = {} as any; - for (let key in _data['routeClaimsRequirement']) { - if (_data['routeClaimsRequirement'].hasOwnProperty(key)) - (this.routeClaimsRequirement)![key] = _data['routeClaimsRequirement'][key]; - } - } - if (_data['addQueriesToRequest']) { - this.addQueriesToRequest = {} as any; - for (let key in _data['addQueriesToRequest']) { - if (_data['addQueriesToRequest'].hasOwnProperty(key)) - (this.addQueriesToRequest)![key] = _data['addQueriesToRequest'][key]; - } - } - if (_data['changeDownstreamPathTemplate']) { - this.changeDownstreamPathTemplate = {} as any; - for (let key in _data['changeDownstreamPathTemplate']) { - if (_data['changeDownstreamPathTemplate'].hasOwnProperty(key)) - (this.changeDownstreamPathTemplate)![key] = - _data['changeDownstreamPathTemplate'][key]; - } - } - this.requestIdKey = _data['requestIdKey']; - this.fileCacheOptions = _data['fileCacheOptions'] - ? FileCacheOptions.fromJS(_data['fileCacheOptions']) - : undefined; - this.routeIsCaseSensitive = _data['routeIsCaseSensitive']; - this.serviceName = _data['serviceName']; - this.serviceNamespace = _data['serviceNamespace']; - this.downstreamScheme = _data['downstreamScheme']; - this.qoSOptions = _data['qoSOptions'] - ? FileQoSOptions.fromJS(_data['qoSOptions']) - : undefined; - this.loadBalancerOptions = _data['loadBalancerOptions'] - ? FileLoadBalancerOptions.fromJS(_data['loadBalancerOptions']) - : undefined; - this.rateLimitOptions = _data['rateLimitOptions'] - ? FileRateLimitRule.fromJS(_data['rateLimitOptions']) - : undefined; - this.authenticationOptions = _data['authenticationOptions'] - ? FileAuthenticationOptions.fromJS(_data['authenticationOptions']) - : undefined; - this.httpHandlerOptions = _data['httpHandlerOptions'] - ? FileHttpHandlerOptions.fromJS(_data['httpHandlerOptions']) - : undefined; - if (Array.isArray(_data['downstreamHostAndPorts'])) { - this.downstreamHostAndPorts = [] as any; - for (let item of _data['downstreamHostAndPorts']) - this.downstreamHostAndPorts!.push(FileHostAndPort.fromJS(item)); - } - this.upstreamHost = _data['upstreamHost']; - this.key = _data['key']; - if (Array.isArray(_data['delegatingHandlers'])) { - this.delegatingHandlers = [] as any; - for (let item of _data['delegatingHandlers']) this.delegatingHandlers!.push(item); - } - this.priority = _data['priority']; - this.timeout = _data['timeout']; - this.dangerousAcceptAnyServerCertificateValidator = - _data['dangerousAcceptAnyServerCertificateValidator']; - this.securityOptions = _data['securityOptions'] - ? FileSecurityOptions.fromJS(_data['securityOptions']) - : undefined; - this.downstreamHttpVersion = _data['downstreamHttpVersion']; - } - } - - static fromJS(data: any): FileRoute { - data = typeof data === 'object' ? data : {}; - let result = new FileRoute(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['downstreamPathTemplate'] = this.downstreamPathTemplate; - data['upstreamPathTemplate'] = this.upstreamPathTemplate; - if (Array.isArray(this.upstreamHttpMethod)) { - data['upstreamHttpMethod'] = []; - for (let item of this.upstreamHttpMethod) data['upstreamHttpMethod'].push(item); - } - data['downstreamHttpMethod'] = this.downstreamHttpMethod; - if (this.addHeadersToRequest) { - data['addHeadersToRequest'] = {}; - for (let key in this.addHeadersToRequest) { - if (this.addHeadersToRequest.hasOwnProperty(key)) - (data['addHeadersToRequest'])[key] = (this.addHeadersToRequest)[key]; - } - } - if (this.upstreamHeaderTransform) { - data['upstreamHeaderTransform'] = {}; - for (let key in this.upstreamHeaderTransform) { - if (this.upstreamHeaderTransform.hasOwnProperty(key)) - (data['upstreamHeaderTransform'])[key] = (this.upstreamHeaderTransform)[key]; - } - } - if (this.downstreamHeaderTransform) { - data['downstreamHeaderTransform'] = {}; - for (let key in this.downstreamHeaderTransform) { - if (this.downstreamHeaderTransform.hasOwnProperty(key)) - (data['downstreamHeaderTransform'])[key] = (this.downstreamHeaderTransform)[ - key - ]; - } - } - if (this.addClaimsToRequest) { - data['addClaimsToRequest'] = {}; - for (let key in this.addClaimsToRequest) { - if (this.addClaimsToRequest.hasOwnProperty(key)) - (data['addClaimsToRequest'])[key] = (this.addClaimsToRequest)[key]; - } - } - if (this.routeClaimsRequirement) { - data['routeClaimsRequirement'] = {}; - for (let key in this.routeClaimsRequirement) { - if (this.routeClaimsRequirement.hasOwnProperty(key)) - (data['routeClaimsRequirement'])[key] = (this.routeClaimsRequirement)[key]; - } - } - if (this.addQueriesToRequest) { - data['addQueriesToRequest'] = {}; - for (let key in this.addQueriesToRequest) { - if (this.addQueriesToRequest.hasOwnProperty(key)) - (data['addQueriesToRequest'])[key] = (this.addQueriesToRequest)[key]; - } - } - if (this.changeDownstreamPathTemplate) { - data['changeDownstreamPathTemplate'] = {}; - for (let key in this.changeDownstreamPathTemplate) { - if (this.changeDownstreamPathTemplate.hasOwnProperty(key)) - (data['changeDownstreamPathTemplate'])[key] = (( - this.changeDownstreamPathTemplate - ))[key]; - } - } - data['requestIdKey'] = this.requestIdKey; - data['fileCacheOptions'] = this.fileCacheOptions - ? this.fileCacheOptions.toJSON() - : undefined; - data['routeIsCaseSensitive'] = this.routeIsCaseSensitive; - data['serviceName'] = this.serviceName; - data['serviceNamespace'] = this.serviceNamespace; - data['downstreamScheme'] = this.downstreamScheme; - data['qoSOptions'] = this.qoSOptions ? this.qoSOptions.toJSON() : undefined; - data['loadBalancerOptions'] = this.loadBalancerOptions - ? this.loadBalancerOptions.toJSON() - : undefined; - data['rateLimitOptions'] = this.rateLimitOptions - ? this.rateLimitOptions.toJSON() - : undefined; - data['authenticationOptions'] = this.authenticationOptions - ? this.authenticationOptions.toJSON() - : undefined; - data['httpHandlerOptions'] = this.httpHandlerOptions - ? this.httpHandlerOptions.toJSON() - : undefined; - if (Array.isArray(this.downstreamHostAndPorts)) { - data['downstreamHostAndPorts'] = []; - for (let item of this.downstreamHostAndPorts) - data['downstreamHostAndPorts'].push(item.toJSON()); - } - data['upstreamHost'] = this.upstreamHost; - data['key'] = this.key; - if (Array.isArray(this.delegatingHandlers)) { - data['delegatingHandlers'] = []; - for (let item of this.delegatingHandlers) data['delegatingHandlers'].push(item); - } - data['priority'] = this.priority; - data['timeout'] = this.timeout; - data['dangerousAcceptAnyServerCertificateValidator'] = - this.dangerousAcceptAnyServerCertificateValidator; - data['securityOptions'] = this.securityOptions ? this.securityOptions.toJSON() : undefined; - data['downstreamHttpVersion'] = this.downstreamHttpVersion; - return data; - } + downstreamPathTemplate!: string | undefined; + upstreamPathTemplate!: string | undefined; + upstreamHttpMethod!: string[] | undefined; + downstreamHttpMethod!: string | undefined; + addHeadersToRequest!: { [key: string]: string; } | undefined; + upstreamHeaderTransform!: { [key: string]: string; } | undefined; + downstreamHeaderTransform!: { [key: string]: string; } | undefined; + addClaimsToRequest!: { [key: string]: string; } | undefined; + routeClaimsRequirement!: { [key: string]: string; } | undefined; + addQueriesToRequest!: { [key: string]: string; } | undefined; + changeDownstreamPathTemplate!: { [key: string]: string; } | undefined; + requestIdKey!: string | undefined; + fileCacheOptions!: FileCacheOptions; + routeIsCaseSensitive!: boolean; + serviceName!: string | undefined; + serviceNamespace!: string | undefined; + downstreamScheme!: string | undefined; + qoSOptions!: FileQoSOptions; + loadBalancerOptions!: FileLoadBalancerOptions; + rateLimitOptions!: FileRateLimitRule; + authenticationOptions!: FileAuthenticationOptions; + httpHandlerOptions!: FileHttpHandlerOptions; + downstreamHostAndPorts!: FileHostAndPort[] | undefined; + upstreamHost!: string | undefined; + key!: string | undefined; + delegatingHandlers!: string[] | undefined; + priority!: number; + timeout!: number; + dangerousAcceptAnyServerCertificateValidator!: boolean; + securityOptions!: FileSecurityOptions; + downstreamHttpVersion!: string | undefined; + + constructor(data?: IFileRoute) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.downstreamPathTemplate = _data["downstreamPathTemplate"]; + this.upstreamPathTemplate = _data["upstreamPathTemplate"]; + if (Array.isArray(_data["upstreamHttpMethod"])) { + this.upstreamHttpMethod = [] as any; + for (let item of _data["upstreamHttpMethod"]) + this.upstreamHttpMethod!.push(item); + } + this.downstreamHttpMethod = _data["downstreamHttpMethod"]; + if (_data["addHeadersToRequest"]) { + this.addHeadersToRequest = {} as any; + for (let key in _data["addHeadersToRequest"]) { + if (_data["addHeadersToRequest"].hasOwnProperty(key)) + (this.addHeadersToRequest)![key] = _data["addHeadersToRequest"][key]; + } + } + if (_data["upstreamHeaderTransform"]) { + this.upstreamHeaderTransform = {} as any; + for (let key in _data["upstreamHeaderTransform"]) { + if (_data["upstreamHeaderTransform"].hasOwnProperty(key)) + (this.upstreamHeaderTransform)![key] = _data["upstreamHeaderTransform"][key]; + } + } + if (_data["downstreamHeaderTransform"]) { + this.downstreamHeaderTransform = {} as any; + for (let key in _data["downstreamHeaderTransform"]) { + if (_data["downstreamHeaderTransform"].hasOwnProperty(key)) + (this.downstreamHeaderTransform)![key] = _data["downstreamHeaderTransform"][key]; + } + } + if (_data["addClaimsToRequest"]) { + this.addClaimsToRequest = {} as any; + for (let key in _data["addClaimsToRequest"]) { + if (_data["addClaimsToRequest"].hasOwnProperty(key)) + (this.addClaimsToRequest)![key] = _data["addClaimsToRequest"][key]; + } + } + if (_data["routeClaimsRequirement"]) { + this.routeClaimsRequirement = {} as any; + for (let key in _data["routeClaimsRequirement"]) { + if (_data["routeClaimsRequirement"].hasOwnProperty(key)) + (this.routeClaimsRequirement)![key] = _data["routeClaimsRequirement"][key]; + } + } + if (_data["addQueriesToRequest"]) { + this.addQueriesToRequest = {} as any; + for (let key in _data["addQueriesToRequest"]) { + if (_data["addQueriesToRequest"].hasOwnProperty(key)) + (this.addQueriesToRequest)![key] = _data["addQueriesToRequest"][key]; + } + } + if (_data["changeDownstreamPathTemplate"]) { + this.changeDownstreamPathTemplate = {} as any; + for (let key in _data["changeDownstreamPathTemplate"]) { + if (_data["changeDownstreamPathTemplate"].hasOwnProperty(key)) + (this.changeDownstreamPathTemplate)![key] = _data["changeDownstreamPathTemplate"][key]; + } + } + this.requestIdKey = _data["requestIdKey"]; + this.fileCacheOptions = _data["fileCacheOptions"] ? FileCacheOptions.fromJS(_data["fileCacheOptions"]) : undefined; + this.routeIsCaseSensitive = _data["routeIsCaseSensitive"]; + this.serviceName = _data["serviceName"]; + this.serviceNamespace = _data["serviceNamespace"]; + this.downstreamScheme = _data["downstreamScheme"]; + this.qoSOptions = _data["qoSOptions"] ? FileQoSOptions.fromJS(_data["qoSOptions"]) : undefined; + this.loadBalancerOptions = _data["loadBalancerOptions"] ? FileLoadBalancerOptions.fromJS(_data["loadBalancerOptions"]) : undefined; + this.rateLimitOptions = _data["rateLimitOptions"] ? FileRateLimitRule.fromJS(_data["rateLimitOptions"]) : undefined; + this.authenticationOptions = _data["authenticationOptions"] ? FileAuthenticationOptions.fromJS(_data["authenticationOptions"]) : undefined; + this.httpHandlerOptions = _data["httpHandlerOptions"] ? FileHttpHandlerOptions.fromJS(_data["httpHandlerOptions"]) : undefined; + if (Array.isArray(_data["downstreamHostAndPorts"])) { + this.downstreamHostAndPorts = [] as any; + for (let item of _data["downstreamHostAndPorts"]) + this.downstreamHostAndPorts!.push(FileHostAndPort.fromJS(item)); + } + this.upstreamHost = _data["upstreamHost"]; + this.key = _data["key"]; + if (Array.isArray(_data["delegatingHandlers"])) { + this.delegatingHandlers = [] as any; + for (let item of _data["delegatingHandlers"]) + this.delegatingHandlers!.push(item); + } + this.priority = _data["priority"]; + this.timeout = _data["timeout"]; + this.dangerousAcceptAnyServerCertificateValidator = _data["dangerousAcceptAnyServerCertificateValidator"]; + this.securityOptions = _data["securityOptions"] ? FileSecurityOptions.fromJS(_data["securityOptions"]) : undefined; + this.downstreamHttpVersion = _data["downstreamHttpVersion"]; + } + } + + static fromJS(data: any): FileRoute { + data = typeof data === 'object' ? data : {}; + let result = new FileRoute(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["downstreamPathTemplate"] = this.downstreamPathTemplate; + data["upstreamPathTemplate"] = this.upstreamPathTemplate; + if (Array.isArray(this.upstreamHttpMethod)) { + data["upstreamHttpMethod"] = []; + for (let item of this.upstreamHttpMethod) + data["upstreamHttpMethod"].push(item); + } + data["downstreamHttpMethod"] = this.downstreamHttpMethod; + if (this.addHeadersToRequest) { + data["addHeadersToRequest"] = {}; + for (let key in this.addHeadersToRequest) { + if (this.addHeadersToRequest.hasOwnProperty(key)) + (data["addHeadersToRequest"])[key] = (this.addHeadersToRequest)[key]; + } + } + if (this.upstreamHeaderTransform) { + data["upstreamHeaderTransform"] = {}; + for (let key in this.upstreamHeaderTransform) { + if (this.upstreamHeaderTransform.hasOwnProperty(key)) + (data["upstreamHeaderTransform"])[key] = (this.upstreamHeaderTransform)[key]; + } + } + if (this.downstreamHeaderTransform) { + data["downstreamHeaderTransform"] = {}; + for (let key in this.downstreamHeaderTransform) { + if (this.downstreamHeaderTransform.hasOwnProperty(key)) + (data["downstreamHeaderTransform"])[key] = (this.downstreamHeaderTransform)[key]; + } + } + if (this.addClaimsToRequest) { + data["addClaimsToRequest"] = {}; + for (let key in this.addClaimsToRequest) { + if (this.addClaimsToRequest.hasOwnProperty(key)) + (data["addClaimsToRequest"])[key] = (this.addClaimsToRequest)[key]; + } + } + if (this.routeClaimsRequirement) { + data["routeClaimsRequirement"] = {}; + for (let key in this.routeClaimsRequirement) { + if (this.routeClaimsRequirement.hasOwnProperty(key)) + (data["routeClaimsRequirement"])[key] = (this.routeClaimsRequirement)[key]; + } + } + if (this.addQueriesToRequest) { + data["addQueriesToRequest"] = {}; + for (let key in this.addQueriesToRequest) { + if (this.addQueriesToRequest.hasOwnProperty(key)) + (data["addQueriesToRequest"])[key] = (this.addQueriesToRequest)[key]; + } + } + if (this.changeDownstreamPathTemplate) { + data["changeDownstreamPathTemplate"] = {}; + for (let key in this.changeDownstreamPathTemplate) { + if (this.changeDownstreamPathTemplate.hasOwnProperty(key)) + (data["changeDownstreamPathTemplate"])[key] = (this.changeDownstreamPathTemplate)[key]; + } + } + data["requestIdKey"] = this.requestIdKey; + data["fileCacheOptions"] = this.fileCacheOptions ? this.fileCacheOptions.toJSON() : undefined; + data["routeIsCaseSensitive"] = this.routeIsCaseSensitive; + data["serviceName"] = this.serviceName; + data["serviceNamespace"] = this.serviceNamespace; + data["downstreamScheme"] = this.downstreamScheme; + data["qoSOptions"] = this.qoSOptions ? this.qoSOptions.toJSON() : undefined; + data["loadBalancerOptions"] = this.loadBalancerOptions ? this.loadBalancerOptions.toJSON() : undefined; + data["rateLimitOptions"] = this.rateLimitOptions ? this.rateLimitOptions.toJSON() : undefined; + data["authenticationOptions"] = this.authenticationOptions ? this.authenticationOptions.toJSON() : undefined; + data["httpHandlerOptions"] = this.httpHandlerOptions ? this.httpHandlerOptions.toJSON() : undefined; + if (Array.isArray(this.downstreamHostAndPorts)) { + data["downstreamHostAndPorts"] = []; + for (let item of this.downstreamHostAndPorts) + data["downstreamHostAndPorts"].push(item.toJSON()); + } + data["upstreamHost"] = this.upstreamHost; + data["key"] = this.key; + if (Array.isArray(this.delegatingHandlers)) { + data["delegatingHandlers"] = []; + for (let item of this.delegatingHandlers) + data["delegatingHandlers"].push(item); + } + data["priority"] = this.priority; + data["timeout"] = this.timeout; + data["dangerousAcceptAnyServerCertificateValidator"] = this.dangerousAcceptAnyServerCertificateValidator; + data["securityOptions"] = this.securityOptions ? this.securityOptions.toJSON() : undefined; + data["downstreamHttpVersion"] = this.downstreamHttpVersion; + return data; + } } export interface IFileRoute { - downstreamPathTemplate: string | undefined; - upstreamPathTemplate: string | undefined; - upstreamHttpMethod: string[] | undefined; - downstreamHttpMethod: string | undefined; - addHeadersToRequest: { [key: string]: string } | undefined; - upstreamHeaderTransform: { [key: string]: string } | undefined; - downstreamHeaderTransform: { [key: string]: string } | undefined; - addClaimsToRequest: { [key: string]: string } | undefined; - routeClaimsRequirement: { [key: string]: string } | undefined; - addQueriesToRequest: { [key: string]: string } | undefined; - changeDownstreamPathTemplate: { [key: string]: string } | undefined; - requestIdKey: string | undefined; - fileCacheOptions: FileCacheOptions; - routeIsCaseSensitive: boolean; - serviceName: string | undefined; - serviceNamespace: string | undefined; - downstreamScheme: string | undefined; - qoSOptions: FileQoSOptions; - loadBalancerOptions: FileLoadBalancerOptions; - rateLimitOptions: FileRateLimitRule; - authenticationOptions: FileAuthenticationOptions; - httpHandlerOptions: FileHttpHandlerOptions; - downstreamHostAndPorts: FileHostAndPort[] | undefined; - upstreamHost: string | undefined; - key: string | undefined; - delegatingHandlers: string[] | undefined; - priority: number; - timeout: number; - dangerousAcceptAnyServerCertificateValidator: boolean; - securityOptions: FileSecurityOptions; - downstreamHttpVersion: string | undefined; + downstreamPathTemplate: string | undefined; + upstreamPathTemplate: string | undefined; + upstreamHttpMethod: string[] | undefined; + downstreamHttpMethod: string | undefined; + addHeadersToRequest: { [key: string]: string; } | undefined; + upstreamHeaderTransform: { [key: string]: string; } | undefined; + downstreamHeaderTransform: { [key: string]: string; } | undefined; + addClaimsToRequest: { [key: string]: string; } | undefined; + routeClaimsRequirement: { [key: string]: string; } | undefined; + addQueriesToRequest: { [key: string]: string; } | undefined; + changeDownstreamPathTemplate: { [key: string]: string; } | undefined; + requestIdKey: string | undefined; + fileCacheOptions: FileCacheOptions; + routeIsCaseSensitive: boolean; + serviceName: string | undefined; + serviceNamespace: string | undefined; + downstreamScheme: string | undefined; + qoSOptions: FileQoSOptions; + loadBalancerOptions: FileLoadBalancerOptions; + rateLimitOptions: FileRateLimitRule; + authenticationOptions: FileAuthenticationOptions; + httpHandlerOptions: FileHttpHandlerOptions; + downstreamHostAndPorts: FileHostAndPort[] | undefined; + upstreamHost: string | undefined; + key: string | undefined; + delegatingHandlers: string[] | undefined; + priority: number; + timeout: number; + dangerousAcceptAnyServerCertificateValidator: boolean; + securityOptions: FileSecurityOptions; + downstreamHttpVersion: string | undefined; } export class FileSecurityOptions implements IFileSecurityOptions { - ipAllowedList!: string[] | undefined; - ipBlockedList!: string[] | undefined; - - constructor(data?: IFileSecurityOptions) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['ipAllowedList'])) { - this.ipAllowedList = [] as any; - for (let item of _data['ipAllowedList']) this.ipAllowedList!.push(item); - } - if (Array.isArray(_data['ipBlockedList'])) { - this.ipBlockedList = [] as any; - for (let item of _data['ipBlockedList']) this.ipBlockedList!.push(item); - } - } - } - - static fromJS(data: any): FileSecurityOptions { - data = typeof data === 'object' ? data : {}; - let result = new FileSecurityOptions(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.ipAllowedList)) { - data['ipAllowedList'] = []; - for (let item of this.ipAllowedList) data['ipAllowedList'].push(item); - } - if (Array.isArray(this.ipBlockedList)) { - data['ipBlockedList'] = []; - for (let item of this.ipBlockedList) data['ipBlockedList'].push(item); - } - return data; - } + ipAllowedList!: string[] | undefined; + ipBlockedList!: string[] | undefined; + + constructor(data?: IFileSecurityOptions) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["ipAllowedList"])) { + this.ipAllowedList = [] as any; + for (let item of _data["ipAllowedList"]) + this.ipAllowedList!.push(item); + } + if (Array.isArray(_data["ipBlockedList"])) { + this.ipBlockedList = [] as any; + for (let item of _data["ipBlockedList"]) + this.ipBlockedList!.push(item); + } + } + } + + static fromJS(data: any): FileSecurityOptions { + data = typeof data === 'object' ? data : {}; + let result = new FileSecurityOptions(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.ipAllowedList)) { + data["ipAllowedList"] = []; + for (let item of this.ipAllowedList) + data["ipAllowedList"].push(item); + } + if (Array.isArray(this.ipBlockedList)) { + data["ipBlockedList"] = []; + for (let item of this.ipBlockedList) + data["ipBlockedList"].push(item); + } + return data; + } } export interface IFileSecurityOptions { - ipAllowedList: string[] | undefined; - ipBlockedList: string[] | undefined; + ipAllowedList: string[] | undefined; + ipBlockedList: string[] | undefined; } export class FileServiceDiscoveryProvider implements IFileServiceDiscoveryProvider { - scheme!: string | undefined; - host!: string | undefined; - port!: number; - type!: string | undefined; - token!: string | undefined; - configurationKey!: string | undefined; - pollingInterval!: number; - namespace!: string | undefined; - - constructor(data?: IFileServiceDiscoveryProvider) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.scheme = _data['scheme']; - this.host = _data['host']; - this.port = _data['port']; - this.type = _data['type']; - this.token = _data['token']; - this.configurationKey = _data['configurationKey']; - this.pollingInterval = _data['pollingInterval']; - this.namespace = _data['namespace']; - } - } - - static fromJS(data: any): FileServiceDiscoveryProvider { - data = typeof data === 'object' ? data : {}; - let result = new FileServiceDiscoveryProvider(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['scheme'] = this.scheme; - data['host'] = this.host; - data['port'] = this.port; - data['type'] = this.type; - data['token'] = this.token; - data['configurationKey'] = this.configurationKey; - data['pollingInterval'] = this.pollingInterval; - data['namespace'] = this.namespace; - return data; - } + scheme!: string | undefined; + host!: string | undefined; + port!: number; + type!: string | undefined; + token!: string | undefined; + configurationKey!: string | undefined; + pollingInterval!: number; + namespace!: string | undefined; + + constructor(data?: IFileServiceDiscoveryProvider) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.scheme = _data["scheme"]; + this.host = _data["host"]; + this.port = _data["port"]; + this.type = _data["type"]; + this.token = _data["token"]; + this.configurationKey = _data["configurationKey"]; + this.pollingInterval = _data["pollingInterval"]; + this.namespace = _data["namespace"]; + } + } + + static fromJS(data: any): FileServiceDiscoveryProvider { + data = typeof data === 'object' ? data : {}; + let result = new FileServiceDiscoveryProvider(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["scheme"] = this.scheme; + data["host"] = this.host; + data["port"] = this.port; + data["type"] = this.type; + data["token"] = this.token; + data["configurationKey"] = this.configurationKey; + data["pollingInterval"] = this.pollingInterval; + data["namespace"] = this.namespace; + return data; + } } export interface IFileServiceDiscoveryProvider { - scheme: string | undefined; - host: string | undefined; - port: number; - type: string | undefined; - token: string | undefined; - configurationKey: string | undefined; - pollingInterval: number; - namespace: string | undefined; + scheme: string | undefined; + host: string | undefined; + port: number; + type: string | undefined; + token: string | undefined; + configurationKey: string | undefined; + pollingInterval: number; + namespace: string | undefined; } export class FindTenantByNameInput implements IFindTenantByNameInput { - name!: string | undefined; - - constructor(data?: IFindTenantByNameInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + name!: string | undefined; + + constructor(data?: IFindTenantByNameInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.name = _data['name']; + init(_data?: any) { + if (_data) { + this.name = _data["name"]; + } } - } - static fromJS(data: any): FindTenantByNameInput { - data = typeof data === 'object' ? data : {}; - let result = new FindTenantByNameInput(); - result.init(data); - return result; - } + static fromJS(data: any): FindTenantByNameInput { + data = typeof data === 'object' ? data : {}; + let result = new FindTenantByNameInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['name'] = this.name; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + return data; + } } export interface IFindTenantByNameInput { - name: string | undefined; + name: string | undefined; } export class FindTenantResultDto implements IFindTenantResultDto { - success!: boolean; - tenantId!: string | undefined; - name!: string | undefined; - isActive!: boolean; - - constructor(data?: IFindTenantResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.success = _data['success']; - this.tenantId = _data['tenantId']; - this.name = _data['name']; - this.isActive = _data['isActive']; - } - } - - static fromJS(data: any): FindTenantResultDto { - data = typeof data === 'object' ? data : {}; - let result = new FindTenantResultDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['success'] = this.success; - data['tenantId'] = this.tenantId; - data['name'] = this.name; - data['isActive'] = this.isActive; - return data; - } + success!: boolean; + tenantId!: string | undefined; + name!: string | undefined; + isActive!: boolean; + + constructor(data?: IFindTenantResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.success = _data["success"]; + this.tenantId = _data["tenantId"]; + this.name = _data["name"]; + this.isActive = _data["isActive"]; + } + } + + static fromJS(data: any): FindTenantResultDto { + data = typeof data === 'object' ? data : {}; + let result = new FindTenantResultDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["success"] = this.success; + data["tenantId"] = this.tenantId; + data["name"] = this.name; + data["isActive"] = this.isActive; + return data; + } } export interface IFindTenantResultDto { - success: boolean; - tenantId: string | undefined; - name: string | undefined; - isActive: boolean; + success: boolean; + tenantId: string | undefined; + name: string | undefined; + isActive: boolean; } export class GetOrganizationUnitRoleInput implements IGetOrganizationUnitRoleInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - organizationUnitId!: string; - - constructor(data?: IGetOrganizationUnitRoleInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.organizationUnitId = _data['organizationUnitId']; - } - } - - static fromJS(data: any): GetOrganizationUnitRoleInput { - data = typeof data === 'object' ? data : {}; - let result = new GetOrganizationUnitRoleInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['organizationUnitId'] = this.organizationUnitId; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + organizationUnitId!: string; + + constructor(data?: IGetOrganizationUnitRoleInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.organizationUnitId = _data["organizationUnitId"]; + } + } + + static fromJS(data: any): GetOrganizationUnitRoleInput { + data = typeof data === 'object' ? data : {}; + let result = new GetOrganizationUnitRoleInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["organizationUnitId"] = this.organizationUnitId; + return data; + } } export interface IGetOrganizationUnitRoleInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - organizationUnitId: string; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + organizationUnitId: string; } export class GetOrganizationUnitRoleOutput implements IGetOrganizationUnitRoleOutput { - id!: string; - name!: string | undefined; - - constructor(data?: IGetOrganizationUnitRoleOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + id!: string; + name!: string | undefined; + + constructor(data?: IGetOrganizationUnitRoleOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.name = _data['name']; + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.name = _data["name"]; + } } - } - static fromJS(data: any): GetOrganizationUnitRoleOutput { - data = typeof data === 'object' ? data : {}; - let result = new GetOrganizationUnitRoleOutput(); - result.init(data); - return result; - } + static fromJS(data: any): GetOrganizationUnitRoleOutput { + data = typeof data === 'object' ? data : {}; + let result = new GetOrganizationUnitRoleOutput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['name'] = this.name; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["name"] = this.name; + return data; + } } export interface IGetOrganizationUnitRoleOutput { - id: string; - name: string | undefined; + id: string; + name: string | undefined; +} + +export class GetOrganizationUnitRoleOutputPagedResultDto implements IGetOrganizationUnitRoleOutputPagedResultDto { + items!: GetOrganizationUnitRoleOutput[] | undefined; + totalCount!: number; + + constructor(data?: IGetOrganizationUnitRoleOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(GetOrganizationUnitRoleOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } + } + + static fromJS(data: any): GetOrganizationUnitRoleOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new GetOrganizationUnitRoleOutputPagedResultDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; + } +} + +export interface IGetOrganizationUnitRoleOutputPagedResultDto { + items: GetOrganizationUnitRoleOutput[] | undefined; + totalCount: number; +} + +export class GetOrganizationUnitUserInput implements IGetOrganizationUnitUserInput { + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + organizationUnitId!: string; + filter!: string | undefined; + + constructor(data?: IGetOrganizationUnitUserInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.organizationUnitId = _data["organizationUnitId"]; + this.filter = _data["filter"]; + } + } + + static fromJS(data: any): GetOrganizationUnitUserInput { + data = typeof data === 'object' ? data : {}; + let result = new GetOrganizationUnitUserInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["organizationUnitId"] = this.organizationUnitId; + data["filter"] = this.filter; + return data; + } +} + +export interface IGetOrganizationUnitUserInput { + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + organizationUnitId: string; + filter: string | undefined; } -export class GetOrganizationUnitRoleOutputPagedResultDto - implements IGetOrganizationUnitRoleOutputPagedResultDto -{ - items!: GetOrganizationUnitRoleOutput[] | undefined; - totalCount!: number; +export class GetOrganizationUnitUserOutput implements IGetOrganizationUnitUserOutput { + id!: string; + userName!: string | undefined; + email!: string | undefined; + + constructor(data?: IGetOrganizationUnitUserOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } - constructor(data?: IGetOrganizationUnitRoleOutputPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.userName = _data["userName"]; + this.email = _data["email"]; + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) - this.items!.push(GetOrganizationUnitRoleOutput.fromJS(item)); - } - this.totalCount = _data['totalCount']; + static fromJS(data: any): GetOrganizationUnitUserOutput { + data = typeof data === 'object' ? data : {}; + let result = new GetOrganizationUnitUserOutput(); + result.init(data); + return result; } - } - static fromJS(data: any): GetOrganizationUnitRoleOutputPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new GetOrganizationUnitRoleOutputPagedResultDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["userName"] = this.userName; + data["email"] = this.email; + return data; } - data['totalCount'] = this.totalCount; - return data; - } } -export interface IGetOrganizationUnitRoleOutputPagedResultDto { - items: GetOrganizationUnitRoleOutput[] | undefined; - totalCount: number; +export interface IGetOrganizationUnitUserOutput { + id: string; + userName: string | undefined; + email: string | undefined; } -export class GetOrganizationUnitUserInput implements IGetOrganizationUnitUserInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - organizationUnitId!: string; - filter!: string | undefined; - - constructor(data?: IGetOrganizationUnitUserInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.organizationUnitId = _data['organizationUnitId']; - this.filter = _data['filter']; - } - } - - static fromJS(data: any): GetOrganizationUnitUserInput { - data = typeof data === 'object' ? data : {}; - let result = new GetOrganizationUnitUserInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['organizationUnitId'] = this.organizationUnitId; - data['filter'] = this.filter; - return data; - } -} +export class GetOrganizationUnitUserOutputPagedResultDto implements IGetOrganizationUnitUserOutputPagedResultDto { + items!: GetOrganizationUnitUserOutput[] | undefined; + totalCount!: number; -export interface IGetOrganizationUnitUserInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - organizationUnitId: string; - filter: string | undefined; -} + constructor(data?: IGetOrganizationUnitUserOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } -export class GetOrganizationUnitUserOutput implements IGetOrganizationUnitUserOutput { - id!: string; - userName!: string | undefined; - email!: string | undefined; - - constructor(data?: IGetOrganizationUnitUserOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.userName = _data['userName']; - this.email = _data['email']; - } - } - - static fromJS(data: any): GetOrganizationUnitUserOutput { - data = typeof data === 'object' ? data : {}; - let result = new GetOrganizationUnitUserOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['userName'] = this.userName; - data['email'] = this.email; - return data; - } -} + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(GetOrganizationUnitUserOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } + } -export interface IGetOrganizationUnitUserOutput { - id: string; - userName: string | undefined; - email: string | undefined; -} - -export class GetOrganizationUnitUserOutputPagedResultDto - implements IGetOrganizationUnitUserOutputPagedResultDto -{ - items!: GetOrganizationUnitUserOutput[] | undefined; - totalCount!: number; - - constructor(data?: IGetOrganizationUnitUserOutputPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) - this.items!.push(GetOrganizationUnitUserOutput.fromJS(item)); - } - this.totalCount = _data['totalCount']; - } - } - - static fromJS(data: any): GetOrganizationUnitUserOutputPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new GetOrganizationUnitUserOutputPagedResultDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); - } - data['totalCount'] = this.totalCount; - return data; - } + static fromJS(data: any): GetOrganizationUnitUserOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new GetOrganizationUnitUserOutputPagedResultDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; + } } export interface IGetOrganizationUnitUserOutputPagedResultDto { - items: GetOrganizationUnitUserOutput[] | undefined; - totalCount: number; + items: GetOrganizationUnitUserOutput[] | undefined; + totalCount: number; } export class GetPermissionInput implements IGetPermissionInput { - providerName!: string | undefined; - providerKey!: string | undefined; - - constructor(data?: IGetPermissionInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + providerName!: string | undefined; + providerKey!: string | undefined; + + constructor(data?: IGetPermissionInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.providerName = _data['providerName']; - this.providerKey = _data['providerKey']; + init(_data?: any) { + if (_data) { + this.providerName = _data["providerName"]; + this.providerKey = _data["providerKey"]; + } } - } - static fromJS(data: any): GetPermissionInput { - data = typeof data === 'object' ? data : {}; - let result = new GetPermissionInput(); - result.init(data); - return result; - } + static fromJS(data: any): GetPermissionInput { + data = typeof data === 'object' ? data : {}; + let result = new GetPermissionInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['providerName'] = this.providerName; - data['providerKey'] = this.providerKey; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["providerName"] = this.providerName; + data["providerKey"] = this.providerKey; + return data; + } } export interface IGetPermissionInput { - providerName: string | undefined; - providerKey: string | undefined; + providerName: string | undefined; + providerKey: string | undefined; } export class GetUnAddRoleInput implements IGetUnAddRoleInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - organizationUnitId!: string; - filter!: string | undefined; - - constructor(data?: IGetUnAddRoleInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.organizationUnitId = _data['organizationUnitId']; - this.filter = _data['filter']; - } - } - - static fromJS(data: any): GetUnAddRoleInput { - data = typeof data === 'object' ? data : {}; - let result = new GetUnAddRoleInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['organizationUnitId'] = this.organizationUnitId; - data['filter'] = this.filter; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + organizationUnitId!: string; + filter!: string | undefined; + + constructor(data?: IGetUnAddRoleInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.organizationUnitId = _data["organizationUnitId"]; + this.filter = _data["filter"]; + } + } + + static fromJS(data: any): GetUnAddRoleInput { + data = typeof data === 'object' ? data : {}; + let result = new GetUnAddRoleInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["organizationUnitId"] = this.organizationUnitId; + data["filter"] = this.filter; + return data; + } } export interface IGetUnAddRoleInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - organizationUnitId: string; - filter: string | undefined; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + organizationUnitId: string; + filter: string | undefined; } export class GetUnAddRoleOutput implements IGetUnAddRoleOutput { - id!: string; - name!: string | undefined; - - constructor(data?: IGetUnAddRoleOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + id!: string; + name!: string | undefined; + + constructor(data?: IGetUnAddRoleOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.name = _data['name']; + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.name = _data["name"]; + } } - } - static fromJS(data: any): GetUnAddRoleOutput { - data = typeof data === 'object' ? data : {}; - let result = new GetUnAddRoleOutput(); - result.init(data); - return result; - } + static fromJS(data: any): GetUnAddRoleOutput { + data = typeof data === 'object' ? data : {}; + let result = new GetUnAddRoleOutput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['name'] = this.name; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["name"] = this.name; + return data; + } } export interface IGetUnAddRoleOutput { - id: string; - name: string | undefined; + id: string; + name: string | undefined; } export class GetUnAddRoleOutputPagedResultDto implements IGetUnAddRoleOutputPagedResultDto { - items!: GetUnAddRoleOutput[] | undefined; - totalCount!: number; - - constructor(data?: IGetUnAddRoleOutputPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + items!: GetUnAddRoleOutput[] | undefined; + totalCount!: number; + + constructor(data?: IGetUnAddRoleOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) this.items!.push(GetUnAddRoleOutput.fromJS(item)); - } - this.totalCount = _data['totalCount']; + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(GetUnAddRoleOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } } - } - static fromJS(data: any): GetUnAddRoleOutputPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new GetUnAddRoleOutputPagedResultDto(); - result.init(data); - return result; - } + static fromJS(data: any): GetUnAddRoleOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new GetUnAddRoleOutputPagedResultDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; } - data['totalCount'] = this.totalCount; - return data; - } } export interface IGetUnAddRoleOutputPagedResultDto { - items: GetUnAddRoleOutput[] | undefined; - totalCount: number; + items: GetUnAddRoleOutput[] | undefined; + totalCount: number; } export class GetUnAddUserInput implements IGetUnAddUserInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - organizationUnitId!: string; - filter!: string | undefined; - - constructor(data?: IGetUnAddUserInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.organizationUnitId = _data['organizationUnitId']; - this.filter = _data['filter']; - } - } - - static fromJS(data: any): GetUnAddUserInput { - data = typeof data === 'object' ? data : {}; - let result = new GetUnAddUserInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['organizationUnitId'] = this.organizationUnitId; - data['filter'] = this.filter; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + organizationUnitId!: string; + filter!: string | undefined; + + constructor(data?: IGetUnAddUserInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.organizationUnitId = _data["organizationUnitId"]; + this.filter = _data["filter"]; + } + } + + static fromJS(data: any): GetUnAddUserInput { + data = typeof data === 'object' ? data : {}; + let result = new GetUnAddUserInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["organizationUnitId"] = this.organizationUnitId; + data["filter"] = this.filter; + return data; + } } export interface IGetUnAddUserInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - organizationUnitId: string; - filter: string | undefined; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + organizationUnitId: string; + filter: string | undefined; } export class GetUnAddUserOutput implements IGetUnAddUserOutput { - id!: string; - userName!: string | undefined; - email!: string | undefined; - - constructor(data?: IGetUnAddUserOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.userName = _data['userName']; - this.email = _data['email']; - } - } - - static fromJS(data: any): GetUnAddUserOutput { - data = typeof data === 'object' ? data : {}; - let result = new GetUnAddUserOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['userName'] = this.userName; - data['email'] = this.email; - return data; - } + id!: string; + userName!: string | undefined; + email!: string | undefined; + + constructor(data?: IGetUnAddUserOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.userName = _data["userName"]; + this.email = _data["email"]; + } + } + + static fromJS(data: any): GetUnAddUserOutput { + data = typeof data === 'object' ? data : {}; + let result = new GetUnAddUserOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["userName"] = this.userName; + data["email"] = this.email; + return data; + } } export interface IGetUnAddUserOutput { - id: string; - userName: string | undefined; - email: string | undefined; + id: string; + userName: string | undefined; + email: string | undefined; } export class GetUnAddUserOutputPagedResultDto implements IGetUnAddUserOutputPagedResultDto { - items!: GetUnAddUserOutput[] | undefined; - totalCount!: number; - - constructor(data?: IGetUnAddUserOutputPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + items!: GetUnAddUserOutput[] | undefined; + totalCount!: number; + + constructor(data?: IGetUnAddUserOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) this.items!.push(GetUnAddUserOutput.fromJS(item)); - } - this.totalCount = _data['totalCount']; + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(GetUnAddUserOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } } - } - static fromJS(data: any): GetUnAddUserOutputPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new GetUnAddUserOutputPagedResultDto(); - result.init(data); - return result; - } + static fromJS(data: any): GetUnAddUserOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new GetUnAddUserOutputPagedResultDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; } - data['totalCount'] = this.totalCount; - return data; - } } export interface IGetUnAddUserOutputPagedResultDto { - items: GetUnAddUserOutput[] | undefined; - totalCount: number; + items: GetUnAddUserOutput[] | undefined; + totalCount: number; } export enum HttpStatusCode { - Continue = 100, - SwitchingProtocols = 101, - Processing = 102, - EarlyHints = 103, - OK = 200, - Created = 201, - Accepted = 202, - NonAuthoritativeInformation = 203, - NoContent = 204, - ResetContent = 205, - PartialContent = 206, - MultiStatus = 207, - AlreadyReported = 208, - IMUsed = 226, - MultipleChoices = 300, - Ambiguous = 301, - MovedPermanently = 302, - Moved = 303, - Found = 304, - Redirect = 305, - SeeOther = 306, - RedirectMethod = 307, - NotModified = 308, - UseProxy = 400, - Unused = 401, - TemporaryRedirect = 402, - RedirectKeepVerb = 403, - PermanentRedirect = 404, - BadRequest = 405, - Unauthorized = 406, - PaymentRequired = 407, - Forbidden = 408, - NotFound = 409, - MethodNotAllowed = 410, - NotAcceptable = 411, - ProxyAuthenticationRequired = 412, - RequestTimeout = 413, - Conflict = 414, - Gone = 415, - LengthRequired = 416, - PreconditionFailed = 417, - RequestEntityTooLarge = 421, - RequestUriTooLong = 422, - UnsupportedMediaType = 423, - RequestedRangeNotSatisfiable = 424, - ExpectationFailed = 426, - MisdirectedRequest = 428, - UnprocessableEntity = 429, - Locked = 431, - FailedDependency = 451, - UpgradeRequired = 500, - PreconditionRequired = 501, - TooManyRequests = 502, - RequestHeaderFieldsTooLarge = 503, - UnavailableForLegalReasons = 504, - InternalServerError = 505, - NotImplemented = 506, - BadGateway = 507, - ServiceUnavailable = 508, - GatewayTimeout = 510, - HttpVersionNotSupported = 511, + Continue = 100, + SwitchingProtocols = 101, + Processing = 102, + EarlyHints = 103, + OK = 200, + Created = 201, + Accepted = 202, + NonAuthoritativeInformation = 203, + NoContent = 204, + ResetContent = 205, + PartialContent = 206, + MultiStatus = 207, + AlreadyReported = 208, + IMUsed = 226, + MultipleChoices = 300, + Ambiguous = 301, + MovedPermanently = 302, + Moved = 303, + Found = 304, + Redirect = 305, + SeeOther = 306, + RedirectMethod = 307, + NotModified = 308, + UseProxy = 400, + Unused = 401, + TemporaryRedirect = 402, + RedirectKeepVerb = 403, + PermanentRedirect = 404, + BadRequest = 405, + Unauthorized = 406, + PaymentRequired = 407, + Forbidden = 408, + NotFound = 409, + MethodNotAllowed = 410, + NotAcceptable = 411, + ProxyAuthenticationRequired = 412, + RequestTimeout = 413, + Conflict = 414, + Gone = 415, + LengthRequired = 416, + PreconditionFailed = 417, + RequestEntityTooLarge = 421, + RequestUriTooLong = 422, + UnsupportedMediaType = 423, + RequestedRangeNotSatisfiable = 424, + ExpectationFailed = 426, + MisdirectedRequest = 428, + UnprocessableEntity = 429, + Locked = 431, + FailedDependency = 451, + UpgradeRequired = 500, + PreconditionRequired = 501, + TooManyRequests = 502, + RequestHeaderFieldsTooLarge = 503, + UnavailableForLegalReasons = 504, + InternalServerError = 505, + NotImplemented = 506, + BadGateway = 507, + ServiceUnavailable = 508, + GatewayTimeout = 510, + HttpVersionNotSupported = 511, } export class IanaTimeZone implements IIanaTimeZone { - timeZoneName!: string | undefined; - - constructor(data?: IIanaTimeZone) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + timeZoneName!: string | undefined; + + constructor(data?: IIanaTimeZone) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.timeZoneName = _data['timeZoneName']; + init(_data?: any) { + if (_data) { + this.timeZoneName = _data["timeZoneName"]; + } } - } - static fromJS(data: any): IanaTimeZone { - data = typeof data === 'object' ? data : {}; - let result = new IanaTimeZone(); - result.init(data); - return result; - } + static fromJS(data: any): IanaTimeZone { + data = typeof data === 'object' ? data : {}; + let result = new IanaTimeZone(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['timeZoneName'] = this.timeZoneName; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["timeZoneName"] = this.timeZoneName; + return data; + } } export interface IIanaTimeZone { - timeZoneName: string | undefined; + timeZoneName: string | undefined; } export class IdInput implements IIdInput { - id!: string; - - constructor(data?: IIdInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + id!: string; + + constructor(data?: IIdInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.id = _data['id']; + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + } } - } - static fromJS(data: any): IdInput { - data = typeof data === 'object' ? data : {}; - let result = new IdInput(); - result.init(data); - return result; - } + static fromJS(data: any): IdInput { + data = typeof data === 'object' ? data : {}; + let result = new IdInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + return data; + } } export interface IIdInput { - id: string; + id: string; } export class IdentityRoleCreateDto implements IIdentityRoleCreateDto { - readonly extraProperties!: { [key: string]: any } | undefined; - name!: string; - isDefault!: boolean; - isPublic!: boolean; - - constructor(data?: IIdentityRoleCreateDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['extraProperties']) { - (this).extraProperties = {} as any; - for (let key in _data['extraProperties']) { - if (_data['extraProperties'].hasOwnProperty(key)) - ((this).extraProperties)![key] = _data['extraProperties'][key]; - } - } - this.name = _data['name']; - this.isDefault = _data['isDefault']; - this.isPublic = _data['isPublic']; - } - } - - static fromJS(data: any): IdentityRoleCreateDto { - data = typeof data === 'object' ? data : {}; - let result = new IdentityRoleCreateDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.extraProperties) { - data['extraProperties'] = {}; - for (let key in this.extraProperties) { - if (this.extraProperties.hasOwnProperty(key)) - (data['extraProperties'])[key] = (this.extraProperties)[key]; - } - } - data['name'] = this.name; - data['isDefault'] = this.isDefault; - data['isPublic'] = this.isPublic; - return data; - } + readonly extraProperties!: { [key: string]: any; } | undefined; + name!: string; + isDefault!: boolean; + isPublic!: boolean; + + constructor(data?: IIdentityRoleCreateDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["extraProperties"]) { + (this).extraProperties = {} as any; + for (let key in _data["extraProperties"]) { + if (_data["extraProperties"].hasOwnProperty(key)) + ((this).extraProperties)![key] = _data["extraProperties"][key]; + } + } + this.name = _data["name"]; + this.isDefault = _data["isDefault"]; + this.isPublic = _data["isPublic"]; + } + } + + static fromJS(data: any): IdentityRoleCreateDto { + data = typeof data === 'object' ? data : {}; + let result = new IdentityRoleCreateDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.extraProperties) { + data["extraProperties"] = {}; + for (let key in this.extraProperties) { + if (this.extraProperties.hasOwnProperty(key)) + (data["extraProperties"])[key] = (this.extraProperties)[key]; + } + } + data["name"] = this.name; + data["isDefault"] = this.isDefault; + data["isPublic"] = this.isPublic; + return data; + } } export interface IIdentityRoleCreateDto { - extraProperties: { [key: string]: any } | undefined; - name: string; - isDefault: boolean; - isPublic: boolean; + extraProperties: { [key: string]: any; } | undefined; + name: string; + isDefault: boolean; + isPublic: boolean; } export class IdentityRoleDto implements IIdentityRoleDto { - readonly extraProperties!: { [key: string]: any } | undefined; - id!: string; - name!: string | undefined; - isDefault!: boolean; - isStatic!: boolean; - isPublic!: boolean; - concurrencyStamp!: string | undefined; - - constructor(data?: IIdentityRoleDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['extraProperties']) { - (this).extraProperties = {} as any; - for (let key in _data['extraProperties']) { - if (_data['extraProperties'].hasOwnProperty(key)) - ((this).extraProperties)![key] = _data['extraProperties'][key]; - } - } - this.id = _data['id']; - this.name = _data['name']; - this.isDefault = _data['isDefault']; - this.isStatic = _data['isStatic']; - this.isPublic = _data['isPublic']; - this.concurrencyStamp = _data['concurrencyStamp']; - } - } - - static fromJS(data: any): IdentityRoleDto { - data = typeof data === 'object' ? data : {}; - let result = new IdentityRoleDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.extraProperties) { - data['extraProperties'] = {}; - for (let key in this.extraProperties) { - if (this.extraProperties.hasOwnProperty(key)) - (data['extraProperties'])[key] = (this.extraProperties)[key]; - } - } - data['id'] = this.id; - data['name'] = this.name; - data['isDefault'] = this.isDefault; - data['isStatic'] = this.isStatic; - data['isPublic'] = this.isPublic; - data['concurrencyStamp'] = this.concurrencyStamp; - return data; - } + readonly extraProperties!: { [key: string]: any; } | undefined; + id!: string; + name!: string | undefined; + isDefault!: boolean; + isStatic!: boolean; + isPublic!: boolean; + concurrencyStamp!: string | undefined; + + constructor(data?: IIdentityRoleDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["extraProperties"]) { + (this).extraProperties = {} as any; + for (let key in _data["extraProperties"]) { + if (_data["extraProperties"].hasOwnProperty(key)) + ((this).extraProperties)![key] = _data["extraProperties"][key]; + } + } + this.id = _data["id"]; + this.name = _data["name"]; + this.isDefault = _data["isDefault"]; + this.isStatic = _data["isStatic"]; + this.isPublic = _data["isPublic"]; + this.concurrencyStamp = _data["concurrencyStamp"]; + } + } + + static fromJS(data: any): IdentityRoleDto { + data = typeof data === 'object' ? data : {}; + let result = new IdentityRoleDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.extraProperties) { + data["extraProperties"] = {}; + for (let key in this.extraProperties) { + if (this.extraProperties.hasOwnProperty(key)) + (data["extraProperties"])[key] = (this.extraProperties)[key]; + } + } + data["id"] = this.id; + data["name"] = this.name; + data["isDefault"] = this.isDefault; + data["isStatic"] = this.isStatic; + data["isPublic"] = this.isPublic; + data["concurrencyStamp"] = this.concurrencyStamp; + return data; + } } export interface IIdentityRoleDto { - extraProperties: { [key: string]: any } | undefined; - id: string; - name: string | undefined; - isDefault: boolean; - isStatic: boolean; - isPublic: boolean; - concurrencyStamp: string | undefined; + extraProperties: { [key: string]: any; } | undefined; + id: string; + name: string | undefined; + isDefault: boolean; + isStatic: boolean; + isPublic: boolean; + concurrencyStamp: string | undefined; } export class IdentityRoleDtoListResultDto implements IIdentityRoleDtoListResultDto { - items!: IdentityRoleDto[] | undefined; - - constructor(data?: IIdentityRoleDtoListResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + items!: IdentityRoleDto[] | undefined; + + constructor(data?: IIdentityRoleDtoListResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) this.items!.push(IdentityRoleDto.fromJS(item)); - } + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(IdentityRoleDto.fromJS(item)); + } + } } - } - static fromJS(data: any): IdentityRoleDtoListResultDto { - data = typeof data === 'object' ? data : {}; - let result = new IdentityRoleDtoListResultDto(); - result.init(data); - return result; - } + static fromJS(data: any): IdentityRoleDtoListResultDto { + data = typeof data === 'object' ? data : {}; + let result = new IdentityRoleDtoListResultDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + return data; } - return data; - } } export interface IIdentityRoleDtoListResultDto { - items: IdentityRoleDto[] | undefined; + items: IdentityRoleDto[] | undefined; } export class IdentityRoleDtoPagedResultDto implements IIdentityRoleDtoPagedResultDto { - items!: IdentityRoleDto[] | undefined; - totalCount!: number; - - constructor(data?: IIdentityRoleDtoPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + items!: IdentityRoleDto[] | undefined; + totalCount!: number; + + constructor(data?: IIdentityRoleDtoPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) this.items!.push(IdentityRoleDto.fromJS(item)); - } - this.totalCount = _data['totalCount']; + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(IdentityRoleDto.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } } - } - static fromJS(data: any): IdentityRoleDtoPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new IdentityRoleDtoPagedResultDto(); - result.init(data); - return result; - } + static fromJS(data: any): IdentityRoleDtoPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new IdentityRoleDtoPagedResultDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; } - data['totalCount'] = this.totalCount; - return data; - } } export interface IIdentityRoleDtoPagedResultDto { - items: IdentityRoleDto[] | undefined; - totalCount: number; + items: IdentityRoleDto[] | undefined; + totalCount: number; } export class IdentityRoleUpdateDto implements IIdentityRoleUpdateDto { - readonly extraProperties!: { [key: string]: any } | undefined; - name!: string; - isDefault!: boolean; - isPublic!: boolean; - concurrencyStamp!: string | undefined; - - constructor(data?: IIdentityRoleUpdateDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['extraProperties']) { - (this).extraProperties = {} as any; - for (let key in _data['extraProperties']) { - if (_data['extraProperties'].hasOwnProperty(key)) - ((this).extraProperties)![key] = _data['extraProperties'][key]; - } - } - this.name = _data['name']; - this.isDefault = _data['isDefault']; - this.isPublic = _data['isPublic']; - this.concurrencyStamp = _data['concurrencyStamp']; - } - } - - static fromJS(data: any): IdentityRoleUpdateDto { - data = typeof data === 'object' ? data : {}; - let result = new IdentityRoleUpdateDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.extraProperties) { - data['extraProperties'] = {}; - for (let key in this.extraProperties) { - if (this.extraProperties.hasOwnProperty(key)) - (data['extraProperties'])[key] = (this.extraProperties)[key]; - } - } - data['name'] = this.name; - data['isDefault'] = this.isDefault; - data['isPublic'] = this.isPublic; - data['concurrencyStamp'] = this.concurrencyStamp; - return data; - } + readonly extraProperties!: { [key: string]: any; } | undefined; + name!: string; + isDefault!: boolean; + isPublic!: boolean; + concurrencyStamp!: string | undefined; + + constructor(data?: IIdentityRoleUpdateDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["extraProperties"]) { + (this).extraProperties = {} as any; + for (let key in _data["extraProperties"]) { + if (_data["extraProperties"].hasOwnProperty(key)) + ((this).extraProperties)![key] = _data["extraProperties"][key]; + } + } + this.name = _data["name"]; + this.isDefault = _data["isDefault"]; + this.isPublic = _data["isPublic"]; + this.concurrencyStamp = _data["concurrencyStamp"]; + } + } + + static fromJS(data: any): IdentityRoleUpdateDto { + data = typeof data === 'object' ? data : {}; + let result = new IdentityRoleUpdateDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.extraProperties) { + data["extraProperties"] = {}; + for (let key in this.extraProperties) { + if (this.extraProperties.hasOwnProperty(key)) + (data["extraProperties"])[key] = (this.extraProperties)[key]; + } + } + data["name"] = this.name; + data["isDefault"] = this.isDefault; + data["isPublic"] = this.isPublic; + data["concurrencyStamp"] = this.concurrencyStamp; + return data; + } } export interface IIdentityRoleUpdateDto { - extraProperties: { [key: string]: any } | undefined; - name: string; - isDefault: boolean; - isPublic: boolean; - concurrencyStamp: string | undefined; + extraProperties: { [key: string]: any; } | undefined; + name: string; + isDefault: boolean; + isPublic: boolean; + concurrencyStamp: string | undefined; } export class IdentityUserCreateDto implements IIdentityUserCreateDto { - readonly extraProperties!: { [key: string]: any } | undefined; - userName!: string; - name!: string | undefined; - surname!: string | undefined; - email!: string; - phoneNumber!: string | undefined; - isActive!: boolean; - lockoutEnabled!: boolean; - roleNames!: string[] | undefined; - password!: string; - - constructor(data?: IIdentityUserCreateDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['extraProperties']) { - (this).extraProperties = {} as any; - for (let key in _data['extraProperties']) { - if (_data['extraProperties'].hasOwnProperty(key)) - ((this).extraProperties)![key] = _data['extraProperties'][key]; - } - } - this.userName = _data['userName']; - this.name = _data['name']; - this.surname = _data['surname']; - this.email = _data['email']; - this.phoneNumber = _data['phoneNumber']; - this.isActive = _data['isActive']; - this.lockoutEnabled = _data['lockoutEnabled']; - if (Array.isArray(_data['roleNames'])) { - this.roleNames = [] as any; - for (let item of _data['roleNames']) this.roleNames!.push(item); - } - this.password = _data['password']; - } - } - - static fromJS(data: any): IdentityUserCreateDto { - data = typeof data === 'object' ? data : {}; - let result = new IdentityUserCreateDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.extraProperties) { - data['extraProperties'] = {}; - for (let key in this.extraProperties) { - if (this.extraProperties.hasOwnProperty(key)) - (data['extraProperties'])[key] = (this.extraProperties)[key]; - } - } - data['userName'] = this.userName; - data['name'] = this.name; - data['surname'] = this.surname; - data['email'] = this.email; - data['phoneNumber'] = this.phoneNumber; - data['isActive'] = this.isActive; - data['lockoutEnabled'] = this.lockoutEnabled; - if (Array.isArray(this.roleNames)) { - data['roleNames'] = []; - for (let item of this.roleNames) data['roleNames'].push(item); - } - data['password'] = this.password; - return data; - } + readonly extraProperties!: { [key: string]: any; } | undefined; + userName!: string; + name!: string | undefined; + surname!: string | undefined; + email!: string; + phoneNumber!: string | undefined; + isActive!: boolean; + lockoutEnabled!: boolean; + roleNames!: string[] | undefined; + password!: string; + + constructor(data?: IIdentityUserCreateDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["extraProperties"]) { + (this).extraProperties = {} as any; + for (let key in _data["extraProperties"]) { + if (_data["extraProperties"].hasOwnProperty(key)) + ((this).extraProperties)![key] = _data["extraProperties"][key]; + } + } + this.userName = _data["userName"]; + this.name = _data["name"]; + this.surname = _data["surname"]; + this.email = _data["email"]; + this.phoneNumber = _data["phoneNumber"]; + this.isActive = _data["isActive"]; + this.lockoutEnabled = _data["lockoutEnabled"]; + if (Array.isArray(_data["roleNames"])) { + this.roleNames = [] as any; + for (let item of _data["roleNames"]) + this.roleNames!.push(item); + } + this.password = _data["password"]; + } + } + + static fromJS(data: any): IdentityUserCreateDto { + data = typeof data === 'object' ? data : {}; + let result = new IdentityUserCreateDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.extraProperties) { + data["extraProperties"] = {}; + for (let key in this.extraProperties) { + if (this.extraProperties.hasOwnProperty(key)) + (data["extraProperties"])[key] = (this.extraProperties)[key]; + } + } + data["userName"] = this.userName; + data["name"] = this.name; + data["surname"] = this.surname; + data["email"] = this.email; + data["phoneNumber"] = this.phoneNumber; + data["isActive"] = this.isActive; + data["lockoutEnabled"] = this.lockoutEnabled; + if (Array.isArray(this.roleNames)) { + data["roleNames"] = []; + for (let item of this.roleNames) + data["roleNames"].push(item); + } + data["password"] = this.password; + return data; + } } export interface IIdentityUserCreateDto { - extraProperties: { [key: string]: any } | undefined; - userName: string; - name: string | undefined; - surname: string | undefined; - email: string; - phoneNumber: string | undefined; - isActive: boolean; - lockoutEnabled: boolean; - roleNames: string[] | undefined; - password: string; + extraProperties: { [key: string]: any; } | undefined; + userName: string; + name: string | undefined; + surname: string | undefined; + email: string; + phoneNumber: string | undefined; + isActive: boolean; + lockoutEnabled: boolean; + roleNames: string[] | undefined; + password: string; } export class IdentityUserDto implements IIdentityUserDto { - readonly extraProperties!: { [key: string]: any } | undefined; - id!: string; - creationTime!: dayjs.Dayjs; - creatorId!: string | undefined; - lastModificationTime!: dayjs.Dayjs | undefined; - lastModifierId!: string | undefined; - isDeleted!: boolean; - deleterId!: string | undefined; - deletionTime!: dayjs.Dayjs | undefined; - tenantId!: string | undefined; - userName!: string | undefined; - name!: string | undefined; - surname!: string | undefined; - email!: string | undefined; - emailConfirmed!: boolean; - phoneNumber!: string | undefined; - phoneNumberConfirmed!: boolean; - isActive!: boolean; - lockoutEnabled!: boolean; - lockoutEnd!: dayjs.Dayjs | undefined; - concurrencyStamp!: string | undefined; - entityVersion!: number; - - constructor(data?: IIdentityUserDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['extraProperties']) { - (this).extraProperties = {} as any; - for (let key in _data['extraProperties']) { - if (_data['extraProperties'].hasOwnProperty(key)) - ((this).extraProperties)![key] = _data['extraProperties'][key]; - } - } - this.id = _data['id']; - this.creationTime = _data['creationTime'] - ? dayjs(_data['creationTime'].toString()) - : undefined; - this.creatorId = _data['creatorId']; - this.lastModificationTime = _data['lastModificationTime'] - ? dayjs(_data['lastModificationTime'].toString()) - : undefined; - this.lastModifierId = _data['lastModifierId']; - this.isDeleted = _data['isDeleted']; - this.deleterId = _data['deleterId']; - this.deletionTime = _data['deletionTime'] - ? dayjs(_data['deletionTime'].toString()) - : undefined; - this.tenantId = _data['tenantId']; - this.userName = _data['userName']; - this.name = _data['name']; - this.surname = _data['surname']; - this.email = _data['email']; - this.emailConfirmed = _data['emailConfirmed']; - this.phoneNumber = _data['phoneNumber']; - this.phoneNumberConfirmed = _data['phoneNumberConfirmed']; - this.isActive = _data['isActive']; - this.lockoutEnabled = _data['lockoutEnabled']; - this.lockoutEnd = _data['lockoutEnd'] - ? dayjs(_data['lockoutEnd'].toString()) - : undefined; - this.concurrencyStamp = _data['concurrencyStamp']; - this.entityVersion = _data['entityVersion']; - } - } - - static fromJS(data: any): IdentityUserDto { - data = typeof data === 'object' ? data : {}; - let result = new IdentityUserDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.extraProperties) { - data['extraProperties'] = {}; - for (let key in this.extraProperties) { - if (this.extraProperties.hasOwnProperty(key)) - (data['extraProperties'])[key] = (this.extraProperties)[key]; - } - } - data['id'] = this.id; - data['creationTime'] = this.creationTime ? this.creationTime.toLocaleString() : undefined; - data['creatorId'] = this.creatorId; - data['lastModificationTime'] = this.lastModificationTime - ? this.lastModificationTime.toLocaleString() - : undefined; - data['lastModifierId'] = this.lastModifierId; - data['isDeleted'] = this.isDeleted; - data['deleterId'] = this.deleterId; - data['deletionTime'] = this.deletionTime ? this.deletionTime.toLocaleString() : undefined; - data['tenantId'] = this.tenantId; - data['userName'] = this.userName; - data['name'] = this.name; - data['surname'] = this.surname; - data['email'] = this.email; - data['emailConfirmed'] = this.emailConfirmed; - data['phoneNumber'] = this.phoneNumber; - data['phoneNumberConfirmed'] = this.phoneNumberConfirmed; - data['isActive'] = this.isActive; - data['lockoutEnabled'] = this.lockoutEnabled; - data['lockoutEnd'] = this.lockoutEnd ? this.lockoutEnd.toLocaleString() : undefined; - data['concurrencyStamp'] = this.concurrencyStamp; - data['entityVersion'] = this.entityVersion; - return data; - } + readonly extraProperties!: { [key: string]: any; } | undefined; + id!: string; + creationTime!: dayjs.Dayjs; + creatorId!: string | undefined; + lastModificationTime!: dayjs.Dayjs | undefined; + lastModifierId!: string | undefined; + isDeleted!: boolean; + deleterId!: string | undefined; + deletionTime!: dayjs.Dayjs | undefined; + tenantId!: string | undefined; + userName!: string | undefined; + name!: string | undefined; + surname!: string | undefined; + email!: string | undefined; + emailConfirmed!: boolean; + phoneNumber!: string | undefined; + phoneNumberConfirmed!: boolean; + isActive!: boolean; + lockoutEnabled!: boolean; + lockoutEnd!: dayjs.Dayjs | undefined; + concurrencyStamp!: string | undefined; + entityVersion!: number; + + constructor(data?: IIdentityUserDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["extraProperties"]) { + (this).extraProperties = {} as any; + for (let key in _data["extraProperties"]) { + if (_data["extraProperties"].hasOwnProperty(key)) + ((this).extraProperties)![key] = _data["extraProperties"][key]; + } + } + this.id = _data["id"]; + this.creationTime = _data["creationTime"] ? dayjs(_data["creationTime"].toString()) : undefined; + this.creatorId = _data["creatorId"]; + this.lastModificationTime = _data["lastModificationTime"] ? dayjs(_data["lastModificationTime"].toString()) : undefined; + this.lastModifierId = _data["lastModifierId"]; + this.isDeleted = _data["isDeleted"]; + this.deleterId = _data["deleterId"]; + this.deletionTime = _data["deletionTime"] ? dayjs(_data["deletionTime"].toString()) : undefined; + this.tenantId = _data["tenantId"]; + this.userName = _data["userName"]; + this.name = _data["name"]; + this.surname = _data["surname"]; + this.email = _data["email"]; + this.emailConfirmed = _data["emailConfirmed"]; + this.phoneNumber = _data["phoneNumber"]; + this.phoneNumberConfirmed = _data["phoneNumberConfirmed"]; + this.isActive = _data["isActive"]; + this.lockoutEnabled = _data["lockoutEnabled"]; + this.lockoutEnd = _data["lockoutEnd"] ? dayjs(_data["lockoutEnd"].toString()) : undefined; + this.concurrencyStamp = _data["concurrencyStamp"]; + this.entityVersion = _data["entityVersion"]; + } + } + + static fromJS(data: any): IdentityUserDto { + data = typeof data === 'object' ? data : {}; + let result = new IdentityUserDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.extraProperties) { + data["extraProperties"] = {}; + for (let key in this.extraProperties) { + if (this.extraProperties.hasOwnProperty(key)) + (data["extraProperties"])[key] = (this.extraProperties)[key]; + } + } + data["id"] = this.id; + data["creationTime"] = this.creationTime ? this.creationTime.toLocaleString() : undefined; + data["creatorId"] = this.creatorId; + data["lastModificationTime"] = this.lastModificationTime ? this.lastModificationTime.toLocaleString() : undefined; + data["lastModifierId"] = this.lastModifierId; + data["isDeleted"] = this.isDeleted; + data["deleterId"] = this.deleterId; + data["deletionTime"] = this.deletionTime ? this.deletionTime.toLocaleString() : undefined; + data["tenantId"] = this.tenantId; + data["userName"] = this.userName; + data["name"] = this.name; + data["surname"] = this.surname; + data["email"] = this.email; + data["emailConfirmed"] = this.emailConfirmed; + data["phoneNumber"] = this.phoneNumber; + data["phoneNumberConfirmed"] = this.phoneNumberConfirmed; + data["isActive"] = this.isActive; + data["lockoutEnabled"] = this.lockoutEnabled; + data["lockoutEnd"] = this.lockoutEnd ? this.lockoutEnd.toLocaleString() : undefined; + data["concurrencyStamp"] = this.concurrencyStamp; + data["entityVersion"] = this.entityVersion; + return data; + } } export interface IIdentityUserDto { - extraProperties: { [key: string]: any } | undefined; - id: string; - creationTime: dayjs.Dayjs; - creatorId: string | undefined; - lastModificationTime: dayjs.Dayjs | undefined; - lastModifierId: string | undefined; - isDeleted: boolean; - deleterId: string | undefined; - deletionTime: dayjs.Dayjs | undefined; - tenantId: string | undefined; - userName: string | undefined; - name: string | undefined; - surname: string | undefined; - email: string | undefined; - emailConfirmed: boolean; - phoneNumber: string | undefined; - phoneNumberConfirmed: boolean; - isActive: boolean; - lockoutEnabled: boolean; - lockoutEnd: dayjs.Dayjs | undefined; - concurrencyStamp: string | undefined; - entityVersion: number; + extraProperties: { [key: string]: any; } | undefined; + id: string; + creationTime: dayjs.Dayjs; + creatorId: string | undefined; + lastModificationTime: dayjs.Dayjs | undefined; + lastModifierId: string | undefined; + isDeleted: boolean; + deleterId: string | undefined; + deletionTime: dayjs.Dayjs | undefined; + tenantId: string | undefined; + userName: string | undefined; + name: string | undefined; + surname: string | undefined; + email: string | undefined; + emailConfirmed: boolean; + phoneNumber: string | undefined; + phoneNumberConfirmed: boolean; + isActive: boolean; + lockoutEnabled: boolean; + lockoutEnd: dayjs.Dayjs | undefined; + concurrencyStamp: string | undefined; + entityVersion: number; } export class IdentityUserDtoPagedResultDto implements IIdentityUserDtoPagedResultDto { - items!: IdentityUserDto[] | undefined; - totalCount!: number; - - constructor(data?: IIdentityUserDtoPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + items!: IdentityUserDto[] | undefined; + totalCount!: number; + + constructor(data?: IIdentityUserDtoPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) this.items!.push(IdentityUserDto.fromJS(item)); - } - this.totalCount = _data['totalCount']; + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(IdentityUserDto.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } } - } - static fromJS(data: any): IdentityUserDtoPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new IdentityUserDtoPagedResultDto(); - result.init(data); - return result; - } + static fromJS(data: any): IdentityUserDtoPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new IdentityUserDtoPagedResultDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; } - data['totalCount'] = this.totalCount; - return data; - } } export interface IIdentityUserDtoPagedResultDto { - items: IdentityUserDto[] | undefined; - totalCount: number; + items: IdentityUserDto[] | undefined; + totalCount: number; } export class IdentityUserUpdateDto implements IIdentityUserUpdateDto { - readonly extraProperties!: { [key: string]: any } | undefined; - userName!: string; - name!: string | undefined; - surname!: string | undefined; - email!: string; - phoneNumber!: string | undefined; - isActive!: boolean; - lockoutEnabled!: boolean; - roleNames!: string[] | undefined; - password!: string | undefined; - concurrencyStamp!: string | undefined; - - constructor(data?: IIdentityUserUpdateDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['extraProperties']) { - (this).extraProperties = {} as any; - for (let key in _data['extraProperties']) { - if (_data['extraProperties'].hasOwnProperty(key)) - ((this).extraProperties)![key] = _data['extraProperties'][key]; - } - } - this.userName = _data['userName']; - this.name = _data['name']; - this.surname = _data['surname']; - this.email = _data['email']; - this.phoneNumber = _data['phoneNumber']; - this.isActive = _data['isActive']; - this.lockoutEnabled = _data['lockoutEnabled']; - if (Array.isArray(_data['roleNames'])) { - this.roleNames = [] as any; - for (let item of _data['roleNames']) this.roleNames!.push(item); - } - this.password = _data['password']; - this.concurrencyStamp = _data['concurrencyStamp']; - } - } - - static fromJS(data: any): IdentityUserUpdateDto { - data = typeof data === 'object' ? data : {}; - let result = new IdentityUserUpdateDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.extraProperties) { - data['extraProperties'] = {}; - for (let key in this.extraProperties) { - if (this.extraProperties.hasOwnProperty(key)) - (data['extraProperties'])[key] = (this.extraProperties)[key]; - } - } - data['userName'] = this.userName; - data['name'] = this.name; - data['surname'] = this.surname; - data['email'] = this.email; - data['phoneNumber'] = this.phoneNumber; - data['isActive'] = this.isActive; - data['lockoutEnabled'] = this.lockoutEnabled; - if (Array.isArray(this.roleNames)) { - data['roleNames'] = []; - for (let item of this.roleNames) data['roleNames'].push(item); - } - data['password'] = this.password; - data['concurrencyStamp'] = this.concurrencyStamp; - return data; - } + readonly extraProperties!: { [key: string]: any; } | undefined; + userName!: string; + name!: string | undefined; + surname!: string | undefined; + email!: string; + phoneNumber!: string | undefined; + isActive!: boolean; + lockoutEnabled!: boolean; + roleNames!: string[] | undefined; + password!: string | undefined; + concurrencyStamp!: string | undefined; + + constructor(data?: IIdentityUserUpdateDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["extraProperties"]) { + (this).extraProperties = {} as any; + for (let key in _data["extraProperties"]) { + if (_data["extraProperties"].hasOwnProperty(key)) + ((this).extraProperties)![key] = _data["extraProperties"][key]; + } + } + this.userName = _data["userName"]; + this.name = _data["name"]; + this.surname = _data["surname"]; + this.email = _data["email"]; + this.phoneNumber = _data["phoneNumber"]; + this.isActive = _data["isActive"]; + this.lockoutEnabled = _data["lockoutEnabled"]; + if (Array.isArray(_data["roleNames"])) { + this.roleNames = [] as any; + for (let item of _data["roleNames"]) + this.roleNames!.push(item); + } + this.password = _data["password"]; + this.concurrencyStamp = _data["concurrencyStamp"]; + } + } + + static fromJS(data: any): IdentityUserUpdateDto { + data = typeof data === 'object' ? data : {}; + let result = new IdentityUserUpdateDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.extraProperties) { + data["extraProperties"] = {}; + for (let key in this.extraProperties) { + if (this.extraProperties.hasOwnProperty(key)) + (data["extraProperties"])[key] = (this.extraProperties)[key]; + } + } + data["userName"] = this.userName; + data["name"] = this.name; + data["surname"] = this.surname; + data["email"] = this.email; + data["phoneNumber"] = this.phoneNumber; + data["isActive"] = this.isActive; + data["lockoutEnabled"] = this.lockoutEnabled; + if (Array.isArray(this.roleNames)) { + data["roleNames"] = []; + for (let item of this.roleNames) + data["roleNames"].push(item); + } + data["password"] = this.password; + data["concurrencyStamp"] = this.concurrencyStamp; + return data; + } } export interface IIdentityUserUpdateDto { - extraProperties: { [key: string]: any } | undefined; - userName: string; - name: string | undefined; - surname: string | undefined; - email: string; - phoneNumber: string | undefined; - isActive: boolean; - lockoutEnabled: boolean; - roleNames: string[] | undefined; - password: string | undefined; - concurrencyStamp: string | undefined; + extraProperties: { [key: string]: any; } | undefined; + userName: string; + name: string | undefined; + surname: string | undefined; + email: string; + phoneNumber: string | undefined; + isActive: boolean; + lockoutEnabled: boolean; + roleNames: string[] | undefined; + password: string | undefined; + concurrencyStamp: string | undefined; } export class InterfaceMethodApiDescriptionModel implements IInterfaceMethodApiDescriptionModel { - name!: string | undefined; - parametersOnMethod!: MethodParameterApiDescriptionModel[] | undefined; - returnValue!: ReturnValueApiDescriptionModel; - - constructor(data?: IInterfaceMethodApiDescriptionModel) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.name = _data['name']; - if (Array.isArray(_data['parametersOnMethod'])) { - this.parametersOnMethod = [] as any; - for (let item of _data['parametersOnMethod']) - this.parametersOnMethod!.push(MethodParameterApiDescriptionModel.fromJS(item)); - } - this.returnValue = _data['returnValue'] - ? ReturnValueApiDescriptionModel.fromJS(_data['returnValue']) - : undefined; - } - } - - static fromJS(data: any): InterfaceMethodApiDescriptionModel { - data = typeof data === 'object' ? data : {}; - let result = new InterfaceMethodApiDescriptionModel(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['name'] = this.name; - if (Array.isArray(this.parametersOnMethod)) { - data['parametersOnMethod'] = []; - for (let item of this.parametersOnMethod) data['parametersOnMethod'].push(item.toJSON()); - } - data['returnValue'] = this.returnValue ? this.returnValue.toJSON() : undefined; - return data; - } + name!: string | undefined; + parametersOnMethod!: MethodParameterApiDescriptionModel[] | undefined; + returnValue!: ReturnValueApiDescriptionModel; + + constructor(data?: IInterfaceMethodApiDescriptionModel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.name = _data["name"]; + if (Array.isArray(_data["parametersOnMethod"])) { + this.parametersOnMethod = [] as any; + for (let item of _data["parametersOnMethod"]) + this.parametersOnMethod!.push(MethodParameterApiDescriptionModel.fromJS(item)); + } + this.returnValue = _data["returnValue"] ? ReturnValueApiDescriptionModel.fromJS(_data["returnValue"]) : undefined; + } + } + + static fromJS(data: any): InterfaceMethodApiDescriptionModel { + data = typeof data === 'object' ? data : {}; + let result = new InterfaceMethodApiDescriptionModel(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + if (Array.isArray(this.parametersOnMethod)) { + data["parametersOnMethod"] = []; + for (let item of this.parametersOnMethod) + data["parametersOnMethod"].push(item.toJSON()); + } + data["returnValue"] = this.returnValue ? this.returnValue.toJSON() : undefined; + return data; + } } export interface IInterfaceMethodApiDescriptionModel { - name: string | undefined; - parametersOnMethod: MethodParameterApiDescriptionModel[] | undefined; - returnValue: ReturnValueApiDescriptionModel; + name: string | undefined; + parametersOnMethod: MethodParameterApiDescriptionModel[] | undefined; + returnValue: ReturnValueApiDescriptionModel; } export class LanguageInfo implements ILanguageInfo { - cultureName!: string | undefined; - uiCultureName!: string | undefined; - displayName!: string | undefined; - readonly twoLetterISOLanguageName!: string | undefined; - flagIcon!: string | undefined; - - constructor(data?: ILanguageInfo) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.cultureName = _data['cultureName']; - this.uiCultureName = _data['uiCultureName']; - this.displayName = _data['displayName']; - (this).twoLetterISOLanguageName = _data['twoLetterISOLanguageName']; - this.flagIcon = _data['flagIcon']; - } - } - - static fromJS(data: any): LanguageInfo { - data = typeof data === 'object' ? data : {}; - let result = new LanguageInfo(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['cultureName'] = this.cultureName; - data['uiCultureName'] = this.uiCultureName; - data['displayName'] = this.displayName; - data['twoLetterISOLanguageName'] = this.twoLetterISOLanguageName; - data['flagIcon'] = this.flagIcon; - return data; - } + cultureName!: string | undefined; + uiCultureName!: string | undefined; + displayName!: string | undefined; + readonly twoLetterISOLanguageName!: string | undefined; + flagIcon!: string | undefined; + + constructor(data?: ILanguageInfo) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.cultureName = _data["cultureName"]; + this.uiCultureName = _data["uiCultureName"]; + this.displayName = _data["displayName"]; + (this).twoLetterISOLanguageName = _data["twoLetterISOLanguageName"]; + this.flagIcon = _data["flagIcon"]; + } + } + + static fromJS(data: any): LanguageInfo { + data = typeof data === 'object' ? data : {}; + let result = new LanguageInfo(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["cultureName"] = this.cultureName; + data["uiCultureName"] = this.uiCultureName; + data["displayName"] = this.displayName; + data["twoLetterISOLanguageName"] = this.twoLetterISOLanguageName; + data["flagIcon"] = this.flagIcon; + return data; + } } export interface ILanguageInfo { - cultureName: string | undefined; - uiCultureName: string | undefined; - displayName: string | undefined; - twoLetterISOLanguageName: string | undefined; - flagIcon: string | undefined; + cultureName: string | undefined; + uiCultureName: string | undefined; + displayName: string | undefined; + twoLetterISOLanguageName: string | undefined; + flagIcon: string | undefined; } export class LocalizableStringDto implements ILocalizableStringDto { - name!: string | undefined; - resource!: string | undefined; - - constructor(data?: ILocalizableStringDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + name!: string | undefined; + resource!: string | undefined; + + constructor(data?: ILocalizableStringDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.name = _data['name']; - this.resource = _data['resource']; + init(_data?: any) { + if (_data) { + this.name = _data["name"]; + this.resource = _data["resource"]; + } } - } - static fromJS(data: any): LocalizableStringDto { - data = typeof data === 'object' ? data : {}; - let result = new LocalizableStringDto(); - result.init(data); - return result; - } + static fromJS(data: any): LocalizableStringDto { + data = typeof data === 'object' ? data : {}; + let result = new LocalizableStringDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['name'] = this.name; - data['resource'] = this.resource; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + data["resource"] = this.resource; + return data; + } } export interface ILocalizableStringDto { - name: string | undefined; - resource: string | undefined; + name: string | undefined; + resource: string | undefined; } export class LockUserInput implements ILockUserInput { - userId!: string; - locked!: boolean; - - constructor(data?: ILockUserInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + userId!: string; + locked!: boolean; + + constructor(data?: ILockUserInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.userId = _data['userId']; - this.locked = _data['locked']; + init(_data?: any) { + if (_data) { + this.userId = _data["userId"]; + this.locked = _data["locked"]; + } } - } - static fromJS(data: any): LockUserInput { - data = typeof data === 'object' ? data : {}; - let result = new LockUserInput(); - result.init(data); - return result; - } + static fromJS(data: any): LockUserInput { + data = typeof data === 'object' ? data : {}; + let result = new LockUserInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['userId'] = this.userId; - data['locked'] = this.locked; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["userId"] = this.userId; + data["locked"] = this.locked; + return data; + } } export interface ILockUserInput { - userId: string; - locked: boolean; + userId: string; + locked: boolean; } /** 登录 */ export class LoginInput implements ILoginInput { - /** 用户名或者邮箱 */ - name!: string | undefined; - /** 密码 */ - password!: string | undefined; - - constructor(data?: ILoginInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + /** 用户名或者邮箱 */ + name!: string | undefined; + /** 密码 */ + password!: string | undefined; + + constructor(data?: ILoginInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.name = _data['name']; - this.password = _data['password']; + init(_data?: any) { + if (_data) { + this.name = _data["name"]; + this.password = _data["password"]; + } } - } - static fromJS(data: any): LoginInput { - data = typeof data === 'object' ? data : {}; - let result = new LoginInput(); - result.init(data); - return result; - } + static fromJS(data: any): LoginInput { + data = typeof data === 'object' ? data : {}; + let result = new LoginInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['name'] = this.name; - data['password'] = this.password; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + data["password"] = this.password; + return data; + } } /** 登录 */ export interface ILoginInput { - /** 用户名或者邮箱 */ - name: string | undefined; - /** 密码 */ - password: string | undefined; + /** 用户名或者邮箱 */ + name: string | undefined; + /** 密码 */ + password: string | undefined; } export class LoginOutput implements ILoginOutput { - id!: string; - name!: string | undefined; - userName!: string | undefined; - token!: string | undefined; - roles!: string[] | undefined; - - constructor(data?: ILoginOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.name = _data['name']; - this.userName = _data['userName']; - this.token = _data['token']; - if (Array.isArray(_data['roles'])) { - this.roles = [] as any; - for (let item of _data['roles']) this.roles!.push(item); - } - } - } - - static fromJS(data: any): LoginOutput { - data = typeof data === 'object' ? data : {}; - let result = new LoginOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['name'] = this.name; - data['userName'] = this.userName; - data['token'] = this.token; - if (Array.isArray(this.roles)) { - data['roles'] = []; - for (let item of this.roles) data['roles'].push(item); - } - return data; - } + id!: string; + name!: string | undefined; + userName!: string | undefined; + token!: string | undefined; + roles!: string[] | undefined; + + constructor(data?: ILoginOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.name = _data["name"]; + this.userName = _data["userName"]; + this.token = _data["token"]; + if (Array.isArray(_data["roles"])) { + this.roles = [] as any; + for (let item of _data["roles"]) + this.roles!.push(item); + } + } + } + + static fromJS(data: any): LoginOutput { + data = typeof data === 'object' ? data : {}; + let result = new LoginOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["name"] = this.name; + data["userName"] = this.userName; + data["token"] = this.token; + if (Array.isArray(this.roles)) { + data["roles"] = []; + for (let item of this.roles) + data["roles"].push(item); + } + return data; + } } export interface ILoginOutput { - id: string; - name: string | undefined; - userName: string | undefined; - token: string | undefined; - roles: string[] | undefined; + id: string; + name: string | undefined; + userName: string | undefined; + token: string | undefined; + roles: string[] | undefined; } export enum LoginResultType { - Success = 1, - InvalidUserNameOrPassword = 2, - NotAllowed = 3, - LockedOut = 4, - RequiresTwoFactor = 5, + Success = 1, + InvalidUserNameOrPassword = 2, + NotAllowed = 3, + LockedOut = 4, + RequiresTwoFactor = 5, } /** 消息等级 */ export enum MessageLevel { - Warning = 10, - Information = 20, - Error = 30, + Warning = 10, + Information = 20, + Error = 30, } /** 消息类型 */ export enum MessageType { - BroadCast = 10, - Common = 20, + BroadCast = 10, + Common = 20, } export class MethodParameterApiDescriptionModel implements IMethodParameterApiDescriptionModel { - name!: string | undefined; - typeAsString!: string | undefined; - type!: string | undefined; - typeSimple!: string | undefined; - isOptional!: boolean; - defaultValue!: any | undefined; - - constructor(data?: IMethodParameterApiDescriptionModel) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.name = _data['name']; - this.typeAsString = _data['typeAsString']; - this.type = _data['type']; - this.typeSimple = _data['typeSimple']; - this.isOptional = _data['isOptional']; - this.defaultValue = _data['defaultValue']; - } - } - - static fromJS(data: any): MethodParameterApiDescriptionModel { - data = typeof data === 'object' ? data : {}; - let result = new MethodParameterApiDescriptionModel(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['name'] = this.name; - data['typeAsString'] = this.typeAsString; - data['type'] = this.type; - data['typeSimple'] = this.typeSimple; - data['isOptional'] = this.isOptional; - data['defaultValue'] = this.defaultValue; - return data; - } + name!: string | undefined; + typeAsString!: string | undefined; + type!: string | undefined; + typeSimple!: string | undefined; + isOptional!: boolean; + defaultValue!: any | undefined; + + constructor(data?: IMethodParameterApiDescriptionModel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.name = _data["name"]; + this.typeAsString = _data["typeAsString"]; + this.type = _data["type"]; + this.typeSimple = _data["typeSimple"]; + this.isOptional = _data["isOptional"]; + this.defaultValue = _data["defaultValue"]; + } + } + + static fromJS(data: any): MethodParameterApiDescriptionModel { + data = typeof data === 'object' ? data : {}; + let result = new MethodParameterApiDescriptionModel(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + data["typeAsString"] = this.typeAsString; + data["type"] = this.type; + data["typeSimple"] = this.typeSimple; + data["isOptional"] = this.isOptional; + data["defaultValue"] = this.defaultValue; + return data; + } } export interface IMethodParameterApiDescriptionModel { - name: string | undefined; - typeAsString: string | undefined; - type: string | undefined; - typeSimple: string | undefined; - isOptional: boolean; - defaultValue: any | undefined; + name: string | undefined; + typeAsString: string | undefined; + type: string | undefined; + typeSimple: string | undefined; + isOptional: boolean; + defaultValue: any | undefined; } export class ModuleApiDescriptionModel implements IModuleApiDescriptionModel { - rootPath!: string | undefined; - remoteServiceName!: string | undefined; - controllers!: { [key: string]: ControllerApiDescriptionModel } | undefined; - - constructor(data?: IModuleApiDescriptionModel) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.rootPath = _data['rootPath']; - this.remoteServiceName = _data['remoteServiceName']; - if (_data['controllers']) { - this.controllers = {} as any; - for (let key in _data['controllers']) { - if (_data['controllers'].hasOwnProperty(key)) - (this.controllers)![key] = _data['controllers'][key] - ? ControllerApiDescriptionModel.fromJS(_data['controllers'][key]) - : new ControllerApiDescriptionModel(); - } - } - } - } - - static fromJS(data: any): ModuleApiDescriptionModel { - data = typeof data === 'object' ? data : {}; - let result = new ModuleApiDescriptionModel(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['rootPath'] = this.rootPath; - data['remoteServiceName'] = this.remoteServiceName; - if (this.controllers) { - data['controllers'] = {}; - for (let key in this.controllers) { - if (this.controllers.hasOwnProperty(key)) - (data['controllers'])[key] = this.controllers[key] - ? this.controllers[key].toJSON() - : undefined; - } - } - return data; - } + rootPath!: string | undefined; + remoteServiceName!: string | undefined; + controllers!: { [key: string]: ControllerApiDescriptionModel; } | undefined; + + constructor(data?: IModuleApiDescriptionModel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.rootPath = _data["rootPath"]; + this.remoteServiceName = _data["remoteServiceName"]; + if (_data["controllers"]) { + this.controllers = {} as any; + for (let key in _data["controllers"]) { + if (_data["controllers"].hasOwnProperty(key)) + (this.controllers)![key] = _data["controllers"][key] ? ControllerApiDescriptionModel.fromJS(_data["controllers"][key]) : new ControllerApiDescriptionModel(); + } + } + } + } + + static fromJS(data: any): ModuleApiDescriptionModel { + data = typeof data === 'object' ? data : {}; + let result = new ModuleApiDescriptionModel(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["rootPath"] = this.rootPath; + data["remoteServiceName"] = this.remoteServiceName; + if (this.controllers) { + data["controllers"] = {}; + for (let key in this.controllers) { + if (this.controllers.hasOwnProperty(key)) + (data["controllers"])[key] = this.controllers[key] ? this.controllers[key].toJSON() : undefined; + } + } + return data; + } } export interface IModuleApiDescriptionModel { - rootPath: string | undefined; - remoteServiceName: string | undefined; - controllers: { [key: string]: ControllerApiDescriptionModel } | undefined; + rootPath: string | undefined; + remoteServiceName: string | undefined; + controllers: { [key: string]: ControllerApiDescriptionModel; } | undefined; } export class ModuleExtensionDto implements IModuleExtensionDto { - entities!: { [key: string]: EntityExtensionDto } | undefined; - configuration!: { [key: string]: any } | undefined; - - constructor(data?: IModuleExtensionDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['entities']) { - this.entities = {} as any; - for (let key in _data['entities']) { - if (_data['entities'].hasOwnProperty(key)) - (this.entities)![key] = _data['entities'][key] - ? EntityExtensionDto.fromJS(_data['entities'][key]) - : new EntityExtensionDto(); - } - } - if (_data['configuration']) { - this.configuration = {} as any; - for (let key in _data['configuration']) { - if (_data['configuration'].hasOwnProperty(key)) - (this.configuration)![key] = _data['configuration'][key]; - } - } - } - } - - static fromJS(data: any): ModuleExtensionDto { - data = typeof data === 'object' ? data : {}; - let result = new ModuleExtensionDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.entities) { - data['entities'] = {}; - for (let key in this.entities) { - if (this.entities.hasOwnProperty(key)) - (data['entities'])[key] = this.entities[key] - ? this.entities[key].toJSON() - : undefined; - } - } - if (this.configuration) { - data['configuration'] = {}; - for (let key in this.configuration) { - if (this.configuration.hasOwnProperty(key)) - (data['configuration'])[key] = (this.configuration)[key]; - } - } - return data; - } + entities!: { [key: string]: EntityExtensionDto; } | undefined; + configuration!: { [key: string]: any; } | undefined; + + constructor(data?: IModuleExtensionDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["entities"]) { + this.entities = {} as any; + for (let key in _data["entities"]) { + if (_data["entities"].hasOwnProperty(key)) + (this.entities)![key] = _data["entities"][key] ? EntityExtensionDto.fromJS(_data["entities"][key]) : new EntityExtensionDto(); + } + } + if (_data["configuration"]) { + this.configuration = {} as any; + for (let key in _data["configuration"]) { + if (_data["configuration"].hasOwnProperty(key)) + (this.configuration)![key] = _data["configuration"][key]; + } + } + } + } + + static fromJS(data: any): ModuleExtensionDto { + data = typeof data === 'object' ? data : {}; + let result = new ModuleExtensionDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.entities) { + data["entities"] = {}; + for (let key in this.entities) { + if (this.entities.hasOwnProperty(key)) + (data["entities"])[key] = this.entities[key] ? this.entities[key].toJSON() : undefined; + } + } + if (this.configuration) { + data["configuration"] = {}; + for (let key in this.configuration) { + if (this.configuration.hasOwnProperty(key)) + (data["configuration"])[key] = (this.configuration)[key]; + } + } + return data; + } } export interface IModuleExtensionDto { - entities: { [key: string]: EntityExtensionDto } | undefined; - configuration: { [key: string]: any } | undefined; + entities: { [key: string]: EntityExtensionDto; } | undefined; + configuration: { [key: string]: any; } | undefined; } export class MultiTenancyInfoDto implements IMultiTenancyInfoDto { - isEnabled!: boolean; - - constructor(data?: IMultiTenancyInfoDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + isEnabled!: boolean; + + constructor(data?: IMultiTenancyInfoDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.isEnabled = _data['isEnabled']; + init(_data?: any) { + if (_data) { + this.isEnabled = _data["isEnabled"]; + } } - } - static fromJS(data: any): MultiTenancyInfoDto { - data = typeof data === 'object' ? data : {}; - let result = new MultiTenancyInfoDto(); - result.init(data); - return result; - } + static fromJS(data: any): MultiTenancyInfoDto { + data = typeof data === 'object' ? data : {}; + let result = new MultiTenancyInfoDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['isEnabled'] = this.isEnabled; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["isEnabled"] = this.isEnabled; + return data; + } } export interface IMultiTenancyInfoDto { - isEnabled: boolean; + isEnabled: boolean; } export class NameValue implements INameValue { - name!: string | undefined; - value!: string | undefined; - - constructor(data?: INameValue) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + name!: string | undefined; + value!: string | undefined; + + constructor(data?: INameValue) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.name = _data['name']; - this.value = _data['value']; + init(_data?: any) { + if (_data) { + this.name = _data["name"]; + this.value = _data["value"]; + } } - } - static fromJS(data: any): NameValue { - data = typeof data === 'object' ? data : {}; - let result = new NameValue(); - result.init(data); - return result; - } + static fromJS(data: any): NameValue { + data = typeof data === 'object' ? data : {}; + let result = new NameValue(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['name'] = this.name; - data['value'] = this.value; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + data["value"] = this.value; + return data; + } } export interface INameValue { - name: string | undefined; - value: string | undefined; + name: string | undefined; + value: string | undefined; } export class ObjectExtensionsDto implements IObjectExtensionsDto { - modules!: { [key: string]: ModuleExtensionDto } | undefined; - enums!: { [key: string]: ExtensionEnumDto } | undefined; - - constructor(data?: IObjectExtensionsDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['modules']) { - this.modules = {} as any; - for (let key in _data['modules']) { - if (_data['modules'].hasOwnProperty(key)) - (this.modules)![key] = _data['modules'][key] - ? ModuleExtensionDto.fromJS(_data['modules'][key]) - : new ModuleExtensionDto(); - } - } - if (_data['enums']) { - this.enums = {} as any; - for (let key in _data['enums']) { - if (_data['enums'].hasOwnProperty(key)) - (this.enums)![key] = _data['enums'][key] - ? ExtensionEnumDto.fromJS(_data['enums'][key]) - : new ExtensionEnumDto(); - } - } - } - } - - static fromJS(data: any): ObjectExtensionsDto { - data = typeof data === 'object' ? data : {}; - let result = new ObjectExtensionsDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.modules) { - data['modules'] = {}; - for (let key in this.modules) { - if (this.modules.hasOwnProperty(key)) - (data['modules'])[key] = this.modules[key] - ? this.modules[key].toJSON() - : undefined; - } - } - if (this.enums) { - data['enums'] = {}; - for (let key in this.enums) { - if (this.enums.hasOwnProperty(key)) - (data['enums'])[key] = this.enums[key] ? this.enums[key].toJSON() : undefined; - } - } - return data; - } + modules!: { [key: string]: ModuleExtensionDto; } | undefined; + enums!: { [key: string]: ExtensionEnumDto; } | undefined; + + constructor(data?: IObjectExtensionsDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["modules"]) { + this.modules = {} as any; + for (let key in _data["modules"]) { + if (_data["modules"].hasOwnProperty(key)) + (this.modules)![key] = _data["modules"][key] ? ModuleExtensionDto.fromJS(_data["modules"][key]) : new ModuleExtensionDto(); + } + } + if (_data["enums"]) { + this.enums = {} as any; + for (let key in _data["enums"]) { + if (_data["enums"].hasOwnProperty(key)) + (this.enums)![key] = _data["enums"][key] ? ExtensionEnumDto.fromJS(_data["enums"][key]) : new ExtensionEnumDto(); + } + } + } + } + + static fromJS(data: any): ObjectExtensionsDto { + data = typeof data === 'object' ? data : {}; + let result = new ObjectExtensionsDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.modules) { + data["modules"] = {}; + for (let key in this.modules) { + if (this.modules.hasOwnProperty(key)) + (data["modules"])[key] = this.modules[key] ? this.modules[key].toJSON() : undefined; + } + } + if (this.enums) { + data["enums"] = {}; + for (let key in this.enums) { + if (this.enums.hasOwnProperty(key)) + (data["enums"])[key] = this.enums[key] ? this.enums[key].toJSON() : undefined; + } + } + return data; + } } export interface IObjectExtensionsDto { - modules: { [key: string]: ModuleExtensionDto } | undefined; - enums: { [key: string]: ExtensionEnumDto } | undefined; + modules: { [key: string]: ModuleExtensionDto; } | undefined; + enums: { [key: string]: ExtensionEnumDto; } | undefined; } /** 创建语言 */ export class PageLanguageInput implements IPageLanguageInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - filter!: string | undefined; - - constructor(data?: IPageLanguageInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.filter = _data['filter']; - } - } - - static fromJS(data: any): PageLanguageInput { - data = typeof data === 'object' ? data : {}; - let result = new PageLanguageInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['filter'] = this.filter; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + filter!: string | undefined; + + constructor(data?: IPageLanguageInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.filter = _data["filter"]; + } + } + + static fromJS(data: any): PageLanguageInput { + data = typeof data === 'object' ? data : {}; + let result = new PageLanguageInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["filter"] = this.filter; + return data; + } } /** 创建语言 */ export interface IPageLanguageInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - filter: string | undefined; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + filter: string | undefined; } /** 创建语言 */ export class PageLanguageOutput implements IPageLanguageOutput { - /** 语言Id */ - id!: string; - /** 语言名称 */ - cultureName!: string | undefined; - /** Ui语言名称 */ - uiCultureName!: string | undefined; - /** 显示名称 */ - displayName!: string | undefined; - /** 图标 */ - flagIcon!: string | undefined; - /** 是否启用 */ - isEnabled!: boolean; - /** 创建时间 */ - creationTime!: dayjs.Dayjs; - /** 是否是默认语言 */ - isDefault!: boolean; - - constructor(data?: IPageLanguageOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.cultureName = _data['cultureName']; - this.uiCultureName = _data['uiCultureName']; - this.displayName = _data['displayName']; - this.flagIcon = _data['flagIcon']; - this.isEnabled = _data['isEnabled']; - this.creationTime = _data['creationTime'] - ? dayjs(_data['creationTime'].toString()) - : undefined; - this.isDefault = _data['isDefault']; - } - } - - static fromJS(data: any): PageLanguageOutput { - data = typeof data === 'object' ? data : {}; - let result = new PageLanguageOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['cultureName'] = this.cultureName; - data['uiCultureName'] = this.uiCultureName; - data['displayName'] = this.displayName; - data['flagIcon'] = this.flagIcon; - data['isEnabled'] = this.isEnabled; - data['creationTime'] = this.creationTime ? this.creationTime.toLocaleString() : undefined; - data['isDefault'] = this.isDefault; - return data; - } + /** 语言Id */ + id!: string; + /** 语言名称 */ + cultureName!: string | undefined; + /** Ui语言名称 */ + uiCultureName!: string | undefined; + /** 显示名称 */ + displayName!: string | undefined; + /** 图标 */ + flagIcon!: string | undefined; + /** 是否启用 */ + isEnabled!: boolean; + /** 创建时间 */ + creationTime!: dayjs.Dayjs; + /** 是否是默认语言 */ + isDefault!: boolean; + + constructor(data?: IPageLanguageOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.cultureName = _data["cultureName"]; + this.uiCultureName = _data["uiCultureName"]; + this.displayName = _data["displayName"]; + this.flagIcon = _data["flagIcon"]; + this.isEnabled = _data["isEnabled"]; + this.creationTime = _data["creationTime"] ? dayjs(_data["creationTime"].toString()) : undefined; + this.isDefault = _data["isDefault"]; + } + } + + static fromJS(data: any): PageLanguageOutput { + data = typeof data === 'object' ? data : {}; + let result = new PageLanguageOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["cultureName"] = this.cultureName; + data["uiCultureName"] = this.uiCultureName; + data["displayName"] = this.displayName; + data["flagIcon"] = this.flagIcon; + data["isEnabled"] = this.isEnabled; + data["creationTime"] = this.creationTime ? this.creationTime.toLocaleString() : undefined; + data["isDefault"] = this.isDefault; + return data; + } } /** 创建语言 */ export interface IPageLanguageOutput { - /** 语言Id */ - id: string; - /** 语言名称 */ - cultureName: string | undefined; - /** Ui语言名称 */ - uiCultureName: string | undefined; - /** 显示名称 */ - displayName: string | undefined; - /** 图标 */ - flagIcon: string | undefined; - /** 是否启用 */ - isEnabled: boolean; - /** 创建时间 */ - creationTime: dayjs.Dayjs; - /** 是否是默认语言 */ - isDefault: boolean; + /** 语言Id */ + id: string; + /** 语言名称 */ + cultureName: string | undefined; + /** Ui语言名称 */ + uiCultureName: string | undefined; + /** 显示名称 */ + displayName: string | undefined; + /** 图标 */ + flagIcon: string | undefined; + /** 是否启用 */ + isEnabled: boolean; + /** 创建时间 */ + creationTime: dayjs.Dayjs; + /** 是否是默认语言 */ + isDefault: boolean; } export class PageLanguageOutputPagedResultDto implements IPageLanguageOutputPagedResultDto { - items!: PageLanguageOutput[] | undefined; - totalCount!: number; - - constructor(data?: IPageLanguageOutputPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + items!: PageLanguageOutput[] | undefined; + totalCount!: number; + + constructor(data?: IPageLanguageOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) this.items!.push(PageLanguageOutput.fromJS(item)); - } - this.totalCount = _data['totalCount']; + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(PageLanguageOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } } - } - static fromJS(data: any): PageLanguageOutputPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new PageLanguageOutputPagedResultDto(); - result.init(data); - return result; - } + static fromJS(data: any): PageLanguageOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new PageLanguageOutputPagedResultDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; } - data['totalCount'] = this.totalCount; - return data; - } } export interface IPageLanguageOutputPagedResultDto { - items: PageLanguageOutput[] | undefined; - totalCount: number; + items: PageLanguageOutput[] | undefined; + totalCount: number; } /** 创建语言文本 */ export class PageLanguageTextInput implements IPageLanguageTextInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - /** 语言 */ - cultureName!: string | undefined; - /** 资源 */ - resourceName!: string | undefined; - /** 查询条件 name or value */ - filter!: string | undefined; - - constructor(data?: IPageLanguageTextInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.cultureName = _data['cultureName']; - this.resourceName = _data['resourceName']; - this.filter = _data['filter']; - } - } - - static fromJS(data: any): PageLanguageTextInput { - data = typeof data === 'object' ? data : {}; - let result = new PageLanguageTextInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['cultureName'] = this.cultureName; - data['resourceName'] = this.resourceName; - data['filter'] = this.filter; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + /** 语言 */ + cultureName!: string | undefined; + /** 资源 */ + resourceName!: string | undefined; + /** 查询条件 name or value */ + filter!: string | undefined; + + constructor(data?: IPageLanguageTextInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.cultureName = _data["cultureName"]; + this.resourceName = _data["resourceName"]; + this.filter = _data["filter"]; + } + } + + static fromJS(data: any): PageLanguageTextInput { + data = typeof data === 'object' ? data : {}; + let result = new PageLanguageTextInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["cultureName"] = this.cultureName; + data["resourceName"] = this.resourceName; + data["filter"] = this.filter; + return data; + } } /** 创建语言文本 */ export interface IPageLanguageTextInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - /** 语言 */ - cultureName: string | undefined; - /** 资源 */ - resourceName: string | undefined; - /** 查询条件 name or value */ - filter: string | undefined; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + /** 语言 */ + cultureName: string | undefined; + /** 资源 */ + resourceName: string | undefined; + /** 查询条件 name or value */ + filter: string | undefined; } /** 创建语言文本 */ export class PageLanguageTextOutput implements IPageLanguageTextOutput { - /** 资源名称 */ - resourceName!: string | undefined; - /** 名称 */ - name!: string | undefined; - /** 值 */ - value!: string | undefined; - - constructor(data?: IPageLanguageTextOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.resourceName = _data['resourceName']; - this.name = _data['name']; - this.value = _data['value']; - } - } - - static fromJS(data: any): PageLanguageTextOutput { - data = typeof data === 'object' ? data : {}; - let result = new PageLanguageTextOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['resourceName'] = this.resourceName; - data['name'] = this.name; - data['value'] = this.value; - return data; - } + /** 资源名称 */ + resourceName!: string | undefined; + /** 名称 */ + name!: string | undefined; + /** 值 */ + value!: string | undefined; + + constructor(data?: IPageLanguageTextOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.resourceName = _data["resourceName"]; + this.name = _data["name"]; + this.value = _data["value"]; + } + } + + static fromJS(data: any): PageLanguageTextOutput { + data = typeof data === 'object' ? data : {}; + let result = new PageLanguageTextOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["resourceName"] = this.resourceName; + data["name"] = this.name; + data["value"] = this.value; + return data; + } } /** 创建语言文本 */ export interface IPageLanguageTextOutput { - /** 资源名称 */ - resourceName: string | undefined; - /** 名称 */ - name: string | undefined; - /** 值 */ - value: string | undefined; + /** 资源名称 */ + resourceName: string | undefined; + /** 名称 */ + name: string | undefined; + /** 值 */ + value: string | undefined; } export class PageLanguageTextOutputPagedResultDto implements IPageLanguageTextOutputPagedResultDto { - items!: PageLanguageTextOutput[] | undefined; - totalCount!: number; - - constructor(data?: IPageLanguageTextOutputPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + items!: PageLanguageTextOutput[] | undefined; + totalCount!: number; + + constructor(data?: IPageLanguageTextOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) this.items!.push(PageLanguageTextOutput.fromJS(item)); - } - this.totalCount = _data['totalCount']; + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(PageLanguageTextOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } } - } - static fromJS(data: any): PageLanguageTextOutputPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new PageLanguageTextOutputPagedResultDto(); - result.init(data); - return result; - } + static fromJS(data: any): PageLanguageTextOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new PageLanguageTextOutputPagedResultDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; } - data['totalCount'] = this.totalCount; - return data; - } } export interface IPageLanguageTextOutputPagedResultDto { - items: PageLanguageTextOutput[] | undefined; - totalCount: number; + items: PageLanguageTextOutput[] | undefined; + totalCount: number; } export class PagingAuditLogActionOutput implements IPagingAuditLogActionOutput { - id!: string; - tenantId!: string | undefined; - auditLogId!: string; - serviceName!: string | undefined; - methodName!: string | undefined; - parameters!: string | undefined; - executionTime!: string | undefined; - executionDuration!: number; - extraProperties!: { [key: string]: any } | undefined; - - constructor(data?: IPagingAuditLogActionOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.tenantId = _data['tenantId']; - this.auditLogId = _data['auditLogId']; - this.serviceName = _data['serviceName']; - this.methodName = _data['methodName']; - this.parameters = _data['parameters']; - this.executionTime = _data['executionTime']; - this.executionDuration = _data['executionDuration']; - if (_data['extraProperties']) { - this.extraProperties = {} as any; - for (let key in _data['extraProperties']) { - if (_data['extraProperties'].hasOwnProperty(key)) - (this.extraProperties)![key] = _data['extraProperties'][key]; - } - } - } - } - - static fromJS(data: any): PagingAuditLogActionOutput { - data = typeof data === 'object' ? data : {}; - let result = new PagingAuditLogActionOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['tenantId'] = this.tenantId; - data['auditLogId'] = this.auditLogId; - data['serviceName'] = this.serviceName; - data['methodName'] = this.methodName; - data['parameters'] = this.parameters; - data['executionTime'] = this.executionTime; - data['executionDuration'] = this.executionDuration; - if (this.extraProperties) { - data['extraProperties'] = {}; - for (let key in this.extraProperties) { - if (this.extraProperties.hasOwnProperty(key)) - (data['extraProperties'])[key] = (this.extraProperties)[key]; - } - } - return data; - } + id!: string; + tenantId!: string | undefined; + auditLogId!: string; + serviceName!: string | undefined; + methodName!: string | undefined; + parameters!: string | undefined; + executionTime!: string | undefined; + executionDuration!: number; + extraProperties!: { [key: string]: any; } | undefined; + + constructor(data?: IPagingAuditLogActionOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.tenantId = _data["tenantId"]; + this.auditLogId = _data["auditLogId"]; + this.serviceName = _data["serviceName"]; + this.methodName = _data["methodName"]; + this.parameters = _data["parameters"]; + this.executionTime = _data["executionTime"]; + this.executionDuration = _data["executionDuration"]; + if (_data["extraProperties"]) { + this.extraProperties = {} as any; + for (let key in _data["extraProperties"]) { + if (_data["extraProperties"].hasOwnProperty(key)) + (this.extraProperties)![key] = _data["extraProperties"][key]; + } + } + } + } + + static fromJS(data: any): PagingAuditLogActionOutput { + data = typeof data === 'object' ? data : {}; + let result = new PagingAuditLogActionOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["tenantId"] = this.tenantId; + data["auditLogId"] = this.auditLogId; + data["serviceName"] = this.serviceName; + data["methodName"] = this.methodName; + data["parameters"] = this.parameters; + data["executionTime"] = this.executionTime; + data["executionDuration"] = this.executionDuration; + if (this.extraProperties) { + data["extraProperties"] = {}; + for (let key in this.extraProperties) { + if (this.extraProperties.hasOwnProperty(key)) + (data["extraProperties"])[key] = (this.extraProperties)[key]; + } + } + return data; + } } export interface IPagingAuditLogActionOutput { - id: string; - tenantId: string | undefined; - auditLogId: string; - serviceName: string | undefined; - methodName: string | undefined; - parameters: string | undefined; - executionTime: string | undefined; - executionDuration: number; - extraProperties: { [key: string]: any } | undefined; + id: string; + tenantId: string | undefined; + auditLogId: string; + serviceName: string | undefined; + methodName: string | undefined; + parameters: string | undefined; + executionTime: string | undefined; + executionDuration: number; + extraProperties: { [key: string]: any; } | undefined; } export class PagingAuditLogInput implements IPagingAuditLogInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - /** 排序 */ - sorting!: string | undefined; - /** 开始时间 */ - startTime!: dayjs.Dayjs | undefined; - /** 结束时间 */ - endTime!: dayjs.Dayjs | undefined; - /** 请求方法 */ - httpMethod!: string | undefined; - /** 请求地址 */ - url!: string | undefined; - /** 用户Id */ - userId!: string | undefined; - /** 用户名 */ - userName!: string | undefined; - /** 应用程序名称 */ - applicationName!: string | undefined; - /** RequestId */ - correlationId!: string | undefined; - /** 最大执行时间 */ - maxExecutionDuration!: number | undefined; - /** 最小执行时间 */ - minExecutionDuration!: number | undefined; - /** 是否有异常 */ - hasException!: boolean | undefined; - httpStatusCode!: HttpStatusCode; - /** 客户端IP */ - clientIpAddress!: string | undefined; - - constructor(data?: IPagingAuditLogInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.sorting = _data['sorting']; - this.startTime = _data['startTime'] ? dayjs(_data['startTime'].toString()) : undefined; - this.endTime = _data['endTime'] ? dayjs(_data['endTime'].toString()) : undefined; - this.httpMethod = _data['httpMethod']; - this.url = _data['url']; - this.userId = _data['userId']; - this.userName = _data['userName']; - this.applicationName = _data['applicationName']; - this.correlationId = _data['correlationId']; - this.maxExecutionDuration = _data['maxExecutionDuration']; - this.minExecutionDuration = _data['minExecutionDuration']; - this.hasException = _data['hasException']; - this.httpStatusCode = _data['httpStatusCode']; - this.clientIpAddress = _data['clientIpAddress']; - } - } - - static fromJS(data: any): PagingAuditLogInput { - data = typeof data === 'object' ? data : {}; - let result = new PagingAuditLogInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['sorting'] = this.sorting; - data['startTime'] = this.startTime ? this.startTime.toLocaleString() : undefined; - data['endTime'] = this.endTime ? this.endTime.toLocaleString() : undefined; - data['httpMethod'] = this.httpMethod; - data['url'] = this.url; - data['userId'] = this.userId; - data['userName'] = this.userName; - data['applicationName'] = this.applicationName; - data['correlationId'] = this.correlationId; - data['maxExecutionDuration'] = this.maxExecutionDuration; - data['minExecutionDuration'] = this.minExecutionDuration; - data['hasException'] = this.hasException; - data['httpStatusCode'] = this.httpStatusCode; - data['clientIpAddress'] = this.clientIpAddress; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + /** 排序 */ + sorting!: string | undefined; + /** 开始时间 */ + startTime!: dayjs.Dayjs | undefined; + /** 结束时间 */ + endTime!: dayjs.Dayjs | undefined; + /** 请求方法 */ + httpMethod!: string | undefined; + /** 请求地址 */ + url!: string | undefined; + /** 用户Id */ + userId!: string | undefined; + /** 用户名 */ + userName!: string | undefined; + /** 应用程序名称 */ + applicationName!: string | undefined; + /** RequestId */ + correlationId!: string | undefined; + /** 最大执行时间 */ + maxExecutionDuration!: number | undefined; + /** 最小执行时间 */ + minExecutionDuration!: number | undefined; + /** 是否有异常 */ + hasException!: boolean | undefined; + httpStatusCode!: HttpStatusCode; + /** 客户端IP */ + clientIpAddress!: string | undefined; + + constructor(data?: IPagingAuditLogInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.sorting = _data["sorting"]; + this.startTime = _data["startTime"] ? dayjs(_data["startTime"].toString()) : undefined; + this.endTime = _data["endTime"] ? dayjs(_data["endTime"].toString()) : undefined; + this.httpMethod = _data["httpMethod"]; + this.url = _data["url"]; + this.userId = _data["userId"]; + this.userName = _data["userName"]; + this.applicationName = _data["applicationName"]; + this.correlationId = _data["correlationId"]; + this.maxExecutionDuration = _data["maxExecutionDuration"]; + this.minExecutionDuration = _data["minExecutionDuration"]; + this.hasException = _data["hasException"]; + this.httpStatusCode = _data["httpStatusCode"]; + this.clientIpAddress = _data["clientIpAddress"]; + } + } + + static fromJS(data: any): PagingAuditLogInput { + data = typeof data === 'object' ? data : {}; + let result = new PagingAuditLogInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["sorting"] = this.sorting; + data["startTime"] = this.startTime ? this.startTime.toLocaleString() : undefined; + data["endTime"] = this.endTime ? this.endTime.toLocaleString() : undefined; + data["httpMethod"] = this.httpMethod; + data["url"] = this.url; + data["userId"] = this.userId; + data["userName"] = this.userName; + data["applicationName"] = this.applicationName; + data["correlationId"] = this.correlationId; + data["maxExecutionDuration"] = this.maxExecutionDuration; + data["minExecutionDuration"] = this.minExecutionDuration; + data["hasException"] = this.hasException; + data["httpStatusCode"] = this.httpStatusCode; + data["clientIpAddress"] = this.clientIpAddress; + return data; + } } export interface IPagingAuditLogInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - /** 排序 */ - sorting: string | undefined; - /** 开始时间 */ - startTime: dayjs.Dayjs | undefined; - /** 结束时间 */ - endTime: dayjs.Dayjs | undefined; - /** 请求方法 */ - httpMethod: string | undefined; - /** 请求地址 */ - url: string | undefined; - /** 用户Id */ - userId: string | undefined; - /** 用户名 */ - userName: string | undefined; - /** 应用程序名称 */ - applicationName: string | undefined; - /** RequestId */ - correlationId: string | undefined; - /** 最大执行时间 */ - maxExecutionDuration: number | undefined; - /** 最小执行时间 */ - minExecutionDuration: number | undefined; - /** 是否有异常 */ - hasException: boolean | undefined; - httpStatusCode: HttpStatusCode; - /** 客户端IP */ - clientIpAddress: string | undefined; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + /** 排序 */ + sorting: string | undefined; + /** 开始时间 */ + startTime: dayjs.Dayjs | undefined; + /** 结束时间 */ + endTime: dayjs.Dayjs | undefined; + /** 请求方法 */ + httpMethod: string | undefined; + /** 请求地址 */ + url: string | undefined; + /** 用户Id */ + userId: string | undefined; + /** 用户名 */ + userName: string | undefined; + /** 应用程序名称 */ + applicationName: string | undefined; + /** RequestId */ + correlationId: string | undefined; + /** 最大执行时间 */ + maxExecutionDuration: number | undefined; + /** 最小执行时间 */ + minExecutionDuration: number | undefined; + /** 是否有异常 */ + hasException: boolean | undefined; + httpStatusCode: HttpStatusCode; + /** 客户端IP */ + clientIpAddress: string | undefined; } export class PagingAuditLogOutput implements IPagingAuditLogOutput { - applicationName!: string | undefined; - userId!: string | undefined; - userName!: string | undefined; - tenantId!: string | undefined; - tenantName!: string | undefined; - impersonatorUserId!: string | undefined; - impersonatorTenantId!: string | undefined; - executionTime!: string | undefined; - executionDuration!: number; - clientIpAddress!: string | undefined; - clientName!: string | undefined; - clientId!: string | undefined; - correlationId!: string | undefined; - browserInfo!: string | undefined; - httpMethod!: string | undefined; - url!: string | undefined; - exceptions!: string | undefined; - comments!: string | undefined; - httpStatusCode!: number | undefined; - entityChanges!: PagingEntityChangeOutput[] | undefined; - actions!: PagingAuditLogActionOutput[] | undefined; - - constructor(data?: IPagingAuditLogOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.applicationName = _data['applicationName']; - this.userId = _data['userId']; - this.userName = _data['userName']; - this.tenantId = _data['tenantId']; - this.tenantName = _data['tenantName']; - this.impersonatorUserId = _data['impersonatorUserId']; - this.impersonatorTenantId = _data['impersonatorTenantId']; - this.executionTime = _data['executionTime']; - this.executionDuration = _data['executionDuration']; - this.clientIpAddress = _data['clientIpAddress']; - this.clientName = _data['clientName']; - this.clientId = _data['clientId']; - this.correlationId = _data['correlationId']; - this.browserInfo = _data['browserInfo']; - this.httpMethod = _data['httpMethod']; - this.url = _data['url']; - this.exceptions = _data['exceptions']; - this.comments = _data['comments']; - this.httpStatusCode = _data['httpStatusCode']; - if (Array.isArray(_data['entityChanges'])) { - this.entityChanges = [] as any; - for (let item of _data['entityChanges']) - this.entityChanges!.push(PagingEntityChangeOutput.fromJS(item)); - } - if (Array.isArray(_data['actions'])) { - this.actions = [] as any; - for (let item of _data['actions']) - this.actions!.push(PagingAuditLogActionOutput.fromJS(item)); - } - } - } - - static fromJS(data: any): PagingAuditLogOutput { - data = typeof data === 'object' ? data : {}; - let result = new PagingAuditLogOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['applicationName'] = this.applicationName; - data['userId'] = this.userId; - data['userName'] = this.userName; - data['tenantId'] = this.tenantId; - data['tenantName'] = this.tenantName; - data['impersonatorUserId'] = this.impersonatorUserId; - data['impersonatorTenantId'] = this.impersonatorTenantId; - data['executionTime'] = this.executionTime; - data['executionDuration'] = this.executionDuration; - data['clientIpAddress'] = this.clientIpAddress; - data['clientName'] = this.clientName; - data['clientId'] = this.clientId; - data['correlationId'] = this.correlationId; - data['browserInfo'] = this.browserInfo; - data['httpMethod'] = this.httpMethod; - data['url'] = this.url; - data['exceptions'] = this.exceptions; - data['comments'] = this.comments; - data['httpStatusCode'] = this.httpStatusCode; - if (Array.isArray(this.entityChanges)) { - data['entityChanges'] = []; - for (let item of this.entityChanges) data['entityChanges'].push(item.toJSON()); - } - if (Array.isArray(this.actions)) { - data['actions'] = []; - for (let item of this.actions) data['actions'].push(item.toJSON()); - } - return data; - } + applicationName!: string | undefined; + userId!: string | undefined; + userName!: string | undefined; + tenantId!: string | undefined; + tenantName!: string | undefined; + impersonatorUserId!: string | undefined; + impersonatorTenantId!: string | undefined; + executionTime!: string | undefined; + executionDuration!: number; + clientIpAddress!: string | undefined; + clientName!: string | undefined; + clientId!: string | undefined; + correlationId!: string | undefined; + browserInfo!: string | undefined; + httpMethod!: string | undefined; + url!: string | undefined; + exceptions!: string | undefined; + comments!: string | undefined; + httpStatusCode!: number | undefined; + entityChanges!: PagingEntityChangeOutput[] | undefined; + actions!: PagingAuditLogActionOutput[] | undefined; + + constructor(data?: IPagingAuditLogOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.applicationName = _data["applicationName"]; + this.userId = _data["userId"]; + this.userName = _data["userName"]; + this.tenantId = _data["tenantId"]; + this.tenantName = _data["tenantName"]; + this.impersonatorUserId = _data["impersonatorUserId"]; + this.impersonatorTenantId = _data["impersonatorTenantId"]; + this.executionTime = _data["executionTime"]; + this.executionDuration = _data["executionDuration"]; + this.clientIpAddress = _data["clientIpAddress"]; + this.clientName = _data["clientName"]; + this.clientId = _data["clientId"]; + this.correlationId = _data["correlationId"]; + this.browserInfo = _data["browserInfo"]; + this.httpMethod = _data["httpMethod"]; + this.url = _data["url"]; + this.exceptions = _data["exceptions"]; + this.comments = _data["comments"]; + this.httpStatusCode = _data["httpStatusCode"]; + if (Array.isArray(_data["entityChanges"])) { + this.entityChanges = [] as any; + for (let item of _data["entityChanges"]) + this.entityChanges!.push(PagingEntityChangeOutput.fromJS(item)); + } + if (Array.isArray(_data["actions"])) { + this.actions = [] as any; + for (let item of _data["actions"]) + this.actions!.push(PagingAuditLogActionOutput.fromJS(item)); + } + } + } + + static fromJS(data: any): PagingAuditLogOutput { + data = typeof data === 'object' ? data : {}; + let result = new PagingAuditLogOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["applicationName"] = this.applicationName; + data["userId"] = this.userId; + data["userName"] = this.userName; + data["tenantId"] = this.tenantId; + data["tenantName"] = this.tenantName; + data["impersonatorUserId"] = this.impersonatorUserId; + data["impersonatorTenantId"] = this.impersonatorTenantId; + data["executionTime"] = this.executionTime; + data["executionDuration"] = this.executionDuration; + data["clientIpAddress"] = this.clientIpAddress; + data["clientName"] = this.clientName; + data["clientId"] = this.clientId; + data["correlationId"] = this.correlationId; + data["browserInfo"] = this.browserInfo; + data["httpMethod"] = this.httpMethod; + data["url"] = this.url; + data["exceptions"] = this.exceptions; + data["comments"] = this.comments; + data["httpStatusCode"] = this.httpStatusCode; + if (Array.isArray(this.entityChanges)) { + data["entityChanges"] = []; + for (let item of this.entityChanges) + data["entityChanges"].push(item.toJSON()); + } + if (Array.isArray(this.actions)) { + data["actions"] = []; + for (let item of this.actions) + data["actions"].push(item.toJSON()); + } + return data; + } } export interface IPagingAuditLogOutput { - applicationName: string | undefined; - userId: string | undefined; - userName: string | undefined; - tenantId: string | undefined; - tenantName: string | undefined; - impersonatorUserId: string | undefined; - impersonatorTenantId: string | undefined; - executionTime: string | undefined; - executionDuration: number; - clientIpAddress: string | undefined; - clientName: string | undefined; - clientId: string | undefined; - correlationId: string | undefined; - browserInfo: string | undefined; - httpMethod: string | undefined; - url: string | undefined; - exceptions: string | undefined; - comments: string | undefined; - httpStatusCode: number | undefined; - entityChanges: PagingEntityChangeOutput[] | undefined; - actions: PagingAuditLogActionOutput[] | undefined; + applicationName: string | undefined; + userId: string | undefined; + userName: string | undefined; + tenantId: string | undefined; + tenantName: string | undefined; + impersonatorUserId: string | undefined; + impersonatorTenantId: string | undefined; + executionTime: string | undefined; + executionDuration: number; + clientIpAddress: string | undefined; + clientName: string | undefined; + clientId: string | undefined; + correlationId: string | undefined; + browserInfo: string | undefined; + httpMethod: string | undefined; + url: string | undefined; + exceptions: string | undefined; + comments: string | undefined; + httpStatusCode: number | undefined; + entityChanges: PagingEntityChangeOutput[] | undefined; + actions: PagingAuditLogActionOutput[] | undefined; } export class PagingAuditLogOutputPagedResultDto implements IPagingAuditLogOutputPagedResultDto { - items!: PagingAuditLogOutput[] | undefined; - totalCount!: number; - - constructor(data?: IPagingAuditLogOutputPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + items!: PagingAuditLogOutput[] | undefined; + totalCount!: number; + + constructor(data?: IPagingAuditLogOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) this.items!.push(PagingAuditLogOutput.fromJS(item)); - } - this.totalCount = _data['totalCount']; + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(PagingAuditLogOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } } - } - static fromJS(data: any): PagingAuditLogOutputPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new PagingAuditLogOutputPagedResultDto(); - result.init(data); - return result; - } + static fromJS(data: any): PagingAuditLogOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new PagingAuditLogOutputPagedResultDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; } - data['totalCount'] = this.totalCount; - return data; - } } export interface IPagingAuditLogOutputPagedResultDto { - items: PagingAuditLogOutput[] | undefined; - totalCount: number; + items: PagingAuditLogOutput[] | undefined; + totalCount: number; } export class PagingDataDictionaryDetailInput implements IPagingDataDictionaryDetailInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - dataDictionaryId!: string; - filter!: string | undefined; - - constructor(data?: IPagingDataDictionaryDetailInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.dataDictionaryId = _data['dataDictionaryId']; - this.filter = _data['filter']; - } - } - - static fromJS(data: any): PagingDataDictionaryDetailInput { - data = typeof data === 'object' ? data : {}; - let result = new PagingDataDictionaryDetailInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['dataDictionaryId'] = this.dataDictionaryId; - data['filter'] = this.filter; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + dataDictionaryId!: string; + filter!: string | undefined; + + constructor(data?: IPagingDataDictionaryDetailInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.dataDictionaryId = _data["dataDictionaryId"]; + this.filter = _data["filter"]; + } + } + + static fromJS(data: any): PagingDataDictionaryDetailInput { + data = typeof data === 'object' ? data : {}; + let result = new PagingDataDictionaryDetailInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["dataDictionaryId"] = this.dataDictionaryId; + data["filter"] = this.filter; + return data; + } } export interface IPagingDataDictionaryDetailInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - dataDictionaryId: string; - filter: string | undefined; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + dataDictionaryId: string; + filter: string | undefined; } export class PagingDataDictionaryDetailOutput implements IPagingDataDictionaryDetailOutput { - id!: string; - /** 所属字典Id */ - dataDictionaryId!: string; - /** 字典明细编码 */ - code!: string | undefined; - /** 展现列表时排序用 */ - order!: number; - /** 英文显示名 */ - displayText!: string | undefined; - /** 描述 */ - description!: string | undefined; - /** 启/停用(默认启用) */ - isEnabled!: boolean; - - constructor(data?: IPagingDataDictionaryDetailOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.dataDictionaryId = _data['dataDictionaryId']; - this.code = _data['code']; - this.order = _data['order']; - this.displayText = _data['displayText']; - this.description = _data['description']; - this.isEnabled = _data['isEnabled']; - } - } - - static fromJS(data: any): PagingDataDictionaryDetailOutput { - data = typeof data === 'object' ? data : {}; - let result = new PagingDataDictionaryDetailOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['dataDictionaryId'] = this.dataDictionaryId; - data['code'] = this.code; - data['order'] = this.order; - data['displayText'] = this.displayText; - data['description'] = this.description; - data['isEnabled'] = this.isEnabled; - return data; - } + id!: string; + /** 所属字典Id */ + dataDictionaryId!: string; + /** 字典明细编码 */ + code!: string | undefined; + /** 展现列表时排序用 */ + order!: number; + /** 英文显示名 */ + displayText!: string | undefined; + /** 描述 */ + description!: string | undefined; + /** 启/停用(默认启用) */ + isEnabled!: boolean; + + constructor(data?: IPagingDataDictionaryDetailOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.dataDictionaryId = _data["dataDictionaryId"]; + this.code = _data["code"]; + this.order = _data["order"]; + this.displayText = _data["displayText"]; + this.description = _data["description"]; + this.isEnabled = _data["isEnabled"]; + } + } + + static fromJS(data: any): PagingDataDictionaryDetailOutput { + data = typeof data === 'object' ? data : {}; + let result = new PagingDataDictionaryDetailOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["dataDictionaryId"] = this.dataDictionaryId; + data["code"] = this.code; + data["order"] = this.order; + data["displayText"] = this.displayText; + data["description"] = this.description; + data["isEnabled"] = this.isEnabled; + return data; + } } export interface IPagingDataDictionaryDetailOutput { - id: string; - /** 所属字典Id */ - dataDictionaryId: string; - /** 字典明细编码 */ - code: string | undefined; - /** 展现列表时排序用 */ - order: number; - /** 英文显示名 */ - displayText: string | undefined; - /** 描述 */ - description: string | undefined; - /** 启/停用(默认启用) */ - isEnabled: boolean; -} - -export class PagingDataDictionaryDetailOutputPagedResultDto - implements IPagingDataDictionaryDetailOutputPagedResultDto -{ - items!: PagingDataDictionaryDetailOutput[] | undefined; - totalCount!: number; - - constructor(data?: IPagingDataDictionaryDetailOutputPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) - this.items!.push(PagingDataDictionaryDetailOutput.fromJS(item)); - } - this.totalCount = _data['totalCount']; - } - } - - static fromJS(data: any): PagingDataDictionaryDetailOutputPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new PagingDataDictionaryDetailOutputPagedResultDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); - } - data['totalCount'] = this.totalCount; - return data; - } + id: string; + /** 所属字典Id */ + dataDictionaryId: string; + /** 字典明细编码 */ + code: string | undefined; + /** 展现列表时排序用 */ + order: number; + /** 英文显示名 */ + displayText: string | undefined; + /** 描述 */ + description: string | undefined; + /** 启/停用(默认启用) */ + isEnabled: boolean; +} + +export class PagingDataDictionaryDetailOutputPagedResultDto implements IPagingDataDictionaryDetailOutputPagedResultDto { + items!: PagingDataDictionaryDetailOutput[] | undefined; + totalCount!: number; + + constructor(data?: IPagingDataDictionaryDetailOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(PagingDataDictionaryDetailOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } + } + + static fromJS(data: any): PagingDataDictionaryDetailOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new PagingDataDictionaryDetailOutputPagedResultDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; + } } export interface IPagingDataDictionaryDetailOutputPagedResultDto { - items: PagingDataDictionaryDetailOutput[] | undefined; - totalCount: number; + items: PagingDataDictionaryDetailOutput[] | undefined; + totalCount: number; } export class PagingDataDictionaryInput implements IPagingDataDictionaryInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - filter!: string | undefined; - - constructor(data?: IPagingDataDictionaryInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.filter = _data['filter']; - } - } - - static fromJS(data: any): PagingDataDictionaryInput { - data = typeof data === 'object' ? data : {}; - let result = new PagingDataDictionaryInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['filter'] = this.filter; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + filter!: string | undefined; + + constructor(data?: IPagingDataDictionaryInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.filter = _data["filter"]; + } + } + + static fromJS(data: any): PagingDataDictionaryInput { + data = typeof data === 'object' ? data : {}; + let result = new PagingDataDictionaryInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["filter"] = this.filter; + return data; + } } export interface IPagingDataDictionaryInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - filter: string | undefined; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + filter: string | undefined; } export class PagingDataDictionaryOutput implements IPagingDataDictionaryOutput { - id!: string; - /** 字典编码 */ - code!: string | undefined; - /** 显示名 */ - displayText!: string | undefined; - /** 描述 */ - description!: string | undefined; - - constructor(data?: IPagingDataDictionaryOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.code = _data['code']; - this.displayText = _data['displayText']; - this.description = _data['description']; - } - } - - static fromJS(data: any): PagingDataDictionaryOutput { - data = typeof data === 'object' ? data : {}; - let result = new PagingDataDictionaryOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['code'] = this.code; - data['displayText'] = this.displayText; - data['description'] = this.description; - return data; - } + id!: string; + /** 字典编码 */ + code!: string | undefined; + /** 显示名 */ + displayText!: string | undefined; + /** 描述 */ + description!: string | undefined; + + constructor(data?: IPagingDataDictionaryOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.code = _data["code"]; + this.displayText = _data["displayText"]; + this.description = _data["description"]; + } + } + + static fromJS(data: any): PagingDataDictionaryOutput { + data = typeof data === 'object' ? data : {}; + let result = new PagingDataDictionaryOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["code"] = this.code; + data["displayText"] = this.displayText; + data["description"] = this.description; + return data; + } } export interface IPagingDataDictionaryOutput { - id: string; - /** 字典编码 */ - code: string | undefined; - /** 显示名 */ - displayText: string | undefined; - /** 描述 */ - description: string | undefined; -} - -export class PagingDataDictionaryOutputPagedResultDto - implements IPagingDataDictionaryOutputPagedResultDto -{ - items!: PagingDataDictionaryOutput[] | undefined; - totalCount!: number; - - constructor(data?: IPagingDataDictionaryOutputPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) this.items!.push(PagingDataDictionaryOutput.fromJS(item)); - } - this.totalCount = _data['totalCount']; - } - } - - static fromJS(data: any): PagingDataDictionaryOutputPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new PagingDataDictionaryOutputPagedResultDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); - } - data['totalCount'] = this.totalCount; - return data; - } + id: string; + /** 字典编码 */ + code: string | undefined; + /** 显示名 */ + displayText: string | undefined; + /** 描述 */ + description: string | undefined; +} + +export class PagingDataDictionaryOutputPagedResultDto implements IPagingDataDictionaryOutputPagedResultDto { + items!: PagingDataDictionaryOutput[] | undefined; + totalCount!: number; + + constructor(data?: IPagingDataDictionaryOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(PagingDataDictionaryOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } + } + + static fromJS(data: any): PagingDataDictionaryOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new PagingDataDictionaryOutputPagedResultDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; + } } export interface IPagingDataDictionaryOutputPagedResultDto { - items: PagingDataDictionaryOutput[] | undefined; - totalCount: number; + items: PagingDataDictionaryOutput[] | undefined; + totalCount: number; } export class PagingEntityChangeOutput implements IPagingEntityChangeOutput { - id!: string; - auditLogId!: string; - tenantId!: string | undefined; - changeTime!: string | undefined; - changeType!: EntityChangeType; - changeTypeDescription!: string | undefined; - entityTenantId!: string | undefined; - entityId!: string | undefined; - entityTypeFullName!: string | undefined; - propertyChanges!: PagingEntityPropertyChangeOutput[] | undefined; - extraProperties!: { [key: string]: any } | undefined; - - constructor(data?: IPagingEntityChangeOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.auditLogId = _data['auditLogId']; - this.tenantId = _data['tenantId']; - this.changeTime = _data['changeTime']; - this.changeType = _data['changeType']; - this.changeTypeDescription = _data['changeTypeDescription']; - this.entityTenantId = _data['entityTenantId']; - this.entityId = _data['entityId']; - this.entityTypeFullName = _data['entityTypeFullName']; - if (Array.isArray(_data['propertyChanges'])) { - this.propertyChanges = [] as any; - for (let item of _data['propertyChanges']) - this.propertyChanges!.push(PagingEntityPropertyChangeOutput.fromJS(item)); - } - if (_data['extraProperties']) { - this.extraProperties = {} as any; - for (let key in _data['extraProperties']) { - if (_data['extraProperties'].hasOwnProperty(key)) - (this.extraProperties)![key] = _data['extraProperties'][key]; - } - } - } - } - - static fromJS(data: any): PagingEntityChangeOutput { - data = typeof data === 'object' ? data : {}; - let result = new PagingEntityChangeOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['auditLogId'] = this.auditLogId; - data['tenantId'] = this.tenantId; - data['changeTime'] = this.changeTime; - data['changeType'] = this.changeType; - data['changeTypeDescription'] = this.changeTypeDescription; - data['entityTenantId'] = this.entityTenantId; - data['entityId'] = this.entityId; - data['entityTypeFullName'] = this.entityTypeFullName; - if (Array.isArray(this.propertyChanges)) { - data['propertyChanges'] = []; - for (let item of this.propertyChanges) data['propertyChanges'].push(item.toJSON()); - } - if (this.extraProperties) { - data['extraProperties'] = {}; - for (let key in this.extraProperties) { - if (this.extraProperties.hasOwnProperty(key)) - (data['extraProperties'])[key] = (this.extraProperties)[key]; - } - } - return data; - } + id!: string; + auditLogId!: string; + tenantId!: string | undefined; + changeTime!: string | undefined; + changeType!: EntityChangeType; + changeTypeDescription!: string | undefined; + entityTenantId!: string | undefined; + entityId!: string | undefined; + entityTypeFullName!: string | undefined; + propertyChanges!: PagingEntityPropertyChangeOutput[] | undefined; + extraProperties!: { [key: string]: any; } | undefined; + + constructor(data?: IPagingEntityChangeOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.auditLogId = _data["auditLogId"]; + this.tenantId = _data["tenantId"]; + this.changeTime = _data["changeTime"]; + this.changeType = _data["changeType"]; + this.changeTypeDescription = _data["changeTypeDescription"]; + this.entityTenantId = _data["entityTenantId"]; + this.entityId = _data["entityId"]; + this.entityTypeFullName = _data["entityTypeFullName"]; + if (Array.isArray(_data["propertyChanges"])) { + this.propertyChanges = [] as any; + for (let item of _data["propertyChanges"]) + this.propertyChanges!.push(PagingEntityPropertyChangeOutput.fromJS(item)); + } + if (_data["extraProperties"]) { + this.extraProperties = {} as any; + for (let key in _data["extraProperties"]) { + if (_data["extraProperties"].hasOwnProperty(key)) + (this.extraProperties)![key] = _data["extraProperties"][key]; + } + } + } + } + + static fromJS(data: any): PagingEntityChangeOutput { + data = typeof data === 'object' ? data : {}; + let result = new PagingEntityChangeOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["auditLogId"] = this.auditLogId; + data["tenantId"] = this.tenantId; + data["changeTime"] = this.changeTime; + data["changeType"] = this.changeType; + data["changeTypeDescription"] = this.changeTypeDescription; + data["entityTenantId"] = this.entityTenantId; + data["entityId"] = this.entityId; + data["entityTypeFullName"] = this.entityTypeFullName; + if (Array.isArray(this.propertyChanges)) { + data["propertyChanges"] = []; + for (let item of this.propertyChanges) + data["propertyChanges"].push(item.toJSON()); + } + if (this.extraProperties) { + data["extraProperties"] = {}; + for (let key in this.extraProperties) { + if (this.extraProperties.hasOwnProperty(key)) + (data["extraProperties"])[key] = (this.extraProperties)[key]; + } + } + return data; + } } export interface IPagingEntityChangeOutput { - id: string; - auditLogId: string; - tenantId: string | undefined; - changeTime: string | undefined; - changeType: EntityChangeType; - changeTypeDescription: string | undefined; - entityTenantId: string | undefined; - entityId: string | undefined; - entityTypeFullName: string | undefined; - propertyChanges: PagingEntityPropertyChangeOutput[] | undefined; - extraProperties: { [key: string]: any } | undefined; + id: string; + auditLogId: string; + tenantId: string | undefined; + changeTime: string | undefined; + changeType: EntityChangeType; + changeTypeDescription: string | undefined; + entityTenantId: string | undefined; + entityId: string | undefined; + entityTypeFullName: string | undefined; + propertyChanges: PagingEntityPropertyChangeOutput[] | undefined; + extraProperties: { [key: string]: any; } | undefined; } export class PagingEntityPropertyChangeOutput implements IPagingEntityPropertyChangeOutput { - id!: string; - tenantId!: string | undefined; - entityChangeId!: string; - newValue!: string | undefined; - originalValue!: string | undefined; - propertyName!: string | undefined; - propertyTypeFullName!: string | undefined; - - constructor(data?: IPagingEntityPropertyChangeOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.tenantId = _data['tenantId']; - this.entityChangeId = _data['entityChangeId']; - this.newValue = _data['newValue']; - this.originalValue = _data['originalValue']; - this.propertyName = _data['propertyName']; - this.propertyTypeFullName = _data['propertyTypeFullName']; - } - } - - static fromJS(data: any): PagingEntityPropertyChangeOutput { - data = typeof data === 'object' ? data : {}; - let result = new PagingEntityPropertyChangeOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['tenantId'] = this.tenantId; - data['entityChangeId'] = this.entityChangeId; - data['newValue'] = this.newValue; - data['originalValue'] = this.originalValue; - data['propertyName'] = this.propertyName; - data['propertyTypeFullName'] = this.propertyTypeFullName; - return data; - } + id!: string; + tenantId!: string | undefined; + entityChangeId!: string; + newValue!: string | undefined; + originalValue!: string | undefined; + propertyName!: string | undefined; + propertyTypeFullName!: string | undefined; + + constructor(data?: IPagingEntityPropertyChangeOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.tenantId = _data["tenantId"]; + this.entityChangeId = _data["entityChangeId"]; + this.newValue = _data["newValue"]; + this.originalValue = _data["originalValue"]; + this.propertyName = _data["propertyName"]; + this.propertyTypeFullName = _data["propertyTypeFullName"]; + } + } + + static fromJS(data: any): PagingEntityPropertyChangeOutput { + data = typeof data === 'object' ? data : {}; + let result = new PagingEntityPropertyChangeOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["tenantId"] = this.tenantId; + data["entityChangeId"] = this.entityChangeId; + data["newValue"] = this.newValue; + data["originalValue"] = this.originalValue; + data["propertyName"] = this.propertyName; + data["propertyTypeFullName"] = this.propertyTypeFullName; + return data; + } } export interface IPagingEntityPropertyChangeOutput { - id: string; - tenantId: string | undefined; - entityChangeId: string; - newValue: string | undefined; - originalValue: string | undefined; - propertyName: string | undefined; - propertyTypeFullName: string | undefined; + id: string; + tenantId: string | undefined; + entityChangeId: string; + newValue: string | undefined; + originalValue: string | undefined; + propertyName: string | undefined; + propertyTypeFullName: string | undefined; +} + +export class PagingIdentitySecurityLogInput implements IPagingIdentitySecurityLogInput { + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + /** 排序 */ + sorting!: string | undefined; + /** 开始时间 */ + startTime!: dayjs.Dayjs | undefined; + /** 结束时间 */ + endTime!: dayjs.Dayjs | undefined; + identity!: string | undefined; + /** 请求地址 */ + action!: string | undefined; + /** 用户Id */ + userId!: string | undefined; + /** 用户名 */ + userName!: string | undefined; + /** 应用程序名称 */ + applicationName!: string | undefined; + /** RequestId */ + correlationId!: string | undefined; + /** ClientId */ + clientId!: string | undefined; + + constructor(data?: IPagingIdentitySecurityLogInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.sorting = _data["sorting"]; + this.startTime = _data["startTime"] ? dayjs(_data["startTime"].toString()) : undefined; + this.endTime = _data["endTime"] ? dayjs(_data["endTime"].toString()) : undefined; + this.identity = _data["identity"]; + this.action = _data["action"]; + this.userId = _data["userId"]; + this.userName = _data["userName"]; + this.applicationName = _data["applicationName"]; + this.correlationId = _data["correlationId"]; + this.clientId = _data["clientId"]; + } + } + + static fromJS(data: any): PagingIdentitySecurityLogInput { + data = typeof data === 'object' ? data : {}; + let result = new PagingIdentitySecurityLogInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["sorting"] = this.sorting; + data["startTime"] = this.startTime ? this.startTime.toLocaleString() : undefined; + data["endTime"] = this.endTime ? this.endTime.toLocaleString() : undefined; + data["identity"] = this.identity; + data["action"] = this.action; + data["userId"] = this.userId; + data["userName"] = this.userName; + data["applicationName"] = this.applicationName; + data["correlationId"] = this.correlationId; + data["clientId"] = this.clientId; + return data; + } +} + +export interface IPagingIdentitySecurityLogInput { + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + /** 排序 */ + sorting: string | undefined; + /** 开始时间 */ + startTime: dayjs.Dayjs | undefined; + /** 结束时间 */ + endTime: dayjs.Dayjs | undefined; + identity: string | undefined; + /** 请求地址 */ + action: string | undefined; + /** 用户Id */ + userId: string | undefined; + /** 用户名 */ + userName: string | undefined; + /** 应用程序名称 */ + applicationName: string | undefined; + /** RequestId */ + correlationId: string | undefined; + /** ClientId */ + clientId: string | undefined; +} + +export class PagingIdentitySecurityLogOutput implements IPagingIdentitySecurityLogOutput { + id!: string; + tenantId!: string | undefined; + applicationName!: string | undefined; + identity!: string | undefined; + action!: string | undefined; + userId!: string | undefined; + userName!: string | undefined; + tenantName!: string | undefined; + clientId!: string | undefined; + correlationId!: string | undefined; + clientIpAddress!: string | undefined; + browserInfo!: string | undefined; + creationTime!: dayjs.Dayjs; + + constructor(data?: IPagingIdentitySecurityLogOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.tenantId = _data["tenantId"]; + this.applicationName = _data["applicationName"]; + this.identity = _data["identity"]; + this.action = _data["action"]; + this.userId = _data["userId"]; + this.userName = _data["userName"]; + this.tenantName = _data["tenantName"]; + this.clientId = _data["clientId"]; + this.correlationId = _data["correlationId"]; + this.clientIpAddress = _data["clientIpAddress"]; + this.browserInfo = _data["browserInfo"]; + this.creationTime = _data["creationTime"] ? dayjs(_data["creationTime"].toString()) : undefined; + } + } + + static fromJS(data: any): PagingIdentitySecurityLogOutput { + data = typeof data === 'object' ? data : {}; + let result = new PagingIdentitySecurityLogOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["tenantId"] = this.tenantId; + data["applicationName"] = this.applicationName; + data["identity"] = this.identity; + data["action"] = this.action; + data["userId"] = this.userId; + data["userName"] = this.userName; + data["tenantName"] = this.tenantName; + data["clientId"] = this.clientId; + data["correlationId"] = this.correlationId; + data["clientIpAddress"] = this.clientIpAddress; + data["browserInfo"] = this.browserInfo; + data["creationTime"] = this.creationTime ? this.creationTime.toLocaleString() : undefined; + return data; + } +} + +export interface IPagingIdentitySecurityLogOutput { + id: string; + tenantId: string | undefined; + applicationName: string | undefined; + identity: string | undefined; + action: string | undefined; + userId: string | undefined; + userName: string | undefined; + tenantName: string | undefined; + clientId: string | undefined; + correlationId: string | undefined; + clientIpAddress: string | undefined; + browserInfo: string | undefined; + creationTime: dayjs.Dayjs; +} + +export class PagingIdentitySecurityLogOutputPagedResultDto implements IPagingIdentitySecurityLogOutputPagedResultDto { + items!: PagingIdentitySecurityLogOutput[] | undefined; + totalCount!: number; + + constructor(data?: IPagingIdentitySecurityLogOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(PagingIdentitySecurityLogOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } + } + + static fromJS(data: any): PagingIdentitySecurityLogOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new PagingIdentitySecurityLogOutputPagedResultDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; + } +} + +export interface IPagingIdentitySecurityLogOutputPagedResultDto { + items: PagingIdentitySecurityLogOutput[] | undefined; + totalCount: number; } export class PagingNotificationListInput implements IPagingNotificationListInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - - constructor(data?: IPagingNotificationListInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - } - } - - static fromJS(data: any): PagingNotificationListInput { - data = typeof data === 'object' ? data : {}; - let result = new PagingNotificationListInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + + constructor(data?: IPagingNotificationListInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + } + } + + static fromJS(data: any): PagingNotificationListInput { + data = typeof data === 'object' ? data : {}; + let result = new PagingNotificationListInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + return data; + } } export interface IPagingNotificationListInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; } export class PagingNotificationListOutput implements IPagingNotificationListOutput { - id!: string; - /** 消息标题 */ - title!: string | undefined; - /** 消息内容 */ - content!: string | undefined; - messageType!: MessageType; - readonly messageTypeDescription!: string | undefined; - messageLevel!: MessageLevel; - readonly messageLevelDescription!: string | undefined; - /** 发送人 */ - senderId!: string; - /** 创建时间 */ - creationTime!: dayjs.Dayjs; - /** 是否已读 */ - read!: boolean; - - constructor(data?: IPagingNotificationListOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.title = _data['title']; - this.content = _data['content']; - this.messageType = _data['messageType']; - (this).messageTypeDescription = _data['messageTypeDescription']; - this.messageLevel = _data['messageLevel']; - (this).messageLevelDescription = _data['messageLevelDescription']; - this.senderId = _data['senderId']; - this.creationTime = _data['creationTime'] - ? dayjs(_data['creationTime'].toString()) - : undefined; - this.read = _data['read']; - } - } - - static fromJS(data: any): PagingNotificationListOutput { - data = typeof data === 'object' ? data : {}; - let result = new PagingNotificationListOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['title'] = this.title; - data['content'] = this.content; - data['messageType'] = this.messageType; - data['messageTypeDescription'] = this.messageTypeDescription; - data['messageLevel'] = this.messageLevel; - data['messageLevelDescription'] = this.messageLevelDescription; - data['senderId'] = this.senderId; - data['creationTime'] = this.creationTime ? this.creationTime.toLocaleString() : undefined; - data['read'] = this.read; - return data; - } + id!: string; + /** 消息标题 */ + title!: string | undefined; + /** 消息内容 */ + content!: string | undefined; + messageType!: MessageType; + readonly messageTypeDescription!: string | undefined; + messageLevel!: MessageLevel; + readonly messageLevelDescription!: string | undefined; + /** 发送人 */ + senderId!: string; + /** 创建时间 */ + creationTime!: dayjs.Dayjs; + /** 是否已读 */ + read!: boolean; + + constructor(data?: IPagingNotificationListOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.title = _data["title"]; + this.content = _data["content"]; + this.messageType = _data["messageType"]; + (this).messageTypeDescription = _data["messageTypeDescription"]; + this.messageLevel = _data["messageLevel"]; + (this).messageLevelDescription = _data["messageLevelDescription"]; + this.senderId = _data["senderId"]; + this.creationTime = _data["creationTime"] ? dayjs(_data["creationTime"].toString()) : undefined; + this.read = _data["read"]; + } + } + + static fromJS(data: any): PagingNotificationListOutput { + data = typeof data === 'object' ? data : {}; + let result = new PagingNotificationListOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["title"] = this.title; + data["content"] = this.content; + data["messageType"] = this.messageType; + data["messageTypeDescription"] = this.messageTypeDescription; + data["messageLevel"] = this.messageLevel; + data["messageLevelDescription"] = this.messageLevelDescription; + data["senderId"] = this.senderId; + data["creationTime"] = this.creationTime ? this.creationTime.toLocaleString() : undefined; + data["read"] = this.read; + return data; + } } export interface IPagingNotificationListOutput { - id: string; - /** 消息标题 */ - title: string | undefined; - /** 消息内容 */ - content: string | undefined; - messageType: MessageType; - messageTypeDescription: string | undefined; - messageLevel: MessageLevel; - messageLevelDescription: string | undefined; - /** 发送人 */ - senderId: string; - /** 创建时间 */ - creationTime: dayjs.Dayjs; - /** 是否已读 */ - read: boolean; -} - -export class PagingNotificationListOutputPagedResultDto - implements IPagingNotificationListOutputPagedResultDto -{ - items!: PagingNotificationListOutput[] | undefined; - totalCount!: number; - - constructor(data?: IPagingNotificationListOutputPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) - this.items!.push(PagingNotificationListOutput.fromJS(item)); - } - this.totalCount = _data['totalCount']; - } - } - - static fromJS(data: any): PagingNotificationListOutputPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new PagingNotificationListOutputPagedResultDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); - } - data['totalCount'] = this.totalCount; - return data; - } + id: string; + /** 消息标题 */ + title: string | undefined; + /** 消息内容 */ + content: string | undefined; + messageType: MessageType; + messageTypeDescription: string | undefined; + messageLevel: MessageLevel; + messageLevelDescription: string | undefined; + /** 发送人 */ + senderId: string; + /** 创建时间 */ + creationTime: dayjs.Dayjs; + /** 是否已读 */ + read: boolean; +} + +export class PagingNotificationListOutputPagedResultDto implements IPagingNotificationListOutputPagedResultDto { + items!: PagingNotificationListOutput[] | undefined; + totalCount!: number; + + constructor(data?: IPagingNotificationListOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(PagingNotificationListOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } + } + + static fromJS(data: any): PagingNotificationListOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new PagingNotificationListOutputPagedResultDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; + } } export interface IPagingNotificationListOutputPagedResultDto { - items: PagingNotificationListOutput[] | undefined; - totalCount: number; + items: PagingNotificationListOutput[] | undefined; + totalCount: number; } export class PagingRoleListInput implements IPagingRoleListInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - filter!: string | undefined; - - constructor(data?: IPagingRoleListInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.filter = _data['filter']; - } - } - - static fromJS(data: any): PagingRoleListInput { - data = typeof data === 'object' ? data : {}; - let result = new PagingRoleListInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['filter'] = this.filter; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + filter!: string | undefined; + + constructor(data?: IPagingRoleListInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.filter = _data["filter"]; + } + } + + static fromJS(data: any): PagingRoleListInput { + data = typeof data === 'object' ? data : {}; + let result = new PagingRoleListInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["filter"] = this.filter; + return data; + } } export interface IPagingRoleListInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - filter: string | undefined; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + filter: string | undefined; } export class PagingTenantInput implements IPagingTenantInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - filter!: string | undefined; - - constructor(data?: IPagingTenantInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.filter = _data['filter']; - } - } - - static fromJS(data: any): PagingTenantInput { - data = typeof data === 'object' ? data : {}; - let result = new PagingTenantInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['filter'] = this.filter; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + filter!: string | undefined; + + constructor(data?: IPagingTenantInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.filter = _data["filter"]; + } + } + + static fromJS(data: any): PagingTenantInput { + data = typeof data === 'object' ? data : {}; + let result = new PagingTenantInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["filter"] = this.filter; + return data; + } } export interface IPagingTenantInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - filter: string | undefined; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + filter: string | undefined; } export class PagingUserListInput implements IPagingUserListInput { - /** 当前页面.默认从1开始 */ - pageIndex!: number; - /** 每页多少条.每页显示多少记录 */ - pageSize!: number; - /** 跳过多少条 */ - readonly skipCount!: number; - /** 关键字 */ - filter!: string | undefined; - - constructor(data?: IPagingUserListInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.pageIndex = _data['pageIndex']; - this.pageSize = _data['pageSize']; - (this).skipCount = _data['skipCount']; - this.filter = _data['filter']; - } - } - - static fromJS(data: any): PagingUserListInput { - data = typeof data === 'object' ? data : {}; - let result = new PagingUserListInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['pageIndex'] = this.pageIndex; - data['pageSize'] = this.pageSize; - data['skipCount'] = this.skipCount; - data['filter'] = this.filter; - return data; - } + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + /** 关键字 */ + filter!: string | undefined; + + constructor(data?: IPagingUserListInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.filter = _data["filter"]; + } + } + + static fromJS(data: any): PagingUserListInput { + data = typeof data === 'object' ? data : {}; + let result = new PagingUserListInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["filter"] = this.filter; + return data; + } } export interface IPagingUserListInput { - /** 当前页面.默认从1开始 */ - pageIndex: number; - /** 每页多少条.每页显示多少记录 */ - pageSize: number; - /** 跳过多少条 */ - skipCount: number; - /** 关键字 */ - filter: string | undefined; + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + /** 关键字 */ + filter: string | undefined; } export class ParameterApiDescriptionModel implements IParameterApiDescriptionModel { - nameOnMethod!: string | undefined; - name!: string | undefined; - jsonName!: string | undefined; - type!: string | undefined; - typeSimple!: string | undefined; - isOptional!: boolean; - defaultValue!: any | undefined; - constraintTypes!: string[] | undefined; - bindingSourceId!: string | undefined; - descriptorName!: string | undefined; - - constructor(data?: IParameterApiDescriptionModel) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.nameOnMethod = _data['nameOnMethod']; - this.name = _data['name']; - this.jsonName = _data['jsonName']; - this.type = _data['type']; - this.typeSimple = _data['typeSimple']; - this.isOptional = _data['isOptional']; - this.defaultValue = _data['defaultValue']; - if (Array.isArray(_data['constraintTypes'])) { - this.constraintTypes = [] as any; - for (let item of _data['constraintTypes']) this.constraintTypes!.push(item); - } - this.bindingSourceId = _data['bindingSourceId']; - this.descriptorName = _data['descriptorName']; - } - } - - static fromJS(data: any): ParameterApiDescriptionModel { - data = typeof data === 'object' ? data : {}; - let result = new ParameterApiDescriptionModel(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['nameOnMethod'] = this.nameOnMethod; - data['name'] = this.name; - data['jsonName'] = this.jsonName; - data['type'] = this.type; - data['typeSimple'] = this.typeSimple; - data['isOptional'] = this.isOptional; - data['defaultValue'] = this.defaultValue; - if (Array.isArray(this.constraintTypes)) { - data['constraintTypes'] = []; - for (let item of this.constraintTypes) data['constraintTypes'].push(item); - } - data['bindingSourceId'] = this.bindingSourceId; - data['descriptorName'] = this.descriptorName; - return data; - } + nameOnMethod!: string | undefined; + name!: string | undefined; + jsonName!: string | undefined; + type!: string | undefined; + typeSimple!: string | undefined; + isOptional!: boolean; + defaultValue!: any | undefined; + constraintTypes!: string[] | undefined; + bindingSourceId!: string | undefined; + descriptorName!: string | undefined; + + constructor(data?: IParameterApiDescriptionModel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.nameOnMethod = _data["nameOnMethod"]; + this.name = _data["name"]; + this.jsonName = _data["jsonName"]; + this.type = _data["type"]; + this.typeSimple = _data["typeSimple"]; + this.isOptional = _data["isOptional"]; + this.defaultValue = _data["defaultValue"]; + if (Array.isArray(_data["constraintTypes"])) { + this.constraintTypes = [] as any; + for (let item of _data["constraintTypes"]) + this.constraintTypes!.push(item); + } + this.bindingSourceId = _data["bindingSourceId"]; + this.descriptorName = _data["descriptorName"]; + } + } + + static fromJS(data: any): ParameterApiDescriptionModel { + data = typeof data === 'object' ? data : {}; + let result = new ParameterApiDescriptionModel(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["nameOnMethod"] = this.nameOnMethod; + data["name"] = this.name; + data["jsonName"] = this.jsonName; + data["type"] = this.type; + data["typeSimple"] = this.typeSimple; + data["isOptional"] = this.isOptional; + data["defaultValue"] = this.defaultValue; + if (Array.isArray(this.constraintTypes)) { + data["constraintTypes"] = []; + for (let item of this.constraintTypes) + data["constraintTypes"].push(item); + } + data["bindingSourceId"] = this.bindingSourceId; + data["descriptorName"] = this.descriptorName; + return data; + } } export interface IParameterApiDescriptionModel { - nameOnMethod: string | undefined; - name: string | undefined; - jsonName: string | undefined; - type: string | undefined; - typeSimple: string | undefined; - isOptional: boolean; - defaultValue: any | undefined; - constraintTypes: string[] | undefined; - bindingSourceId: string | undefined; - descriptorName: string | undefined; + nameOnMethod: string | undefined; + name: string | undefined; + jsonName: string | undefined; + type: string | undefined; + typeSimple: string | undefined; + isOptional: boolean; + defaultValue: any | undefined; + constraintTypes: string[] | undefined; + bindingSourceId: string | undefined; + descriptorName: string | undefined; } export class PermissionOutput implements IPermissionOutput { - grants!: string[] | undefined; - allGrants!: string[] | undefined; - permissions!: PermissionTreeDto[] | undefined; - - constructor(data?: IPermissionOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['grants'])) { - this.grants = [] as any; - for (let item of _data['grants']) this.grants!.push(item); - } - if (Array.isArray(_data['allGrants'])) { - this.allGrants = [] as any; - for (let item of _data['allGrants']) this.allGrants!.push(item); - } - if (Array.isArray(_data['permissions'])) { - this.permissions = [] as any; - for (let item of _data['permissions']) - this.permissions!.push(PermissionTreeDto.fromJS(item)); - } - } - } - - static fromJS(data: any): PermissionOutput { - data = typeof data === 'object' ? data : {}; - let result = new PermissionOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.grants)) { - data['grants'] = []; - for (let item of this.grants) data['grants'].push(item); - } - if (Array.isArray(this.allGrants)) { - data['allGrants'] = []; - for (let item of this.allGrants) data['allGrants'].push(item); - } - if (Array.isArray(this.permissions)) { - data['permissions'] = []; - for (let item of this.permissions) data['permissions'].push(item.toJSON()); - } - return data; - } + grants!: string[] | undefined; + allGrants!: string[] | undefined; + permissions!: PermissionTreeDto[] | undefined; + + constructor(data?: IPermissionOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["grants"])) { + this.grants = [] as any; + for (let item of _data["grants"]) + this.grants!.push(item); + } + if (Array.isArray(_data["allGrants"])) { + this.allGrants = [] as any; + for (let item of _data["allGrants"]) + this.allGrants!.push(item); + } + if (Array.isArray(_data["permissions"])) { + this.permissions = [] as any; + for (let item of _data["permissions"]) + this.permissions!.push(PermissionTreeDto.fromJS(item)); + } + } + } + + static fromJS(data: any): PermissionOutput { + data = typeof data === 'object' ? data : {}; + let result = new PermissionOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.grants)) { + data["grants"] = []; + for (let item of this.grants) + data["grants"].push(item); + } + if (Array.isArray(this.allGrants)) { + data["allGrants"] = []; + for (let item of this.allGrants) + data["allGrants"].push(item); + } + if (Array.isArray(this.permissions)) { + data["permissions"] = []; + for (let item of this.permissions) + data["permissions"].push(item.toJSON()); + } + return data; + } } export interface IPermissionOutput { - grants: string[] | undefined; - allGrants: string[] | undefined; - permissions: PermissionTreeDto[] | undefined; + grants: string[] | undefined; + allGrants: string[] | undefined; + permissions: PermissionTreeDto[] | undefined; } export class PermissionTreeDto implements IPermissionTreeDto { - title!: string | undefined; - key!: string | undefined; - children!: PermissionTreeDto[] | undefined; - - constructor(data?: IPermissionTreeDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.title = _data['title']; - this.key = _data['key']; - if (Array.isArray(_data['children'])) { - this.children = [] as any; - for (let item of _data['children']) this.children!.push(PermissionTreeDto.fromJS(item)); - } - } - } - - static fromJS(data: any): PermissionTreeDto { - data = typeof data === 'object' ? data : {}; - let result = new PermissionTreeDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['title'] = this.title; - data['key'] = this.key; - if (Array.isArray(this.children)) { - data['children'] = []; - for (let item of this.children) data['children'].push(item.toJSON()); - } - return data; - } + title!: string | undefined; + key!: string | undefined; + children!: PermissionTreeDto[] | undefined; + + constructor(data?: IPermissionTreeDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.title = _data["title"]; + this.key = _data["key"]; + if (Array.isArray(_data["children"])) { + this.children = [] as any; + for (let item of _data["children"]) + this.children!.push(PermissionTreeDto.fromJS(item)); + } + } + } + + static fromJS(data: any): PermissionTreeDto { + data = typeof data === 'object' ? data : {}; + let result = new PermissionTreeDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["title"] = this.title; + data["key"] = this.key; + if (Array.isArray(this.children)) { + data["children"] = []; + for (let item of this.children) + data["children"].push(item.toJSON()); + } + return data; + } } export interface IPermissionTreeDto { - title: string | undefined; - key: string | undefined; - children: PermissionTreeDto[] | undefined; + title: string | undefined; + key: string | undefined; + children: PermissionTreeDto[] | undefined; } -export class PropertyApiDescriptionModel implements IPropertyApiDescriptionModel { - name!: string | undefined; - jsonName!: string | undefined; - type!: string | undefined; - typeSimple!: string | undefined; - isRequired!: boolean; - minLength!: number | undefined; - maxLength!: number | undefined; - minimum!: string | undefined; - maximum!: string | undefined; - regex!: string | undefined; - - constructor(data?: IPropertyApiDescriptionModel) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.name = _data['name']; - this.jsonName = _data['jsonName']; - this.type = _data['type']; - this.typeSimple = _data['typeSimple']; - this.isRequired = _data['isRequired']; - this.minLength = _data['minLength']; - this.maxLength = _data['maxLength']; - this.minimum = _data['minimum']; - this.maximum = _data['maximum']; - this.regex = _data['regex']; - } - } - - static fromJS(data: any): PropertyApiDescriptionModel { - data = typeof data === 'object' ? data : {}; - let result = new PropertyApiDescriptionModel(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['name'] = this.name; - data['jsonName'] = this.jsonName; - data['type'] = this.type; - data['typeSimple'] = this.typeSimple; - data['isRequired'] = this.isRequired; - data['minLength'] = this.minLength; - data['maxLength'] = this.maxLength; - data['minimum'] = this.minimum; - data['maximum'] = this.maximum; - data['regex'] = this.regex; - return data; - } +export class PropertyApiDescriptionModel implements IPropertyApiDescriptionModel { + name!: string | undefined; + jsonName!: string | undefined; + type!: string | undefined; + typeSimple!: string | undefined; + isRequired!: boolean; + minLength!: number | undefined; + maxLength!: number | undefined; + minimum!: string | undefined; + maximum!: string | undefined; + regex!: string | undefined; + + constructor(data?: IPropertyApiDescriptionModel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.name = _data["name"]; + this.jsonName = _data["jsonName"]; + this.type = _data["type"]; + this.typeSimple = _data["typeSimple"]; + this.isRequired = _data["isRequired"]; + this.minLength = _data["minLength"]; + this.maxLength = _data["maxLength"]; + this.minimum = _data["minimum"]; + this.maximum = _data["maximum"]; + this.regex = _data["regex"]; + } + } + + static fromJS(data: any): PropertyApiDescriptionModel { + data = typeof data === 'object' ? data : {}; + let result = new PropertyApiDescriptionModel(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + data["jsonName"] = this.jsonName; + data["type"] = this.type; + data["typeSimple"] = this.typeSimple; + data["isRequired"] = this.isRequired; + data["minLength"] = this.minLength; + data["maxLength"] = this.maxLength; + data["minimum"] = this.minimum; + data["maximum"] = this.maximum; + data["regex"] = this.regex; + return data; + } } export interface IPropertyApiDescriptionModel { - name: string | undefined; - jsonName: string | undefined; - type: string | undefined; - typeSimple: string | undefined; - isRequired: boolean; - minLength: number | undefined; - maxLength: number | undefined; - minimum: string | undefined; - maximum: string | undefined; - regex: string | undefined; + name: string | undefined; + jsonName: string | undefined; + type: string | undefined; + typeSimple: string | undefined; + isRequired: boolean; + minLength: number | undefined; + maxLength: number | undefined; + minimum: string | undefined; + maximum: string | undefined; + regex: string | undefined; } export class RemoteServiceErrorInfo implements IRemoteServiceErrorInfo { - code!: string | undefined; - message!: string | undefined; - details!: string | undefined; - data!: { [key: string]: any } | undefined; - validationErrors!: RemoteServiceValidationErrorInfo[] | undefined; - - constructor(data?: IRemoteServiceErrorInfo) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.code = _data['code']; - this.message = _data['message']; - this.details = _data['details']; - if (_data['data']) { - this.data = {} as any; - for (let key in _data['data']) { - if (_data['data'].hasOwnProperty(key)) (this.data)![key] = _data['data'][key]; - } - } - if (Array.isArray(_data['validationErrors'])) { - this.validationErrors = [] as any; - for (let item of _data['validationErrors']) - this.validationErrors!.push(RemoteServiceValidationErrorInfo.fromJS(item)); - } - } - } - - static fromJS(data: any): RemoteServiceErrorInfo { - data = typeof data === 'object' ? data : {}; - let result = new RemoteServiceErrorInfo(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['code'] = this.code; - data['message'] = this.message; - data['details'] = this.details; - if (this.data) { - data['data'] = {}; - for (let key in this.data) { - if (this.data.hasOwnProperty(key)) (data['data'])[key] = (this.data)[key]; - } - } - if (Array.isArray(this.validationErrors)) { - data['validationErrors'] = []; - for (let item of this.validationErrors) data['validationErrors'].push(item.toJSON()); - } - return data; - } + code!: string | undefined; + message!: string | undefined; + details!: string | undefined; + data!: { [key: string]: any; } | undefined; + validationErrors!: RemoteServiceValidationErrorInfo[] | undefined; + + constructor(data?: IRemoteServiceErrorInfo) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.code = _data["code"]; + this.message = _data["message"]; + this.details = _data["details"]; + if (_data["data"]) { + this.data = {} as any; + for (let key in _data["data"]) { + if (_data["data"].hasOwnProperty(key)) + (this.data)![key] = _data["data"][key]; + } + } + if (Array.isArray(_data["validationErrors"])) { + this.validationErrors = [] as any; + for (let item of _data["validationErrors"]) + this.validationErrors!.push(RemoteServiceValidationErrorInfo.fromJS(item)); + } + } + } + + static fromJS(data: any): RemoteServiceErrorInfo { + data = typeof data === 'object' ? data : {}; + let result = new RemoteServiceErrorInfo(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["code"] = this.code; + data["message"] = this.message; + data["details"] = this.details; + if (this.data) { + data["data"] = {}; + for (let key in this.data) { + if (this.data.hasOwnProperty(key)) + (data["data"])[key] = (this.data)[key]; + } + } + if (Array.isArray(this.validationErrors)) { + data["validationErrors"] = []; + for (let item of this.validationErrors) + data["validationErrors"].push(item.toJSON()); + } + return data; + } } export interface IRemoteServiceErrorInfo { - code: string | undefined; - message: string | undefined; - details: string | undefined; - data: { [key: string]: any } | undefined; - validationErrors: RemoteServiceValidationErrorInfo[] | undefined; + code: string | undefined; + message: string | undefined; + details: string | undefined; + data: { [key: string]: any; } | undefined; + validationErrors: RemoteServiceValidationErrorInfo[] | undefined; } export class RemoteServiceErrorResponse implements IRemoteServiceErrorResponse { - error!: RemoteServiceErrorInfo; - - constructor(data?: IRemoteServiceErrorResponse) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + error!: RemoteServiceErrorInfo; + + constructor(data?: IRemoteServiceErrorResponse) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.error = _data['error'] ? RemoteServiceErrorInfo.fromJS(_data['error']) : undefined; + init(_data?: any) { + if (_data) { + this.error = _data["error"] ? RemoteServiceErrorInfo.fromJS(_data["error"]) : undefined; + } } - } - static fromJS(data: any): RemoteServiceErrorResponse { - data = typeof data === 'object' ? data : {}; - let result = new RemoteServiceErrorResponse(); - result.init(data); - return result; - } + static fromJS(data: any): RemoteServiceErrorResponse { + data = typeof data === 'object' ? data : {}; + let result = new RemoteServiceErrorResponse(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['error'] = this.error ? this.error.toJSON() : undefined; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["error"] = this.error ? this.error.toJSON() : undefined; + return data; + } } export interface IRemoteServiceErrorResponse { - error: RemoteServiceErrorInfo; + error: RemoteServiceErrorInfo; } export class RemoteServiceValidationErrorInfo implements IRemoteServiceValidationErrorInfo { - message!: string | undefined; - members!: string[] | undefined; - - constructor(data?: IRemoteServiceValidationErrorInfo) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + message!: string | undefined; + members!: string[] | undefined; + + constructor(data?: IRemoteServiceValidationErrorInfo) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.message = _data['message']; - if (Array.isArray(_data['members'])) { - this.members = [] as any; - for (let item of _data['members']) this.members!.push(item); - } + init(_data?: any) { + if (_data) { + this.message = _data["message"]; + if (Array.isArray(_data["members"])) { + this.members = [] as any; + for (let item of _data["members"]) + this.members!.push(item); + } + } } - } - static fromJS(data: any): RemoteServiceValidationErrorInfo { - data = typeof data === 'object' ? data : {}; - let result = new RemoteServiceValidationErrorInfo(); - result.init(data); - return result; - } + static fromJS(data: any): RemoteServiceValidationErrorInfo { + data = typeof data === 'object' ? data : {}; + let result = new RemoteServiceValidationErrorInfo(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['message'] = this.message; - if (Array.isArray(this.members)) { - data['members'] = []; - for (let item of this.members) data['members'].push(item); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["message"] = this.message; + if (Array.isArray(this.members)) { + data["members"] = []; + for (let item of this.members) + data["members"].push(item); + } + return data; } - return data; - } } export interface IRemoteServiceValidationErrorInfo { - message: string | undefined; - members: string[] | undefined; + message: string | undefined; + members: string[] | undefined; } export class RemoveRoleToOrganizationUnitInput implements IRemoveRoleToOrganizationUnitInput { - roleId!: string; - organizationUnitId!: string; - - constructor(data?: IRemoveRoleToOrganizationUnitInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + roleId!: string; + organizationUnitId!: string; + + constructor(data?: IRemoveRoleToOrganizationUnitInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.roleId = _data['roleId']; - this.organizationUnitId = _data['organizationUnitId']; + init(_data?: any) { + if (_data) { + this.roleId = _data["roleId"]; + this.organizationUnitId = _data["organizationUnitId"]; + } } - } - static fromJS(data: any): RemoveRoleToOrganizationUnitInput { - data = typeof data === 'object' ? data : {}; - let result = new RemoveRoleToOrganizationUnitInput(); - result.init(data); - return result; - } + static fromJS(data: any): RemoveRoleToOrganizationUnitInput { + data = typeof data === 'object' ? data : {}; + let result = new RemoveRoleToOrganizationUnitInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['roleId'] = this.roleId; - data['organizationUnitId'] = this.organizationUnitId; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["roleId"] = this.roleId; + data["organizationUnitId"] = this.organizationUnitId; + return data; + } } export interface IRemoveRoleToOrganizationUnitInput { - roleId: string; - organizationUnitId: string; + roleId: string; + organizationUnitId: string; } export class RemoveUserToOrganizationUnitInput implements IRemoveUserToOrganizationUnitInput { - userId!: string; - organizationUnitId!: string; - - constructor(data?: IRemoveUserToOrganizationUnitInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + userId!: string; + organizationUnitId!: string; + + constructor(data?: IRemoveUserToOrganizationUnitInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.userId = _data['userId']; - this.organizationUnitId = _data['organizationUnitId']; + init(_data?: any) { + if (_data) { + this.userId = _data["userId"]; + this.organizationUnitId = _data["organizationUnitId"]; + } } - } - static fromJS(data: any): RemoveUserToOrganizationUnitInput { - data = typeof data === 'object' ? data : {}; - let result = new RemoveUserToOrganizationUnitInput(); - result.init(data); - return result; - } + static fromJS(data: any): RemoveUserToOrganizationUnitInput { + data = typeof data === 'object' ? data : {}; + let result = new RemoveUserToOrganizationUnitInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['userId'] = this.userId; - data['organizationUnitId'] = this.organizationUnitId; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["userId"] = this.userId; + data["organizationUnitId"] = this.organizationUnitId; + return data; + } } export interface IRemoveUserToOrganizationUnitInput { - userId: string; - organizationUnitId: string; + userId: string; + organizationUnitId: string; } export class ReturnValueApiDescriptionModel implements IReturnValueApiDescriptionModel { - type!: string | undefined; - typeSimple!: string | undefined; - - constructor(data?: IReturnValueApiDescriptionModel) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + type!: string | undefined; + typeSimple!: string | undefined; + + constructor(data?: IReturnValueApiDescriptionModel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.type = _data['type']; - this.typeSimple = _data['typeSimple']; + init(_data?: any) { + if (_data) { + this.type = _data["type"]; + this.typeSimple = _data["typeSimple"]; + } } - } - static fromJS(data: any): ReturnValueApiDescriptionModel { - data = typeof data === 'object' ? data : {}; - let result = new ReturnValueApiDescriptionModel(); - result.init(data); - return result; - } + static fromJS(data: any): ReturnValueApiDescriptionModel { + data = typeof data === 'object' ? data : {}; + let result = new ReturnValueApiDescriptionModel(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['type'] = this.type; - data['typeSimple'] = this.typeSimple; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["type"] = this.type; + data["typeSimple"] = this.typeSimple; + return data; + } } export interface IReturnValueApiDescriptionModel { - type: string | undefined; - typeSimple: string | undefined; + type: string | undefined; + typeSimple: string | undefined; } export class SendBroadCastMessageInput implements ISendBroadCastMessageInput { - /** 消息标题 */ - title!: string | undefined; - /** 消息内容 */ - content!: string | undefined; - - constructor(data?: ISendBroadCastMessageInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + /** 消息标题 */ + title!: string | undefined; + /** 消息内容 */ + content!: string | undefined; + + constructor(data?: ISendBroadCastMessageInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.title = _data['title']; - this.content = _data['content']; + init(_data?: any) { + if (_data) { + this.title = _data["title"]; + this.content = _data["content"]; + } } - } - static fromJS(data: any): SendBroadCastMessageInput { - data = typeof data === 'object' ? data : {}; - let result = new SendBroadCastMessageInput(); - result.init(data); - return result; - } + static fromJS(data: any): SendBroadCastMessageInput { + data = typeof data === 'object' ? data : {}; + let result = new SendBroadCastMessageInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['title'] = this.title; - data['content'] = this.content; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["title"] = this.title; + data["content"] = this.content; + return data; + } } export interface ISendBroadCastMessageInput { - /** 消息标题 */ - title: string | undefined; - /** 消息内容 */ - content: string | undefined; + /** 消息标题 */ + title: string | undefined; + /** 消息内容 */ + content: string | undefined; } export class SendCommonMessageInput implements ISendCommonMessageInput { - /** 消息标题 */ - title!: string | undefined; - /** 消息内容 */ - content!: string | undefined; - /** 发送人 */ - receiveIds!: string[] | undefined; - - constructor(data?: ISendCommonMessageInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.title = _data['title']; - this.content = _data['content']; - if (Array.isArray(_data['receiveIds'])) { - this.receiveIds = [] as any; - for (let item of _data['receiveIds']) this.receiveIds!.push(item); - } - } - } - - static fromJS(data: any): SendCommonMessageInput { - data = typeof data === 'object' ? data : {}; - let result = new SendCommonMessageInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['title'] = this.title; - data['content'] = this.content; - if (Array.isArray(this.receiveIds)) { - data['receiveIds'] = []; - for (let item of this.receiveIds) data['receiveIds'].push(item); - } - return data; - } + /** 消息标题 */ + title!: string | undefined; + /** 消息内容 */ + content!: string | undefined; + /** 发送人 */ + receiveIds!: string[] | undefined; + + constructor(data?: ISendCommonMessageInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.title = _data["title"]; + this.content = _data["content"]; + if (Array.isArray(_data["receiveIds"])) { + this.receiveIds = [] as any; + for (let item of _data["receiveIds"]) + this.receiveIds!.push(item); + } + } + } + + static fromJS(data: any): SendCommonMessageInput { + data = typeof data === 'object' ? data : {}; + let result = new SendCommonMessageInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["title"] = this.title; + data["content"] = this.content; + if (Array.isArray(this.receiveIds)) { + data["receiveIds"] = []; + for (let item of this.receiveIds) + data["receiveIds"].push(item); + } + return data; + } } export interface ISendCommonMessageInput { - /** 消息标题 */ - title: string | undefined; - /** 消息内容 */ - content: string | undefined; - /** 发送人 */ - receiveIds: string[] | undefined; + /** 消息标题 */ + title: string | undefined; + /** 消息内容 */ + content: string | undefined; + /** 发送人 */ + receiveIds: string[] | undefined; } export class SetDataDictinaryDetailInput implements ISetDataDictinaryDetailInput { - dataDictionaryId!: string; - dataDictionayDetailId!: string; - isEnabled!: boolean; - - constructor(data?: ISetDataDictinaryDetailInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.dataDictionaryId = _data['dataDictionaryId']; - this.dataDictionayDetailId = _data['dataDictionayDetailId']; - this.isEnabled = _data['isEnabled']; - } - } - - static fromJS(data: any): SetDataDictinaryDetailInput { - data = typeof data === 'object' ? data : {}; - let result = new SetDataDictinaryDetailInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['dataDictionaryId'] = this.dataDictionaryId; - data['dataDictionayDetailId'] = this.dataDictionayDetailId; - data['isEnabled'] = this.isEnabled; - return data; - } + dataDictionaryId!: string; + dataDictionayDetailId!: string; + isEnabled!: boolean; + + constructor(data?: ISetDataDictinaryDetailInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.dataDictionaryId = _data["dataDictionaryId"]; + this.dataDictionayDetailId = _data["dataDictionayDetailId"]; + this.isEnabled = _data["isEnabled"]; + } + } + + static fromJS(data: any): SetDataDictinaryDetailInput { + data = typeof data === 'object' ? data : {}; + let result = new SetDataDictinaryDetailInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["dataDictionaryId"] = this.dataDictionaryId; + data["dataDictionayDetailId"] = this.dataDictionayDetailId; + data["isEnabled"] = this.isEnabled; + return data; + } } export interface ISetDataDictinaryDetailInput { - dataDictionaryId: string; - dataDictionayDetailId: string; - isEnabled: boolean; + dataDictionaryId: string; + dataDictionayDetailId: string; + isEnabled: boolean; } export class SetReadInput implements ISetReadInput { - id!: string; - - constructor(data?: ISetReadInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + id!: string; + + constructor(data?: ISetReadInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.id = _data['id']; + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + } } - } - static fromJS(data: any): SetReadInput { - data = typeof data === 'object' ? data : {}; - let result = new SetReadInput(); - result.init(data); - return result; - } + static fromJS(data: any): SetReadInput { + data = typeof data === 'object' ? data : {}; + let result = new SetReadInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + return data; + } } export interface ISetReadInput { - id: string; + id: string; } export class SettingItemOutput implements ISettingItemOutput { - /** 名称 */ - name!: string | undefined; - /** 显示名称 */ - displayName!: string | undefined; - /** 描述 */ - description!: string | undefined; - /** 值 */ - value!: string | undefined; - /** 前端控件类型 */ - type!: string | undefined; - - constructor(data?: ISettingItemOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.name = _data['name']; - this.displayName = _data['displayName']; - this.description = _data['description']; - this.value = _data['value']; - this.type = _data['type']; - } - } - - static fromJS(data: any): SettingItemOutput { - data = typeof data === 'object' ? data : {}; - let result = new SettingItemOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['name'] = this.name; - data['displayName'] = this.displayName; - data['description'] = this.description; - data['value'] = this.value; - data['type'] = this.type; - return data; - } + /** 名称 */ + name!: string | undefined; + /** 显示名称 */ + displayName!: string | undefined; + /** 描述 */ + description!: string | undefined; + /** 值 */ + value!: string | undefined; + /** 前端控件类型 */ + type!: string | undefined; + + constructor(data?: ISettingItemOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.name = _data["name"]; + this.displayName = _data["displayName"]; + this.description = _data["description"]; + this.value = _data["value"]; + this.type = _data["type"]; + } + } + + static fromJS(data: any): SettingItemOutput { + data = typeof data === 'object' ? data : {}; + let result = new SettingItemOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + data["displayName"] = this.displayName; + data["description"] = this.description; + data["value"] = this.value; + data["type"] = this.type; + return data; + } } export interface ISettingItemOutput { - /** 名称 */ - name: string | undefined; - /** 显示名称 */ - displayName: string | undefined; - /** 描述 */ - description: string | undefined; - /** 值 */ - value: string | undefined; - /** 前端控件类型 */ - type: string | undefined; + /** 名称 */ + name: string | undefined; + /** 显示名称 */ + displayName: string | undefined; + /** 描述 */ + description: string | undefined; + /** 值 */ + value: string | undefined; + /** 前端控件类型 */ + type: string | undefined; } export class SettingOutput implements ISettingOutput { - /** 分组 */ - group!: string | undefined; - /** 分组显示名称 */ - groupDisplayName!: string | undefined; - settingItemOutput!: SettingItemOutput[] | undefined; - - constructor(data?: ISettingOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.group = _data['group']; - this.groupDisplayName = _data['groupDisplayName']; - if (Array.isArray(_data['settingItemOutput'])) { - this.settingItemOutput = [] as any; - for (let item of _data['settingItemOutput']) - this.settingItemOutput!.push(SettingItemOutput.fromJS(item)); - } - } - } - - static fromJS(data: any): SettingOutput { - data = typeof data === 'object' ? data : {}; - let result = new SettingOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['group'] = this.group; - data['groupDisplayName'] = this.groupDisplayName; - if (Array.isArray(this.settingItemOutput)) { - data['settingItemOutput'] = []; - for (let item of this.settingItemOutput) data['settingItemOutput'].push(item.toJSON()); - } - return data; - } + /** 分组 */ + group!: string | undefined; + /** 分组显示名称 */ + groupDisplayName!: string | undefined; + settingItemOutput!: SettingItemOutput[] | undefined; + + constructor(data?: ISettingOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.group = _data["group"]; + this.groupDisplayName = _data["groupDisplayName"]; + if (Array.isArray(_data["settingItemOutput"])) { + this.settingItemOutput = [] as any; + for (let item of _data["settingItemOutput"]) + this.settingItemOutput!.push(SettingItemOutput.fromJS(item)); + } + } + } + + static fromJS(data: any): SettingOutput { + data = typeof data === 'object' ? data : {}; + let result = new SettingOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["group"] = this.group; + data["groupDisplayName"] = this.groupDisplayName; + if (Array.isArray(this.settingItemOutput)) { + data["settingItemOutput"] = []; + for (let item of this.settingItemOutput) + data["settingItemOutput"].push(item.toJSON()); + } + return data; + } } export interface ISettingOutput { - /** 分组 */ - group: string | undefined; - /** 分组显示名称 */ - groupDisplayName: string | undefined; - settingItemOutput: SettingItemOutput[] | undefined; + /** 分组 */ + group: string | undefined; + /** 分组显示名称 */ + groupDisplayName: string | undefined; + settingItemOutput: SettingItemOutput[] | undefined; } export class StringStringFromSelector implements IStringStringFromSelector { - readonly value!: string | undefined; - readonly label!: string | undefined; - - constructor(data?: IStringStringFromSelector) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + readonly value!: string | undefined; + readonly label!: string | undefined; + + constructor(data?: IStringStringFromSelector) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - (this).value = _data['value']; - (this).label = _data['label']; + init(_data?: any) { + if (_data) { + (this).value = _data["value"]; + (this).label = _data["label"]; + } } - } - static fromJS(data: any): StringStringFromSelector { - data = typeof data === 'object' ? data : {}; - let result = new StringStringFromSelector(); - result.init(data); - return result; - } + static fromJS(data: any): StringStringFromSelector { + data = typeof data === 'object' ? data : {}; + let result = new StringStringFromSelector(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['value'] = this.value; - data['label'] = this.label; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["value"] = this.value; + data["label"] = this.label; + return data; + } } export interface IStringStringFromSelector { - value: string | undefined; - label: string | undefined; + value: string | undefined; + label: string | undefined; } export class TenantCreateDto implements ITenantCreateDto { - readonly extraProperties!: { [key: string]: any } | undefined; - name!: string; - adminEmailAddress!: string; - adminPassword!: string; - - constructor(data?: ITenantCreateDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['extraProperties']) { - (this).extraProperties = {} as any; - for (let key in _data['extraProperties']) { - if (_data['extraProperties'].hasOwnProperty(key)) - ((this).extraProperties)![key] = _data['extraProperties'][key]; - } - } - this.name = _data['name']; - this.adminEmailAddress = _data['adminEmailAddress']; - this.adminPassword = _data['adminPassword']; - } - } - - static fromJS(data: any): TenantCreateDto { - data = typeof data === 'object' ? data : {}; - let result = new TenantCreateDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.extraProperties) { - data['extraProperties'] = {}; - for (let key in this.extraProperties) { - if (this.extraProperties.hasOwnProperty(key)) - (data['extraProperties'])[key] = (this.extraProperties)[key]; - } - } - data['name'] = this.name; - data['adminEmailAddress'] = this.adminEmailAddress; - data['adminPassword'] = this.adminPassword; - return data; - } + readonly extraProperties!: { [key: string]: any; } | undefined; + name!: string; + adminEmailAddress!: string; + adminPassword!: string; + + constructor(data?: ITenantCreateDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["extraProperties"]) { + (this).extraProperties = {} as any; + for (let key in _data["extraProperties"]) { + if (_data["extraProperties"].hasOwnProperty(key)) + ((this).extraProperties)![key] = _data["extraProperties"][key]; + } + } + this.name = _data["name"]; + this.adminEmailAddress = _data["adminEmailAddress"]; + this.adminPassword = _data["adminPassword"]; + } + } + + static fromJS(data: any): TenantCreateDto { + data = typeof data === 'object' ? data : {}; + let result = new TenantCreateDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.extraProperties) { + data["extraProperties"] = {}; + for (let key in this.extraProperties) { + if (this.extraProperties.hasOwnProperty(key)) + (data["extraProperties"])[key] = (this.extraProperties)[key]; + } + } + data["name"] = this.name; + data["adminEmailAddress"] = this.adminEmailAddress; + data["adminPassword"] = this.adminPassword; + return data; + } } export interface ITenantCreateDto { - extraProperties: { [key: string]: any } | undefined; - name: string; - adminEmailAddress: string; - adminPassword: string; + extraProperties: { [key: string]: any; } | undefined; + name: string; + adminEmailAddress: string; + adminPassword: string; } export class TenantDto implements ITenantDto { - readonly extraProperties!: { [key: string]: any } | undefined; - id!: string; - name!: string | undefined; - concurrencyStamp!: string | undefined; - - constructor(data?: ITenantDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - if (_data['extraProperties']) { - (this).extraProperties = {} as any; - for (let key in _data['extraProperties']) { - if (_data['extraProperties'].hasOwnProperty(key)) - ((this).extraProperties)![key] = _data['extraProperties'][key]; - } - } - this.id = _data['id']; - this.name = _data['name']; - this.concurrencyStamp = _data['concurrencyStamp']; - } - } - - static fromJS(data: any): TenantDto { - data = typeof data === 'object' ? data : {}; - let result = new TenantDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.extraProperties) { - data['extraProperties'] = {}; - for (let key in this.extraProperties) { - if (this.extraProperties.hasOwnProperty(key)) - (data['extraProperties'])[key] = (this.extraProperties)[key]; - } - } - data['id'] = this.id; - data['name'] = this.name; - data['concurrencyStamp'] = this.concurrencyStamp; - return data; - } + readonly extraProperties!: { [key: string]: any; } | undefined; + id!: string; + name!: string | undefined; + concurrencyStamp!: string | undefined; + + constructor(data?: ITenantDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (_data["extraProperties"]) { + (this).extraProperties = {} as any; + for (let key in _data["extraProperties"]) { + if (_data["extraProperties"].hasOwnProperty(key)) + ((this).extraProperties)![key] = _data["extraProperties"][key]; + } + } + this.id = _data["id"]; + this.name = _data["name"]; + this.concurrencyStamp = _data["concurrencyStamp"]; + } + } + + static fromJS(data: any): TenantDto { + data = typeof data === 'object' ? data : {}; + let result = new TenantDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.extraProperties) { + data["extraProperties"] = {}; + for (let key in this.extraProperties) { + if (this.extraProperties.hasOwnProperty(key)) + (data["extraProperties"])[key] = (this.extraProperties)[key]; + } + } + data["id"] = this.id; + data["name"] = this.name; + data["concurrencyStamp"] = this.concurrencyStamp; + return data; + } } export interface ITenantDto { - extraProperties: { [key: string]: any } | undefined; - id: string; - name: string | undefined; - concurrencyStamp: string | undefined; + extraProperties: { [key: string]: any; } | undefined; + id: string; + name: string | undefined; + concurrencyStamp: string | undefined; } export class TenantDtoPagedResultDto implements ITenantDtoPagedResultDto { - items!: TenantDto[] | undefined; - totalCount!: number; - - constructor(data?: ITenantDtoPagedResultDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + items!: TenantDto[] | undefined; + totalCount!: number; + + constructor(data?: ITenantDtoPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['items'])) { - this.items = [] as any; - for (let item of _data['items']) this.items!.push(TenantDto.fromJS(item)); - } - this.totalCount = _data['totalCount']; + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(TenantDto.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } } - } - static fromJS(data: any): TenantDtoPagedResultDto { - data = typeof data === 'object' ? data : {}; - let result = new TenantDtoPagedResultDto(); - result.init(data); - return result; - } + static fromJS(data: any): TenantDtoPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new TenantDtoPagedResultDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.items)) { - data['items'] = []; - for (let item of this.items) data['items'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; } - data['totalCount'] = this.totalCount; - return data; - } } export interface ITenantDtoPagedResultDto { - items: TenantDto[] | undefined; - totalCount: number; + items: TenantDto[] | undefined; + totalCount: number; } export class TimeZone implements ITimeZone { - iana!: IanaTimeZone; - windows!: WindowsTimeZone; - - constructor(data?: ITimeZone) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + iana!: IanaTimeZone; + windows!: WindowsTimeZone; + + constructor(data?: ITimeZone) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.iana = _data['iana'] ? IanaTimeZone.fromJS(_data['iana']) : undefined; - this.windows = _data['windows'] ? WindowsTimeZone.fromJS(_data['windows']) : undefined; + init(_data?: any) { + if (_data) { + this.iana = _data["iana"] ? IanaTimeZone.fromJS(_data["iana"]) : undefined; + this.windows = _data["windows"] ? WindowsTimeZone.fromJS(_data["windows"]) : undefined; + } } - } - static fromJS(data: any): TimeZone { - data = typeof data === 'object' ? data : {}; - let result = new TimeZone(); - result.init(data); - return result; - } + static fromJS(data: any): TimeZone { + data = typeof data === 'object' ? data : {}; + let result = new TimeZone(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['iana'] = this.iana ? this.iana.toJSON() : undefined; - data['windows'] = this.windows ? this.windows.toJSON() : undefined; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["iana"] = this.iana ? this.iana.toJSON() : undefined; + data["windows"] = this.windows ? this.windows.toJSON() : undefined; + return data; + } } export interface ITimeZone { - iana: IanaTimeZone; - windows: WindowsTimeZone; + iana: IanaTimeZone; + windows: WindowsTimeZone; } export class TimingDto implements ITimingDto { - timeZone!: TimeZone; - - constructor(data?: ITimingDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + timeZone!: TimeZone; + + constructor(data?: ITimingDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.timeZone = _data['timeZone'] ? TimeZone.fromJS(_data['timeZone']) : undefined; + init(_data?: any) { + if (_data) { + this.timeZone = _data["timeZone"] ? TimeZone.fromJS(_data["timeZone"]) : undefined; + } } - } - static fromJS(data: any): TimingDto { - data = typeof data === 'object' ? data : {}; - let result = new TimingDto(); - result.init(data); - return result; - } + static fromJS(data: any): TimingDto { + data = typeof data === 'object' ? data : {}; + let result = new TimingDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['timeZone'] = this.timeZone ? this.timeZone.toJSON() : undefined; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["timeZone"] = this.timeZone ? this.timeZone.toJSON() : undefined; + return data; + } } export interface ITimingDto { - timeZone: TimeZone; + timeZone: TimeZone; } export class TreeOutput implements ITreeOutput { - title!: string | undefined; - key!: string; - children!: TreeOutput[] | undefined; - - constructor(data?: ITreeOutput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.title = _data['title']; - this.key = _data['key']; - if (Array.isArray(_data['children'])) { - this.children = [] as any; - for (let item of _data['children']) this.children!.push(TreeOutput.fromJS(item)); - } - } - } - - static fromJS(data: any): TreeOutput { - data = typeof data === 'object' ? data : {}; - let result = new TreeOutput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['title'] = this.title; - data['key'] = this.key; - if (Array.isArray(this.children)) { - data['children'] = []; - for (let item of this.children) data['children'].push(item.toJSON()); - } - return data; - } + title!: string | undefined; + key!: string; + children!: TreeOutput[] | undefined; + + constructor(data?: ITreeOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.title = _data["title"]; + this.key = _data["key"]; + if (Array.isArray(_data["children"])) { + this.children = [] as any; + for (let item of _data["children"]) + this.children!.push(TreeOutput.fromJS(item)); + } + } + } + + static fromJS(data: any): TreeOutput { + data = typeof data === 'object' ? data : {}; + let result = new TreeOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["title"] = this.title; + data["key"] = this.key; + if (Array.isArray(this.children)) { + data["children"] = []; + for (let item of this.children) + data["children"].push(item.toJSON()); + } + return data; + } } export interface ITreeOutput { - title: string | undefined; - key: string; - children: TreeOutput[] | undefined; + title: string | undefined; + key: string; + children: TreeOutput[] | undefined; } export class TypeApiDescriptionModel implements ITypeApiDescriptionModel { - baseType!: string | undefined; - isEnum!: boolean; - enumNames!: string[] | undefined; - enumValues!: any[] | undefined; - genericArguments!: string[] | undefined; - properties!: PropertyApiDescriptionModel[] | undefined; - - constructor(data?: ITypeApiDescriptionModel) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.baseType = _data['baseType']; - this.isEnum = _data['isEnum']; - if (Array.isArray(_data['enumNames'])) { - this.enumNames = [] as any; - for (let item of _data['enumNames']) this.enumNames!.push(item); - } - if (Array.isArray(_data['enumValues'])) { - this.enumValues = [] as any; - for (let item of _data['enumValues']) this.enumValues!.push(item); - } - if (Array.isArray(_data['genericArguments'])) { - this.genericArguments = [] as any; - for (let item of _data['genericArguments']) this.genericArguments!.push(item); - } - if (Array.isArray(_data['properties'])) { - this.properties = [] as any; - for (let item of _data['properties']) - this.properties!.push(PropertyApiDescriptionModel.fromJS(item)); - } - } - } - - static fromJS(data: any): TypeApiDescriptionModel { - data = typeof data === 'object' ? data : {}; - let result = new TypeApiDescriptionModel(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['baseType'] = this.baseType; - data['isEnum'] = this.isEnum; - if (Array.isArray(this.enumNames)) { - data['enumNames'] = []; - for (let item of this.enumNames) data['enumNames'].push(item); - } - if (Array.isArray(this.enumValues)) { - data['enumValues'] = []; - for (let item of this.enumValues) data['enumValues'].push(item); - } - if (Array.isArray(this.genericArguments)) { - data['genericArguments'] = []; - for (let item of this.genericArguments) data['genericArguments'].push(item); - } - if (Array.isArray(this.properties)) { - data['properties'] = []; - for (let item of this.properties) data['properties'].push(item.toJSON()); - } - return data; - } + baseType!: string | undefined; + isEnum!: boolean; + enumNames!: string[] | undefined; + enumValues!: any[] | undefined; + genericArguments!: string[] | undefined; + properties!: PropertyApiDescriptionModel[] | undefined; + + constructor(data?: ITypeApiDescriptionModel) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.baseType = _data["baseType"]; + this.isEnum = _data["isEnum"]; + if (Array.isArray(_data["enumNames"])) { + this.enumNames = [] as any; + for (let item of _data["enumNames"]) + this.enumNames!.push(item); + } + if (Array.isArray(_data["enumValues"])) { + this.enumValues = [] as any; + for (let item of _data["enumValues"]) + this.enumValues!.push(item); + } + if (Array.isArray(_data["genericArguments"])) { + this.genericArguments = [] as any; + for (let item of _data["genericArguments"]) + this.genericArguments!.push(item); + } + if (Array.isArray(_data["properties"])) { + this.properties = [] as any; + for (let item of _data["properties"]) + this.properties!.push(PropertyApiDescriptionModel.fromJS(item)); + } + } + } + + static fromJS(data: any): TypeApiDescriptionModel { + data = typeof data === 'object' ? data : {}; + let result = new TypeApiDescriptionModel(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["baseType"] = this.baseType; + data["isEnum"] = this.isEnum; + if (Array.isArray(this.enumNames)) { + data["enumNames"] = []; + for (let item of this.enumNames) + data["enumNames"].push(item); + } + if (Array.isArray(this.enumValues)) { + data["enumValues"] = []; + for (let item of this.enumValues) + data["enumValues"].push(item); + } + if (Array.isArray(this.genericArguments)) { + data["genericArguments"] = []; + for (let item of this.genericArguments) + data["genericArguments"].push(item); + } + if (Array.isArray(this.properties)) { + data["properties"] = []; + for (let item of this.properties) + data["properties"].push(item.toJSON()); + } + return data; + } } export interface ITypeApiDescriptionModel { - baseType: string | undefined; - isEnum: boolean; - enumNames: string[] | undefined; - enumValues: any[] | undefined; - genericArguments: string[] | undefined; - properties: PropertyApiDescriptionModel[] | undefined; + baseType: string | undefined; + isEnum: boolean; + enumNames: string[] | undefined; + enumValues: any[] | undefined; + genericArguments: string[] | undefined; + properties: PropertyApiDescriptionModel[] | undefined; } export class UpdateConnectionStringInput implements IUpdateConnectionStringInput { - id!: string; - connectionString!: string | undefined; - - constructor(data?: IUpdateConnectionStringInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + id!: string; + connectionString!: string | undefined; + + constructor(data?: IUpdateConnectionStringInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.connectionString = _data['connectionString']; + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.connectionString = _data["connectionString"]; + } } - } - static fromJS(data: any): UpdateConnectionStringInput { - data = typeof data === 'object' ? data : {}; - let result = new UpdateConnectionStringInput(); - result.init(data); - return result; - } + static fromJS(data: any): UpdateConnectionStringInput { + data = typeof data === 'object' ? data : {}; + let result = new UpdateConnectionStringInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['connectionString'] = this.connectionString; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["connectionString"] = this.connectionString; + return data; + } } export interface IUpdateConnectionStringInput { - id: string; - connectionString: string | undefined; + id: string; + connectionString: string | undefined; } export class UpdateDataDictinaryInput implements IUpdateDataDictinaryInput { - id!: string; - code!: string | undefined; - displayText!: string | undefined; - description!: string | undefined; - - constructor(data?: IUpdateDataDictinaryInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.code = _data['code']; - this.displayText = _data['displayText']; - this.description = _data['description']; - } - } - - static fromJS(data: any): UpdateDataDictinaryInput { - data = typeof data === 'object' ? data : {}; - let result = new UpdateDataDictinaryInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['code'] = this.code; - data['displayText'] = this.displayText; - data['description'] = this.description; - return data; - } + id!: string; + code!: string | undefined; + displayText!: string | undefined; + description!: string | undefined; + + constructor(data?: IUpdateDataDictinaryInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.code = _data["code"]; + this.displayText = _data["displayText"]; + this.description = _data["description"]; + } + } + + static fromJS(data: any): UpdateDataDictinaryInput { + data = typeof data === 'object' ? data : {}; + let result = new UpdateDataDictinaryInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["code"] = this.code; + data["displayText"] = this.displayText; + data["description"] = this.description; + return data; + } } export interface IUpdateDataDictinaryInput { - id: string; - code: string | undefined; - displayText: string | undefined; - description: string | undefined; + id: string; + code: string | undefined; + displayText: string | undefined; + description: string | undefined; } export class UpdateDetailInput implements IUpdateDetailInput { - dataDictionaryId!: string; - id!: string; - displayText!: string | undefined; - description!: string | undefined; - order!: number; - - constructor(data?: IUpdateDetailInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.dataDictionaryId = _data['dataDictionaryId']; - this.id = _data['id']; - this.displayText = _data['displayText']; - this.description = _data['description']; - this.order = _data['order']; - } - } - - static fromJS(data: any): UpdateDetailInput { - data = typeof data === 'object' ? data : {}; - let result = new UpdateDetailInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['dataDictionaryId'] = this.dataDictionaryId; - data['id'] = this.id; - data['displayText'] = this.displayText; - data['description'] = this.description; - data['order'] = this.order; - return data; - } + dataDictionaryId!: string; + id!: string; + displayText!: string | undefined; + description!: string | undefined; + order!: number; + + constructor(data?: IUpdateDetailInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.dataDictionaryId = _data["dataDictionaryId"]; + this.id = _data["id"]; + this.displayText = _data["displayText"]; + this.description = _data["description"]; + this.order = _data["order"]; + } + } + + static fromJS(data: any): UpdateDetailInput { + data = typeof data === 'object' ? data : {}; + let result = new UpdateDetailInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["dataDictionaryId"] = this.dataDictionaryId; + data["id"] = this.id; + data["displayText"] = this.displayText; + data["description"] = this.description; + data["order"] = this.order; + return data; + } } export interface IUpdateDetailInput { - dataDictionaryId: string; - id: string; - displayText: string | undefined; - description: string | undefined; - order: number; + dataDictionaryId: string; + id: string; + displayText: string | undefined; + description: string | undefined; + order: number; } /** 删除语言 */ export class UpdateLanguageInput implements IUpdateLanguageInput { - /** 语言Id */ - id!: string; - /** 语言名称 */ - cultureName!: string | undefined; - /** Ui语言名称 */ - uiCultureName!: string | undefined; - /** 显示名称 */ - displayName!: string | undefined; - /** 图标 */ - flagIcon!: string | undefined; - /** 是否启用 */ - isEnabled!: boolean; - - constructor(data?: IUpdateLanguageInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.cultureName = _data['cultureName']; - this.uiCultureName = _data['uiCultureName']; - this.displayName = _data['displayName']; - this.flagIcon = _data['flagIcon']; - this.isEnabled = _data['isEnabled']; - } - } - - static fromJS(data: any): UpdateLanguageInput { - data = typeof data === 'object' ? data : {}; - let result = new UpdateLanguageInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['cultureName'] = this.cultureName; - data['uiCultureName'] = this.uiCultureName; - data['displayName'] = this.displayName; - data['flagIcon'] = this.flagIcon; - data['isEnabled'] = this.isEnabled; - return data; - } + /** 语言Id */ + id!: string; + /** 语言名称 */ + cultureName!: string | undefined; + /** Ui语言名称 */ + uiCultureName!: string | undefined; + /** 显示名称 */ + displayName!: string | undefined; + /** 图标 */ + flagIcon!: string | undefined; + /** 是否启用 */ + isEnabled!: boolean; + + constructor(data?: IUpdateLanguageInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.cultureName = _data["cultureName"]; + this.uiCultureName = _data["uiCultureName"]; + this.displayName = _data["displayName"]; + this.flagIcon = _data["flagIcon"]; + this.isEnabled = _data["isEnabled"]; + } + } + + static fromJS(data: any): UpdateLanguageInput { + data = typeof data === 'object' ? data : {}; + let result = new UpdateLanguageInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["cultureName"] = this.cultureName; + data["uiCultureName"] = this.uiCultureName; + data["displayName"] = this.displayName; + data["flagIcon"] = this.flagIcon; + data["isEnabled"] = this.isEnabled; + return data; + } } /** 删除语言 */ export interface IUpdateLanguageInput { - /** 语言Id */ - id: string; - /** 语言名称 */ - cultureName: string | undefined; - /** Ui语言名称 */ - uiCultureName: string | undefined; - /** 显示名称 */ - displayName: string | undefined; - /** 图标 */ - flagIcon: string | undefined; - /** 是否启用 */ - isEnabled: boolean; + /** 语言Id */ + id: string; + /** 语言名称 */ + cultureName: string | undefined; + /** Ui语言名称 */ + uiCultureName: string | undefined; + /** 显示名称 */ + displayName: string | undefined; + /** 图标 */ + flagIcon: string | undefined; + /** 是否启用 */ + isEnabled: boolean; } /** 删除语言文本 */ export class UpdateLanguageTextInput implements IUpdateLanguageTextInput { - /** 资源名称 */ - resourceName!: string; - /** 语言名称 */ - cultureName!: string; - /** 名称 */ - name!: string; - /** 值 */ - value!: string; - - constructor(data?: IUpdateLanguageTextInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.resourceName = _data['resourceName']; - this.cultureName = _data['cultureName']; - this.name = _data['name']; - this.value = _data['value']; - } - } - - static fromJS(data: any): UpdateLanguageTextInput { - data = typeof data === 'object' ? data : {}; - let result = new UpdateLanguageTextInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['resourceName'] = this.resourceName; - data['cultureName'] = this.cultureName; - data['name'] = this.name; - data['value'] = this.value; - return data; - } + /** 资源名称 */ + resourceName!: string; + /** 语言名称 */ + cultureName!: string; + /** 名称 */ + name!: string; + /** 值 */ + value!: string; + + constructor(data?: IUpdateLanguageTextInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.resourceName = _data["resourceName"]; + this.cultureName = _data["cultureName"]; + this.name = _data["name"]; + this.value = _data["value"]; + } + } + + static fromJS(data: any): UpdateLanguageTextInput { + data = typeof data === 'object' ? data : {}; + let result = new UpdateLanguageTextInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["resourceName"] = this.resourceName; + data["cultureName"] = this.cultureName; + data["name"] = this.name; + data["value"] = this.value; + return data; + } } /** 删除语言文本 */ export interface IUpdateLanguageTextInput { - /** 资源名称 */ - resourceName: string; - /** 语言名称 */ - cultureName: string; - /** 名称 */ - name: string; - /** 值 */ - value: string; + /** 资源名称 */ + resourceName: string; + /** 语言名称 */ + cultureName: string; + /** 名称 */ + name: string; + /** 值 */ + value: string; } export class UpdateOrganizationUnitInput implements IUpdateOrganizationUnitInput { - displayName!: string | undefined; - id!: string; - - constructor(data?: IUpdateOrganizationUnitInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + displayName!: string | undefined; + id!: string; + + constructor(data?: IUpdateOrganizationUnitInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.displayName = _data['displayName']; - this.id = _data['id']; + init(_data?: any) { + if (_data) { + this.displayName = _data["displayName"]; + this.id = _data["id"]; + } } - } - static fromJS(data: any): UpdateOrganizationUnitInput { - data = typeof data === 'object' ? data : {}; - let result = new UpdateOrganizationUnitInput(); - result.init(data); - return result; - } + static fromJS(data: any): UpdateOrganizationUnitInput { + data = typeof data === 'object' ? data : {}; + let result = new UpdateOrganizationUnitInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['displayName'] = this.displayName; - data['id'] = this.id; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["displayName"] = this.displayName; + data["id"] = this.id; + return data; + } } export interface IUpdateOrganizationUnitInput { - displayName: string | undefined; - id: string; + displayName: string | undefined; + id: string; } export class UpdatePermissionDto implements IUpdatePermissionDto { - name!: string | undefined; - isGranted!: boolean; - - constructor(data?: IUpdatePermissionDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + name!: string | undefined; + isGranted!: boolean; + + constructor(data?: IUpdatePermissionDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.name = _data['name']; - this.isGranted = _data['isGranted']; + init(_data?: any) { + if (_data) { + this.name = _data["name"]; + this.isGranted = _data["isGranted"]; + } } - } - static fromJS(data: any): UpdatePermissionDto { - data = typeof data === 'object' ? data : {}; - let result = new UpdatePermissionDto(); - result.init(data); - return result; - } + static fromJS(data: any): UpdatePermissionDto { + data = typeof data === 'object' ? data : {}; + let result = new UpdatePermissionDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['name'] = this.name; - data['isGranted'] = this.isGranted; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["name"] = this.name; + data["isGranted"] = this.isGranted; + return data; + } } export interface IUpdatePermissionDto { - name: string | undefined; - isGranted: boolean; + name: string | undefined; + isGranted: boolean; } export class UpdatePermissionsDto implements IUpdatePermissionsDto { - permissions!: UpdatePermissionDto[] | undefined; - - constructor(data?: IUpdatePermissionsDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + permissions!: UpdatePermissionDto[] | undefined; + + constructor(data?: IUpdatePermissionsDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (Array.isArray(_data['permissions'])) { - this.permissions = [] as any; - for (let item of _data['permissions']) - this.permissions!.push(UpdatePermissionDto.fromJS(item)); - } + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["permissions"])) { + this.permissions = [] as any; + for (let item of _data["permissions"]) + this.permissions!.push(UpdatePermissionDto.fromJS(item)); + } + } } - } - static fromJS(data: any): UpdatePermissionsDto { - data = typeof data === 'object' ? data : {}; - let result = new UpdatePermissionsDto(); - result.init(data); - return result; - } + static fromJS(data: any): UpdatePermissionsDto { + data = typeof data === 'object' ? data : {}; + let result = new UpdatePermissionsDto(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (Array.isArray(this.permissions)) { - data['permissions'] = []; - for (let item of this.permissions) data['permissions'].push(item.toJSON()); + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.permissions)) { + data["permissions"] = []; + for (let item of this.permissions) + data["permissions"].push(item.toJSON()); + } + return data; } - return data; - } } export interface IUpdatePermissionsDto { - permissions: UpdatePermissionDto[] | undefined; + permissions: UpdatePermissionDto[] | undefined; } export class UpdateRoleInput implements IUpdateRoleInput { - roleId!: string; - roleInfo!: IdentityRoleUpdateDto; - - constructor(data?: IUpdateRoleInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + roleId!: string; + roleInfo!: IdentityRoleUpdateDto; + + constructor(data?: IUpdateRoleInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.roleId = _data['roleId']; - this.roleInfo = _data['roleInfo'] - ? IdentityRoleUpdateDto.fromJS(_data['roleInfo']) - : undefined; + init(_data?: any) { + if (_data) { + this.roleId = _data["roleId"]; + this.roleInfo = _data["roleInfo"] ? IdentityRoleUpdateDto.fromJS(_data["roleInfo"]) : undefined; + } } - } - static fromJS(data: any): UpdateRoleInput { - data = typeof data === 'object' ? data : {}; - let result = new UpdateRoleInput(); - result.init(data); - return result; - } + static fromJS(data: any): UpdateRoleInput { + data = typeof data === 'object' ? data : {}; + let result = new UpdateRoleInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['roleId'] = this.roleId; - data['roleInfo'] = this.roleInfo ? this.roleInfo.toJSON() : undefined; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["roleId"] = this.roleId; + data["roleInfo"] = this.roleInfo ? this.roleInfo.toJSON() : undefined; + return data; + } } export interface IUpdateRoleInput { - roleId: string; - roleInfo: IdentityRoleUpdateDto; + roleId: string; + roleInfo: IdentityRoleUpdateDto; } export class UpdateRolePermissionsInput implements IUpdateRolePermissionsInput { - providerName!: string | undefined; - providerKey!: string | undefined; - updatePermissionsDto!: UpdatePermissionsDto; - - constructor(data?: IUpdateRolePermissionsInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.providerName = _data['providerName']; - this.providerKey = _data['providerKey']; - this.updatePermissionsDto = _data['updatePermissionsDto'] - ? UpdatePermissionsDto.fromJS(_data['updatePermissionsDto']) - : undefined; - } - } - - static fromJS(data: any): UpdateRolePermissionsInput { - data = typeof data === 'object' ? data : {}; - let result = new UpdateRolePermissionsInput(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['providerName'] = this.providerName; - data['providerKey'] = this.providerKey; - data['updatePermissionsDto'] = this.updatePermissionsDto - ? this.updatePermissionsDto.toJSON() - : undefined; - return data; - } + providerName!: string | undefined; + providerKey!: string | undefined; + updatePermissionsDto!: UpdatePermissionsDto; + + constructor(data?: IUpdateRolePermissionsInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.providerName = _data["providerName"]; + this.providerKey = _data["providerKey"]; + this.updatePermissionsDto = _data["updatePermissionsDto"] ? UpdatePermissionsDto.fromJS(_data["updatePermissionsDto"]) : undefined; + } + } + + static fromJS(data: any): UpdateRolePermissionsInput { + data = typeof data === 'object' ? data : {}; + let result = new UpdateRolePermissionsInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["providerName"] = this.providerName; + data["providerKey"] = this.providerKey; + data["updatePermissionsDto"] = this.updatePermissionsDto ? this.updatePermissionsDto.toJSON() : undefined; + return data; + } } export interface IUpdateRolePermissionsInput { - providerName: string | undefined; - providerKey: string | undefined; - updatePermissionsDto: UpdatePermissionsDto; + providerName: string | undefined; + providerKey: string | undefined; + updatePermissionsDto: UpdatePermissionsDto; } export class UpdateSettingInput implements IUpdateSettingInput { - values!: { [key: string]: string } | undefined; - - constructor(data?: IUpdateSettingInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + values!: { [key: string]: string; } | undefined; + + constructor(data?: IUpdateSettingInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - if (_data['values']) { - this.values = {} as any; - for (let key in _data['values']) { - if (_data['values'].hasOwnProperty(key)) (this.values)![key] = _data['values'][key]; + init(_data?: any) { + if (_data) { + if (_data["values"]) { + this.values = {} as any; + for (let key in _data["values"]) { + if (_data["values"].hasOwnProperty(key)) + (this.values)![key] = _data["values"][key]; + } + } } - } } - } - static fromJS(data: any): UpdateSettingInput { - data = typeof data === 'object' ? data : {}; - let result = new UpdateSettingInput(); - result.init(data); - return result; - } + static fromJS(data: any): UpdateSettingInput { + data = typeof data === 'object' ? data : {}; + let result = new UpdateSettingInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - if (this.values) { - data['values'] = {}; - for (let key in this.values) { - if (this.values.hasOwnProperty(key)) (data['values'])[key] = (this.values)[key]; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (this.values) { + data["values"] = {}; + for (let key in this.values) { + if (this.values.hasOwnProperty(key)) + (data["values"])[key] = (this.values)[key]; + } + } + return data; } - return data; - } } export interface IUpdateSettingInput { - values: { [key: string]: string } | undefined; + values: { [key: string]: string; } | undefined; } export class UpdateTenantInput implements IUpdateTenantInput { - id!: string; - name!: string | undefined; - - constructor(data?: IUpdateTenantInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + id!: string; + name!: string | undefined; + + constructor(data?: IUpdateTenantInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.id = _data['id']; - this.name = _data['name']; + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.name = _data["name"]; + } } - } - static fromJS(data: any): UpdateTenantInput { - data = typeof data === 'object' ? data : {}; - let result = new UpdateTenantInput(); - result.init(data); - return result; - } + static fromJS(data: any): UpdateTenantInput { + data = typeof data === 'object' ? data : {}; + let result = new UpdateTenantInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['id'] = this.id; - data['name'] = this.name; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["name"] = this.name; + return data; + } } export interface IUpdateTenantInput { - id: string; - name: string | undefined; + id: string; + name: string | undefined; } export class UpdateUserInput implements IUpdateUserInput { - userId!: string; - userInfo!: IdentityUserUpdateDto; - - constructor(data?: IUpdateUserInput) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + userId!: string; + userInfo!: IdentityUserUpdateDto; + + constructor(data?: IUpdateUserInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.userId = _data['userId']; - this.userInfo = _data['userInfo'] - ? IdentityUserUpdateDto.fromJS(_data['userInfo']) - : undefined; + init(_data?: any) { + if (_data) { + this.userId = _data["userId"]; + this.userInfo = _data["userInfo"] ? IdentityUserUpdateDto.fromJS(_data["userInfo"]) : undefined; + } } - } - static fromJS(data: any): UpdateUserInput { - data = typeof data === 'object' ? data : {}; - let result = new UpdateUserInput(); - result.init(data); - return result; - } + static fromJS(data: any): UpdateUserInput { + data = typeof data === 'object' ? data : {}; + let result = new UpdateUserInput(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['userId'] = this.userId; - data['userInfo'] = this.userInfo ? this.userInfo.toJSON() : undefined; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["userId"] = this.userId; + data["userInfo"] = this.userInfo ? this.userInfo.toJSON() : undefined; + return data; + } } export interface IUpdateUserInput { - userId: string; - userInfo: IdentityUserUpdateDto; + userId: string; + userInfo: IdentityUserUpdateDto; } export class UserLoginInfo implements IUserLoginInfo { - userNameOrEmailAddress!: string; - password!: string; - rememberMe!: boolean; - - constructor(data?: IUserLoginInfo) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.userNameOrEmailAddress = _data['userNameOrEmailAddress']; - this.password = _data['password']; - this.rememberMe = _data['rememberMe']; - } - } - - static fromJS(data: any): UserLoginInfo { - data = typeof data === 'object' ? data : {}; - let result = new UserLoginInfo(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['userNameOrEmailAddress'] = this.userNameOrEmailAddress; - data['password'] = this.password; - data['rememberMe'] = this.rememberMe; - return data; - } + userNameOrEmailAddress!: string; + password!: string; + rememberMe!: boolean; + + constructor(data?: IUserLoginInfo) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.userNameOrEmailAddress = _data["userNameOrEmailAddress"]; + this.password = _data["password"]; + this.rememberMe = _data["rememberMe"]; + } + } + + static fromJS(data: any): UserLoginInfo { + data = typeof data === 'object' ? data : {}; + let result = new UserLoginInfo(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["userNameOrEmailAddress"] = this.userNameOrEmailAddress; + data["password"] = this.password; + data["rememberMe"] = this.rememberMe; + return data; + } } export interface IUserLoginInfo { - userNameOrEmailAddress: string; - password: string; - rememberMe: boolean; + userNameOrEmailAddress: string; + password: string; + rememberMe: boolean; } export class WindowsTimeZone implements IWindowsTimeZone { - timeZoneId!: string | undefined; - - constructor(data?: IWindowsTimeZone) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) (this)[property] = (data)[property]; - } + timeZoneId!: string | undefined; + + constructor(data?: IWindowsTimeZone) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } } - } - init(_data?: any) { - if (_data) { - this.timeZoneId = _data['timeZoneId']; + init(_data?: any) { + if (_data) { + this.timeZoneId = _data["timeZoneId"]; + } } - } - static fromJS(data: any): WindowsTimeZone { - data = typeof data === 'object' ? data : {}; - let result = new WindowsTimeZone(); - result.init(data); - return result; - } + static fromJS(data: any): WindowsTimeZone { + data = typeof data === 'object' ? data : {}; + let result = new WindowsTimeZone(); + result.init(data); + return result; + } - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data['timeZoneId'] = this.timeZoneId; - return data; - } + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["timeZoneId"] = this.timeZoneId; + return data; + } } export interface IWindowsTimeZone { - timeZoneId: string | undefined; + timeZoneId: string | undefined; } export interface FileResponse { - data: Blob; - status: number; - fileName?: string; - headers?: { [name: string]: any }; + data: Blob; + status: number; + fileName?: string; + headers?: { [name: string]: any }; } export class ApiException extends Error { - message: string; - status: number; - response: string; - headers: { [key: string]: any }; - result: any; - - constructor( - message: string, - status: number, - response: string, - headers: { [key: string]: any }, - result: any, - ) { - super(); - - this.message = message; - this.status = status; - this.response = response; - this.headers = headers; - this.result = result; - } - - protected isApiException = true; - - static isApiException(obj: any): obj is ApiException { - return obj.isApiException === true; - } -} - -function throwException( - message: string, - status: number, - response: string, - headers: { [key: string]: any }, - result?: any, -): any { - if (result !== null && result !== undefined) throw result; - else throw new ApiException(message, status, response, headers, null); + message: string; + status: number; + response: string; + headers: { [key: string]: any; }; + result: any; + + constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) { + super(); + + this.message = message; + this.status = status; + this.response = response; + this.headers = headers; + this.result = result; + } + + protected isApiException = true; + + static isApiException(obj: any): obj is ApiException { + return obj.isApiException === true; + } } -function isAxiosError(obj: any | undefined): obj is AxiosError { - return obj && obj.isAxiosError === true; +function throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): any { + if (result !== null && result !== undefined) + throw result; + else + throw new ApiException(message, status, response, headers, null); } + +function isAxiosError(obj: any | undefined): obj is AxiosError { + return obj && obj.isAxiosError === true; +} \ No newline at end of file diff --git a/vben28/src/views/admin/identitySecurityLog/Index.ts b/vben28/src/views/admin/identitySecurityLog/Index.ts new file mode 100644 index 00000000..19b72d1a --- /dev/null +++ b/vben28/src/views/admin/identitySecurityLog/Index.ts @@ -0,0 +1,80 @@ +import {FormSchema} from '/src/components/Table'; +import {BasicColumn} from '/src/components/Table'; +import {useI18n} from '/src/hooks/web/useI18n'; +import { formatToDateTime, dateUtil } from '/src/utils/dateUtil'; +const {t} = useI18n(); +import { + IdentitySecurityLogsServiceProxy, + PageIdentitySecurityLogInput, +} from '/src/services/ServiceProxies'; + +// 分页表格登录日志 BasicColumn +export const tableColumns: BasicColumn[] = [ + { + title: t('routes.admin.identitySecurityLog_ApplicationName'), + dataIndex: 'applicationName', + }, + { + title: t('routes.admin.identitySecurityLog_Identity'), + dataIndex: 'identity', + }, + { + title: t('routes.admin.identitySecurityLog_Action'), + dataIndex: 'action', + }, + { + title: t('routes.admin.identitySecurityLog_UserName'), + dataIndex: 'userName', + }, + { + title: t('routes.admin.identitySecurityLog_CorrelationId'), + dataIndex: 'correlationId', + }, + { + title: t('routes.admin.identitySecurityLog_ClientIpAddress'), + dataIndex: 'clientIpAddress', + }, + { + title: t('routes.admin.identitySecurityLog_CreationTime'), + dataIndex: 'creationTime', + customRender: ({ text }) => { + return formatToDateTime(text); + }, + }, +]; + +// 分页查询登录日志 FormSchema +export const searchFormSchema: FormSchema[] = [ + { + field: 'time', + component: 'RangePicker', + label: t('routes.admin.audit_executeTime'), + colProps: { + span: 4, + }, + defaultValue: [dateUtil().subtract(7, 'days'), dateUtil().add(1, 'days')], + }, + { + field: 'userName', + label: t('routes.admin.identitySecurityLog_UserName'), + component: 'Input', + colProps: { span: 3 }, + }, + { + field: 'correlationId', + label: 'CorrelationId', + labelWidth: 95, + component: 'Input', + colProps: { span: 4 }, + } +]; + + +/** + * 分页查询登录日志 + */ +export async function pageAsync(params: PageIdentitySecurityLogInput, +) { + const identitySecurityLogServiceProxy = new IdentitySecurityLogsServiceProxy(); + return identitySecurityLogServiceProxy.page(params); +} diff --git a/vben28/src/views/admin/identitySecurityLog/Index.vue b/vben28/src/views/admin/identitySecurityLog/Index.vue new file mode 100644 index 00000000..a5fb9faa --- /dev/null +++ b/vben28/src/views/admin/identitySecurityLog/Index.vue @@ -0,0 +1,45 @@ + + +