syntax = "proto3";

package com.wixpress.appservice.api;

import "wix/api/validations.proto";

message PageReplace {
    // The app id of the page the app can replace
    string app_id = 1 [(.wix.api.format) = GUID];
    // The page id the app can replace
    string page_id = 2 [(.wix.api.format) = GUID];
}

message PageReplaceOptions {

    enum ReplacementType {
        UNKNOWN_REPLACEMENT = 0;
        REPLACING = 1;
        REPLACEABLE = 2;
    }

    message ReplacingOptions {
        // describe the page and application id that this page will replace.
        PageReplace page_replace = 1;
    }

    message ReplaceableOptions {
        // toggle to mark whether this page can be replaced by other page or app.
        bool is_replaceable = 1;
    }

    ReplacementType type = 1;
    oneof options {
        option (.wix.api.aligned_with_enum).field = "type";
        ReplacingOptions replacing_options = 2;
        ReplaceableOptions replaceable_options = 3;
    }
}
