syntax = "proto3";

package com.wixpress.appservice.api;
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "wix/api/validations.proto";
import "wix/api/annotations.proto";
import "components_catalog_data/notifications_common.proto";

// Describes contact notifications
message ContactNotification {
  google.protobuf.StringValue reference_id = 8 [(wix.api.format) = GUID];

  ContactsNotificationData reference_data = 9;
}

message ContactsNotificationData {
  message RecipientFilter {
    enum Type {
      UNKNOWN_TYPE = 0;
      CONTACTS = 1;
    }

    message ContactsData {
      TypedDynamicParam id = 1; // id
    }

    Type type = 1; // recipient filter type
    oneof data {
      ContactsData contacts_data = 2; // contacts data
    }
  }
  message Initiator {
    enum Type {
      UNKNOWN_TYPE = 0;
      CONTACT = 1;
      SITE_MEMBER = 2;
    }

    message ContactData {
      string dynamic_param_name = 1 [(.wix.api.minLength) = 1]; // dynamic param name
    }

    message SiteMemberData {
      string dynamic_param_name = 1 [(.wix.api.minLength) = 1]; // dynamic param name
    }

    Type type = 1; // initiator type
    oneof data {
      ContactData contact_data = 2; // contact data
      SiteMemberData site_member_data = 3; // site member data
    }
  }
  message Deeplink {
    message LiveSiteActionDeeplink {
      google.protobuf.StringValue app_page_id = 1; // app page ID
      google.protobuf.StringValue path = 2; // path
      ConstOrDynamicParam language = 3; // language
      ConstOrDynamicParam hash_fragment = 4; // hash fragment
      map<string, ConstOrDynamicParam> query_params = 5; // query params
    }

    oneof of {
      Url url = 1; // url
      LiveSiteActionDeeplink live_site = 2 [(wix.api.field_exposure) = INTERNAL]; // live site
    }
  }
  message Context {
    map<string, OrderValue> params = 1; // params
  }

  google.protobuf.StringValue name = 1 [(.wix.api.minLength) = 1]; // name
  google.protobuf.StringValue description = 2; // description
  google.protobuf.StringValue topic_id = 3 [(.wix.api.minLength) = 1]; // topic id
  NotificationChannels channels = 4; // channels
  Icon icon = 5; // icon
  Intent intent = 6 [(wix.api.field_exposure) = INTERNAL]; // intent
  LimiterField limiter_field = 7; // limiter field


  RecipientFilter recipient_filter = 10; // recipient filter
  Initiator initiator = 11; // initiator
  Deeplink single_deeplink = 12; // single deeplink
  Deeplink grouped_deeplink = 13; // grouped deeplink
  Context context = 14; // context
}