syntax = "proto3";

package reddit.coreplatform.comments.v1;

import "reddit/api/metadata/v1/metadata.proto";
import "reddit/coreplatform/api/metadata/v1/metadata.proto";
import "reddit/coreplatform/common/v1/features.proto";
import "reddit/coreplatform/common/v1/lang.proto";
import "reddit/coreplatform/common/v1/legal.proto";
import "reddit/coreplatform/common/v1/media.proto";
import "reddit/coreplatform/common/v1/moderation.proto";
import "reddit/coreplatform/common/v1/safety.proto";

option go_package = "github.snooguts.net/reddit/thing-api/go/grpc/comments/v1;comments";
option java_multiple_files = true;
option java_outer_classname = "CommentsProto";
option java_package = "com.reddit.coreplatform.api.comments.v1";

/* @exclude No documentation present when converted from Thrift to Proto */
message Comment {
  /* @exclude No documentation present when converted from Thrift to Proto */
  enum MediaType {
    /* @exclude No documentation present when converted from Thrift to Proto */
    MEDIA_TYPE_UNSPECIFIED = 0 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "UNKNOWN"
      ordinal: 0,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    MEDIA_TYPE_GIPHY = 1 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "GIPHY"
      ordinal: 1,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    MEDIA_TYPE_STATIC = 2 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "STATIC"
      ordinal: 2,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    MEDIA_TYPE_ANIMATED = 3 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "ANIMATED"
      ordinal: 3,
    }];

    // An animated expression applied to the user's avatar.
    // Design document: https://docs.google.com/document/d/1toly1eQ7qha7u9daVXB97huuG4kLALMpMxkf9O3mmVU/edit
    MEDIA_TYPE_EXPRESSION = 4 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "EXPRESSION"
      ordinal: 4,
    }];
  }

  /* @exclude No documentation present when converted from Thrift to Proto */
  enum ApprovalStatus {
    /* @exclude No documentation present when converted from Thrift to Proto */
    APPROVAL_STATUS_UNSPECIFIED = 0;

    /* @exclude No documentation present when converted from Thrift to Proto */
    APPROVAL_STATUS_MOD_APPROVED = 1 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "MOD_APPROVED"
      ordinal: 0,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    APPROVAL_STATUS_MOD_REMOVED = 2 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "MOD_REMOVED"
      ordinal: 1,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    APPROVAL_STATUS_MOD_SPAMMED = 3 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "MOD_SPAMMED"
      ordinal: 2,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    APPROVAL_STATUS_ADMIN_APPROVED = 4 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "ADMIN_APPROVED"
      ordinal: 3,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    APPROVAL_STATUS_ADMIN_REMOVED = 5 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "ADMIN_REMOVED"
      ordinal: 4,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    APPROVAL_STATUS_ADMIN_SPAMMED = 6 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "ADMIN_SPAMMED"
      ordinal: 5,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    APPROVAL_STATUS_UNSET = 7 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "UNSET"
      ordinal: 6,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    APPROVAL_STATUS_AUTHOR_REMOVED = 8 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "AUTHOR_REMOVED"
      ordinal: 7,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    APPROVAL_STATUS_AUTHOR_SPAMMED = 9 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "AUTHOR_SPAMMED"
      ordinal: 8,
    }];
  }

  /* @exclude No documentation present when converted from Thrift to Proto */
  enum Sort {
    /* @exclude No documentation present when converted from Thrift to Proto */
    SORT_UNSPECIFIED = 0;

    /* @exclude No documentation present when converted from Thrift to Proto */
    SORT_CONFIDENCE = 1 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "CONFIDENCE"
      ordinal: 0,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    SORT_TOP = 2 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "TOP"
      ordinal: 1,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    SORT_NEW = 3 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "NEW"
      ordinal: 2,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    SORT_CONTROVERSIAL = 4 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "CONTROVERSIAL"
      ordinal: 3,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    SORT_OLD = 5 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "OLD"
      ordinal: 4,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    SORT_RANDOM = 6 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "RANDOM"
      ordinal: 5,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    SORT_QA = 7 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "QA"
      ordinal: 6,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    SORT_LIVE = 8 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "LIVE"
      ordinal: 7,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    SORT_UNSET = 9 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "NULL_VALUE"
      ordinal: 8,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    SORT_BLANK = 10 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "BLANK"
      ordinal: 9,
    }];
  }

  /* @exclude No documentation present when converted from Thrift to Proto */
  enum Type {
    /* @exclude No documentation present when converted from Thrift to Proto */
    TYPE_UNSPECIFIED = 0;

    /* @exclude No documentation present when converted from Thrift to Proto */
    TYPE_COMMENT = 1 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "COMMENT"
      ordinal: 0,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    TYPE_PREDICTION = 2 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "PREDICTION"
      ordinal: 1,
    }];

    /* @exclude No documentation present when converted from Thrift to Proto */
    TYPE_SHORT_VIDEO = 3 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "SHORT_VIDEO"
      ordinal: 2,
    }];
  }

  /* @exclude No documentation present when converted from Thrift to Proto */
  string id = 1;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int64 date = 2;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool deleted = 3;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool spam = 4;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 ups = 5;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 downs = 6;

  /* @exclude No documentation present when converted from Thrift to Proto */
  string author_id = 7;

  /* @exclude No documentation present when converted from Thrift to Proto */
  string link_id = 8;

  /* @exclude No documentation present when converted from Thrift to Proto */
  string parent_id = 9;

  /* @exclude No documentation present when converted from Thrift to Proto */
  string subreddit_id = 10;

  /* @exclude No documentation present when converted from Thrift to Proto */
  string body = 11;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int64 last_edit_date = 12;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 display_score = 13;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 cosmetic_ups = 14;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 cosmetic_downs = 15;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool admin_takedown = 17;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool sendreplies = 18;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool editable = 20;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 fake_ups = 21;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 fake_downs = 22;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 gildings = 23;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool ignore_reports = 24;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 ignored_ups = 25;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 ignored_downs = 26;

  /* @exclude No documentation present when converted from Thrift to Proto */
  string ip = 27 [(reddit.api.metadata.v1.entity_field_metadata) = {
    sensitivity_level: SENSITIVITY_LEVEL_PII
    max_retention: {
      seconds: 7776000 // 90 Days
    }
  }];

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 report_count = 28;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool request_from_tor = 29;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool request_has_loid = 30;

  /* @exclude No documentation present when converted from Thrift to Proto */
  reddit.coreplatform.common.v1.DistinguishType distinguished = 31;

  /* @exclude No documentation present when converted from Thrift to Proto */
  reddit.coreplatform.common.v1.Verdict verdict = 32;

  /* @exclude No documentation present when converted from Thrift to Proto */
  reddit.coreplatform.common.v1.BanInfo ban_info = 33;

  /* @exclude No documentation present when converted from Thrift to Proto */
  double abuse_score = 34;

  /* @exclude No documentation present when converted from Thrift to Proto */
  string author_request_organization = 35;

  /* @exclude No documentation present when converted from Thrift to Proto */
  string request_organization = 37;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool author_request_has_loid = 38;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool selftext_is_richtext = 39;

  /* @exclude No documentation present when converted from Thrift to Proto */
  repeated int32 reports_approved = 40;

  /* @exclude No documentation present when converted from Thrift to Proto */
  repeated int32 reports_made = 41;

  /* @exclude No documentation present when converted from Thrift to Proto */
  repeated int32 reports_rejected = 42;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 gildings_silver = 43;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 gildings_supergold = 44;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool author_request_from_tor = 45;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool approve_disabled = 46;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int64 delete_time = 47;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool expunged = 49;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int64 expunge_time = 50;

  /* @exclude No documentation present when converted from Thrift to Proto */
  string delete_message = 51;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool collapsed_in_crowd_control = 52;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 num_awardings = 53;

  /* @exclude No documentation present when converted from Thrift to Proto */
  map<string, double> perspective_scores = 54;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool locked = 55;

  /* @exclude No documentation present when converted from Thrift to Proto */
  bool media_is_processed = 56;

  /* @exclude No documentation present when converted from Thrift to Proto */
  repeated string media_ids = 57;

  /* @exclude No documentation present when converted from Thrift to Proto */
  repeated string meta_media_ids = 58;

  /* @exclude No documentation present when converted from Thrift to Proto */
  map<string, reddit.coreplatform.common.v1.MediaObject> meta_media_objects = 59;

  /* @exclude No documentation present when converted from Thrift to Proto */
  string associated_award_id = 60;

  /* @exclude No documentation present when converted from Thrift to Proto */
  string crowd_control_context = 61;

  /* @exclude No documentation present when converted from Thrift to Proto */
  ApprovalStatus approval_status = 62;

  /* @exclude No documentation present when converted from Thrift to Proto */
  Type comment_type = 63;

  /* @exclude No documentation present when converted from Thrift to Proto */
  repeated reddit.coreplatform.common.v1.LegalBlock legal_blocks = 64;

  /* @exclude No documentation present when converted from Thrift to Proto */
  repeated reddit.coreplatform.common.v1.DetectedLanguage detected_languages = 65;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 crowd_control_version = 66;

  /* @exclude No documentation present when converted from Thrift to Proto */
  int32 crowd_control_reputation = 67;

  // Contains a comment's sexually explicit content classification according to safety models
  // The field's score attribute will be set to 1.0 if sexually explicit content is detected
  // Field is set by Content Classification Service and is not user facing
  // The comment should be classified by the time it is publicly viewable (due to system latency and processing time it is not guaranteed)
  // Design document: https://docs.google.com/document/d/1kV1ZPI0CfVhM0tMt21XQl4_UqihNqXaYCrZb6bck29w/edit#heading=h.wb5nzkr7fhs4
  reddit.coreplatform.common.v1.SafetyXTag safety_x_tag = 68;

  // Contains a comment's violent content classification according to safety models
  // The field's score attribute will be set to 1.0 if violent content is detected
  // Field is set by Content Classification Service and is not user facing
  // The comment should be classified by the time it is publicly viewable (due to system latency and processing time it is not guaranteed)
  // Design document: https://docs.google.com/document/d/1JNQFp7TaBIY3AQ3YpAskelWshh5sJAOVgS4KtgPV5DI/edit#heading=h.hp7jr2y2s0pt
  reddit.coreplatform.common.v1.SafetyVTag safety_v_tag = 69;

  // Contains whether this comment was made "for commercial intent" so clients can
  // mark this content as being sponsored
  // Design document: https://docs.google.com/document/d/1gIAwynDBcBKNG8YB38InJo3XEeEKkDcfN5C47_A_vjg/edit#heading=h.ouoexgnkzdml
  bool is_commercial_communication = 70;
  // Contains indicators of the comment's visibility levels
  // [Design Doc](https://docs.google.com/document/d/15Ma5uxgqY3fp7lY4iRbx7rFoCt-0AYTh-Qu89lCjBls/edit)
  InternalVisibilitySettings internal_visibility_settings = 71;
}

// Settings to control the visibility of comments or their contents on various surfaces. Limited to attributes that
// are needed to inform decisions made by other service (e.g. GraphQL) that directly or indirectly surface data to
// end-users. For internal use only and not to be exposed to end-users via external APIs (e.g. GraphQL).
// [Design Doc](https://docs.google.com/document/d/15Ma5uxgqY3fp7lY4iRbx7rFoCt-0AYTh-Qu89lCjBls/edit)
message InternalVisibilitySettings {
  // Safety-specific labels that affect the visibility of the subreddit.
  repeated SafetyLabel safety_labels = 1;

  // Safety-specific labels for determining comment visibility. This should be limited in usage to safety as a signal
  // that internal systems should use as a trigger for determining if the comment or its contents should be surfaced
  // to end-user product surfaces. Should not be exposed to end users.
  enum SafetyLabel {
    // This is a default value used to convey the absence of a meaningful value.
    SAFETY_LABEL_UNSPECIFIED = 0 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "UNKNOWN"
      ordinal: 0,
    }];
    // Whether a comment should be collapsed due to being spammy
    // [Design Doc](https://docs.google.com/document/d/15Ma5uxgqY3fp7lY4iRbx7rFoCt-0AYTh-Qu89lCjBls/edit)
    SAFETY_LABEL_SPAMMY = 1 [(reddit.coreplatform.api.metadata.v1.thrift_alias) = {
      name: "SPAMMY"
      ordinal: 1,
    }];
  }
}
