syntax = "proto3";

package shared_ban_information_settings;

option go_package = "shared_ban_information_settings";

import "eventbus/owner.proto";

// SharedBanInformationSettingsUpdate occurs when a channel owner changes their settings related to sending/receiving shared ban information requests.
message SharedBanInformationSettingsUpdate {
  option (eventbus.owner.ldap_group) = "team-safety";
  // user_id refers to the channel owner that has updated a channel's shared bans information settings
  string user_id = 1;
  // feature_enabled refers to whether the feature has been enabled (false when feature has been disabled).
  bool feature_enabled = 2;
  // channel_type_permissions refers to what kind of channels this channel can receive/send requests from/to, only present when feature_enabled is true.
  ChannelTypePermissionSettingsArrayChange channel_type_permissions = 3;
}

// Denotes a ChannelTypePermissionSettings array that can change and allows for new values to be set.
message ChannelTypePermissionSettingsArrayChange {
  bool updated = 1;
  repeated ChannelTypePermissionSettings value = 2;
  bool has_old_value = 3;
  repeated ChannelTypePermissionSettings old_value = 4;
}

// ChannelTypePermissionSettings are different types of channels that a user may limit sharing requests to/from.
enum ChannelTypePermissionSettings {
  CHANNEL_TYPE_PERMISSION_SETTINGS_INVALID = 0;
  // the channel allows requests to/from all channels, this supercedes the other values.
  CHANNEL_TYPE_PERMISSION_SETTINGS_ALL_CHANNELS = 1;
  // the channel allows requests to/from partners.
  CHANNEL_TYPE_PERMISSION_SETTINGS_PARTNERS = 2;
  // the channel allows requests to/from affiliates.
  CHANNEL_TYPE_PERMISSION_SETTINGS_AFFILIATES = 3;
  // the channel allows requests to/from friends.
  CHANNEL_TYPE_PERMISSION_SETTINGS_FRIENDS = 4;
}
