// flynt-disable no-oneof-empty-markers
syntax = "proto3";

package com.wixpress.metasite.event.api;

import "wix/api/validations.proto";
import "com/wixpress/metasite/event/api/dto.proto";
import "com/wixpress/metasite/event/api/events.proto";

message MetaSiteFullEvent {
    MetaSite meta_site = 1; // The entire DTO, describing MetaSite.
    Context context = 2; // The context of this event (create, update, delete).
    repeated MetaSiteEvent events = 3 [(wix.api.minSize) = 0, (wix.api.maxSize) = 1000]; // Events that triggered this event.

    enum Context {
        UNKNOWN = 0;
        CREATE = 1; // Creation of the site (might be from template, clone, blank site, etc).
        UPDATE = 2; // Update of the existing site.
        HARD_DELETE = 3; // Deletion of the site FOREVER (shouldn't present in db anymore).
        ARCHIVE = 4; // Soft deletion of the site (could be restored).
        RESTORE = 5; // Restoration of a soft deleted site.
        UPDATE_DELETED = 6; // Update of deleted meta site. Happens rarely, only because of data migrations.
        PURGED_EXTERNALLY = 7; // notify about deleted site.
    }
}

message MetaSiteEvent {
    oneof payload {
        SiteCreated created = 100; // Site is created.
        SiteTransferred transferred = 101; // Site is transferred.
        SiteDeleted deleted = 102; // Site is deleted.
        SiteUndeleted undeleted = 103; // Site is undeleted (restored).,
        SitePublished published = 104; // Site is published.
        SiteUnpublished unpublished = 105; // Site is unpublished.
        SiteMarkedAsTemplate marked_as_template = 106; // Marked as Template.
        SiteMarkedAsWixSite marked_as_wix_site = 107; // Marked as WixSite.
        ServiceProvisioned service_provisioned = 108; // A service is provisioned.
        ServiceRemoved service_removed = 109; // A service is removed.
        SiteRenamed renamed = 110; // Site is renamed.
        SiteHardDeleted hard_deleted = 111; // Site is hard deleted.
        NamespaceChanged namespace_changed = 112; // Site's namespace is changed.
        SiteUrlChanged url_changed = 113; // Site's URLs are changed.
        StudioAssigned studio_assigned = 114; // Site is marked/created as Wix Studio site
        StudioUnassigned studio_unassigned = 115; // Site is no longer WIx Studio site
        VirtualTpaMentioned virtual_tpa_mentioned = 116; // A service mentioned in one of the payloads is a Virtual Tpa
        SitePurgedExternally site_purged_externally = 117; // Site is marked as PurgedExternally
        OdeditorAssigned odeditor_assigned = 118; // Site is marked/created as Odeditor site
        OdeditorUnassigned odeditor_unassigned = 119; // Site is no longer Odeditor site
        PicassoAssigned picasso_assigned = 120; // Site is marked/created as Picasso site
        PicassoUnassigned picasso_unassigned = 121; // Site is no longer Picasso site
    }
}
