/*
 * Copyright 2021 Tianmian Tech. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.welab.wefe.mpc.psi.sdk.service;

import com.welab.wefe.mpc.config.CommunicationConfig;
import com.welab.wefe.mpc.pir.PrivateInformationRetrievalApiName;
import com.welab.wefe.mpc.pir.request.QueryKeysRequest;
import com.welab.wefe.mpc.pir.request.naor.QueryNaorPinkasRandomResponse;
import com.welab.wefe.mpc.pir.request.naor.QueryNaorPinkasResultRequest;
import com.welab.wefe.mpc.pir.request.naor.QueryNaorPinkasResultResponse;
import com.welab.wefe.mpc.psi.request.QueryPrivateSetIntersectionRequest;
import com.welab.wefe.mpc.psi.request.QueryPrivateSetIntersectionResponse;
import com.welab.wefe.mpc.trasfer.AbstractHttpTransferVariable;

/**
 * @Author: eval
 * @Date: 2021-12-24
 **/
public class PrivateSetIntersectionService extends AbstractHttpTransferVariable {

    public QueryPrivateSetIntersectionResponse handle(CommunicationConfig config,
            QueryPrivateSetIntersectionRequest request) {
        return query(request, config.getApiName(), config, QueryPrivateSetIntersectionResponse.class);
    }

    public QueryNaorPinkasRandomResponse handlePirResult(CommunicationConfig config, QueryKeysRequest request) {
        return query(request, config.getApiName(), config, QueryNaorPinkasRandomResponse.class);
    }

    public QueryNaorPinkasResultResponse queryNaorPinkasResult(CommunicationConfig config,
            QueryNaorPinkasResultRequest request) {
        return query(request, PrivateInformationRetrievalApiName.NAORPINKAS_RESULTS, config,
                QueryNaorPinkasResultResponse.class);
    }

}
