syntax = "proto3";

package wix.common.tags;

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

option java_multiple_files = true;
option java_package = "com.wix.common";
/*
  Common object for tags.
  Should be use as in this example:
  message Foo {
    string id = 1;
    // ...
    Tags tags = 5
  }

  example of taggable entity
  {
    id: "123"
    tags: {
      tags: {
        tag_ids:["11","22"]
      },
      private_tags: {
        tag_ids: ["33", "44"]
      }
    }
  }
 */
message Tags {
  option (.wix.api.decomposition_minimum_fields) = {
    field: "tags"
  };

  message TagList {
    repeated string tag_ids = 1 [(.wix.api.referenced_entity) = "wix.os.tags.v1.tag", (.wix.api.maxSize) = 100, (.wix.api.maxLength) = 5]; // List of tag IDs
  }
  TagList private_tags = 1; // Tags that require an additional permission in order to access them, normally not given to site members or visitors.
  TagList tags = 2; // Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.
}

message PublicTags {
  option (.wix.api.decomposite_of) = "wix.common.tags.Tags";
  option (.wix.api.decomposition_minimum_fields) = {
    field: "tags"
  };

  message TagList {
    repeated string tag_ids = 1 [(.wix.api.referenced_entity) = "wix.os.tags.v1.tag", (.wix.api.maxSize) = 100, (.wix.api.maxLength) = 5]; // List of tag IDs
  }
  TagList tags = 2; // Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.
}
