/*
 * Copyright (C) Photon Vision.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY

package org.photonvision.struct;

import org.photonvision.common.dataflow.structures.Packet;
import org.photonvision.common.dataflow.structures.PacketSerde;
import org.photonvision.utils.PacketUtils;

// Assume that the base class lives here and we can import it
import org.photonvision.targeting.*;

// WPILib imports (if any)
import edu.wpi.first.util.struct.Struct;


/**
 * Auto-generated serialization/deserialization helper for PhotonPipelineMetadata
 */
public class PhotonPipelineMetadataSerde implements PacketSerde<PhotonPipelineMetadata> {

    @Override
    public final String getInterfaceUUID() { return "ac0a45f686457856fb30af77699ea356"; }
    @Override
    public final String getSchema() { return "int64 sequenceID;int64 captureTimestampMicros;int64 publishTimestampMicros;int64 timeSinceLastPong;"; }
    @Override
    public final String getTypeName() { return "PhotonPipelineMetadata"; }

    @Override
    public int getMaxByteSize() {
        // TODO Auto-generated method stub
        throw new UnsupportedOperationException("Unimplemented method 'getMaxByteSize'");
    }

    @Override
    public void pack(Packet packet, PhotonPipelineMetadata value) {
        // field sequenceID is of intrinsic type int64
        packet.encode((long) value.sequenceID);

        // field captureTimestampMicros is of intrinsic type int64
        packet.encode((long) value.captureTimestampMicros);

        // field publishTimestampMicros is of intrinsic type int64
        packet.encode((long) value.publishTimestampMicros);

        // field timeSinceLastPong is of intrinsic type int64
        packet.encode((long) value.timeSinceLastPong);
    }

    @Override
    public PhotonPipelineMetadata unpack(Packet packet) {
        var ret = new PhotonPipelineMetadata();

        // sequenceID is of intrinsic type int64
        ret.sequenceID = packet.decodeLong();

        // captureTimestampMicros is of intrinsic type int64
        ret.captureTimestampMicros = packet.decodeLong();

        // publishTimestampMicros is of intrinsic type int64
        ret.publishTimestampMicros = packet.decodeLong();

        // timeSinceLastPong is of intrinsic type int64
        ret.timeSinceLastPong = packet.decodeLong();

        return ret;
    }

    @Override
    public PacketSerde<?>[] getNestedPhotonMessages() {
        return new PacketSerde<?>[] {
            
        };
    }

    @Override
    public Struct<?>[] getNestedWpilibMessages() {
        return new Struct<?>[] {
            
        };
    }
}
