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

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

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

        @Override
        public StorageInfo[] newArray(int size) {
            return new StorageInfo[size];
        }
    };
    public long total;                  // Total internal storage in bytes
    public long free;                   // Free storage in bytes
    public long used;                   // Used storage in bytes
    public float ratio;                 // Usage ratio (0-100)

    public StorageInfo() {
    }

    protected StorageInfo(Parcel in) {
        total = in.readLong();
        free = in.readLong();
        used = in.readLong();
        ratio = in.readFloat();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(total);
        dest.writeLong(free);
        dest.writeLong(used);
        dest.writeFloat(ratio);
    }

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