Reporting Services

<back to all web services

AssignRoles

auth
Requires Authentication
Required role:Admin
The following routes are available for this service:
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: 'cip_reporting_staging.chargeitpro.com', types: <String, TypeInfo> {
});

Dart AssignRoles DTOs

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

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /assignroles HTTP/1.1 
Host: cip-reporting-staging.chargeitpro.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"UserName":"String","Permissions":["String"],"Roles":["String"],"Meta":{"String":"String"}}
HTTP/1.1 200 OK
Content-Type: text/csv
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"}}}