| Required role: | SystemAdmin |
| POST | /roles |
|---|
import 'package:servicestack/servicestack.dart';
class RolesAddResponse implements IConvertible
{
// @DataMember(Order=2)
int? tenantsId;
// @DataMember(Order=3)
String? name;
// @DataMember(Order=5)
ResponseStatus? responseStatus;
RolesAddResponse({this.tenantsId,this.name,this.responseStatus});
RolesAddResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
tenantsId = json['tenantsId'];
name = json['name'];
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'tenantsId': tenantsId,
'name': name,
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "RolesAddResponse";
TypeContext? context = _ctx;
}
// @DataContract
class RolesAdd implements IConvertible
{
// @DataMember(Order=2)
// @Validate(Validator="NotNull")
int? tenantsId;
// @DataMember(Order=3)
// @Validate(Validator="NotNull")
String? name;
RolesAdd({this.tenantsId,this.name});
RolesAdd.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
tenantsId = json['tenantsId'];
name = json['name'];
return this;
}
Map<String, dynamic> toJson() => {
'tenantsId': tenantsId,
'name': name
};
getTypeName() => "RolesAdd";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.sfgtec.com', types: <String, TypeInfo> {
'RolesAddResponse': TypeInfo(TypeOf.Class, create:() => RolesAddResponse()),
'RolesAdd': TypeInfo(TypeOf.Class, create:() => RolesAdd()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /roles HTTP/1.1
Host: api.sfgtec.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"tenantsId":0,"name":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"tenantsId":0,"name":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}