syntax = "proto3";

package com.wixpress.appservice.api.upstream.com.wixpress.comm.channels.entities.v2.commons.channel;

import "components_catalog_data/communication_channel_provider/com/wixpress/appservice/api/upstream/com/wixpress/comm/channels/entities/v2/commons/channel/accepted_message_types.proto";
import "components_catalog_data/communication_channel_provider/com/wixpress/appservice/api/upstream/com/wixpress/comm/channels/entities/v2/commons/channel/sms/sms_message_config.proto";
import "components_catalog_data/communication_channel_provider/com/wixpress/appservice/api/upstream/com/wixpress/comm/channels/entities/v2/commons/channel/email/email_message_config.proto";
import "components_catalog_data/communication_channel_provider/com/wixpress/appservice/api/upstream/com/wixpress/comm/channels/entities/v2/commons/channel/dm/direct_message_config.proto";
import "components_catalog_data/communication_channel_provider/com/wixpress/appservice/api/upstream/com/wixpress/comm/channels/entities/v2/commons/channel/channel_branding.proto";
import "wix/api/validations.proto";
import "google/protobuf/wrappers.proto";
import "wix/api/annotations.proto";

message ChannelConfiguration {
    option (.wix.api.decomposite_of) = "com.wixpress.comm.channels.entities.v2.commons.channel.ChannelConfiguration";
  // kebab-case channel identifier. Allows the provider to register multiple channels with the same provider app.
  string channel_key = 1 [(.wix.api.minLength) = 1, (.wix.api.maxLength) = 50];
  // The type of the communication channel
  ChannelType type = 2;

  oneof messaging_config {
    option (.wix.api.aligned_with_enum) = {
      field: "type";
      suffix: "config"
    };

    // Direct messaging configuration
    dm.DirectMessageConfig direct_messaging_config = 3;
    // Email messaging configuration
    email.EmailMessageConfig email_config = 4;
    // Sms messaging configuration
    sms.SmsMessageConfig sms_config = 5;
  }
  // Specific provider branding parameters for the channel
  com.wixpress.comm.channels.entities.v2.commons.channel.ChannelBranding branding = 6;

  // Indicates if the channel is HIPAA compliant
  bool hipaa_compliant = 7 [(wix.api.readOnly) = true];

//  // todo: add use case here
//  // todo: maybe needed for channel information / learn more in the settings page? if the channel does not implement a dashboard component?
//  // todo: do we get the apps config page in the getInstalledImplementors
//  google.protobuf.StringValue configuration_url = 7 [(wix.api.format) = WEB_URL, (wix.api.maxLength) = 2048];

  // The type of the communication channel
  enum ChannelType {
    UNKNOWN_CHANNEL_TYPE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED];
    DIRECT_MESSAGING = 1;
    EMAIL = 2;
    SMS = 3;
  }
}