syntax = "proto3";

package components_catalog_data.legends_persona_configuration.com.wixpress.appservice.api.upstream.wix.legends.persona.v1;

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

message LegendsSpiConfig {
    option (.wix.api.decomposite_of) = "wix.legends.persona.v1.LegendsSpiConfig";
  // URI where the SPI Implementer is deployed.
  string deployment_uri = 1 [(.wix.spi.base_uri) = true, (.wix.api.maxLength) = 1000];
  // Configuration of namespaces known by implementer.
  repeated NamespaceConfig namespace_configs = 2 [(.wix.api.maxSize) = 5];
}

message NamespaceConfig {
    option (.wix.api.decomposite_of) = "wix.legends.persona.v1.NamespaceConfig";
  // Namespace name.
  string namespace = 1 [(.wix.api.maxLength) = 100];
  // PersonaService permissions associated with this namespace.
  Permissions persona_permissions = 2;
  // KnowledgeService permissions associated with this namespace.
  Permissions knowledge_permissions = 3;
  // MediaService permissions associated with this namespace.
  Permissions media_permissions = 4;
  // PersonaChatService permissions associated with this namespace.
  Permissions chat_permissions = 5;
  // AvatarService permissions associated with this namespace.
  Permissions avatar_permissions = 6;
  // PitchService permissions associated with this namespace.
  Permissions pitch_permissions = 7;
  // VoiceService permissions associated with this namespace.
  Permissions voice_permissions = 8;
  // PersonaInsightsService permissions associated with this namespace.
  Permissions persona_insights_permissions = 9;
  // PersonaTopicClusteringService permissions associated with this namespace.
  Permissions persona_topic_clustering_permissions = 10;
}

message Permissions {
    option (.wix.api.decomposite_of) = "wix.legends.persona.v1.Permissions";
  // Create permission.
  string create = 1 [(.wix.api.maxLength) = 50];
  // Read permission.
  string read = 2 [(.wix.api.maxLength) = 50];
  // Update permission.
  string update = 3 [(.wix.api.maxLength) = 50];
  // Delete permission.
  string delete = 4 [(.wix.api.maxLength) = 50];
  // Custom permissions
  repeated CustomPermission custom = 5 [(.wix.api.maxSize) = 10];
}

message CustomPermission {
    option (.wix.api.decomposite_of) = "wix.legends.persona.v1.CustomPermission";
  // The name of the custom permission.
  string name = 1 [(.wix.api.maxLength) = 50];
  // The description of the custom permission.
  string permission = 2 [(.wix.api.maxLength) = 50];
}

message GetPermissionsRequest {
    option (.wix.api.decomposite_of) = "wix.legends.persona.v1.GetPermissionsRequest";
  // The namespace with permissions.
  string namespace = 1 [(.wix.api.maxLength) = 100];
}

message GetPermissionsResponse {
    option (.wix.api.decomposite_of) = "wix.legends.persona.v1.GetPermissionsResponse";
  // Result with permissions.
  Permissions permissions = 1;
}