| GET | /api/v1/games/{GameId}/giftcode/received |
|---|
import Foundation
import ServiceStack
public class GetReceivedGiftcodeRequest : PagingRequest
{
public var gameId:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case gameId
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
gameId = try container.decodeIfPresent(Int.self, forKey: .gameId)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if gameId != nil { try container.encode(gameId, forKey: .gameId) }
}
}
public class PagingRequest : Codable
{
public var page:Int
public var limit:Int
public var offSet:Int
required public init(){}
}
public class PageResponse<T : Codable> : IResponseRequest, Codable
{
public var code:Int
public var message:String
public var data:[ReceivedGiftcodeResponse] = []
public var pagination:Pagination
required public init(){}
}
public class ReceivedGiftcodeResponse : Codable
{
public var eventId:Int
public var eventName:String
public var eventUrl:String
public var Description:String
public var iconUrl:String
public var label:String
public var labelColor:String
public var eventType:Int
public var code:String
public var serverId:String
public var characterId:String
public var characterName:String
public var startDate:Date?
public var dueDate:Date?
public var eventStartDate:Date?
public var eventEndDate:Date?
public var createdDate:Date
public var isUsed:Bool
required public init(){}
}
public class Pagination : Codable
{
public var total:Int
public var pages:Int
public var offset:Int
public var limit:Int
public var currentPage:Int
required public init(){}
}
Swift GetReceivedGiftcodeRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=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
}
]
}