| GET,OPTIONS | /v1/Roles/{RoleId} |
|---|
import 'package:servicestack/servicestack.dart';
class Permission implements IConvertible
{
int? PermissionId;
String? Module;
String? Resource;
String? Action;
String? Name;
String? Description;
String? Tags;
int? SortOrder;
bool? IsActive;
DateTime? CreatedUtc;
String? Code;
Permission({this.PermissionId,this.Module,this.Resource,this.Action,this.Name,this.Description,this.Tags,this.SortOrder,this.IsActive,this.CreatedUtc,this.Code});
Permission.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
PermissionId = json['PermissionId'];
Module = json['Module'];
Resource = json['Resource'];
Action = json['Action'];
Name = json['Name'];
Description = json['Description'];
Tags = json['Tags'];
SortOrder = json['SortOrder'];
IsActive = json['IsActive'];
CreatedUtc = JsonConverters.fromJson(json['CreatedUtc'],'DateTime',context!);
Code = json['Code'];
return this;
}
Map<String, dynamic> toJson() => {
'PermissionId': PermissionId,
'Module': Module,
'Resource': Resource,
'Action': Action,
'Name': Name,
'Description': Description,
'Tags': Tags,
'SortOrder': SortOrder,
'IsActive': IsActive,
'CreatedUtc': JsonConverters.toJson(CreatedUtc,'DateTime',context!),
'Code': Code
};
getTypeName() => "Permission";
TypeContext? context = _ctx;
}
class Role implements IConvertible
{
int? RoleId;
String? TenantId;
String? Code;
String? Name;
String? Description;
bool? IsSystem;
bool? IsActive;
DateTime? CreatedUtc;
List<Permission>? Permissions = [];
Role({this.RoleId,this.TenantId,this.Code,this.Name,this.Description,this.IsSystem,this.IsActive,this.CreatedUtc,this.Permissions});
Role.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
RoleId = json['RoleId'];
TenantId = json['TenantId'];
Code = json['Code'];
Name = json['Name'];
Description = json['Description'];
IsSystem = json['IsSystem'];
IsActive = json['IsActive'];
CreatedUtc = JsonConverters.fromJson(json['CreatedUtc'],'DateTime',context!);
Permissions = JsonConverters.fromJson(json['Permissions'],'List<Permission>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'RoleId': RoleId,
'TenantId': TenantId,
'Code': Code,
'Name': Name,
'Description': Description,
'IsSystem': IsSystem,
'IsActive': IsActive,
'CreatedUtc': JsonConverters.toJson(CreatedUtc,'DateTime',context!),
'Permissions': JsonConverters.toJson(Permissions,'List<Permission>',context!)
};
getTypeName() => "Role";
TypeContext? context = _ctx;
}
class GetRoleByIdRequest implements IConvertible
{
int? RoleId;
GetRoleByIdRequest({this.RoleId});
GetRoleByIdRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
RoleId = json['RoleId'];
return this;
}
Map<String, dynamic> toJson() => {
'RoleId': RoleId
};
getTypeName() => "GetRoleByIdRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'Permission': TypeInfo(TypeOf.Class, create:() => Permission()),
'Role': TypeInfo(TypeOf.Class, create:() => Role()),
'List<Permission>': TypeInfo(TypeOf.Class, create:() => <Permission>[]),
'GetRoleByIdRequest': TypeInfo(TypeOf.Class, create:() => GetRoleByIdRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/Roles/{RoleId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
RoleId: 0,
TenantId: 00000000000000000000000000000000,
Code: String,
Name: String,
Description: String,
IsSystem: False,
IsActive: False,
CreatedUtc: 0001-01-01,
Permissions:
[
{
PermissionId: 0,
Module: String,
Resource: String,
Action: String,
Name: String,
Description: String,
Tags: String,
SortOrder: 0,
IsActive: False,
CreatedUtc: 0001-01-01,
Code: String
}
]
}