package com.amazon.ads.ema.api.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Timezone information model
 */
public class TimezoneInfo implements Parcelable {
    public static final Creator<TimezoneInfo> CREATOR = new Creator<TimezoneInfo>() {
        @Override
        public TimezoneInfo createFromParcel(Parcel in) {
            return new TimezoneInfo(in);
        }

        @Override
        public TimezoneInfo[] newArray(int size) {
            return new TimezoneInfo[size];
        }
    };
    public String id;              // Timezone ID like "Asia/Shanghai"
    public String displayName;     // Display name like "China Standard Time"
    public String shortName;       // Short name like "CST"
    public int rawOffsetMs;        // Raw offset in milliseconds from UTC
    public String gmtOffset;       // GMT offset string like "GMT+8"

    public TimezoneInfo() {
    }

    protected TimezoneInfo(Parcel in) {
        id = in.readString();
        displayName = in.readString();
        shortName = in.readString();
        rawOffsetMs = in.readInt();
        gmtOffset = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(displayName);
        dest.writeString(shortName);
        dest.writeInt(rawOffsetMs);
        dest.writeString(gmtOffset);
    }

    @Override
    public int describeContents() {
        return 0;
    }
}
