syntax = "proto3";

package com.wixpress.appservice.api.upstream.wix.forms.templates.v2;
option java_package = "com.wixpress.appservice.api.upstream.wix.forms.templates.v2";


import "google/protobuf/wrappers.proto";
import "wix/api/validations.proto";
import "wix/api/annotations.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/payment_type.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/dropdown.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/text_input.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/radio_group.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/number_input.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/checkbox.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/checkbox_group.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/file_upload.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/product_checkbox_group.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/date_time_input.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/date_input.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/time_input.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/date_picker.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/donation_input.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/signature.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/multiline_address.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/phone_input.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/components/rating_input.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/multiline_address_validation.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/v4/post_submission_trigger.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/templates/v2/form_field_contact_info.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/templates/v2/validation/string_type.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/templates/v2/validation/number_type.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/templates/v2/validation/object_array_type.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/templates/v2/validation/boolean_type.proto";
import "components_catalog_data/form_template/com/wixpress/appservice/api/upstream/wix/forms/templates/v2/validation/integer_type.proto";


message InputField {
    option (.wix.api.decomposite_of) = "wix.forms.templates.v2.InputField";
  // Definition of a target where the value of field belongs.
  string target = 1 [(.wix.api.minLength) = 1, (.wix.api.maxLength) = 200, (.wix.api.immutable) = true];
  // Mark the field as containing personal information. This will encrypt user data when storing it.
  // Default: false
  bool pii = 2;
  // Whether the field is required.
  // Default: false
  bool required = 3;
  // Type of the input field
  InputType input_type = 4 [(.wix.api.readOnly) = true];
  // Mapping to contacts, telling to what contact property field input value should be saved.
  com.wixpress.appservice.api.upstream.wix.forms.templates.v2.FormFieldContactInfo contact_mapping = 13;
  // Whether the field is read only.
  // Default: false
  bool read_only = 14;

  oneof input_type_options {
    option (.wix.api.aligned_with_enum).field = "input_type";
    // Input return string as value
    String string_options = 5;
    // Input return number as value
    Number number_options = 6;
    // Input return boolean as value
    Boolean boolean_options = 7;
    // Input return array as value
    Array array_options = 8;
    // Input return object as value
    Object object_options = 9;
    // Input return "Wix file" as value
    WixFile wix_file_options = 10;
    // Input returns selected products as value.
    Payment payment_options = 11;
    // Input returns multiline address as value.
    MultilineAddress multiline_address_options = 12;
  }

  enum InputType {
    UNKNOWN_INPUT_TYPE = 0;
    STRING = 1;
    NUMBER = 2;
    BOOLEAN = 3;
    ARRAY = 4;
    OBJECT = 5;
    WIX_FILE = 6;
    PAYMENT = 7;
    MULTILINE_ADDRESS = 8;
  }

  message String {
    option (.wix.api.decomposite_of) = "wix.forms.templates.v2.String";
    // Validation of field output value.
    com.wixpress.appservice.api.upstream.wix.forms.templates.v2.validation.StringType validation = 1;
    // Component type of the string input field
    ComponentType component_type = 2 [(.wix.api.readOnly) = true];

    oneof component_type_options {
      option (.wix.api.aligned_with_enum).field = "component_type";
      // Text input field
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.TextInput text_input_options = 3;
      // Selection field as radio group
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.RadioGroup radio_group_options = 4;
      // Selection field as drop down
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.Dropdown dropdown_options = 5;
      // Field for selecting date and/or time
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.DateTimeInput date_time_options = 6;
      // Phone input field
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.PhoneInput phone_input_options = 7;
      // Dropdown based component for selecting date
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.DateInput date_input_options = 8;
      // Field for selecting time
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.TimeInput time_input_options = 9;
      // Calendar type component for selecting date
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.DatePicker date_picker_options = 10;
    }

    enum ComponentType {
      UNKNOWN_COMPONENT_TYPE = 0;
      TEXT_INPUT = 1;
      RADIO_GROUP = 2;
      DROPDOWN = 3;
      DATE_TIME = 4;
      PHONE_INPUT = 5;
      DATE_INPUT = 6;
      TIME_INPUT = 7;
      DATE_PICKER = 8;
    }
  }

  message Number {
    option (.wix.api.decomposite_of) = "wix.forms.templates.v2.Number";
    // Validation of field output value.
    com.wixpress.appservice.api.upstream.wix.forms.templates.v2.validation.NumberType validation = 1;
    // Component type of the number input field
    ComponentType component_type = 2 [(.wix.api.readOnly) = true];

    oneof component_type_options {
      option (.wix.api.aligned_with_enum).field = "component_type";
      // Number value input field
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.NumberInput number_input_options = 3;
      // Rating value input field
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.RatingInput rating_input_options = 4;
    }

    enum ComponentType {
      UNKNOWN = 0;
      NUMBER_INPUT = 1;
      RATING_INPUT = 2;
    }
  }

  message Boolean {
    option (.wix.api.decomposite_of) = "wix.forms.templates.v2.Boolean";
    // Validation of field output value.
    com.wixpress.appservice.api.upstream.wix.forms.templates.v2.validation.BooleanType validation = 1;
    // Component type of the boolean input field
    ComponentType component_type = 2 [(.wix.api.readOnly) = true];

    oneof component_type_options {
      option (.wix.api.aligned_with_enum).field = "component_type";
      // Checkbox input field
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.Checkbox checkbox_options = 3;
    }

    enum ComponentType {
      UNKNOWN_COMPONENT_TYPE = 0;
      CHECKBOX = 1;
    }
  }

  message Array {
    option (.wix.api.decomposite_of) = "wix.forms.templates.v2.Array";
    // Validation of array type.
    com.wixpress.appservice.api.upstream.wix.forms.templates.v2.validation.ArrayType validation = 1;
    // Component type of the array input field
    ComponentType component_type = 2 [(.wix.api.readOnly) = true];

    oneof component_type_options {
      option (.wix.api.aligned_with_enum).field = "component_type";
      // Checkbox group input field
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.CheckboxGroup checkbox_group_options = 3;
    }

    enum ComponentType {
      UNKNOWN_COMPONENT_TYPE = 0;
      CHECKBOX_GROUP = 1;
    }
  }

  message Object {
    option (.wix.api.decomposite_of) = "wix.forms.templates.v2.Object";
    reserved 2;
    // Validation of object type.
    com.wixpress.appservice.api.upstream.wix.forms.templates.v2.validation.ObjectType validation = 1;
  }

  message WixFile{
    option (.wix.api.decomposite_of) = "wix.forms.templates.v2.WixFile";
    // Component type of the array input field
    ComponentType component_type = 1 [(.wix.api.readOnly) = true];

    oneof component_type_options {
      option (.wix.api.aligned_with_enum).field = "component_type";
      // File upload input field
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.FileUpload file_upload_options = 2;
      // Signature input field
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.Signature signature_options = 3;
    }

    enum ComponentType {
      UNKNOWN_COMPONENT_TYPE = 0;
      FILE_UPLOAD = 1;
      SIGNATURE = 2;
    }
  }

  message Payment {
    option (.wix.api.decomposite_of) = "wix.forms.templates.v2.Payment";
    // Component type of the payment input field.
    ComponentType component_type = 1 [(.wix.api.readOnly) = true];
    // Validation of payment type.
    com.wixpress.appservice.api.upstream.wix.forms.v4.PaymentType validation = 3;

    oneof component_type_options {
      option (.wix.api.aligned_with_enum).field = "component_type";
      // Checkbox group input field.
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.ProductCheckboxGroup checkbox_group_options = 2;
      // Donation input field.
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.DonationInput donation_input_options = 4;
    }

    enum ComponentType {
      UNKNOWN_COMPONENT_TYPE = 0;
      CHECKBOX_GROUP = 1;
      DONATION_INPUT = 2;
    }
  }

  message MultilineAddress {
    option (.wix.api.decomposite_of) = "wix.forms.templates.v2.MultilineAddress";
    // Component type of the multiline address field.
    ComponentType component_type = 1 [(.wix.api.readOnly) = true];
    // Validation of multiline address field output value.
    com.wixpress.appservice.api.upstream.wix.forms.v4.MultilineAddressValidation validation = 2;

    oneof component_type_options {
      option (.wix.api.aligned_with_enum).field = "component_type";
      // Multiline address input field.
      com.wixpress.appservice.api.upstream.wix.forms.v4.components.MultilineAddress multiline_address_options = 3;
    }

    enum ComponentType {
      UNKNOWN_COMPONENT_TYPE = 0;
      MULTILINE_ADDRESS = 1;
    }
  }
}
