Billhighway Cloud API

<back to all web services

UserObligationsRequest

The following routes are available for this service:
GET/invoices/recurringInvoices/obligation
import 'package:servicestack/servicestack.dart';

class ObligationLineItem implements IConvertible
{
    int? ChartOfAccountId;
    String? ChartOfAccountRefId;
    double? Amount;

    ObligationLineItem({this.ChartOfAccountId,this.ChartOfAccountRefId,this.Amount});
    ObligationLineItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ChartOfAccountId = json['ChartOfAccountId'];
        ChartOfAccountRefId = json['ChartOfAccountRefId'];
        Amount = JsonConverters.toDouble(json['Amount']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ChartOfAccountId': ChartOfAccountId,
        'ChartOfAccountRefId': ChartOfAccountRefId,
        'Amount': Amount
    };

    getTypeName() => "ObligationLineItem";
    TypeContext? context = _ctx;
}

class Obligation implements IConvertible
{
    DateTime? CreatedDate;
    DateTime? LastUpdateDate;
    bool? IsActive;
    List<ObligationLineItem>? LineItems;

    Obligation({this.CreatedDate,this.LastUpdateDate,this.IsActive,this.LineItems});
    Obligation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
        LastUpdateDate = JsonConverters.fromJson(json['LastUpdateDate'],'DateTime',context!);
        IsActive = json['IsActive'];
        LineItems = JsonConverters.fromJson(json['LineItems'],'List<ObligationLineItem>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
        'LastUpdateDate': JsonConverters.toJson(LastUpdateDate,'DateTime',context!),
        'IsActive': IsActive,
        'LineItems': JsonConverters.toJson(LineItems,'List<ObligationLineItem>',context!)
    };

    getTypeName() => "Obligation";
    TypeContext? context = _ctx;
}

class ObligationYear implements IConvertible
{
    int? FiscalYear;
    List<Obligation>? Obligations;

    ObligationYear({this.FiscalYear,this.Obligations});
    ObligationYear.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FiscalYear = json['FiscalYear'];
        Obligations = JsonConverters.fromJson(json['Obligations'],'List<Obligation>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FiscalYear': FiscalYear,
        'Obligations': JsonConverters.toJson(Obligations,'List<Obligation>',context!)
    };

    getTypeName() => "ObligationYear";
    TypeContext? context = _ctx;
}

class ObligationUser implements IConvertible
{
    String? UserId;
    String? GroupId;
    List<ObligationYear>? FiscalYears;

    ObligationUser({this.UserId,this.GroupId,this.FiscalYears});
    ObligationUser.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        UserId = json['UserId'];
        GroupId = json['GroupId'];
        FiscalYears = JsonConverters.fromJson(json['FiscalYears'],'List<ObligationYear>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'UserId': UserId,
        'GroupId': GroupId,
        'FiscalYears': JsonConverters.toJson(FiscalYears,'List<ObligationYear>',context!)
    };

    getTypeName() => "ObligationUser";
    TypeContext? context = _ctx;
}

class UserObligationsRequest implements IConvertible
{
    String? GroupId;
    String? UserId;
    int? FiscalYear;
    bool? ShowHistory;

    UserObligationsRequest({this.GroupId,this.UserId,this.FiscalYear,this.ShowHistory});
    UserObligationsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        GroupId = json['GroupId'];
        UserId = json['UserId'];
        FiscalYear = json['FiscalYear'];
        ShowHistory = json['ShowHistory'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'GroupId': GroupId,
        'UserId': UserId,
        'FiscalYear': FiscalYear,
        'ShowHistory': ShowHistory
    };

    getTypeName() => "UserObligationsRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'devapi.billhighway.com', types: <String, TypeInfo> {
    'ObligationLineItem': TypeInfo(TypeOf.Class, create:() => ObligationLineItem()),
    'Obligation': TypeInfo(TypeOf.Class, create:() => Obligation()),
    'List<ObligationLineItem>': TypeInfo(TypeOf.Class, create:() => <ObligationLineItem>[]),
    'ObligationYear': TypeInfo(TypeOf.Class, create:() => ObligationYear()),
    'List<Obligation>': TypeInfo(TypeOf.Class, create:() => <Obligation>[]),
    'ObligationUser': TypeInfo(TypeOf.Class, create:() => ObligationUser()),
    'List<ObligationYear>': TypeInfo(TypeOf.Class, create:() => <ObligationYear>[]),
    'UserObligationsRequest': TypeInfo(TypeOf.Class, create:() => UserObligationsRequest()),
});

Dart UserObligationsRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /invoices/recurringInvoices/obligation HTTP/1.1 
Host: devapi.billhighway.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	UserId: String,
	GroupId: String,
	FiscalYears: 
	[
		{
			FiscalYear: 0,
			Obligations: 
			[
				{
					CreatedDate: 0001-01-01,
					LastUpdateDate: 0001-01-01,
					IsActive: False,
					LineItems: 
					[
						{
							ChartOfAccountRefId: String,
							Amount: 0
						}
					]
				}
			]
		}
	]
}