syntax = "proto3";

package com.wix.media.site_media.upstream.wix.common;

option java_multiple_files = true;
option java_package = "com.wix.media.site_media.upstream.wix.common";

import "google/protobuf/wrappers.proto";
import "wix/api/validations.proto";
import "wix/api/annotations.proto";

message IdentificationData {
    option (.wix.api.decomposite_of) = "wix.common.IdentificationData";
    option (.wix.api.decomposition_minimum_fields) = {
        field: "identity_type"
        field: "anonymous_visitor_id"
        field: "member_id"
        field: "wix_user_id"
        field: "app_id"
    };
    enum IdentityType {
        UNKNOWN = 0;
        ANONYMOUS_VISITOR = 1;
        MEMBER = 2;
        WIX_USER = 3;
        APP = 4;
    }
    // ID of of a contact in the site's [CRM by Ascend](https://www.wix.com/ascend/crm) system.
    google.protobuf.StringValue contact_id = 1 [(.wix.api.format) = GUID, (.wix.api.referenced_entity) = "wix.contacts.v4.contact"];
    // The typed of identity that is used
    IdentityType identity_type = 6 [(.wix.api.readOnly) = true, (.wix.api.field_exposure) = PRIVATE];
    oneof id {
        // ID of a site visitor that has not logged in to the site.
        string anonymous_visitor_id = 2 [(.wix.api.format) = GUID];
        // ID of a site visitor that has logged in to the site.
        string member_id = 3 [(.wix.api.format) = GUID, (.wix.api.referenced_entity) = "wix.members.v1.member"];
        // ID of a Wix user (site owner, contributor, etc.).
        string wix_user_id = 4 [(.wix.api.format) = GUID];
        // ID of an app.
        string app_id = 5 [(.wix.api.format) = GUID];
    }
}
