TicketUserServices

<back to all web services

DiscountCodeInfoRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdmin, MobileAppRequires the permission:ReadData
The following routes are available for this service:
GET POST/ticketOrder/getDiscountCodeInfo
import 'package:servicestack/servicestack.dart';

class DiscountCodeInfo implements IConvertible
{
    int? codeId;
    int? discountCodeType;
    String? code;
    bool? isMultiUse;
    int? maxTickets;
    bool? isSingleUse;
    bool? isForPhoneNumberOnly;
    String? fullPhoneNumber;
    bool? isUsed;
    bool? codeTypeIsValid;
    String? name;
    bool? isForEventId;
    int? eventId;
    int? eventOwnerId;
    bool? isForTicketType;
    int? ticketTypeId;
    bool? isFixedAmount;
    double? fixedAmount;
    bool? isPercent;
    double? percent;
    bool? isValid;
    int? validTicketTypeId;
    int? discountCodeTypeId;
    int? eventSeriesOwnerTicketType;
    bool? ticketTypeIsValid;

    DiscountCodeInfo({this.codeId,this.discountCodeType,this.code,this.isMultiUse,this.maxTickets,this.isSingleUse,this.isForPhoneNumberOnly,this.fullPhoneNumber,this.isUsed,this.codeTypeIsValid,this.name,this.isForEventId,this.eventId,this.eventOwnerId,this.isForTicketType,this.ticketTypeId,this.isFixedAmount,this.fixedAmount,this.isPercent,this.percent,this.isValid,this.validTicketTypeId,this.discountCodeTypeId,this.eventSeriesOwnerTicketType,this.ticketTypeIsValid});
    DiscountCodeInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        codeId = json['codeId'];
        discountCodeType = json['discountCodeType'];
        code = json['code'];
        isMultiUse = json['isMultiUse'];
        maxTickets = json['maxTickets'];
        isSingleUse = json['isSingleUse'];
        isForPhoneNumberOnly = json['isForPhoneNumberOnly'];
        fullPhoneNumber = json['fullPhoneNumber'];
        isUsed = json['isUsed'];
        codeTypeIsValid = json['codeTypeIsValid'];
        name = json['name'];
        isForEventId = json['isForEventId'];
        eventId = json['eventId'];
        eventOwnerId = json['eventOwnerId'];
        isForTicketType = json['isForTicketType'];
        ticketTypeId = json['ticketTypeId'];
        isFixedAmount = json['isFixedAmount'];
        fixedAmount = JsonConverters.toDouble(json['fixedAmount']);
        isPercent = json['isPercent'];
        percent = JsonConverters.toDouble(json['percent']);
        isValid = json['isValid'];
        validTicketTypeId = json['validTicketTypeId'];
        discountCodeTypeId = json['discountCodeTypeId'];
        eventSeriesOwnerTicketType = json['eventSeriesOwnerTicketType'];
        ticketTypeIsValid = json['ticketTypeIsValid'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'codeId': codeId,
        'discountCodeType': discountCodeType,
        'code': code,
        'isMultiUse': isMultiUse,
        'maxTickets': maxTickets,
        'isSingleUse': isSingleUse,
        'isForPhoneNumberOnly': isForPhoneNumberOnly,
        'fullPhoneNumber': fullPhoneNumber,
        'isUsed': isUsed,
        'codeTypeIsValid': codeTypeIsValid,
        'name': name,
        'isForEventId': isForEventId,
        'eventId': eventId,
        'eventOwnerId': eventOwnerId,
        'isForTicketType': isForTicketType,
        'ticketTypeId': ticketTypeId,
        'isFixedAmount': isFixedAmount,
        'fixedAmount': fixedAmount,
        'isPercent': isPercent,
        'percent': percent,
        'isValid': isValid,
        'validTicketTypeId': validTicketTypeId,
        'discountCodeTypeId': discountCodeTypeId,
        'eventSeriesOwnerTicketType': eventSeriesOwnerTicketType,
        'ticketTypeIsValid': ticketTypeIsValid
    };

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

class DiscountCodeInfoResult implements IConvertible
{
    DiscountCodeInfo? info;
    int? statusCode;
    bool? success;
    String? message;

    DiscountCodeInfoResult({this.info,this.statusCode,this.success,this.message});
    DiscountCodeInfoResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class DiscountCodeInfoRequest implements IConvertible
{
    String? code;

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

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

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

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

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

Dart DiscountCodeInfoRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /ticketOrder/getDiscountCodeInfo HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"code":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"info":{"codeId":0,"discountCodeType":0,"code":"String","isMultiUse":false,"maxTickets":0,"isSingleUse":false,"isForPhoneNumberOnly":false,"fullPhoneNumber":"String","isUsed":false,"codeTypeIsValid":false,"name":"String","isForEventId":false,"eventId":0,"eventOwnerId":0,"isForTicketType":false,"ticketTypeId":0,"isFixedAmount":false,"fixedAmount":0,"isPercent":false,"percent":0,"isValid":false,"validTicketTypeId":0,"discountCodeTypeId":0,"eventSeriesOwnerTicketType":0,"ticketTypeIsValid":false},"statusCode":0,"success":false,"message":"String"}