Imports System.IO
Imports System.Runtime.Serialization
Imports System.ServiceModel
Imports DigitalData.Modules.EDMI.API.Rights

Namespace Messages

#Region "DocumentImport"
    <MessageContract>
    Public Class DocumentImportRequest
        <MessageBodyMember>
        Public Contents() As Byte
        <MessageBodyMember>
        Public ObjectStoreId As Long
        <MessageBodyMember>
        Public FileName As String
        <MessageBodyMember>
        Public DocumentType As String
        <MessageBodyMember>
        Public RetentionDays As Long = 0
    End Class

    <MessageContract>
    Public Class DocumentImportResponse
        <MessageBodyMember>
        Public ObjectId As Long
    End Class
#End Region

#Region "DocumentStream"
    <MessageContract>
    Public Class DocumentStreamRequest
        <MessageBodyMember>
        Public ObjectId As Long
    End Class

    <MessageContract>
    Public Class DocumentStreamResponse
        <MessageHeader(MustUnderstand:=True)>
        Public FileName As String

        <MessageBodyMember(Order:=1)>
        Public FileContents As Stream
    End Class
#End Region

#Region "DocumentInfo"
    <MessageContract>
    Public Class DocumentInfoRequest
        <MessageBodyMember>
        Public ObjectId As Long

        <MessageBodyMember>
        Public UserId As Long
    End Class

    <MessageContract>
    Public Class DocumentInfoResponse
        <MessageBodyMember>
        Public FullPath As String

        <MessageBodyMember>
        Public FileRight As AccessRight
    End Class
#End Region

#Region "DocumentList"
    <MessageContract>
    <KnownType(GetType(DBNull))>
    Public Class DocumentListResponse
        <MessageBodyMember>
        Public Datatable As DataTable
    End Class
#End Region

#Region "Helpers"
    <MessageContract>
    Public Class TestObjectIdExistsRequest
        <MessageBodyMember>
        Public ObjectId As Long
    End Class

    <MessageContract>
    Public Class TestObjectIdExistsResponse
        Public Sub New(pExists As Boolean)
            Exists = pExists
        End Sub

        <MessageBodyMember>
        Public Exists As Boolean = False
        <MessageBodyMember>
        Public Inactive As Boolean = False
        <MessageBodyMember>
        Public Deleted As Boolean = False
    End Class
#End Region

End Namespace



