package com.alterdekim.game.controller.result.async;

import com.alterdekim.game.entity.Miniquest;
import com.alterdekim.game.entity.Preloader;
import com.alterdekim.game.entity.Promotion;
import com.alterdekim.game.entity.PromotionBanner;
import com.alterdekim.game.xml.CryptoSerializer;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@JsonRootName(value = "response")
public class ServerActionResult {

    @JacksonXmlProperty(isAttribute = false, localName = "sn_status")
    private SnStatus snStatus;

    @JacksonXmlProperty(isAttribute = false, localName = "user_name")
    private UserName username;

    @JacksonXmlProperty
    private List<Preloader> preloader;

    @JacksonXmlProperty
    private Flags flags;

    @JacksonXmlProperty(localName = "tutorial")
    @JacksonXmlElementWrapper(useWrapping = true, localName = "tutorial")
    private List<Tutorial> tutorial;

    @JacksonXmlProperty
    private Grants grants;

    @JacksonXmlProperty
    private Grants requests;

    @JacksonXmlProperty
    private List<Promotion> promotion;

    @JacksonXmlProperty(localName = "promotion_banner")
    private List<PromotionBanner> promotionBanners;

    @JacksonXmlProperty
    private PhoneMessages phone;

    @JacksonXmlProperty
    private PostcardMessages postcard;

    @JacksonXmlProperty
    @JacksonXmlElementWrapper(useWrapping = true, localName = "miniquest")
    private List<Miniquest> miniquest;

    @JacksonXmlProperty(localName = "cdata")
    @JsonSerialize(using = CryptoSerializer.class)
    @JacksonXmlElementWrapper(useWrapping = false, localName = "cdata")
    private List<ServerActionCData> cdata;
}