syntax = "proto3";

package channel_points_custom_reward;

option go_package = "channel_points_custom_reward";

import "channel_points_custom_reward/create.proto";
import "eventbus/change.proto";
import "eventbus/owner.proto";

// ChannelPointsCustomRewardUpdate triggers when a custom reward is updated on a channel.
message ChannelPointsCustomRewardUpdate {
  option (eventbus.owner.ldap_group) = "team-communications";
  // The reward’s unique ID.
  string id = 1;
  // The ID of the channel the reward belongs to.
  string user_id = 2;
  // CDN URLs for reward icons at different resolutions.
  ImageURLsChange image = 3;
  // Background color for reward icons in hex.
  eventbus.change.StringChange background_color = 4;
  // Whether this reward is enabled by the broadcaster. Disabled rewards won't show to viewers.
  eventbus.change.BoolChange enabled = 5;
  // Whether this reward is usable by subs only.
  eventbus.change.BoolChange sub_only = 6;
  // Number of points a reward costs to redeem.
  eventbus.change.Int64Change cost = 7;
  // A short title used to describe the reward.
  eventbus.change.StringChange title = 8;
  // The user-facing prompt that will be shown when users want to redeem the reward.
  eventbus.change.StringChange prompt = 9;
  // Whether this reward requires viewer input.
  eventbus.change.BoolChange user_input_required = 10;
  // Setting for the maximum number of rewards of this type that can be redeemed per stream.
  // Can be disabled.
  MaxPerStreamSettingChange max_per_stream_setting = 11;
  // Whether this reward is paused. Paused rewards will show to viewers but can't be redeemed.
  eventbus.change.BoolChange paused = 12;
  // Whether this reward is out of stock. If this reward been redeemed the maximum number of times per stream, or if the stream is not live.
  eventbus.change.BoolChange in_stock = 13;
  // Default CDN URLs for custom reward icons at different resolutions.
  ImageURLs default_image = 14;
  // Whether this reward should skip appearing in the broadcaster's reward request queue.
  // Redemptions will be created in the FULFILLED state instead of UNFULFILLED.
  eventbus.change.BoolChange redemptions_skip_request_queue = 15;
  // The template the reward was created from. Blank if not created from a template.
  string template_id = 16;
  // Setting for the maximum number of rewards of this type that can be redeemed per user per stream.
  // Can be disabled.
  MaxPerUserPerStreamSettingChange max_per_user_per_stream_setting = 17;
  // Setting for the global cooldown on custom rewards
  // Can be disabled.
  GlobalCooldownSettingChange global_cooldown_setting = 18;
  // Timestamp of the cooldown expiration for the reward.
  // Null if the reward isn't on cooldown.
  eventbus.change.TimestampChange cooldown_expires_at = 19;
  // Number of redemptions redeemed for this reward during the current live stream.
  // This will reset everytime a new stream is started.
  // Null if the channel isn't currently live or the max_per_stream_setting isn't enabled.
  eventbus.change.Int64ValueChange redemptions_redeemed_current_stream = 20;
}

// An object representing the state change for ImageURLs.
message ImageURLsChange {
  bool updated = 1;
  ImageURLs value = 2;
  bool has_old_value = 3;
  ImageURLs old_value = 4;
}

// An object representing the state change for MaxPerStreamSetting.
message MaxPerStreamSettingChange {
  bool updated = 1;
  MaxPerStreamSetting value = 2;
  bool has_old_value = 3;
  MaxPerStreamSetting old_value = 4;
}

// An object representing the state change for MaxPerStreamSetting.
message MaxPerUserPerStreamSettingChange {
  bool updated = 1;
  MaxPerUserPerStreamSetting value = 2;
  bool has_old_value = 3;
  MaxPerUserPerStreamSetting old_value = 4;
}

// An object representing the state change for GlobalCooldownSetting.
message GlobalCooldownSettingChange {
  bool updated = 1;
  GlobalCooldownSetting value = 2;
  bool has_old_value = 3;
  GlobalCooldownSetting old_value = 4;
}
