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 MultilineAddress {
    option (.wix.api.decomposite_of) = "wix.forms.v4.components.MultilineAddress";
  // Label of the field.
  google.protobuf.StringValue label = 1 [(.wix.api.maxLength) = 350, (.wix.api.translatable) = {
    name: "Multiline Address Label"
    hidden: false
    grouping: "formFields"
    type: SHORT_TEXT
  }];
  // Description of the field.
  .wix.rich_content.v1.RichContent description = 2 [(.wix.api.translatable) = {
    name: "Multiline Address Description"
    hidden: false
    grouping: "formFields"
    type: RICH_CONTENT_EDITOR
  }];
  // Show country flags.
  bool show_country_flags = 3;
  // Default country configuration.
  DefaultCountryConfig default_country_config = 4;
  // Fields settings.
  FieldsSettings field_settings = 5;
  // Autocomplete enabled for address line field.
  bool autocomplete_enabled = 6;

  message DefaultCountryConfig {
        option (.wix.api.decomposite_of) = "wix.forms.v4.components.MultilineAddress.DefaultCountryConfig";
    enum Type {
      // Unknown default country config type.
      UNKNOWN_DEFAULT_COUNTRY = 0;
      // Country is determined by customer's IP address.
      BY_IP = 1;
      // Pre-selected default country.
      COUNTRY = 2;
    }

    // Default country type.
    Type type = 1;
    oneof options {
      option (.wix.api.aligned_with_enum).field = "type";
      // Country.
      string country_options = 2 [(.wix.api.format) = COUNTRY];
    }
  }

  message FieldsSettings {
    option (.wix.api.decomposite_of) = "wix.forms.v4.components.MultilineAddress.FieldsSettings";
    reserved 1;
    // Address line 2.
    AddressLine2 address_line_2 = 2;
  }
  message AddressLine2 {
    option (.wix.api.decomposite_of) = "wix.forms.v4.components.MultilineAddress.AddressLine2";
    // Show address line 2 field.
    bool show = 1;
  }
}
