syntax = "proto3";

package com.wixpress.richcontent;

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

service TruncateService {
    option (wix.api.service_entity) = {
      message: ".wix.rich_content.v1.RichContent"
      namespace: "RichContentTruncateService"
    };
    rpc truncate(TruncateRequest) returns (TruncateResponse) {
			option (wix.api.required) = "TruncateRequest.contentState";
			option (google.api.http).post = "/truncate-content";
    }
}

message TruncateRequest {
    google.protobuf.Struct contentState = 1;
    int32 size = 2;
    google.protobuf.BoolValue keep_empty_paragraphs = 3;
}

message TruncateResponse {
    google.protobuf.Struct contentState = 1;
}
