import
{
    AttributeDTO,
    ResponseContainerDTO,
    AttributeResponseDTO,
    IdLocationNameIdentityDTO,
    LocationNameIdentityDTO,
    IdLocationNameIdentityResponseDTO,
    ObjectTypeIdentityDTO,
    ItemResponseContainerDTO,
    ExistingItemIdentityDTO,
    ResponseDetailsType,
    WSAttributeFlags,
    ItemEntityDTO,
    NewItemIdentityDTO
} from './Windream.WebService';


export interface IDirectoriesController
{
    Create(parameter: CreateDirectoryDTO): DirectoryResponseContainerDTO;
    CreateBulk(parameters: CreateDirectoryDTO[]): DirectoryResponseContainerDTO[];
    Delete(parameter: DeleteDirectoryDTO): DirectoryResponseContainerDTO;
    DeleteBulk(parameters: DeleteDirectoryDTO[]): DirectoryResponseContainerDTO[];
    Update(parameter: UpdateDirectoryDTO): DirectoryResponseContainerDTO;
    UpdateBulk(parameters: UpdateDirectoryDTO[]): DirectoryResponseContainerDTO[];
    GetDetails(id: Number): DirectoryResponseContainerDTO;
    GetDetails(parameter: GetDirectoryDetailsDTO): DirectoryResponseContainerDTO;
    GetDetailsBulk(parameters: GetDirectoryDetailsDTO[]): DirectoryResponseContainerDTO[];
    GetSubObjects(parameter: GetSubObjectsDTO): ItemResponseContainerDTO[];
    Move(parameter: MoveDirectoryDTO): DirectoryResponseContainerDTO;
    MoveBulk(parameters: MoveDirectoryDTO[]): DirectoryResponseContainerDTO[];
    Copy(parameter: CopyDirectoryDTO): DirectoryResponseContainerDTO;
    CopyBulk(parameters: CopyDirectoryDTO[]): DirectoryResponseContainerDTO[];
}

export const enum CopyDirectoryFlags
{
    FolderOnly = 0,
    WithFiles = 2,
    WithSubTree = 4
}

export const enum SubObjectFlags
{
    None = 1,
    IncludePreVersions = 2,
    Recursive = 4
}

export interface CopyDirectoryDTO
{
    Flags: CopyDirectoryFlags;
    Item: IdLocationNameIdentityDTO;
    Target: LocationNameIdentityDTO;
}

export interface CreateDirectoryDTO
{
    CreateTree: boolean;
    Item: NewDirectoryDTO;
    ResponseDetails: ResponseDetailsType;
}

export interface DeleteDirectoryDTO
{
    Item: IdLocationNameIdentityDTO;
    Recursive: boolean;
    ResponseDetails: ResponseDetailsType;
}

export interface DirectoryResponseContainerDTO extends ResponseContainerDTO
{
    Item: DirectoryResponseDTO;
}

export interface DirectoryResponseDTO extends IdLocationNameIdentityResponseDTO
{
    Attributes: AttributeResponseDTO[];
    ObjectType: ObjectTypeIdentityDTO;
    ParentWindreamObject: IdLocationNameIdentityResponseDTO;
}

export interface ExistingDirectoryIdentityDTO extends ExistingItemIdentityDTO
{
    Attributes: AttributeDTO[];
    ObjectType: ObjectTypeIdentityDTO;
}

export interface GetDirectoryDetailsDTO
{
    AttributeFlags: WSAttributeFlags;
    Item: IdLocationNameIdentityDTO;
    Values: string[];
}

export interface GetSubObjectsDTO
{
    Entity: ItemEntityDTO;
    Filter: string;
    Flags: SubObjectFlags;
    Item: IdLocationNameIdentityDTO;
}

export interface MoveDirectoryDTO
{
    Item: IdLocationNameIdentityDTO;
    ResponseDetails: ResponseDetailsType;
    Target: LocationNameIdentityDTO;
}

export interface NewDirectoryDTO extends NewItemIdentityDTO
{
    Attributes: AttributeDTO[];
    ObjectType: ObjectTypeIdentityDTO;
}

export interface UpdateDirectoryDTO
{
    Item: ExistingDirectoryIdentityDTO;
    ResponseDetails: ResponseDetailsType;
}