| POST | /v1/forms/{FormUID}/invites |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class FormFillReceiptLine implements IConvertible
{
String? Channel;
String? To;
String? Outcome;
FormFillReceiptLine({this.Channel,this.To,this.Outcome});
FormFillReceiptLine.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Channel = json['Channel'];
To = json['To'];
Outcome = json['Outcome'];
return this;
}
Map<String, dynamic> toJson() => {
'Channel': Channel,
'To': To,
'Outcome': Outcome
};
getTypeName() => "FormFillReceiptLine";
TypeContext? context = _ctx;
}
class FormInviteView implements IConvertible
{
String? InviteUID;
String? Name;
String? Email;
String? Phone;
String? CreatedBy;
DateTime? CreatedAt;
DateTime? ExpiresAt;
DateTime? SentAt;
DateTime? LastSentAt;
int? SendCount;
DateTime? OpenedAt;
DateTime? RevokedAt;
String? Number;
String? State;
String? Link;
List<FormFillReceiptLine>? Sends = [];
FormInviteView({this.InviteUID,this.Name,this.Email,this.Phone,this.CreatedBy,this.CreatedAt,this.ExpiresAt,this.SentAt,this.LastSentAt,this.SendCount,this.OpenedAt,this.RevokedAt,this.Number,this.State,this.Link,this.Sends});
FormInviteView.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
InviteUID = json['InviteUID'];
Name = json['Name'];
Email = json['Email'];
Phone = json['Phone'];
CreatedBy = json['CreatedBy'];
CreatedAt = JsonConverters.fromJson(json['CreatedAt'],'DateTime',context!);
ExpiresAt = JsonConverters.fromJson(json['ExpiresAt'],'DateTime',context!);
SentAt = JsonConverters.fromJson(json['SentAt'],'DateTime',context!);
LastSentAt = JsonConverters.fromJson(json['LastSentAt'],'DateTime',context!);
SendCount = json['SendCount'];
OpenedAt = JsonConverters.fromJson(json['OpenedAt'],'DateTime',context!);
RevokedAt = JsonConverters.fromJson(json['RevokedAt'],'DateTime',context!);
Number = json['Number'];
State = json['State'];
Link = json['Link'];
Sends = JsonConverters.fromJson(json['Sends'],'List<FormFillReceiptLine>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'InviteUID': InviteUID,
'Name': Name,
'Email': Email,
'Phone': Phone,
'CreatedBy': CreatedBy,
'CreatedAt': JsonConverters.toJson(CreatedAt,'DateTime',context!),
'ExpiresAt': JsonConverters.toJson(ExpiresAt,'DateTime',context!),
'SentAt': JsonConverters.toJson(SentAt,'DateTime',context!),
'LastSentAt': JsonConverters.toJson(LastSentAt,'DateTime',context!),
'SendCount': SendCount,
'OpenedAt': JsonConverters.toJson(OpenedAt,'DateTime',context!),
'RevokedAt': JsonConverters.toJson(RevokedAt,'DateTime',context!),
'Number': Number,
'State': State,
'Link': Link,
'Sends': JsonConverters.toJson(Sends,'List<FormFillReceiptLine>',context!)
};
getTypeName() => "FormInviteView";
TypeContext? context = _ctx;
}
class FormInvitesResponse implements IConvertible
{
List<FormInviteView>? Invites = [];
List<FormInviteView>? Created = [];
int? Emails;
int? Texts;
String? Consequence;
ResponseStatus? ResponseStatus;
FormInvitesResponse({this.Invites,this.Created,this.Emails,this.Texts,this.Consequence,this.ResponseStatus});
FormInvitesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Invites = JsonConverters.fromJson(json['Invites'],'List<FormInviteView>',context!);
Created = JsonConverters.fromJson(json['Created'],'List<FormInviteView>',context!);
Emails = json['Emails'];
Texts = json['Texts'];
Consequence = json['Consequence'];
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Invites': JsonConverters.toJson(Invites,'List<FormInviteView>',context!),
'Created': JsonConverters.toJson(Created,'List<FormInviteView>',context!),
'Emails': Emails,
'Texts': Texts,
'Consequence': Consequence,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "FormInvitesResponse";
TypeContext? context = _ctx;
}
class FormInvitePerson implements IConvertible
{
String? Name;
String? Email;
String? Phone;
FormInvitePerson({this.Name,this.Email,this.Phone});
FormInvitePerson.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
Email = json['Email'];
Phone = json['Phone'];
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'Email': Email,
'Phone': Phone
};
getTypeName() => "FormInvitePerson";
TypeContext? context = _ctx;
}
class FormInviteCreateRequest implements IConvertible
{
String? FormUID;
List<FormInvitePerson>? People = [];
bool? Preview;
FormInviteCreateRequest({this.FormUID,this.People,this.Preview});
FormInviteCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
FormUID = json['FormUID'];
People = JsonConverters.fromJson(json['People'],'List<FormInvitePerson>',context!);
Preview = json['Preview'];
return this;
}
Map<String, dynamic> toJson() => {
'FormUID': FormUID,
'People': JsonConverters.toJson(People,'List<FormInvitePerson>',context!),
'Preview': Preview
};
getTypeName() => "FormInviteCreateRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'FormFillReceiptLine': TypeInfo(TypeOf.Class, create:() => FormFillReceiptLine()),
'FormInviteView': TypeInfo(TypeOf.Class, create:() => FormInviteView()),
'List<FormFillReceiptLine>': TypeInfo(TypeOf.Class, create:() => <FormFillReceiptLine>[]),
'FormInvitesResponse': TypeInfo(TypeOf.Class, create:() => FormInvitesResponse()),
'List<FormInviteView>': TypeInfo(TypeOf.Class, create:() => <FormInviteView>[]),
'FormInvitePerson': TypeInfo(TypeOf.Class, create:() => FormInvitePerson()),
'FormInviteCreateRequest': TypeInfo(TypeOf.Class, create:() => FormInviteCreateRequest()),
'List<FormInvitePerson>': TypeInfo(TypeOf.Class, create:() => <FormInvitePerson>[]),
});
Dart FormInviteCreateRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/forms/{FormUID}/invites HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"FormUID":"00000000000000000000000000000000","People":[{"Name":"String","Email":"String","Phone":"String"}],"Preview":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Invites":[{"InviteUID":"00000000000000000000000000000000","Name":"String","Email":"String","Phone":"String","CreatedBy":"String","CreatedAt":"0001-01-01T00:00:00.0000000","ExpiresAt":"0001-01-01T00:00:00.0000000","SentAt":"0001-01-01T00:00:00.0000000","LastSentAt":"0001-01-01T00:00:00.0000000","SendCount":0,"OpenedAt":"0001-01-01T00:00:00.0000000","RevokedAt":"0001-01-01T00:00:00.0000000","Number":"String","State":"String","Link":"String","Sends":[{"Channel":"String","To":"String","Outcome":"String"}]}],"Created":[{"InviteUID":"00000000000000000000000000000000","Name":"String","Email":"String","Phone":"String","CreatedBy":"String","CreatedAt":"0001-01-01T00:00:00.0000000","ExpiresAt":"0001-01-01T00:00:00.0000000","SentAt":"0001-01-01T00:00:00.0000000","LastSentAt":"0001-01-01T00:00:00.0000000","SendCount":0,"OpenedAt":"0001-01-01T00:00:00.0000000","RevokedAt":"0001-01-01T00:00:00.0000000","Number":"String","State":"String","Link":"String","Sends":[{"Channel":"String","To":"String","Outcome":"String"}]}],"Emails":0,"Texts":0,"Consequence":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}