syntax = "proto3";

package com.wixpress.appservice.api.upstream.wix.forms.v4.components;
option java_package = "com.wixpress.appservice.api.upstream.wix.forms.v4.components";

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

message FileUpload{
    option (.wix.api.decomposite_of) = "wix.forms.v4.components.FileUpload";
  reserved 3;
  // Selectable option label
  google.protobuf.StringValue label = 1 [(.wix.api.maxLength) = 350, (.wix.api.translatable) = {
    name: "File Upload Label"
    hidden: false
    grouping: "formFields"
    type: SHORT_TEXT
  }];
  // Description of the field
  .wix.rich_content.v1.RichContent description = 2 [(.wix.api.translatable) = {
    name: "File Upload Description"
    hidden: false
    grouping: "formFields"
    type: RICH_CONTENT_EDITOR
  }];
  // Flag identifying to hide or not label
  // Default: true
  google.protobuf.BoolValue show_label = 8;
  // Text on upload button
  google.protobuf.StringValue button_text = 4 [(.wix.api.maxLength) = 500, (.wix.api.translatable) = {
    name: "File Upload Button Text"
    hidden: false
    grouping: "formFields"
    type: SHORT_TEXT
  }];
  // Amount of files allowed to upload
  int32 file_limit = 5 [(.wix.api.min) = 1, (.wix.api.max) = 30];
  // Supported file formats for upload
  repeated UploadFileFormatEnum.UploadFileFormat upload_file_formats = 6 [(.wix.api.maxSize) = 5];
  // Custom text which appears when file is uploaded, if missing file name will be shown
  google.protobuf.StringValue explanation_text = 7 [(.wix.api.maxLength) = 255, (.wix.api.translatable) = {
    name: "File Upload Explanation Text"
    hidden: false
    grouping: "formFields"
    type: SHORT_TEXT
  }];

  message UploadFileFormatEnum{
        option (.wix.api.decomposite_of) = "wix.forms.v4.components.FileUpload.UploadFileFormatEnum";
    enum UploadFileFormat{
      // Undefined upload file format.
      UNDEFINED = 0;
      // Video files.
      VIDEO = 1;
      // Image files.
      IMAGE = 2;
      // Audio files.
      AUDIO = 3;
      // Document files.
      DOCUMENT = 4;
      // Archive files.
      ARCHIVE = 5;
    }
  }
}
