syntax = "proto3";

package promotion_impression;

option go_package = "promotion_impression";

import "eventbus/owner.proto";

// PromotionImpressionCreate triggers every time content is promoted to a viewer.
message PromotionImpressionCreate {
  option (eventbus.owner.ldap_group) = "team-ads";
  // The unique item tracking id associated with a given promotion shown to a given user on page load. (Formatted as Version 4 UUID.)
  string id = 1;
  // Metadata associated with the campaign being promoted.
  PromotionsCampaign promotions_campaign = 2;
  // Metadata associated with the client.
  UserContext user_context = 3;
  // The surface on Twitch where the promotion is placed.
  PromotionLocation promotion_location = 4;
}

// PromotionsCampaign contains information about a promotional campaign.
message PromotionsCampaign {
  // The unique id of the promotions campaign. (Formatted as Version 4 UUID.)
  string id = 1;
  // The unique id of the channel/creator being promoted (not the display name).
  string promoted_creator_id = 2;
  // The type of the promotional campaign.
  PromotionType promotion_type = 3;
  // The metric used to measure progress of the campaign.
  GoalMetric goal_metric = 4;
}

// UserContext contains information about a user/client.
message UserContext {
  // The device id of the client visiting Twitch.
  string device_id = 1;
  // The id of a logged-in user, or null for a user who isn't logged in.
  string user_id = 2;
  // The platform being used to access Twitch, i.e. web, mobile_web, ios, android, etc.
  string platform = 3;
  // A 2-character country code generated by IP geolocation.
  string country = 4;
  // The languages in a user's language cookie.
  repeated string languages = 5;
}

// PromotionType refers to the different types of campaigns that can be run.
enum PromotionType {
  PROMOTION_TYPE_INVALID = 0;
  PROMOTION_TYPE_GAMEPLAY_PLUS = 1;
  PROMOTION_TYPE_COMMUNITY_BOOST = 2;
  PROMOTION_TYPE_NEW_PARTNER = 3;
  PROMOTION_TYPE_HIGH_AD_DENSITY = 4;
}

// GoalMetric refers to the unit of measurement used to track progress of a campaign.
enum GoalMetric {
  GOAL_METRIC_INVALID = 0;
  GOAL_METRIC_IMPRESSIONS = 1;
  GOAL_METRIC_CLICKS = 2;
  GOAL_METRIC_VIDEO_PLAYS = 3;
}

// PromotionLocation refers to the surface on Twitch where a stream will be placed as part of its promotion.
enum PromotionLocation {
  PROMOTION_LOCATION_INVALID = 0;
  PROMOTION_LOCATION_SIDE_NAV = 1;
  PROMOTION_LOCATION_HOMEPAGE_LIVE_RECOMMENDED = 2;
  PROMOTION_LOCATION_SIDE_NAV_RECOMMENDED = 3;
}
