efun.id.api

<back to all web services

GetReceivedGiftcodeRequest

Requires Authentication
The following routes are available for this service:
GET/api/v1/games/{GameId}/giftcode/received
import 'package:servicestack/servicestack.dart';

class PagingRequest implements IConvertible
{
    int page = 0;
    int limit = 0;
    int offSet = 0;

    PagingRequest({this.page,this.limit,this.offSet});
    PagingRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'page': page,
        'limit': limit,
        'offSet': offSet
    };

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

class ReceivedGiftcodeResponse implements IConvertible
{
    int eventId = 0;
    String eventName = "";
    String? eventUrl;
    String? description;
    String? iconUrl;
    String? label;
    String? labelColor;
    int eventType = 0;
    String? code;
    String? serverId;
    String? characterId;
    String? characterName;
    DateTime? startDate;
    DateTime? dueDate;
    DateTime? eventStartDate;
    DateTime? eventEndDate;
    DateTime createdDate = DateTime(0);
    bool isUsed;

    ReceivedGiftcodeResponse({this.eventId,this.eventName,this.eventUrl,this.description,this.iconUrl,this.label,this.labelColor,this.eventType,this.code,this.serverId,this.characterId,this.characterName,this.startDate,this.dueDate,this.eventStartDate,this.eventEndDate,this.createdDate,this.isUsed});
    ReceivedGiftcodeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        eventId = json['eventId'];
        eventName = json['eventName'];
        eventUrl = json['eventUrl'];
        description = json['description'];
        iconUrl = json['iconUrl'];
        label = json['label'];
        labelColor = json['labelColor'];
        eventType = json['eventType'];
        code = json['code'];
        serverId = json['serverId'];
        characterId = json['characterId'];
        characterName = json['characterName'];
        startDate = JsonConverters.fromJson(json['startDate'],'DateTime',context!);
        dueDate = JsonConverters.fromJson(json['dueDate'],'DateTime',context!);
        eventStartDate = JsonConverters.fromJson(json['eventStartDate'],'DateTime',context!);
        eventEndDate = JsonConverters.fromJson(json['eventEndDate'],'DateTime',context!);
        createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
        isUsed = json['isUsed'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'eventId': eventId,
        'eventName': eventName,
        'eventUrl': eventUrl,
        'description': description,
        'iconUrl': iconUrl,
        'label': label,
        'labelColor': labelColor,
        'eventType': eventType,
        'code': code,
        'serverId': serverId,
        'characterId': characterId,
        'characterName': characterName,
        'startDate': JsonConverters.toJson(startDate,'DateTime',context!),
        'dueDate': JsonConverters.toJson(dueDate,'DateTime',context!),
        'eventStartDate': JsonConverters.toJson(eventStartDate,'DateTime',context!),
        'eventEndDate': JsonConverters.toJson(eventEndDate,'DateTime',context!),
        'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
        'isUsed': isUsed
    };

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

class GetReceivedGiftcodeRequest extends PagingRequest implements IConvertible
{
    int gameId = 0;

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

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'gameId': gameId
    });

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

class Pagination implements IConvertible
{
    int total = 0;
    int pages = 0;
    int offset = 0;
    int limit = 0;
    int currentPage = 0;

    Pagination({this.total,this.pages,this.offset,this.limit,this.currentPage});
    Pagination.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        total = json['total'];
        pages = json['pages'];
        offset = json['offset'];
        limit = json['limit'];
        currentPage = json['currentPage'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'total': total,
        'pages': pages,
        'offset': offset,
        'limit': limit,
        'currentPage': currentPage
    };

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

class PageResponse<T> implements IResponseRequest, IConvertible
{
    int code = 0;
    String message = "";
    List<ReceivedGiftcodeResponse> data = [];
    Pagination pagination;

    PageResponse({this.code,this.message,this.data,this.pagination});
    PageResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        code = json['code'];
        message = json['message'];
        data = JsonConverters.fromJson(json['data'],'List<ReceivedGiftcodeResponse>',context!);
        pagination = JsonConverters.fromJson(json['pagination'],'Pagination',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'code': code,
        'message': message,
        'data': JsonConverters.toJson(data,'List<ReceivedGiftcodeResponse>',context!),
        'pagination': JsonConverters.toJson(pagination,'Pagination',context!)
    };

    getTypeName() => "PageResponse<$T>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'efun_id_api_sandbox.efun.vn', types: <String, TypeInfo> {
    'PagingRequest': TypeInfo(TypeOf.Class, create:() => PagingRequest()),
    'ReceivedGiftcodeResponse': TypeInfo(TypeOf.Class, create:() => ReceivedGiftcodeResponse()),
    'GetReceivedGiftcodeRequest': TypeInfo(TypeOf.Class, create:() => GetReceivedGiftcodeRequest()),
    'Pagination': TypeInfo(TypeOf.Class, create:() => Pagination()),
    'PageResponse<T>': TypeInfo(TypeOf.Class, create:() => PageResponse<T>()),
    'List<ReceivedGiftcodeResponse>': TypeInfo(TypeOf.Class, create:() => <ReceivedGiftcodeResponse>[]),
});

Dart GetReceivedGiftcodeRequest 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 /api/v1/games/{GameId}/giftcode/received HTTP/1.1 
Host: efun-id-api-sandbox.efun.vn 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	code: 0,
	message: String,
	data: 
	[
		{
			eventId: 0,
			eventName: String,
			eventUrl: String,
			description: String,
			iconUrl: String,
			label: String,
			labelColor: String,
			eventType: 0,
			code: String,
			serverId: String,
			characterId: String,
			characterName: String,
			startDate: "0001-01-01T00:00:00.0000000+07:06",
			dueDate: "0001-01-01T00:00:00.0000000+07:06",
			eventStartDate: "0001-01-01T00:00:00.0000000+07:06",
			eventEndDate: "0001-01-01T00:00:00.0000000+07:06",
			isUsed: False
		}
	]
}