| GET,OPTIONS | /v1/Roles/{RoleId} |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
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 .xml suffix or ?format=xml
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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<Role xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal.Models">
<Code>String</Code>
<CreatedUtc>0001-01-01T00:00:00</CreatedUtc>
<Description>String</Description>
<IsActive>false</IsActive>
<IsSystem>false</IsSystem>
<Name>String</Name>
<Permissions>
<Permission>
<Action>String</Action>
<Code>String</Code>
<CreatedUtc>0001-01-01T00:00:00</CreatedUtc>
<Description>String</Description>
<IsActive>false</IsActive>
<Module>String</Module>
<Name>String</Name>
<PermissionId>0</PermissionId>
<Resource>String</Resource>
<SortOrder>0</SortOrder>
<Tags>String</Tags>
</Permission>
</Permissions>
<RoleId>0</RoleId>
<TenantId>00000000-0000-0000-0000-000000000000</TenantId>
</Role>