| GET,OPTIONS | /v1/billing/runs |
|---|
import 'package:servicestack/servicestack.dart';
class BillingRun implements IConvertible
{
int? BillingRunID;
String? TenantId;
String? BranchId;
String? BranchName;
String? RunType;
String? PeriodKey;
String? Status;
int? InvoicesCreated;
int? CreditsApplied;
String? Error;
String? CreatedBy;
DateTime? StartedAt;
DateTime? CompletedAt;
BillingRun({this.BillingRunID,this.TenantId,this.BranchId,this.BranchName,this.RunType,this.PeriodKey,this.Status,this.InvoicesCreated,this.CreditsApplied,this.Error,this.CreatedBy,this.StartedAt,this.CompletedAt});
BillingRun.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
BillingRunID = json['BillingRunID'];
TenantId = json['TenantId'];
BranchId = json['BranchId'];
BranchName = json['BranchName'];
RunType = json['RunType'];
PeriodKey = json['PeriodKey'];
Status = json['Status'];
InvoicesCreated = json['InvoicesCreated'];
CreditsApplied = json['CreditsApplied'];
Error = json['Error'];
CreatedBy = json['CreatedBy'];
StartedAt = JsonConverters.fromJson(json['StartedAt'],'DateTime',context!);
CompletedAt = JsonConverters.fromJson(json['CompletedAt'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'BillingRunID': BillingRunID,
'TenantId': TenantId,
'BranchId': BranchId,
'BranchName': BranchName,
'RunType': RunType,
'PeriodKey': PeriodKey,
'Status': Status,
'InvoicesCreated': InvoicesCreated,
'CreditsApplied': CreditsApplied,
'Error': Error,
'CreatedBy': CreatedBy,
'StartedAt': JsonConverters.toJson(StartedAt,'DateTime',context!),
'CompletedAt': JsonConverters.toJson(CompletedAt,'DateTime',context!)
};
getTypeName() => "BillingRun";
TypeContext? context = _ctx;
}
class BillingRunsResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
List<BillingRun>? Runs = [];
BillingRunsResponse({this.ResponseStatus,this.Runs});
BillingRunsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Runs = JsonConverters.fromJson(json['Runs'],'List<BillingRun>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Runs': JsonConverters.toJson(Runs,'List<BillingRun>',context!)
};
getTypeName() => "BillingRunsResponse";
TypeContext? context = _ctx;
}
class BillingRunsRequest implements IConvertible
{
int? Top;
BillingRunsRequest({this.Top});
BillingRunsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Top = json['Top'];
return this;
}
Map<String, dynamic> toJson() => {
'Top': Top
};
getTypeName() => "BillingRunsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'BillingRun': TypeInfo(TypeOf.Class, create:() => BillingRun()),
'BillingRunsResponse': TypeInfo(TypeOf.Class, create:() => BillingRunsResponse()),
'List<BillingRun>': TypeInfo(TypeOf.Class, create:() => <BillingRun>[]),
'BillingRunsRequest': TypeInfo(TypeOf.Class, create:() => BillingRunsRequest()),
});
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/billing/runs HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
Runs:
[
{
BillingRunID: 0,
TenantId: 00000000000000000000000000000000,
BranchId: 00000000000000000000000000000000,
BranchName: String,
RunType: String,
PeriodKey: String,
Status: String,
InvoicesCreated: 0,
CreditsApplied: 0,
Error: String,
CreatedBy: String,
StartedAt: 0001-01-01,
CompletedAt: 0001-01-01
}
]
}