Requires the role: | superadmin |
PUT | /mailchimp/member/company/sync | sync mailchimp memebers |
---|
import 'package:servicestack/servicestack.dart';
class MemberTag implements IConvertible
{
int? Id;
String? Name;
DateTime? DateAdded;
String? Status;
MemberTag({this.Id,this.Name,this.DateAdded,this.Status});
MemberTag.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
DateAdded = JsonConverters.fromJson(json['DateAdded'],'DateTime',context!);
Status = json['Status'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'DateAdded': JsonConverters.toJson(DateAdded,'DateTime',context!),
'Status': Status
};
getTypeName() => "MemberTag";
TypeContext? context = _ctx;
}
class MemberResponse implements IConvertible
{
String? EmailAddress;
String? FullName;
List<MemberTag>? Tags;
MemberResponse({this.EmailAddress,this.FullName,this.Tags});
MemberResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
EmailAddress = json['EmailAddress'];
FullName = json['FullName'];
Tags = JsonConverters.fromJson(json['Tags'],'List<MemberTag>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'EmailAddress': EmailAddress,
'FullName': FullName,
'Tags': JsonConverters.toJson(Tags,'List<MemberTag>',context!)
};
getTypeName() => "MemberResponse";
TypeContext? context = _ctx;
}
class SyncMembersResponse implements IConvertible
{
List<MemberResponse>? FailedSyncedMembers;
List<MemberResponse>? SuccessSyncedMembers;
SyncMembersResponse({this.FailedSyncedMembers,this.SuccessSyncedMembers});
SyncMembersResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
FailedSyncedMembers = JsonConverters.fromJson(json['FailedSyncedMembers'],'List<MemberResponse>',context!);
SuccessSyncedMembers = JsonConverters.fromJson(json['SuccessSyncedMembers'],'List<MemberResponse>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'FailedSyncedMembers': JsonConverters.toJson(FailedSyncedMembers,'List<MemberResponse>',context!),
'SuccessSyncedMembers': JsonConverters.toJson(SuccessSyncedMembers,'List<MemberResponse>',context!)
};
getTypeName() => "SyncMembersResponse";
TypeContext? context = _ctx;
}
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class SyncCompanyMembers implements IConvertible
{
/**
* Should we delete emails that do not exist in BokaMera.
*/
// @ApiMember(Description="Should we delete emails that do not exist in BokaMera.")
bool? DeleteNonExisting;
/**
* Determines if it is a test user
*/
// @ApiMember(Description="Determines if it is a test user")
bool? Test;
/**
* The company id of member of which members you want to sync.
*/
// @ApiMember(Description="The company id of member of which members you want to sync.")
String? MemberCompanyId;
SyncCompanyMembers({this.DeleteNonExisting,this.Test,this.MemberCompanyId});
SyncCompanyMembers.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
DeleteNonExisting = json['DeleteNonExisting'];
Test = json['Test'];
MemberCompanyId = json['MemberCompanyId'];
return this;
}
Map<String, dynamic> toJson() => {
'DeleteNonExisting': DeleteNonExisting,
'Test': Test,
'MemberCompanyId': MemberCompanyId
};
getTypeName() => "SyncCompanyMembers";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'MemberTag': TypeInfo(TypeOf.Class, create:() => MemberTag()),
'MemberResponse': TypeInfo(TypeOf.Class, create:() => MemberResponse()),
'List<MemberTag>': TypeInfo(TypeOf.Class, create:() => <MemberTag>[]),
'SyncMembersResponse': TypeInfo(TypeOf.Class, create:() => SyncMembersResponse()),
'List<MemberResponse>': TypeInfo(TypeOf.Class, create:() => <MemberResponse>[]),
'SyncCompanyMembers': TypeInfo(TypeOf.Class, create:() => SyncCompanyMembers()),
});
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.
PUT /mailchimp/member/company/sync HTTP/1.1
Host: api.bokamera.se
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"DeleteNonExisting":false,"Test":false,"MemberCompanyId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"FailedSyncedMembers":[{"EmailAddress":"String","FullName":"String","Tags":[{"Id":0,"Name":"String","DateAdded":"0001-01-01T00:00:00","Status":"String"}]}],"SuccessSyncedMembers":[{"EmailAddress":"String","FullName":"String","Tags":[{"Id":0,"Name":"String","DateAdded":"0001-01-01T00:00:00","Status":"String"}]}]}