Billhighway Cloud API

<back to all web services

UserObligation

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

class ErrorDetail implements IConvertible
{
    int? Id;
    String? Message;
    String? Value;

    ErrorDetail({this.Id,this.Message,this.Value});
    ErrorDetail.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Message = json['Message'];
        Value = json['Value'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Message': Message,
        'Value': Value
    };

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

class ObligationResponse implements IHaveErrorField, IConvertible
{
    List<ErrorDetail>? ErrorDetails;
    bool? IsError;
    int? MemberCount;
    double? TotalAmount;

    ObligationResponse({this.ErrorDetails,this.IsError,this.MemberCount,this.TotalAmount});
    ObligationResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ErrorDetails = JsonConverters.fromJson(json['ErrorDetails'],'List<ErrorDetail>',context!);
        IsError = json['IsError'];
        MemberCount = json['MemberCount'];
        TotalAmount = JsonConverters.toDouble(json['TotalAmount']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ErrorDetails': JsonConverters.toJson(ErrorDetails,'List<ErrorDetail>',context!),
        'IsError': IsError,
        'MemberCount': MemberCount,
        'TotalAmount': TotalAmount
    };

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

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 UserObligation implements IConvertible
{
    String? UserId;
    int? FiscalYear;
    String? GroupId;
    List<ObligationLineItem>? LineItems;
    bool? OptedToPayCTADues;

    UserObligation({this.UserId,this.FiscalYear,this.GroupId,this.LineItems,this.OptedToPayCTADues});
    UserObligation.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'UserId': UserId,
        'FiscalYear': FiscalYear,
        'GroupId': GroupId,
        'LineItems': JsonConverters.toJson(LineItems,'List<ObligationLineItem>',context!),
        'OptedToPayCTADues': OptedToPayCTADues
    };

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

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

Dart UserObligation DTOs

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

HTTP + CSV

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

PUT /invoices/recurringInvoices/obligation HTTP/1.1 
Host: devapi.billhighway.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"UserId":"String","FiscalYear":0,"GroupId":"String","LineItems":[{"ChartOfAccountId":0,"ChartOfAccountRefId":"String","Amount":0}],"OptedToPayCTADues":false}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ErrorDetails":[{"Id":0,"Message":"String","Value":"String"}],"IsError":true,"MemberCount":0,"TotalAmount":0}