TicketUserServices

<back to all web services

GiftCardTypeCreateRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdminRequired permission:Tickets.Add
The following routes are available for this service:
POST/GiftCardType
import 'package:servicestack/servicestack.dart';

class GiftCardType implements IConvertible
{
    int? id;
    String? name;
    String? scope;
    int? ownerId;
    String? currency;
    int? defaultExpiryMonths;
    bool? isActive;
    DateTime? createdAt;

    GiftCardType({this.id,this.name,this.scope,this.ownerId,this.currency,this.defaultExpiryMonths,this.isActive,this.createdAt});
    GiftCardType.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        scope = json['scope'];
        ownerId = json['ownerId'];
        currency = json['currency'];
        defaultExpiryMonths = json['defaultExpiryMonths'];
        isActive = json['isActive'];
        createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'scope': scope,
        'ownerId': ownerId,
        'currency': currency,
        'defaultExpiryMonths': defaultExpiryMonths,
        'isActive': isActive,
        'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!)
    };

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

class GiftCardTypeResult implements IConvertible
{
    GiftCardType? item;
    int? statusCode;
    String? message;

    GiftCardTypeResult({this.item,this.statusCode,this.message});
    GiftCardTypeResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'item': JsonConverters.toJson(item,'GiftCardType',context!),
        'statusCode': statusCode,
        'message': message
    };

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

class GiftCardTypeCreateRequest implements IConvertible
{
    GiftCardType? item;

    GiftCardTypeCreateRequest({this.item});
    GiftCardTypeCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'item': JsonConverters.toJson(item,'GiftCardType',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
    'GiftCardType': TypeInfo(TypeOf.Class, create:() => GiftCardType()),
    'GiftCardTypeResult': TypeInfo(TypeOf.Class, create:() => GiftCardTypeResult()),
    'GiftCardTypeCreateRequest': TypeInfo(TypeOf.Class, create:() => GiftCardTypeCreateRequest()),
});

Dart GiftCardTypeCreateRequest 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.

POST /GiftCardType HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	item: 
	{
		id: 0,
		name: String,
		scope: String,
		ownerId: 0,
		currency: String,
		defaultExpiryMonths: 0,
		isActive: False,
		createdAt: 0001-01-01
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	item: 
	{
		id: 0,
		name: String,
		scope: String,
		ownerId: 0,
		currency: String,
		defaultExpiryMonths: 0,
		isActive: False,
		createdAt: 0001-01-01
	},
	statusCode: 0,
	message: String
}