syntax = "proto3";

import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "wix/api/entity.proto";
import "wix/api/validations.proto";

package com.wixpress.advanced.seo;
option java_package = "com.wixpress.advanced.seo";

// The SEO schema object contains data about different types of meta tags. It makes sure that the information about your page is presented properly to search engines.
// The search engines use this information for ranking purposes, or to display snippets in the search results.
// This data will override other sources of tags (for example patterns) and will be included in the <head> section of the HTML document, while not being displayed on the page itself.
message SeoSchema {
  option (.wix.api.entity) = {
    fqdn: "wix.promote.seo.v1.seo_schema",
    segment: USERS
  };
  // SEO tag information.
 repeated Tag tags = 1;

   // SEO general settings.
 Settings settings = 2;

 message Tag {
   // SEO tag type.
   //
   //
   // Supported values: `title`, `meta`, `script`, `link`.
   string                 type     = 1;

   // A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value.
   // For example: `{"name": "description", "content": "the description itself"}`.
   google.protobuf.Struct props    = 2;

   // SEO tag metadata. For example, `{"height": 300, "width": 240}`.
   google.protobuf.Struct meta    = 3;

   // SEO tag inner content. For example, `<title> inner content </title>`.
   string                 children = 4;

   // Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages).
   bool                   custom   = 5;

   // Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines.
   bool                   disabled = 6;
 }

 message Settings {
   // Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled.
   //
   //
   // Default: `false` (automatical redirect is enabled).
   bool      prevent_auto_redirect = 1;

   // User-selected keyword terms for a specific page.
   repeated Keyword       keywords = 2 [(.wix.api.maxSize) = 5];
 }

 message Keyword {
   // Keyword value.
   string                     term = 1;

   // Whether the keyword is the main focus keyword.
   bool                    is_main = 2;

   // The source that added the keyword terms to the SEO settings.
   google.protobuf.StringValue origin = 3 [(.wix.api.maxLength) = 1000];
  }
}
