Required role: | Admin |
POST | /assignroles |
---|
import 'package:servicestack/servicestack.dart';
// @DataContract
class AssignRolesResponse implements IMeta, IConvertible
{
// @DataMember(Order=1)
List<String>? AllRoles;
// @DataMember(Order=2)
List<String>? AllPermissions;
// @DataMember(Order=3)
Map<String,String?>? Meta;
// @DataMember(Order=4)
ResponseStatus? ResponseStatus;
AssignRolesResponse({this.AllRoles,this.AllPermissions,this.Meta,this.ResponseStatus});
AssignRolesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
AllRoles = JsonConverters.fromJson(json['AllRoles'],'List<String>',context!);
AllPermissions = JsonConverters.fromJson(json['AllPermissions'],'List<String>',context!);
Meta = JsonConverters.toStringMap(json['Meta']);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'AllRoles': JsonConverters.toJson(AllRoles,'List<String>',context!),
'AllPermissions': JsonConverters.toJson(AllPermissions,'List<String>',context!),
'Meta': Meta,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "AssignRolesResponse";
TypeContext? context = _ctx;
}
// @DataContract
class AssignRoles implements IPost, IMeta, IConvertible
{
// @DataMember(Order=1)
String? UserName;
// @DataMember(Order=2)
List<String>? Permissions;
// @DataMember(Order=3)
List<String>? Roles;
// @DataMember(Order=4)
Map<String,String?>? Meta;
AssignRoles({this.UserName,this.Permissions,this.Roles,this.Meta});
AssignRoles.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
UserName = json['UserName'];
Permissions = JsonConverters.fromJson(json['Permissions'],'List<String>',context!);
Roles = JsonConverters.fromJson(json['Roles'],'List<String>',context!);
Meta = JsonConverters.toStringMap(json['Meta']);
return this;
}
Map<String, dynamic> toJson() => {
'UserName': UserName,
'Permissions': JsonConverters.toJson(Permissions,'List<String>',context!),
'Roles': JsonConverters.toJson(Roles,'List<String>',context!),
'Meta': Meta
};
getTypeName() => "AssignRoles";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: '54.235.149.200', types: <String, TypeInfo> {
});
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.
POST /assignroles HTTP/1.1
Host: 54.235.149.200
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
UserName: String,
Permissions:
[
String
],
Roles:
[
String
],
Meta:
{
String: String
}
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { AllRoles: [ String ], AllPermissions: [ String ], Meta: { String: String }, ResponseStatus: { ErrorCode: String, Message: String, StackTrace: String, Errors: [ { ErrorCode: String, FieldName: String, Message: String, Meta: { String: String } } ], Meta: { String: String } } }