| GET,OPTIONS | /v1/workspace/modules |
|---|
import 'package:servicestack/servicestack.dart';
class ModuleLimit implements IConvertible
{
String? MeterKey;
int? Used;
int? Allowance;
bool? IsReached;
ModuleLimit({this.MeterKey,this.Used,this.Allowance,this.IsReached});
ModuleLimit.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
MeterKey = json['MeterKey'];
Used = json['Used'];
Allowance = json['Allowance'];
IsReached = json['IsReached'];
return this;
}
Map<String, dynamic> toJson() => {
'MeterKey': MeterKey,
'Used': Used,
'Allowance': Allowance,
'IsReached': IsReached
};
getTypeName() => "ModuleLimit";
TypeContext? context = _ctx;
}
class WorkspaceModuleFeature implements IConvertible
{
String? Key;
String? Name;
bool? Enabled;
bool? InPack;
String? Group;
String? Description;
bool? IsOn;
bool? Entitled;
String? Reason;
String? ModuleKey;
String? ModuleName;
String? ModuleStatus;
DateTime? ModuleExpiresAt;
ModuleLimit? Limit;
WorkspaceModuleFeature({this.Key,this.Name,this.Enabled,this.InPack,this.Group,this.Description,this.IsOn,this.Entitled,this.Reason,this.ModuleKey,this.ModuleName,this.ModuleStatus,this.ModuleExpiresAt,this.Limit});
WorkspaceModuleFeature.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
Name = json['Name'];
Enabled = json['Enabled'];
InPack = json['InPack'];
Group = json['Group'];
Description = json['Description'];
IsOn = json['IsOn'];
Entitled = json['Entitled'];
Reason = json['Reason'];
ModuleKey = json['ModuleKey'];
ModuleName = json['ModuleName'];
ModuleStatus = json['ModuleStatus'];
ModuleExpiresAt = JsonConverters.fromJson(json['ModuleExpiresAt'],'DateTime',context!);
Limit = JsonConverters.fromJson(json['Limit'],'ModuleLimit',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'Name': Name,
'Enabled': Enabled,
'InPack': InPack,
'Group': Group,
'Description': Description,
'IsOn': IsOn,
'Entitled': Entitled,
'Reason': Reason,
'ModuleKey': ModuleKey,
'ModuleName': ModuleName,
'ModuleStatus': ModuleStatus,
'ModuleExpiresAt': JsonConverters.toJson(ModuleExpiresAt,'DateTime',context!),
'Limit': JsonConverters.toJson(Limit,'ModuleLimit',context!)
};
getTypeName() => "WorkspaceModuleFeature";
TypeContext? context = _ctx;
}
class WorkspaceModule implements IConvertible
{
String? Key;
String? Name;
String? Letter;
String? Color;
String? Question;
String? Description;
List<WorkspaceModuleFeature>? Features = [];
WorkspaceModule({this.Key,this.Name,this.Letter,this.Color,this.Question,this.Description,this.Features});
WorkspaceModule.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
Name = json['Name'];
Letter = json['Letter'];
Color = json['Color'];
Question = json['Question'];
Description = json['Description'];
Features = JsonConverters.fromJson(json['Features'],'List<WorkspaceModuleFeature>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'Name': Name,
'Letter': Letter,
'Color': Color,
'Question': Question,
'Description': Description,
'Features': JsonConverters.toJson(Features,'List<WorkspaceModuleFeature>',context!)
};
getTypeName() => "WorkspaceModule";
TypeContext? context = _ctx;
}
class WorkspaceRequestMark implements IConvertible
{
String? Kind;
String? Key;
List<String>? Features = [];
DateTime? RequestedAt;
WorkspaceRequestMark({this.Kind,this.Key,this.Features,this.RequestedAt});
WorkspaceRequestMark.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Kind = json['Kind'];
Key = json['Key'];
Features = JsonConverters.fromJson(json['Features'],'List<String>',context!);
RequestedAt = JsonConverters.fromJson(json['RequestedAt'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Kind': Kind,
'Key': Key,
'Features': JsonConverters.toJson(Features,'List<String>',context!),
'RequestedAt': JsonConverters.toJson(RequestedAt,'DateTime',context!)
};
getTypeName() => "WorkspaceRequestMark";
TypeContext? context = _ctx;
}
class WorkspaceModulesResponse implements IConvertible
{
List<WorkspaceModule>? Modules = [];
String? PackName;
List<WorkspaceRequestMark>? Requests = [];
ResponseStatus? ResponseStatus;
WorkspaceModulesResponse({this.Modules,this.PackName,this.Requests,this.ResponseStatus});
WorkspaceModulesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Modules = JsonConverters.fromJson(json['Modules'],'List<WorkspaceModule>',context!);
PackName = json['PackName'];
Requests = JsonConverters.fromJson(json['Requests'],'List<WorkspaceRequestMark>',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Modules': JsonConverters.toJson(Modules,'List<WorkspaceModule>',context!),
'PackName': PackName,
'Requests': JsonConverters.toJson(Requests,'List<WorkspaceRequestMark>',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "WorkspaceModulesResponse";
TypeContext? context = _ctx;
}
class GetWorkspaceModulesRequest implements IConvertible
{
GetWorkspaceModulesRequest();
GetWorkspaceModulesRequest.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "GetWorkspaceModulesRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'ModuleLimit': TypeInfo(TypeOf.Class, create:() => ModuleLimit()),
'WorkspaceModuleFeature': TypeInfo(TypeOf.Class, create:() => WorkspaceModuleFeature()),
'WorkspaceModule': TypeInfo(TypeOf.Class, create:() => WorkspaceModule()),
'List<WorkspaceModuleFeature>': TypeInfo(TypeOf.Class, create:() => <WorkspaceModuleFeature>[]),
'WorkspaceRequestMark': TypeInfo(TypeOf.Class, create:() => WorkspaceRequestMark()),
'WorkspaceModulesResponse': TypeInfo(TypeOf.Class, create:() => WorkspaceModulesResponse()),
'List<WorkspaceModule>': TypeInfo(TypeOf.Class, create:() => <WorkspaceModule>[]),
'List<WorkspaceRequestMark>': TypeInfo(TypeOf.Class, create:() => <WorkspaceRequestMark>[]),
'GetWorkspaceModulesRequest': TypeInfo(TypeOf.Class, create:() => GetWorkspaceModulesRequest()),
});
Dart GetWorkspaceModulesRequest DTOs
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.
GET /v1/workspace/modules HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Modules:
[
{
Key: String,
Name: String,
Letter: String,
Color: String,
Question: String,
Description: String,
Features:
[
{
Key: String,
Name: String,
Enabled: False,
InPack: False,
Group: String,
Description: String,
IsOn: False,
Entitled: False,
Reason: String,
ModuleKey: String,
ModuleName: String,
ModuleStatus: String,
ModuleExpiresAt: 0001-01-01,
Limit:
{
MeterKey: String,
Used: 0,
Allowance: 0,
IsReached: True
}
}
]
}
],
PackName: String,
Requests:
[
{
Kind: String,
Key: String,
Features:
[
String
],
RequestedAt: 0001-01-01
}
],
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}