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

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

/**
 * Screen recording status response
 */
public class ScreenRecordStatus implements Parcelable {
    public static final Creator<ScreenRecordStatus> CREATOR = new Creator<ScreenRecordStatus>() {
        @Override
        public ScreenRecordStatus createFromParcel(Parcel in) {
            return new ScreenRecordStatus(in);
        }

        @Override
        public ScreenRecordStatus[] newArray(int size) {
            return new ScreenRecordStatus[size];
        }
    };
    public int code;                    // Status code
    public String message;              // Status message
    public String timestamp;            // ISO 8601 timestamp
    // Recording state: "idle", "recording", "completed", "failed"
    public String state;
    public int progressPercent;         // 0-100 during recording
    public int durationMs;              // Actual duration when completed
    public long fileSizeBytes;          // File size when completed

    public ScreenRecordStatus() {
    }

    protected ScreenRecordStatus(Parcel in) {
        code = in.readInt();
        message = in.readString();
        timestamp = in.readString();
        state = in.readString();
        progressPercent = in.readInt();
        durationMs = in.readInt();
        fileSizeBytes = in.readLong();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(code);
        dest.writeString(message);
        dest.writeString(timestamp);
        dest.writeString(state);
        dest.writeInt(progressPercent);
        dest.writeInt(durationMs);
        dest.writeLong(fileSizeBytes);
    }

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