syntax = "proto3";

package wix.devcenter.apps.dependencies.v2.upstream.wix.common;

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

option java_multiple_files = true;
option java_package = "com.wixpress.devcenter.apps.dependencies.v2.upstream.wix.common";

/*
  Common object for tags.
  Should be use as in this example:
  message Foo {
    option (.wix.api.decomposite_of) = "wix.commons.v2.tags.Foo";
    string id = 1;
    // ...
    Tags tags = 5
  }

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

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

message PrivateTags {
    option (.wix.api.decomposite_of) = "wix.commons.v2.tags.PrivateTags";
  option (.wix.api.decomposition_minimum_fields) = {
    field: "private_tags"
  };

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