﻿// Copyright (c) Kai Langlie. All rights reserved.
// Licensed under the Apache License, Version 2.0.

using System.IO;
using System.ServiceModel;

namespace OpenUpdate.Deployment.Common
{
    [MessageContract]
    public class FileUploadMessage : IDeploymentFile
    {
        [MessageHeader(MustUnderstand = true)]
        public string Token { get; set; }

        [MessageHeader(MustUnderstand = true)]
        public DirectoryType DirectoryType { get; set; }

        [MessageBodyMember(Order = 1)]
        public Stream DataStream { get; set; }

        [MessageHeader(MustUnderstand = true)]
        public string FileHash { get; set; }

        [MessageHeader(MustUnderstand = true)]
        public HashType HashType { get; set; }

        [MessageHeader(MustUnderstand = true)]
        public string FileName { get; set; }

        [MessageHeader(MustUnderstand = true)]
        public long FileSize { get; set; }

        [MessageHeader(MustUnderstand = true)]
        public string LastWriteTime { get; set; }
    }
}