syntax = "proto2";

package maps_adv.adv_store.proto.action;

message OpenSite {
    required string url = 1;
}

message Search {
    repeated uint64 organizations = 1 [packed=true];
    required string history_text = 2;
}

message PhoneCall {
    required string phone = 1;
}

message DownloadApp {
    optional string google_play_id = 1;
    optional string app_store_id = 2;
    required string url = 3;
}

message Promocode {
    required string promocode = 1;
}

message ActionType {
    enum Enum {
        OPEN_SITE = 1;
    }
}

message Dialog {
    required string title = 1;
    required string content = 2;
    required string ok = 3;
    required string cancel = 4;
    required string event_ok = 5;
    required string event_cancel = 6;
}

message ResolveUri {
    enum Target {
        WEB_VIEW = 1;
        BROWSER = 2;
    }

    required string uri = 1;
    required ActionType.Enum action_type = 2;
    optional Target target = 3;
    optional Dialog dialog = 4;
}

message AddPointToRoute {
    required double latitude = 1;
    required double longitude = 2;
}

message Action {
    oneof action {
        OpenSite open_site = 1;
        Search search = 2;
        PhoneCall phone_call = 3;
        DownloadApp download_app = 4;
        Promocode promocode = 5;
        ResolveUri resolve_uri = 6;
        AddPointToRoute add_point_to_route = 7;
    }
    optional string title = 10;
    optional bool main = 11;
}
