TicketUserServices

<back to all web services

DonationListRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdminRequired permission:ReadData
The following routes are available for this service:
GET/donations/{OwnerId}
import 'package:servicestack/servicestack.dart';

class DonationListRequest implements IConvertible
{
    int? ownerId;
    int? year;

    DonationListRequest({this.ownerId,this.year});
    DonationListRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ownerId = json['ownerId'];
        year = json['year'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ownerId': ownerId,
        'year': year
    };

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

class Donation implements IConvertible
{
    int? id;
    int? ownerId;
    int? ownerCardTypeId;
    int? ownerCardId;
    int? recurringPaymentId;
    String? payerKennitala;
    String? payerName;
    String? payerEmail;
    int? amount;
    String? currency;
    DateTime? paidUTC;
    String? paymentReference;
    String? status;
    DateTime? refundedUTC;
    DateTime? timeStampCreatedUTC;
    DateTime? timeStampLastChangedUTC;

    Donation({this.id,this.ownerId,this.ownerCardTypeId,this.ownerCardId,this.recurringPaymentId,this.payerKennitala,this.payerName,this.payerEmail,this.amount,this.currency,this.paidUTC,this.paymentReference,this.status,this.refundedUTC,this.timeStampCreatedUTC,this.timeStampLastChangedUTC});
    Donation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        ownerId = json['ownerId'];
        ownerCardTypeId = json['ownerCardTypeId'];
        ownerCardId = json['ownerCardId'];
        recurringPaymentId = json['recurringPaymentId'];
        payerKennitala = json['payerKennitala'];
        payerName = json['payerName'];
        payerEmail = json['payerEmail'];
        amount = json['amount'];
        currency = json['currency'];
        paidUTC = JsonConverters.fromJson(json['paidUTC'],'DateTime',context!);
        paymentReference = json['paymentReference'];
        status = json['status'];
        refundedUTC = JsonConverters.fromJson(json['refundedUTC'],'DateTime',context!);
        timeStampCreatedUTC = JsonConverters.fromJson(json['timeStampCreatedUTC'],'DateTime',context!);
        timeStampLastChangedUTC = JsonConverters.fromJson(json['timeStampLastChangedUTC'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'ownerId': ownerId,
        'ownerCardTypeId': ownerCardTypeId,
        'ownerCardId': ownerCardId,
        'recurringPaymentId': recurringPaymentId,
        'payerKennitala': payerKennitala,
        'payerName': payerName,
        'payerEmail': payerEmail,
        'amount': amount,
        'currency': currency,
        'paidUTC': JsonConverters.toJson(paidUTC,'DateTime',context!),
        'paymentReference': paymentReference,
        'status': status,
        'refundedUTC': JsonConverters.toJson(refundedUTC,'DateTime',context!),
        'timeStampCreatedUTC': JsonConverters.toJson(timeStampCreatedUTC,'DateTime',context!),
        'timeStampLastChangedUTC': JsonConverters.toJson(timeStampLastChangedUTC,'DateTime',context!)
    };

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

class DonationListResult implements IConvertible
{
    List<Donation>? items;
    int? totalAmount;
    int? statusCode;
    String? message;

    DonationListResult({this.items,this.totalAmount,this.statusCode,this.message});
    DonationListResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        items = JsonConverters.fromJson(json['items'],'List<Donation>',context!);
        totalAmount = json['totalAmount'];
        statusCode = json['statusCode'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'items': JsonConverters.toJson(items,'List<Donation>',context!),
        'totalAmount': totalAmount,
        'statusCode': statusCode,
        'message': message
    };

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

TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
    'DonationListRequest': TypeInfo(TypeOf.Class, create:() => DonationListRequest()),
    'Donation': TypeInfo(TypeOf.Class, create:() => Donation()),
    'DonationListResult': TypeInfo(TypeOf.Class, create:() => DonationListResult()),
    'List<Donation>': TypeInfo(TypeOf.Class, create:() => <Donation>[]),
});

Dart DonationListRequest 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 /donations/{OwnerId} HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	items: 
	[
		{
			id: 0,
			ownerId: 0,
			ownerCardTypeId: 0,
			ownerCardId: 0,
			recurringPaymentId: 0,
			payerKennitala: String,
			payerName: String,
			payerEmail: String,
			amount: 0,
			currency: String,
			paidUTC: 0001-01-01,
			paymentReference: String,
			status: String,
			refundedUTC: 0001-01-01,
			timeStampCreatedUTC: 0001-01-01,
			timeStampLastChangedUTC: 0001-01-01
		}
	],
	totalAmount: 0,
	statusCode: 0,
	message: String
}