syntax = "proto3";

package wix.coupons.api.v2;

import "google/api/annotations.proto";
import "wix/api/validations.proto";
import "wix/api/annotations.proto";
import "wix/coupons/api/v2/item-for-coupon.proto";
import "google/protobuf/wrappers.proto";

option java_package = "com.wix.coupons.api.v2";

service CouponsAdapter {
    option (wix.api.service_exposure) = PRIVATE;

    rpc GetItemsForCouponsByIds (GetItemsForCouponsByIdsRequest) returns (GetItemsForCouponsResponse) {
        option (google.api.http) = {
            get: "/api/v2/items-for-coupons-by-ids"
        };
        option (wix.api.maturity) = ALPHA;
    }

    rpc GetItemsForCouponsByFilters (GetItemsForCouponsByFiltersRequest) returns (GetItemsForCouponsResponse) {
        option (google.api.http) = {
            get: "/api/v2/items-for-coupons-by-filters"
        };
        option (wix.api.maturity) = ALPHA;
    }

    rpc GetItemsForShoutout (GetItemsForShoutoutRequest) returns (GetItemsForCouponsResponse) {
        option (google.api.http) = {
            get: "/api/v2/items-for-shoutout"
        };
        option (wix.api.maturity) = ALPHA;
    }
}

message GetItemsForCouponsByIdsRequest {
    string group = 1;
    repeated string ids = 2 [(wix.api.maxLength)=100];
}

message GetItemsForCouponsByFiltersRequest {
    string group = 1;
    int32 offset = 2;
    int32 limit = 3 [(wix.api.max) = 100];
    google.protobuf.StringValue text = 4;
}

message GetItemsForShoutoutRequest {
    google.protobuf.StringValue group = 1;
    google.protobuf.StringValue entityId = 2;
}

message GetItemsForCouponsResponse {
    repeated ItemForCoupon items = 1;
    int32 totalCount = 2;
}



