/**
 * Messages used in communication between servers and within server.
 * @author Mateusz Paciorek
 * @copyright (C) 2016 ACK CYFRONET AGH
 * @copyright This software is released under the MIT license cited in
 * 'LICENSE.txt'
 */

syntax = "proto2";
package one.clproto;

import "common_messages.proto";

// Generic provider request
message ProviderRequest {
    required bytes context_guid = 1;

    oneof provider_request { // list of all provider requests
        GetParent get_parent = 2;
        GetAcl get_acl = 3;
        SetAcl set_acl = 4;
        RemoveAcl remove_acl = 5;
        GetFilePath get_file_path = 6;
        CheckPerms check_perms = 7;
    }
}

message GetParent {
}

message Acl {
    required bytes value = 1;
}

message GetAcl {
}

message SetAcl {
    required Acl acl = 1;
}

message RemoveAcl {
}

message GetFilePath {
}

message CheckPerms {
    required OpenFlag flag = 1;
}


// Generic provider response
message ProviderResponse {
    required Status status = 1;

    oneof provider_response { // list of all provider responses
        Acl acl = 2;
        Dir dir = 3;
        FilePath file_path = 4;
    }
}

message FilePath {
    required bytes value = 1;
}
