syntax = "proto3";

message ObjectGenericUnion {
  oneof value {
    ObjectGenericUnion.ISaleReview v1 = 1;
    ObjectGenericUnion.ISaleQuestion v2 = 2;
  }
  message ISaleQuestion {
    required string writer = 1;
    optional ObjectGenericUnion.ISaleAnswer answer = 2;
    required string id = 3;
    required double hit = 4;
    repeated ObjectGenericUnion.ISaleArticle.IContent contents = 5;
    required string created_at = 6;
  }

  message ISaleAnswer {
    required string id = 1;
    required double hit = 2;
    repeated ObjectGenericUnion.ISaleArticle.IContent contents = 3;
    required string created_at = 4;
  }

  message ISaleArticle {
    message IContent {
      required string id = 1;
      required string created_at = 2;
      required string title = 3;
      required string body = 4;
      repeated ObjectGenericUnion.IAttachmentFile files = 5;
    }
  }

  message IAttachmentFile {
    required string name = 1;
    optional string extension = 2;
    required string url = 3;
  }

  message ISaleReview {
    required string writer = 1;
    optional ObjectGenericUnion.ISaleAnswer answer = 2;
    required string id = 3;
    required double hit = 4;
    repeated ObjectGenericUnion.ISaleReview.IContent contents = 5;
    required string created_at = 6;
    message IContent {
      required double score = 1;
      required string id = 2;
      required string created_at = 3;
      required string title = 4;
      required string body = 5;
      repeated ObjectGenericUnion.IAttachmentFile files = 6;
    }
  }
}