package grpc

// Code generated by gowrap. DO NOT EDIT.
// template: ../../templates/grpc.tmpl
// gowrap: http://github.com/hexdigest/gowrap

import (
	"context"

	"go.uber.org/yarpc"

	"github.com/uber/cadence/common/types"
	"github.com/uber/cadence/common/types/mapper/proto"
)

func (g matchingClient) AddActivityTask(ctx context.Context, ap1 *types.AddActivityTaskRequest, p1 ...yarpc.CallOption) (ap2 *types.AddActivityTaskResponse, err error) {
	response, err := g.c.AddActivityTask(ctx, proto.FromMatchingAddActivityTaskRequest(ap1), p1...)
	return proto.ToMatchingAddActivityTaskResponse(response), proto.ToError(err)
}

func (g matchingClient) AddDecisionTask(ctx context.Context, ap1 *types.AddDecisionTaskRequest, p1 ...yarpc.CallOption) (ap2 *types.AddDecisionTaskResponse, err error) {
	response, err := g.c.AddDecisionTask(ctx, proto.FromMatchingAddDecisionTaskRequest(ap1), p1...)
	return proto.ToMatchingAddDecisionTaskResponse(response), proto.ToError(err)
}

func (g matchingClient) CancelOutstandingPoll(ctx context.Context, cp1 *types.CancelOutstandingPollRequest, p1 ...yarpc.CallOption) (err error) {
	_, err = g.c.CancelOutstandingPoll(ctx, proto.FromMatchingCancelOutstandingPollRequest(cp1), p1...)
	return proto.ToError(err)
}

func (g matchingClient) DescribeTaskList(ctx context.Context, mp1 *types.MatchingDescribeTaskListRequest, p1 ...yarpc.CallOption) (dp1 *types.DescribeTaskListResponse, err error) {
	response, err := g.c.DescribeTaskList(ctx, proto.FromMatchingDescribeTaskListRequest(mp1), p1...)
	return proto.ToMatchingDescribeTaskListResponse(response), proto.ToError(err)
}

func (g matchingClient) GetTaskListsByDomain(ctx context.Context, gp1 *types.GetTaskListsByDomainRequest, p1 ...yarpc.CallOption) (gp2 *types.GetTaskListsByDomainResponse, err error) {
	response, err := g.c.GetTaskListsByDomain(ctx, proto.FromMatchingGetTaskListsByDomainRequest(gp1), p1...)
	return proto.ToMatchingGetTaskListsByDomainResponse(response), proto.ToError(err)
}

func (g matchingClient) ListTaskListPartitions(ctx context.Context, mp1 *types.MatchingListTaskListPartitionsRequest, p1 ...yarpc.CallOption) (lp1 *types.ListTaskListPartitionsResponse, err error) {
	response, err := g.c.ListTaskListPartitions(ctx, proto.FromMatchingListTaskListPartitionsRequest(mp1), p1...)
	return proto.ToMatchingListTaskListPartitionsResponse(response), proto.ToError(err)
}

func (g matchingClient) PollForActivityTask(ctx context.Context, mp1 *types.MatchingPollForActivityTaskRequest, p1 ...yarpc.CallOption) (mp2 *types.MatchingPollForActivityTaskResponse, err error) {
	response, err := g.c.PollForActivityTask(ctx, proto.FromMatchingPollForActivityTaskRequest(mp1), p1...)
	return proto.ToMatchingPollForActivityTaskResponse(response), proto.ToError(err)
}

func (g matchingClient) PollForDecisionTask(ctx context.Context, mp1 *types.MatchingPollForDecisionTaskRequest, p1 ...yarpc.CallOption) (mp2 *types.MatchingPollForDecisionTaskResponse, err error) {
	response, err := g.c.PollForDecisionTask(ctx, proto.FromMatchingPollForDecisionTaskRequest(mp1), p1...)
	return proto.ToMatchingPollForDecisionTaskResponse(response), proto.ToError(err)
}

func (g matchingClient) QueryWorkflow(ctx context.Context, mp1 *types.MatchingQueryWorkflowRequest, p1 ...yarpc.CallOption) (mp2 *types.MatchingQueryWorkflowResponse, err error) {
	response, err := g.c.QueryWorkflow(ctx, proto.FromMatchingQueryWorkflowRequest(mp1), p1...)
	return proto.ToMatchingQueryWorkflowResponse(response), proto.ToError(err)
}

func (g matchingClient) RefreshTaskListPartitionConfig(ctx context.Context, mp1 *types.MatchingRefreshTaskListPartitionConfigRequest, p1 ...yarpc.CallOption) (mp2 *types.MatchingRefreshTaskListPartitionConfigResponse, err error) {
	response, err := g.c.RefreshTaskListPartitionConfig(ctx, proto.FromMatchingRefreshTaskListPartitionConfigRequest(mp1), p1...)
	return proto.ToMatchingRefreshTaskListPartitionConfigResponse(response), proto.ToError(err)
}

func (g matchingClient) RespondQueryTaskCompleted(ctx context.Context, mp1 *types.MatchingRespondQueryTaskCompletedRequest, p1 ...yarpc.CallOption) (err error) {
	_, err = g.c.RespondQueryTaskCompleted(ctx, proto.FromMatchingRespondQueryTaskCompletedRequest(mp1), p1...)
	return proto.ToError(err)
}

func (g matchingClient) UpdateTaskListPartitionConfig(ctx context.Context, mp1 *types.MatchingUpdateTaskListPartitionConfigRequest, p1 ...yarpc.CallOption) (mp2 *types.MatchingUpdateTaskListPartitionConfigResponse, err error) {
	response, err := g.c.UpdateTaskListPartitionConfig(ctx, proto.FromMatchingUpdateTaskListPartitionConfigRequest(mp1), p1...)
	return proto.ToMatchingUpdateTaskListPartitionConfigResponse(response), proto.ToError(err)
}
