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";

message NotificationChannels {
  message EmailChannel {
    message EmailTemplateConfig {
      message ResponsysEmail {
        string responsys_template = 1 [(.wix.api.minLength) = 1]; // responsys email
      }

      message VelocityEmail {
        string velocity_module_name = 1 [(.wix.api.minLength) = 1]; // velocity module name
        string template_file = 2 [(.wix.api.minLength) = 1]; // template file
      }

      message ShoutoutEmail {
        string template_id = 1 [(.wix.api.minLength) = 1]; // template ID
        string stream_by = 2 [(.wix.api.minLength) = 1]; // stream by
        string template_msid = 3 [(.wix.api.minLength) = 1]; // template msid
      }

      oneof provider {
        ResponsysEmail responsys_email = 1; // responsys email
        VelocityEmail velocity_email = 2 [(wix.api.field_exposure) = PRIVATE]; // velocity email
        ShoutoutEmail shoutout_email = 3 [(wix.api.field_exposure) = PRIVATE]; // shoutout email
      }
    }

    EmailTemplateConfig config = 1; // config
  }

  message FeedChannels {
    message WebFeedChannel {
      message WebFeedContentKeys {
        google.protobuf.StringValue title = 1; // title
        google.protobuf.StringValue message = 2; // message
        google.protobuf.StringValue action = 3; // action
        google.protobuf.StringValue group_of_two_message = 4; // group of two message
        google.protobuf.StringValue group_of_many_message = 5; // group of many message
        google.protobuf.StringValue group_of_many_action = 6; // group of many action
      }
      WebFeedContentKeys content_keys = 1; // content_keys
    }

    message MobileFeedChannel {
      message MobileFeedContentKeys {
        google.protobuf.StringValue title = 1; // title
        google.protobuf.StringValue message = 2; // message
        google.protobuf.StringValue action = 3; // action
        google.protobuf.StringValue group_of_two_message = 4; // group of two message
        google.protobuf.StringValue group_of_many_message = 5; // group of many message
        google.protobuf.StringValue group_of_many_action = 6; // group of many action
      }
      MobileFeedContentKeys content_keys = 1; // content keys
    }

    message FeedChannelsConfig {
      FeedAggregation aggregation = 1; // aggregation
    }

    message FeedAggregation {
      string group_key = 1 [(.wix.api.minLength) = 1]; // group key
      string window = 2 [(.wix.api.minLength) = 1]; // window
      Icon icon = 3; // icon
    }

    WebFeedChannel web_feed = 1; // web feed
    MobileFeedChannel mobile_feed = 2; // mobile feed
    FeedChannelsConfig config = 3; // config
  }

  message MobilePushChannel {
    message MobilePushChannelConfig {
      SharedPlatformMobilePushConfig shared = 1; // shared
      AndroidMobilePushConfig android = 2; // android
    }

    message SharedPlatformMobilePushConfig {
      enum MobileApplication {
        UNKNOWN_MOBILE_APPLICATION = 0;
        OWNER = 1;
        SPACES = 2;
        DINE = 3;
        FITNESS = 4;
        WIX_LIFE = 5;
        WIX_PARTNERS = 6;
        BRANDED = 7;
        WIX_STUDIO = 8;
        NO_SPECIFIC_TARGET_APP = 9;
      }

      string sound = 1; // sound
      google.protobuf.StringValue group_key = 2; // group key
      google.protobuf.Int32Value ttl = 3; // ttl
      MobileApplication target_application = 4; // target application
    }

    message AndroidMobilePushConfig {
      enum AndroidStyle {
        UNKNOWN_ANDROID_STYLE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED, (.wix.api.enum_exposure) = PRIVATE];
        BIG_TEXT = 1;
        MESSAGING = 2;
        INBOX = 3;
      }

      google.protobuf.StringValue sub_group_key = 1; // sub group key
      AndroidStyle style = 2; // style
      google.protobuf.StringValue grouped_deeplink_pattern = 3; // grouped deeplink pattern
      google.protobuf.StringValue os_settings_category = 4 [(wix.api.field_exposure) = PRIVATE]; // os settings category
    }

    message MobilePushContentKeys {
      google.protobuf.StringValue title = 1; // title
      google.protobuf.StringValue message = 2; // message
      google.protobuf.StringValue group_of_many_title = 3; // group of many title
      google.protobuf.StringValue group_of_many_message = 4; // group of many message
      google.protobuf.StringValue master_group_name_override = 5; // master group name override
    }

    MobilePushChannelConfig config = 1; // config
    MobilePushContentKeys content_keys = 2; // content_keys
    ExposureRule exposure = 3 [(wix.api.field_exposure) = PRIVATE]; // exposure rule
  }

  message VoiceChannel {
    message VoiceContentKeys {
      google.protobuf.StringValue message = 1; // message
    }
    VoiceContentKeys content_keys = 1; // content keys
  }

  message SmsChannel {
    message SmsContentKeys {
      google.protobuf.StringValue message = 1; // message
    }
    SmsContentKeys content_keys = 1; // content_keys
  }

  message BrowserPushChannel {
    message BrowserPushContentKeys {
      google.protobuf.StringValue title = 1; // title
      google.protobuf.StringValue message = 2; // message
    }
    BrowserPushContentKeys content_keys = 1; // content_keys
  }

  message ExposureRule {
    enum Type {
      UNKNOWN_TYPE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED, (.wix.api.enum_exposure) = PRIVATE];
      OPEN_TO_ALL = 1;
      OPEN_TO_NONE = 2;
      BOOLEAN_EXPERIMENT = 3;
      CUSTOM_EXPERIMENT = 4;
    }

    message BooleanExperimentExposureRule {
      string spec = 1; // spec
    }

    message CustomExperimentExposureRule {
      string spec = 1; // spec
      string default_value = 2; // default value
      string expected_value = 3; // expected value
    }

    Type type = 1; // type
    oneof rule {
      BooleanExperimentExposureRule boolean_experiment_exposure_rule = 2; // boolean experiment exposure rule
      CustomExperimentExposureRule custom_experiment_exposure_rule = 3; // custom experiment exposure rule
    }
  }

  EmailChannel email = 1; // email
  FeedChannels feed = 2; // feed
  MobilePushChannel mobile_push = 3; // mobile push
  VoiceChannel voice = 4 ; // voice
  SmsChannel sms = 5; // sms
  BrowserPushChannel browser_push = 6; // browser push
  map<string, string> content_map = 10 [(wix.api.translatable) = {
    type: LONG_TEXT
  }];
}

message Icon {
  enum Type {
    UNKNOWN_TYPE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED, (.wix.api.enum_exposure) = PRIVATE];
    URL = 1;
    SPOUT = 2;
    INITIATOR = 3;
  }

  message UrlData {
    string url = 1 [(.wix.api.format) = WEB_URL]; // actual url
  }

  Type type = 1; // icon type
  oneof data {
    UrlData url_data = 2; // url data
  }
}

enum Intent {
  UNKNOWN_INTENT = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED, (.wix.api.enum_exposure) = PRIVATE];
  MARKETING = 1;
  TRANSACTIONAL = 2;
}

message LimiterField {
  string dynamic_param_name = 1; // dynamic param name
}

message ConstOrDynamicParam {
  oneof value {
    string dynamic_param_name = 1 [(.wix.api.minLength) = 1]; // dynamic param name
    string constant = 2 [(.wix.api.minLength) = 1]; // constant
  }
}

message TypedDynamicParam {
  enum Type {
    UNKNOWN_TYPE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED, (.wix.api.enum_exposure) = PRIVATE];
    STRING = 1;
    ARRAY = 2;
  }

  string name = 1  [(.wix.api.minLength) = 1]; // name
  Type dynamic_param_type = 2; // dynamic param type
}

message OrderValue {
  ConstOrDynamicParam value = 1; // can be const/dynamicParamName
  int32 order = 2 [(.wix.api.min) = 1]; // order
}

message Url {
  ConstOrDynamicParam const_or_dynamic_param = 1;
}
