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

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

/**
 * Cache clear operation result wrapper
 */
public class CacheClearResult implements Parcelable {
    public static final Creator<CacheClearResult> CREATOR = new Creator<>() {
        @Override
        public CacheClearResult createFromParcel(Parcel in) {
            return new CacheClearResult(in);
        }

        @Override
        public CacheClearResult[] newArray(int size) {
            return new CacheClearResult[size];
        }
    };
    public int code;                    // Status code
    public String message;              // Status message
    public String timestamp;            // ISO 8601: "2025-10-11T23:01:00.000Z"
    public CacheClearData data;         // Cache clear data

    public CacheClearResult() {
    }

    protected CacheClearResult(Parcel in) {
        code = in.readInt();
        message = in.readString();
        timestamp = in.readString();
        data = in.readParcelable(CacheClearData.class.getClassLoader());
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(code);
        dest.writeString(message);
        dest.writeString(timestamp);
        dest.writeParcelable(data, flags);
    }

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