syntax = "proto3";

package com.wixpress.appservice.api;

import "google/protobuf/wrappers.proto";
import "wix/api/validations.proto";
import "wix/api/annotations.proto";
import "wix/spi/definitions.proto";
import "components_catalog_common.proto";
import "wix/rich_content/v1/rich_content.proto";

// A component used for testing dev center functionality
message DevCenterTestingComponentData {
  // Non translatable field
  string non_translatable = 1;

  string name = 2 [(wix.api.translatable) = {
    type: SHORT_TEXT
    name: "Name"
    grouping: "name"
  }];

  google.protobuf.StringValue description = 3 [(.wix.api.maxLength) = 500, (wix.api.translatable) = {
    type: LONG_TEXT
    grouping: "description"
  }];

  map<string, string> translations_map = 4 [(wix.api.translatable) = {
    type: SHORT_TEXT
    name: "Readable name of translations map"
    grouping: "some_map"
  }];

  MessageContainingTranslatables translatable_message = 5;

  map<string, MessageContainingTranslatables> map_of_translatable_messages = 6 [(.wix.api.maxSize) = 500];

  string base_uri = 7 [(.wix.spi.base_uri) = true];

  google.protobuf.StringValue reference_id = 8 [(wix.api.format) = GUID];

  CustomRefData reference_data = 9;

  int32 price_multiplier = 10;

  string response_prefix = 11;

  oneof translatable_one_of {
    string translatable_string = 12 [(wix.api.translatable) = {
      type: SHORT_TEXT
      grouping: "translatable_string"
    }];

    google.protobuf.StringValue translatable_optional_string = 13 [(wix.api.translatable) = {
      type: SHORT_TEXT
      grouping: "translatable_optional_string"
    }];

    MessageContainingTranslatables translatable_message_in_one_of = 14;
  }

  repeated TranslatedMessageWithUniqueFieldRepeated translated_messages_with_unique_field = 15 [(.wix.api.maxSize) = 500];
  repeated TranslatedMessageWithIdRepeated translated_messages_with_id_field = 16 [(.wix.api.maxSize) = 500];
  DiscoveryMetaData component_metadata = 17;
  repeated DiscoveryMetaData repeated_component_metadata = 18 [(.wix.api.maxSize) = 500];
  repeated InternalComponentMetadata repeated_internal_component_metadata = 19 [(.wix.api.maxSize) = 500];
  .wix.rich_content.v1.RichContent translatable_rich_content = 20 [(.wix.api.translatable) = {
    name: "Text Input Description"
    hidden: false
    grouping: "some_group"
    type: RICH_CONTENT_EDITOR
  }];

  .wix.rich_content.v1.RichContent non_translatable_rich_content = 21;

  map<string, .wix.rich_content.v1.RichContent> rich_content_map = 22 [(wix.api.translatable) = {
    name: "Text Input Description"
    hidden: false
    grouping: "some_group"
    type: RICH_CONTENT_EDITOR
  }];
  ExtensionExposure exposure = 23;
  repeated string referenced_entity = 24 [(.wix.api.referenced_entity) = 'wix.devcenter.components.v1.component', (.wix.api.maxSize) = 500, (.wix.api.maxLength) = 500];
}

message InternalComponentMetadata {
  DiscoveryMetaData component_metadata = 1;
  repeated DiscoveryMetaData repeated_component_metadata = 2 [(.wix.api.maxSize) = 500];
}

message CustomRefData {
  string title = 1 [(wix.api.translatable) = {
    type: SHORT_TEXT
    name: "Title"
    grouping: "title"
  }];

  string another_title = 2;
}

message MessageContainingTranslatables {
  string message_name = 2 [(wix.api.translatable) = {
    type: SHORT_TEXT
    grouping: "name"
  }];

  google.protobuf.StringValue message_description = 3 [(wix.api.translatable) = {
    type: LONG_TEXT
    name: "Readable name of description"
    grouping: "description"
  }];

  map<string, string> message_translations_map = 4 [(wix.api.translatable) = {
    type: SHORT_TEXT
    grouping: "some_map"
  }];

  .wix.rich_content.v1.RichContent inner_translatable_rich_content = 5 [(.wix.api.translatable) = {
    name: "Text Input Description"
    hidden: false
    grouping: "some_group"
    type: RICH_CONTENT_EDITOR
  }];
}

message TranslatedMessageWithIdRepeated {
  string id = 1;
  string message = 2 [(wix.api.translatable) = {
    type: SHORT_TEXT
    name: "Readable name of message"
    grouping: "message"
  }];
}

message TranslatedMessageWithUniqueFieldRepeated {
  option (.wix.api.unique) = {field: "unique_field"};
  string unique_field = 1;
  string message = 2 [(wix.api.translatable) = {
    type: SHORT_TEXT
    name: "Readable name of message"
    grouping: "message"
  }];
}
