/*
 * Copyright (c) 2015 Ushahidi.
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program in the file LICENSE-AGPL. If not, see
 * https://www.gnu.org/licenses/agpl-3.0.html
 */

package com.ushahidi.android.domain.entity;

import com.addhen.android.raiburari.domain.entity.Entity;

import java.util.Date;
import java.util.List;

/**
 * A post entity
 *
 * @author Ushahidi Team <team@ushahidi.com>
 */

public class Post extends Entity {

    private Long mParent;

    private Type mType;

    private String mTitle;

    private String mSlug;

    private String mContent;

    private String mAuthorEmail;

    private String mAuthorRealname;

    private Status mStatus;

    private Date mCreated;

    private Date mUpdated;

    private long mDeploymentId;

    // Store the raw JSON for this field. This is a dynamic field
    // and can't predict its keys.
    private PostValue mValues;

    private List<Tag> mTags;

    public Long getParent() {
        return mParent;
    }

    public void setParent(Long parent) {
        mParent = parent;
    }

    public Type getType() {
        return mType;
    }

    public void setType(Type type) {
        mType = type;
    }

    public String getTitle() {
        return mTitle;
    }

    public void setTitle(String title) {
        mTitle = title;
    }

    public String getSlug() {
        return mSlug;
    }

    public void setSlug(String slug) {
        mSlug = slug;
    }

    public String getContent() {
        return mContent;
    }

    public void setContent(String content) {
        mContent = content;
    }

    public String getAuthorRealname() {
        return mAuthorRealname;
    }

    public void setAuthorRealname(String authorRealname) {
        mAuthorRealname = authorRealname;
    }

    public String getAuthorEmail() {
        return mAuthorEmail;
    }

    public void setAuthorEmail(String authorEmail) {
        mAuthorEmail = authorEmail;
    }

    public Status getStatus() {
        return mStatus;
    }

    public void setStatus(Status status) {
        mStatus = status;
    }

    public Date getCreated() {
        return mCreated;
    }

    public void setCreated(Date created) {
        mCreated = created;
    }

    public Date getUpdated() {
        return mUpdated;
    }

    public void setUpdated(Date updated) {
        mUpdated = updated;
    }

    public PostValue getValues() {
        return mValues;
    }

    public void setValues(PostValue values) {
        mValues = values;
    }

    public List<Tag> getTags() {
        return mTags;
    }

    public void setTags(List<Tag> tags) {
        mTags = tags;
    }

    public long getDeploymentId() {
        return mDeploymentId;
    }

    public void setDeploymentId(long deploymentId) {
        mDeploymentId = deploymentId;
    }

    public enum Status {
        DRAFT, PUBLISHED, PENDING
    }

    public enum Type {
        REPORT, UPDATE, REVISION
    }

    @Override
    public String toString() {
        return "Post{" +
                "mParent=" + mParent +
                ", mType=" + mType +
                ", mTitle='" + mTitle + '\'' +
                ", mSlug='" + mSlug + '\'' +
                ", mContent='" + mContent + '\'' +
                ", mAuthorEmail='" + mAuthorEmail + '\'' +
                ", mAuthorRealname='" + mAuthorRealname + '\'' +
                ", mStatus=" + mStatus +
                ", mCreated=" + mCreated +
                ", mUpdated=" + mUpdated +
                ", mDeploymentId=" + mDeploymentId +
                ", mValues=" + mValues +
                ", mTags=" + mTags +
                '}';
    }
}

@@ -3480,26 +3480,161 @@
 PORT
-, UPDATE, REVISION
+(%22report%22), UPDATE(%22update%22), REVISION(%22revision%22);%0A%0A        public String value;%0A%0A        Type(String value) %7B%0A            this.value = value;%0A        %7D
 %0A   

Update enum type for post to reflect what the API returns