All Verbs | /user/organizations |
---|
import 'package:servicestack/servicestack.dart';
class OrganizationMember implements IConvertible
{
int? id;
int? organizationId;
int? userId;
String? userName;
bool? isOwner;
bool? isModerator;
bool? denyAll;
bool? denyPosts;
bool? denyComments;
String? notes;
OrganizationMember({this.id,this.organizationId,this.userId,this.userName,this.isOwner,this.isModerator,this.denyAll,this.denyPosts,this.denyComments,this.notes});
OrganizationMember.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
organizationId = json['organizationId'];
userId = json['userId'];
userName = json['userName'];
isOwner = json['isOwner'];
isModerator = json['isModerator'];
denyAll = json['denyAll'];
denyPosts = json['denyPosts'];
denyComments = json['denyComments'];
notes = json['notes'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'organizationId': organizationId,
'userId': userId,
'userName': userName,
'isOwner': isOwner,
'isModerator': isModerator,
'denyAll': denyAll,
'denyPosts': denyPosts,
'denyComments': denyComments,
'notes': notes
};
getTypeName() => "OrganizationMember";
TypeContext? context = _ctx;
}
class OrganizationMemberInvite implements IConvertible
{
int? id;
int? organizationId;
int? userId;
String? userName;
DateTime? dismissed;
OrganizationMemberInvite({this.id,this.organizationId,this.userId,this.userName,this.dismissed});
OrganizationMemberInvite.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
organizationId = json['organizationId'];
userId = json['userId'];
userName = json['userName'];
dismissed = JsonConverters.fromJson(json['dismissed'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'organizationId': organizationId,
'userId': userId,
'userName': userName,
'dismissed': JsonConverters.toJson(dismissed,'DateTime',context!)
};
getTypeName() => "OrganizationMemberInvite";
TypeContext? context = _ctx;
}
class OrganizationSubscription implements IConvertible
{
int? id;
int? organizationId;
int? userId;
String? userName;
List<String>? postTypes;
int? frequencyDays;
int? lastSyncedId;
DateTime? lastSynced;
DateTime? created;
OrganizationSubscription({this.id,this.organizationId,this.userId,this.userName,this.postTypes,this.frequencyDays,this.lastSyncedId,this.lastSynced,this.created});
OrganizationSubscription.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
organizationId = json['organizationId'];
userId = json['userId'];
userName = json['userName'];
postTypes = JsonConverters.fromJson(json['postTypes'],'List<String>',context!);
frequencyDays = json['frequencyDays'];
lastSyncedId = json['lastSyncedId'];
lastSynced = JsonConverters.fromJson(json['lastSynced'],'DateTime',context!);
created = JsonConverters.fromJson(json['created'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'organizationId': organizationId,
'userId': userId,
'userName': userName,
'postTypes': JsonConverters.toJson(postTypes,'List<String>',context!),
'frequencyDays': frequencyDays,
'lastSyncedId': lastSyncedId,
'lastSynced': JsonConverters.toJson(lastSynced,'DateTime',context!),
'created': JsonConverters.toJson(created,'DateTime',context!)
};
getTypeName() => "OrganizationSubscription";
TypeContext? context = _ctx;
}
class GetUserOrganizationsResponse implements IConvertible
{
List<OrganizationMember>? members;
List<OrganizationMemberInvite>? memberInvites;
List<OrganizationSubscription>? subscriptions;
GetUserOrganizationsResponse({this.members,this.memberInvites,this.subscriptions});
GetUserOrganizationsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
members = JsonConverters.fromJson(json['members'],'List<OrganizationMember>',context!);
memberInvites = JsonConverters.fromJson(json['memberInvites'],'List<OrganizationMemberInvite>',context!);
subscriptions = JsonConverters.fromJson(json['subscriptions'],'List<OrganizationSubscription>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'members': JsonConverters.toJson(members,'List<OrganizationMember>',context!),
'memberInvites': JsonConverters.toJson(memberInvites,'List<OrganizationMemberInvite>',context!),
'subscriptions': JsonConverters.toJson(subscriptions,'List<OrganizationSubscription>',context!)
};
getTypeName() => "GetUserOrganizationsResponse";
TypeContext? context = _ctx;
}
class GetUserOrganizations implements IGet, IConvertible
{
GetUserOrganizations();
GetUserOrganizations.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "GetUserOrganizations";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'techstacks.io', types: <String, TypeInfo> {
'OrganizationMember': TypeInfo(TypeOf.Class, create:() => OrganizationMember()),
'OrganizationMemberInvite': TypeInfo(TypeOf.Class, create:() => OrganizationMemberInvite()),
'OrganizationSubscription': TypeInfo(TypeOf.Class, create:() => OrganizationSubscription()),
'GetUserOrganizationsResponse': TypeInfo(TypeOf.Class, create:() => GetUserOrganizationsResponse()),
'List<OrganizationMember>': TypeInfo(TypeOf.Class, create:() => <OrganizationMember>[]),
'List<OrganizationMemberInvite>': TypeInfo(TypeOf.Class, create:() => <OrganizationMemberInvite>[]),
'List<OrganizationSubscription>': TypeInfo(TypeOf.Class, create:() => <OrganizationSubscription>[]),
'GetUserOrganizations': TypeInfo(TypeOf.Class, create:() => GetUserOrganizations()),
});
Dart GetUserOrganizations 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.
POST /user/organizations HTTP/1.1
Host: techstacks.io
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { members: [ { id: 0, organizationId: 0, userId: 0, userName: String, isOwner: False, isModerator: False, denyAll: False, denyPosts: False, denyComments: False, notes: String } ], memberInvites: [ { id: 0, organizationId: 0, userId: 0, userName: String, dismissed: 0001-01-01 } ], subscriptions: [ { id: 0, organizationId: 0, userId: 0, userName: String, postTypes: [ String ], frequencyDays: 0, lastSyncedId: 0, lastSynced: 0001-01-01, created: 0001-01-01 } ] }