| Required role: | Tartarus.Read |
| GET,POST | /api/citi-bank-statement |
|---|
import 'package:servicestack/servicestack.dart';
enum BankEntryType
{
Balance,
Transaction,
}
class CitiBankAccountEntry implements IConvertible
{
BankEntryType? entryType;
String? description;
double? amount;
String? currencyCode;
String? creditDebitIndicator;
DateTime? entryDate;
CitiBankAccountEntry({this.entryType,this.description,this.amount,this.currencyCode,this.creditDebitIndicator,this.entryDate});
CitiBankAccountEntry.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
entryType = JsonConverters.fromJson(json['entryType'],'BankEntryType',context!);
description = json['description'];
amount = JsonConverters.toDouble(json['amount']);
currencyCode = json['currencyCode'];
creditDebitIndicator = json['creditDebitIndicator'];
entryDate = JsonConverters.fromJson(json['entryDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'entryType': JsonConverters.toJson(entryType,'BankEntryType',context!),
'description': description,
'amount': amount,
'currencyCode': currencyCode,
'creditDebitIndicator': creditDebitIndicator,
'entryDate': JsonConverters.toJson(entryDate,'DateTime',context!)
};
getTypeName() => "CitiBankAccountEntry";
TypeContext? context = _ctx;
}
class CitiBankEntriesResponse implements IConvertible
{
ResponseStatus? responseStatus;
bool? statementIsStillGenerating;
List<CitiBankAccountEntry>? entries = [];
CitiBankEntriesResponse({this.responseStatus,this.statementIsStillGenerating,this.entries});
CitiBankEntriesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
statementIsStillGenerating = json['statementIsStillGenerating'];
entries = JsonConverters.fromJson(json['entries'],'List<CitiBankAccountEntry>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!),
'statementIsStillGenerating': statementIsStillGenerating,
'entries': JsonConverters.toJson(entries,'List<CitiBankAccountEntry>',context!)
};
getTypeName() => "CitiBankEntriesResponse";
TypeContext? context = _ctx;
}
class RetrieveCitiBankStatementRequest implements IGet, IPost, IConvertible
{
String? statementId;
RetrieveCitiBankStatementRequest({this.statementId});
RetrieveCitiBankStatementRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
statementId = json['statementId'];
return this;
}
Map<String, dynamic> toJson() => {
'statementId': statementId
};
getTypeName() => "RetrieveCitiBankStatementRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'tartarus.nephila.com', types: <String, TypeInfo> {
'BankEntryType': TypeInfo(TypeOf.Enum, enumValues:BankEntryType.values),
'CitiBankAccountEntry': TypeInfo(TypeOf.Class, create:() => CitiBankAccountEntry()),
'CitiBankEntriesResponse': TypeInfo(TypeOf.Class, create:() => CitiBankEntriesResponse()),
'List<CitiBankAccountEntry>': TypeInfo(TypeOf.Class, create:() => <CitiBankAccountEntry>[]),
'RetrieveCitiBankStatementRequest': TypeInfo(TypeOf.Class, create:() => RetrieveCitiBankStatementRequest()),
});
Dart RetrieveCitiBankStatementRequest 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 /api/citi-bank-statement HTTP/1.1
Host: tartarus.nephila.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"statementId":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"statementIsStillGenerating":false,"entries":[{"entryType":"Balance","description":"String","amount":0,"currencyCode":"String","creditDebitIndicator":"String","entryDate":"\/Date(-62135596800000-0000)\/"}]}