package thrift

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

import (
	"context"

	"github.com/uber/cadence/.gen/go/shared"
	"github.com/uber/cadence/common/types/mapper/thrift"
)

func (g APIHandler) CountWorkflowExecutions(ctx context.Context, CountRequest *shared.CountWorkflowExecutionsRequest) (cp1 *shared.CountWorkflowExecutionsResponse, err error) {
	response, err := g.h.CountWorkflowExecutions(ctx, thrift.ToCountWorkflowExecutionsRequest(CountRequest))
	return thrift.FromCountWorkflowExecutionsResponse(response), thrift.FromError(err)
}

func (g APIHandler) DeleteDomain(ctx context.Context, DeleteRequest *shared.DeleteDomainRequest) (err error) {
	err = g.h.DeleteDomain(ctx, thrift.ToDeleteDomainRequest(DeleteRequest))
	return thrift.FromError(err)
}

func (g APIHandler) DeprecateDomain(ctx context.Context, DeprecateRequest *shared.DeprecateDomainRequest) (err error) {
	err = g.h.DeprecateDomain(ctx, thrift.ToDeprecateDomainRequest(DeprecateRequest))
	return thrift.FromError(err)
}

func (g APIHandler) DescribeDomain(ctx context.Context, DescribeRequest *shared.DescribeDomainRequest) (dp1 *shared.DescribeDomainResponse, err error) {
	response, err := g.h.DescribeDomain(ctx, thrift.ToDescribeDomainRequest(DescribeRequest))
	return thrift.FromDescribeDomainResponse(response), thrift.FromError(err)
}

func (g APIHandler) DescribeTaskList(ctx context.Context, Request *shared.DescribeTaskListRequest) (dp1 *shared.DescribeTaskListResponse, err error) {
	response, err := g.h.DescribeTaskList(ctx, thrift.ToDescribeTaskListRequest(Request))
	return thrift.FromDescribeTaskListResponse(response), thrift.FromError(err)
}

func (g APIHandler) DescribeWorkflowExecution(ctx context.Context, DescribeRequest *shared.DescribeWorkflowExecutionRequest) (dp1 *shared.DescribeWorkflowExecutionResponse, err error) {
	response, err := g.h.DescribeWorkflowExecution(ctx, thrift.ToDescribeWorkflowExecutionRequest(DescribeRequest))
	return thrift.FromDescribeWorkflowExecutionResponse(response), thrift.FromError(err)
}

func (g APIHandler) DiagnoseWorkflowExecution(ctx context.Context, DiagnoseRequest *shared.DiagnoseWorkflowExecutionRequest) (dp1 *shared.DiagnoseWorkflowExecutionResponse, err error) {
	response, err := g.h.DiagnoseWorkflowExecution(ctx, thrift.ToDiagnoseWorkflowExecutionRequest(DiagnoseRequest))
	return thrift.FromDiagnoseWorkflowExecutionResponse(response), thrift.FromError(err)
}

func (g APIHandler) FailoverDomain(ctx context.Context, FailoverRequest *shared.FailoverDomainRequest) (fp1 *shared.FailoverDomainResponse, err error) {
	response, err := g.h.FailoverDomain(ctx, thrift.ToFailoverDomainRequest(FailoverRequest))
	return thrift.FromFailoverDomainResponse(response), thrift.FromError(err)
}

func (g APIHandler) GetClusterInfo(ctx context.Context) (cp1 *shared.ClusterInfo, err error) {
	response, err := g.h.GetClusterInfo(ctx)
	return thrift.FromGetClusterInfoResponse(response), thrift.FromError(err)
}

func (g APIHandler) GetSearchAttributes(ctx context.Context) (gp1 *shared.GetSearchAttributesResponse, err error) {
	response, err := g.h.GetSearchAttributes(ctx)
	return thrift.FromGetSearchAttributesResponse(response), thrift.FromError(err)
}

func (g APIHandler) GetTaskListsByDomain(ctx context.Context, Request *shared.GetTaskListsByDomainRequest) (gp1 *shared.GetTaskListsByDomainResponse, err error) {
	response, err := g.h.GetTaskListsByDomain(ctx, thrift.ToGetTaskListsByDomainRequest(Request))
	return thrift.FromGetTaskListsByDomainResponse(response), thrift.FromError(err)
}

func (g APIHandler) GetWorkflowExecutionHistory(ctx context.Context, GetRequest *shared.GetWorkflowExecutionHistoryRequest) (gp1 *shared.GetWorkflowExecutionHistoryResponse, err error) {
	response, err := g.h.GetWorkflowExecutionHistory(ctx, thrift.ToGetWorkflowExecutionHistoryRequest(GetRequest))
	return thrift.FromGetWorkflowExecutionHistoryResponse(response), thrift.FromError(err)
}

func (g APIHandler) ListArchivedWorkflowExecutions(ctx context.Context, ListRequest *shared.ListArchivedWorkflowExecutionsRequest) (lp1 *shared.ListArchivedWorkflowExecutionsResponse, err error) {
	response, err := g.h.ListArchivedWorkflowExecutions(ctx, thrift.ToListArchivedWorkflowExecutionsRequest(ListRequest))
	return thrift.FromListArchivedWorkflowExecutionsResponse(response), thrift.FromError(err)
}

func (g APIHandler) ListClosedWorkflowExecutions(ctx context.Context, ListRequest *shared.ListClosedWorkflowExecutionsRequest) (lp1 *shared.ListClosedWorkflowExecutionsResponse, err error) {
	response, err := g.h.ListClosedWorkflowExecutions(ctx, thrift.ToListClosedWorkflowExecutionsRequest(ListRequest))
	return thrift.FromListClosedWorkflowExecutionsResponse(response), thrift.FromError(err)
}

func (g APIHandler) ListDomains(ctx context.Context, ListRequest *shared.ListDomainsRequest) (lp1 *shared.ListDomainsResponse, err error) {
	response, err := g.h.ListDomains(ctx, thrift.ToListDomainsRequest(ListRequest))
	return thrift.FromListDomainsResponse(response), thrift.FromError(err)
}

func (g APIHandler) ListOpenWorkflowExecutions(ctx context.Context, ListRequest *shared.ListOpenWorkflowExecutionsRequest) (lp1 *shared.ListOpenWorkflowExecutionsResponse, err error) {
	response, err := g.h.ListOpenWorkflowExecutions(ctx, thrift.ToListOpenWorkflowExecutionsRequest(ListRequest))
	return thrift.FromListOpenWorkflowExecutionsResponse(response), thrift.FromError(err)
}

func (g APIHandler) ListTaskListPartitions(ctx context.Context, Request *shared.ListTaskListPartitionsRequest) (lp1 *shared.ListTaskListPartitionsResponse, err error) {
	response, err := g.h.ListTaskListPartitions(ctx, thrift.ToListTaskListPartitionsRequest(Request))
	return thrift.FromListTaskListPartitionsResponse(response), thrift.FromError(err)
}

func (g APIHandler) ListWorkflowExecutions(ctx context.Context, ListRequest *shared.ListWorkflowExecutionsRequest) (lp1 *shared.ListWorkflowExecutionsResponse, err error) {
	response, err := g.h.ListWorkflowExecutions(ctx, thrift.ToListWorkflowExecutionsRequest(ListRequest))
	return thrift.FromListWorkflowExecutionsResponse(response), thrift.FromError(err)
}

func (g APIHandler) PollForActivityTask(ctx context.Context, PollRequest *shared.PollForActivityTaskRequest) (pp1 *shared.PollForActivityTaskResponse, err error) {
	response, err := g.h.PollForActivityTask(ctx, thrift.ToPollForActivityTaskRequest(PollRequest))
	return thrift.FromPollForActivityTaskResponse(response), thrift.FromError(err)
}

func (g APIHandler) PollForDecisionTask(ctx context.Context, PollRequest *shared.PollForDecisionTaskRequest) (pp1 *shared.PollForDecisionTaskResponse, err error) {
	response, err := g.h.PollForDecisionTask(ctx, thrift.ToPollForDecisionTaskRequest(PollRequest))
	return thrift.FromPollForDecisionTaskResponse(response), thrift.FromError(err)
}

func (g APIHandler) QueryWorkflow(ctx context.Context, QueryRequest *shared.QueryWorkflowRequest) (qp1 *shared.QueryWorkflowResponse, err error) {
	response, err := g.h.QueryWorkflow(ctx, thrift.ToQueryWorkflowRequest(QueryRequest))
	return thrift.FromQueryWorkflowResponse(response), thrift.FromError(err)
}

func (g APIHandler) RecordActivityTaskHeartbeat(ctx context.Context, HeartbeatRequest *shared.RecordActivityTaskHeartbeatRequest) (rp1 *shared.RecordActivityTaskHeartbeatResponse, err error) {
	response, err := g.h.RecordActivityTaskHeartbeat(ctx, thrift.ToRecordActivityTaskHeartbeatRequest(HeartbeatRequest))
	return thrift.FromRecordActivityTaskHeartbeatResponse(response), thrift.FromError(err)
}

func (g APIHandler) RecordActivityTaskHeartbeatByID(ctx context.Context, HeartbeatRequest *shared.RecordActivityTaskHeartbeatByIDRequest) (rp1 *shared.RecordActivityTaskHeartbeatResponse, err error) {
	response, err := g.h.RecordActivityTaskHeartbeatByID(ctx, thrift.ToRecordActivityTaskHeartbeatByIDRequest(HeartbeatRequest))
	return thrift.FromRecordActivityTaskHeartbeatByIDResponse(response), thrift.FromError(err)
}

func (g APIHandler) RefreshWorkflowTasks(ctx context.Context, Request *shared.RefreshWorkflowTasksRequest) (err error) {
	err = g.h.RefreshWorkflowTasks(ctx, thrift.ToRefreshWorkflowTasksRequest(Request))
	return thrift.FromError(err)
}

func (g APIHandler) RegisterDomain(ctx context.Context, RegisterRequest *shared.RegisterDomainRequest) (err error) {
	err = g.h.RegisterDomain(ctx, thrift.ToRegisterDomainRequest(RegisterRequest))
	return thrift.FromError(err)
}

func (g APIHandler) RequestCancelWorkflowExecution(ctx context.Context, CancelRequest *shared.RequestCancelWorkflowExecutionRequest) (err error) {
	err = g.h.RequestCancelWorkflowExecution(ctx, thrift.ToRequestCancelWorkflowExecutionRequest(CancelRequest))
	return thrift.FromError(err)
}

func (g APIHandler) ResetStickyTaskList(ctx context.Context, ResetRequest *shared.ResetStickyTaskListRequest) (rp1 *shared.ResetStickyTaskListResponse, err error) {
	response, err := g.h.ResetStickyTaskList(ctx, thrift.ToResetStickyTaskListRequest(ResetRequest))
	return thrift.FromResetStickyTaskListResponse(response), thrift.FromError(err)
}

func (g APIHandler) ResetWorkflowExecution(ctx context.Context, ResetRequest *shared.ResetWorkflowExecutionRequest) (rp1 *shared.ResetWorkflowExecutionResponse, err error) {
	response, err := g.h.ResetWorkflowExecution(ctx, thrift.ToResetWorkflowExecutionRequest(ResetRequest))
	return thrift.FromResetWorkflowExecutionResponse(response), thrift.FromError(err)
}

func (g APIHandler) RespondActivityTaskCanceled(ctx context.Context, CanceledRequest *shared.RespondActivityTaskCanceledRequest) (err error) {
	err = g.h.RespondActivityTaskCanceled(ctx, thrift.ToRespondActivityTaskCanceledRequest(CanceledRequest))
	return thrift.FromError(err)
}

func (g APIHandler) RespondActivityTaskCanceledByID(ctx context.Context, CanceledRequest *shared.RespondActivityTaskCanceledByIDRequest) (err error) {
	err = g.h.RespondActivityTaskCanceledByID(ctx, thrift.ToRespondActivityTaskCanceledByIDRequest(CanceledRequest))
	return thrift.FromError(err)
}

func (g APIHandler) RespondActivityTaskCompleted(ctx context.Context, CompleteRequest *shared.RespondActivityTaskCompletedRequest) (err error) {
	err = g.h.RespondActivityTaskCompleted(ctx, thrift.ToRespondActivityTaskCompletedRequest(CompleteRequest))
	return thrift.FromError(err)
}

func (g APIHandler) RespondActivityTaskCompletedByID(ctx context.Context, CompleteRequest *shared.RespondActivityTaskCompletedByIDRequest) (err error) {
	err = g.h.RespondActivityTaskCompletedByID(ctx, thrift.ToRespondActivityTaskCompletedByIDRequest(CompleteRequest))
	return thrift.FromError(err)
}

func (g APIHandler) RespondActivityTaskFailed(ctx context.Context, FailRequest *shared.RespondActivityTaskFailedRequest) (err error) {
	err = g.h.RespondActivityTaskFailed(ctx, thrift.ToRespondActivityTaskFailedRequest(FailRequest))
	return thrift.FromError(err)
}

func (g APIHandler) RespondActivityTaskFailedByID(ctx context.Context, FailRequest *shared.RespondActivityTaskFailedByIDRequest) (err error) {
	err = g.h.RespondActivityTaskFailedByID(ctx, thrift.ToRespondActivityTaskFailedByIDRequest(FailRequest))
	return thrift.FromError(err)
}

func (g APIHandler) RespondDecisionTaskCompleted(ctx context.Context, CompleteRequest *shared.RespondDecisionTaskCompletedRequest) (rp1 *shared.RespondDecisionTaskCompletedResponse, err error) {
	response, err := g.h.RespondDecisionTaskCompleted(ctx, thrift.ToRespondDecisionTaskCompletedRequest(CompleteRequest))
	return thrift.FromRespondDecisionTaskCompletedResponse(response), thrift.FromError(err)
}

func (g APIHandler) RespondDecisionTaskFailed(ctx context.Context, FailedRequest *shared.RespondDecisionTaskFailedRequest) (err error) {
	err = g.h.RespondDecisionTaskFailed(ctx, thrift.ToRespondDecisionTaskFailedRequest(FailedRequest))
	return thrift.FromError(err)
}

func (g APIHandler) RespondQueryTaskCompleted(ctx context.Context, CompleteRequest *shared.RespondQueryTaskCompletedRequest) (err error) {
	err = g.h.RespondQueryTaskCompleted(ctx, thrift.ToRespondQueryTaskCompletedRequest(CompleteRequest))
	return thrift.FromError(err)
}

func (g APIHandler) RestartWorkflowExecution(ctx context.Context, RestartRequest *shared.RestartWorkflowExecutionRequest) (rp1 *shared.RestartWorkflowExecutionResponse, err error) {
	response, err := g.h.RestartWorkflowExecution(ctx, thrift.ToRestartWorkflowExecutionRequest(RestartRequest))
	return thrift.FromRestartWorkflowExecutionResponse(response), thrift.FromError(err)
}

func (g APIHandler) ScanWorkflowExecutions(ctx context.Context, ListRequest *shared.ListWorkflowExecutionsRequest) (lp1 *shared.ListWorkflowExecutionsResponse, err error) {
	response, err := g.h.ScanWorkflowExecutions(ctx, thrift.ToScanWorkflowExecutionsRequest(ListRequest))
	return thrift.FromScanWorkflowExecutionsResponse(response), thrift.FromError(err)
}

func (g APIHandler) SignalWithStartWorkflowExecution(ctx context.Context, SignalWithStartRequest *shared.SignalWithStartWorkflowExecutionRequest) (sp1 *shared.StartWorkflowExecutionResponse, err error) {
	response, err := g.h.SignalWithStartWorkflowExecution(ctx, thrift.ToSignalWithStartWorkflowExecutionRequest(SignalWithStartRequest))
	return thrift.FromSignalWithStartWorkflowExecutionResponse(response), thrift.FromError(err)
}

func (g APIHandler) SignalWithStartWorkflowExecutionAsync(ctx context.Context, SignalWithStartRequest *shared.SignalWithStartWorkflowExecutionAsyncRequest) (sp1 *shared.SignalWithStartWorkflowExecutionAsyncResponse, err error) {
	response, err := g.h.SignalWithStartWorkflowExecutionAsync(ctx, thrift.ToSignalWithStartWorkflowExecutionAsyncRequest(SignalWithStartRequest))
	return thrift.FromSignalWithStartWorkflowExecutionAsyncResponse(response), thrift.FromError(err)
}

func (g APIHandler) SignalWorkflowExecution(ctx context.Context, SignalRequest *shared.SignalWorkflowExecutionRequest) (err error) {
	err = g.h.SignalWorkflowExecution(ctx, thrift.ToSignalWorkflowExecutionRequest(SignalRequest))
	return thrift.FromError(err)
}

func (g APIHandler) StartWorkflowExecution(ctx context.Context, StartRequest *shared.StartWorkflowExecutionRequest) (sp1 *shared.StartWorkflowExecutionResponse, err error) {
	response, err := g.h.StartWorkflowExecution(ctx, thrift.ToStartWorkflowExecutionRequest(StartRequest))
	return thrift.FromStartWorkflowExecutionResponse(response), thrift.FromError(err)
}

func (g APIHandler) StartWorkflowExecutionAsync(ctx context.Context, StartRequest *shared.StartWorkflowExecutionAsyncRequest) (sp1 *shared.StartWorkflowExecutionAsyncResponse, err error) {
	response, err := g.h.StartWorkflowExecutionAsync(ctx, thrift.ToStartWorkflowExecutionAsyncRequest(StartRequest))
	return thrift.FromStartWorkflowExecutionAsyncResponse(response), thrift.FromError(err)
}

func (g APIHandler) TerminateWorkflowExecution(ctx context.Context, TerminateRequest *shared.TerminateWorkflowExecutionRequest) (err error) {
	err = g.h.TerminateWorkflowExecution(ctx, thrift.ToTerminateWorkflowExecutionRequest(TerminateRequest))
	return thrift.FromError(err)
}

func (g APIHandler) UpdateDomain(ctx context.Context, UpdateRequest *shared.UpdateDomainRequest) (up1 *shared.UpdateDomainResponse, err error) {
	response, err := g.h.UpdateDomain(ctx, thrift.ToUpdateDomainRequest(UpdateRequest))
	return thrift.FromUpdateDomainResponse(response), thrift.FromError(err)
}
