syntax = "proto3";

package producttag;

import "public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/duration.proto";  
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";

option csharp_namespace = "CMSMicroservice.Protobuf.Protos.ProductTag";

service ProductTagContract
{
    rpc CreateNewProductTag(CreateNewProductTagRequest) returns (CreateNewProductTagResponse){
        option (google.api.http) = {
            post: "/CreateNewProductTag"
            body: "*"
        };
    };
    rpc UpdateProductTag(UpdateProductTagRequest) returns (google.protobuf.Empty){
        option (google.api.http) = {
            put: "/UpdateProductTag"
            body: "*"
        };
    };
    rpc DeleteProductTag(DeleteProductTagRequest) returns (google.protobuf.Empty){
        option (google.api.http) = {
            delete: "/DeleteProductTag"
            body: "*"
        };
    };
    rpc GetProductTag(GetProductTagRequest) returns (GetProductTagResponse){
        option (google.api.http) = {
            get: "/GetProductTag"
            
        };
    };
    rpc GetAllProductTagByFilter(GetAllProductTagByFilterRequest) returns (GetAllProductTagByFilterResponse){
        option (google.api.http) = {
            get: "/GetAllProductTagByFilter"
            
        };
    };
}
message CreateNewProductTagRequest
{
    int64 product_id = 1;
    int64 tag_id = 2;
}
message CreateNewProductTagResponse
{
    int64 id = 1;
}
message UpdateProductTagRequest
{
    int64 id = 1;
    int64 product_id = 2;
    int64 tag_id = 3;
}
message DeleteProductTagRequest
{
    int64 id = 1;
}
message GetProductTagRequest
{
    int64 id = 1;
}
message GetProductTagResponse
{
    int64 id = 1;
    int64 product_id = 2;
    int64 tag_id = 3;
}
message GetAllProductTagByFilterRequest
{
    messages.PaginationState pagination_state = 1;
    google.protobuf.StringValue sort_by = 2;
    GetAllProductTagByFilterFilter filter = 3;
}
message GetAllProductTagByFilterFilter
{
    google.protobuf.Int64Value id = 1;
    google.protobuf.Int64Value product_id = 2;
    google.protobuf.Int64Value tag_id = 3;
}
message GetAllProductTagByFilterResponse
{
    messages.MetaData meta_data = 1;
    repeated GetAllProductTagByFilterResponseModel models = 2;
}
message GetAllProductTagByFilterResponseModel
{
    int64 id = 1;
    int64 product_id = 2;
    int64 tag_id = 3;
}
