Trendsic Platform Service

<back to all web services

GetRoleByIdRequest

Requires Authentication
The following routes are available for this service:
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()),
});

Dart GetRoleByIdRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

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/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"RoleId":0,"TenantId":"00000000000000000000000000000000","Code":"String","Name":"String","Description":"String","IsSystem":false,"IsActive":false,"CreatedUtc":"0001-01-01T00:00:00.0000000","Permissions":[{"PermissionId":0,"Module":"String","Resource":"String","Action":"String","Name":"String","Description":"String","Tags":"String","SortOrder":0,"IsActive":false,"CreatedUtc":"0001-01-01T00:00:00.0000000","Code":"String"}]}