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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<UserObligation xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.RecurringInvoice.Request">
  <FiscalYear>0</FiscalYear>
  <GroupId>String</GroupId>
  <LineItems>
    <ObligationLineItem>
      <Amount>0</Amount>
      <ChartOfAccountId>0</ChartOfAccountId>
      <ChartOfAccountRefId>String</ChartOfAccountRefId>
    </ObligationLineItem>
  </LineItems>
  <OptedToPayCTADues>false</OptedToPayCTADues>
  <UserId>String</UserId>
</UserObligation>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ObligationResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.RecurringInvoice.Response">
  <ErrorDetails>
    <ErrorDetail>
      <Id>0</Id>
      <Message>String</Message>
      <Value>String</Value>
    </ErrorDetail>
  </ErrorDetails>
  <MemberCount>0</MemberCount>
  <TotalAmount>0</TotalAmount>
</ObligationResponse>