// Code generated by thriftrw-plugin-yarpc
// @generated

package historyserviceserver

import (
	context "context"

	stream "go.uber.org/thriftrw/protocol/stream"
	wire "go.uber.org/thriftrw/wire"
	transport "go.uber.org/yarpc/api/transport"
	thrift "go.uber.org/yarpc/encoding/thrift"
	yarpcerrors "go.uber.org/yarpc/yarpcerrors"

	history "github.com/uber/cadence/.gen/go/history"
	replicator "github.com/uber/cadence/.gen/go/replicator"
	shared "github.com/uber/cadence/.gen/go/shared"
)

// Interface is the server-side interface for the HistoryService service.
type Interface interface {
	CloseShard(
		ctx context.Context,
		Request *shared.CloseShardRequest,
	) error

	DescribeHistoryHost(
		ctx context.Context,
		Request *shared.DescribeHistoryHostRequest,
	) (*shared.DescribeHistoryHostResponse, error)

	DescribeMutableState(
		ctx context.Context,
		Request *history.DescribeMutableStateRequest,
	) (*history.DescribeMutableStateResponse, error)

	DescribeQueue(
		ctx context.Context,
		Request *shared.DescribeQueueRequest,
	) (*shared.DescribeQueueResponse, error)

	DescribeWorkflowExecution(
		ctx context.Context,
		DescribeRequest *history.DescribeWorkflowExecutionRequest,
	) (*shared.DescribeWorkflowExecutionResponse, error)

	GetCrossClusterTasks(
		ctx context.Context,
		Request *shared.GetCrossClusterTasksRequest,
	) (*shared.GetCrossClusterTasksResponse, error)

	GetDLQReplicationMessages(
		ctx context.Context,
		Request *replicator.GetDLQReplicationMessagesRequest,
	) (*replicator.GetDLQReplicationMessagesResponse, error)

	GetFailoverInfo(
		ctx context.Context,
		Request *history.GetFailoverInfoRequest,
	) (*history.GetFailoverInfoResponse, error)

	GetMutableState(
		ctx context.Context,
		GetRequest *history.GetMutableStateRequest,
	) (*history.GetMutableStateResponse, error)

	GetReplicationMessages(
		ctx context.Context,
		Request *replicator.GetReplicationMessagesRequest,
	) (*replicator.GetReplicationMessagesResponse, error)

	MergeDLQMessages(
		ctx context.Context,
		Request *replicator.MergeDLQMessagesRequest,
	) (*replicator.MergeDLQMessagesResponse, error)

	NotifyFailoverMarkers(
		ctx context.Context,
		Request *history.NotifyFailoverMarkersRequest,
	) error

	PollMutableState(
		ctx context.Context,
		PollRequest *history.PollMutableStateRequest,
	) (*history.PollMutableStateResponse, error)

	PurgeDLQMessages(
		ctx context.Context,
		Request *replicator.PurgeDLQMessagesRequest,
	) error

	QueryWorkflow(
		ctx context.Context,
		QueryRequest *history.QueryWorkflowRequest,
	) (*history.QueryWorkflowResponse, error)

	RatelimitUpdate(
		ctx context.Context,
		Request *history.RatelimitUpdateRequest,
	) (*history.RatelimitUpdateResponse, error)

	ReadDLQMessages(
		ctx context.Context,
		Request *replicator.ReadDLQMessagesRequest,
	) (*replicator.ReadDLQMessagesResponse, error)

	ReapplyEvents(
		ctx context.Context,
		ReapplyEventsRequest *history.ReapplyEventsRequest,
	) error

	RecordActivityTaskHeartbeat(
		ctx context.Context,
		HeartbeatRequest *history.RecordActivityTaskHeartbeatRequest,
	) (*shared.RecordActivityTaskHeartbeatResponse, error)

	RecordActivityTaskStarted(
		ctx context.Context,
		AddRequest *history.RecordActivityTaskStartedRequest,
	) (*history.RecordActivityTaskStartedResponse, error)

	RecordChildExecutionCompleted(
		ctx context.Context,
		CompletionRequest *history.RecordChildExecutionCompletedRequest,
	) error

	RecordDecisionTaskStarted(
		ctx context.Context,
		AddRequest *history.RecordDecisionTaskStartedRequest,
	) (*history.RecordDecisionTaskStartedResponse, error)

	RefreshWorkflowTasks(
		ctx context.Context,
		Request *history.RefreshWorkflowTasksRequest,
	) error

	RemoveSignalMutableState(
		ctx context.Context,
		RemoveRequest *history.RemoveSignalMutableStateRequest,
	) error

	RemoveTask(
		ctx context.Context,
		Request *shared.RemoveTaskRequest,
	) error

	ReplicateEventsV2(
		ctx context.Context,
		ReplicateV2Request *history.ReplicateEventsV2Request,
	) error

	RequestCancelWorkflowExecution(
		ctx context.Context,
		CancelRequest *history.RequestCancelWorkflowExecutionRequest,
	) error

	ResetQueue(
		ctx context.Context,
		Request *shared.ResetQueueRequest,
	) error

	ResetStickyTaskList(
		ctx context.Context,
		ResetRequest *history.ResetStickyTaskListRequest,
	) (*history.ResetStickyTaskListResponse, error)

	ResetWorkflowExecution(
		ctx context.Context,
		ResetRequest *history.ResetWorkflowExecutionRequest,
	) (*shared.ResetWorkflowExecutionResponse, error)

	RespondActivityTaskCanceled(
		ctx context.Context,
		CanceledRequest *history.RespondActivityTaskCanceledRequest,
	) error

	RespondActivityTaskCompleted(
		ctx context.Context,
		CompleteRequest *history.RespondActivityTaskCompletedRequest,
	) error

	RespondActivityTaskFailed(
		ctx context.Context,
		FailRequest *history.RespondActivityTaskFailedRequest,
	) error

	RespondCrossClusterTasksCompleted(
		ctx context.Context,
		Request *shared.RespondCrossClusterTasksCompletedRequest,
	) (*shared.RespondCrossClusterTasksCompletedResponse, error)

	RespondDecisionTaskCompleted(
		ctx context.Context,
		CompleteRequest *history.RespondDecisionTaskCompletedRequest,
	) (*history.RespondDecisionTaskCompletedResponse, error)

	RespondDecisionTaskFailed(
		ctx context.Context,
		FailedRequest *history.RespondDecisionTaskFailedRequest,
	) error

	ScheduleDecisionTask(
		ctx context.Context,
		ScheduleRequest *history.ScheduleDecisionTaskRequest,
	) error

	SignalWithStartWorkflowExecution(
		ctx context.Context,
		SignalWithStartRequest *history.SignalWithStartWorkflowExecutionRequest,
	) (*shared.StartWorkflowExecutionResponse, error)

	SignalWorkflowExecution(
		ctx context.Context,
		SignalRequest *history.SignalWorkflowExecutionRequest,
	) error

	StartWorkflowExecution(
		ctx context.Context,
		StartRequest *history.StartWorkflowExecutionRequest,
	) (*shared.StartWorkflowExecutionResponse, error)

	SyncActivity(
		ctx context.Context,
		SyncActivityRequest *history.SyncActivityRequest,
	) error

	SyncShardStatus(
		ctx context.Context,
		SyncShardStatusRequest *history.SyncShardStatusRequest,
	) error

	TerminateWorkflowExecution(
		ctx context.Context,
		TerminateRequest *history.TerminateWorkflowExecutionRequest,
	) error
}

// New prepares an implementation of the HistoryService service for
// registration.
//
//	handler := HistoryServiceHandler{}
//	dispatcher.Register(historyserviceserver.New(handler))
func New(impl Interface, opts ...thrift.RegisterOption) []transport.Procedure {
	h := handler{impl}
	service := thrift.Service{
		Name: "HistoryService",
		Methods: []thrift.Method{

			thrift.Method{
				Name: "CloseShard",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.CloseShard),
					NoWire: closeshard_NoWireHandler{impl},
				},
				Signature:    "CloseShard(Request *shared.CloseShardRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "DescribeHistoryHost",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.DescribeHistoryHost),
					NoWire: describehistoryhost_NoWireHandler{impl},
				},
				Signature:    "DescribeHistoryHost(Request *shared.DescribeHistoryHostRequest) (*shared.DescribeHistoryHostResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "DescribeMutableState",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.DescribeMutableState),
					NoWire: describemutablestate_NoWireHandler{impl},
				},
				Signature:    "DescribeMutableState(Request *history.DescribeMutableStateRequest) (*history.DescribeMutableStateResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "DescribeQueue",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.DescribeQueue),
					NoWire: describequeue_NoWireHandler{impl},
				},
				Signature:    "DescribeQueue(Request *shared.DescribeQueueRequest) (*shared.DescribeQueueResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "DescribeWorkflowExecution",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.DescribeWorkflowExecution),
					NoWire: describeworkflowexecution_NoWireHandler{impl},
				},
				Signature:    "DescribeWorkflowExecution(DescribeRequest *history.DescribeWorkflowExecutionRequest) (*shared.DescribeWorkflowExecutionResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "GetCrossClusterTasks",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.GetCrossClusterTasks),
					NoWire: getcrossclustertasks_NoWireHandler{impl},
				},
				Signature:    "GetCrossClusterTasks(Request *shared.GetCrossClusterTasksRequest) (*shared.GetCrossClusterTasksResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "GetDLQReplicationMessages",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.GetDLQReplicationMessages),
					NoWire: getdlqreplicationmessages_NoWireHandler{impl},
				},
				Signature:    "GetDLQReplicationMessages(Request *replicator.GetDLQReplicationMessagesRequest) (*replicator.GetDLQReplicationMessagesResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "GetFailoverInfo",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.GetFailoverInfo),
					NoWire: getfailoverinfo_NoWireHandler{impl},
				},
				Signature:    "GetFailoverInfo(Request *history.GetFailoverInfoRequest) (*history.GetFailoverInfoResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "GetMutableState",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.GetMutableState),
					NoWire: getmutablestate_NoWireHandler{impl},
				},
				Signature:    "GetMutableState(GetRequest *history.GetMutableStateRequest) (*history.GetMutableStateResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "GetReplicationMessages",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.GetReplicationMessages),
					NoWire: getreplicationmessages_NoWireHandler{impl},
				},
				Signature:    "GetReplicationMessages(Request *replicator.GetReplicationMessagesRequest) (*replicator.GetReplicationMessagesResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "MergeDLQMessages",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.MergeDLQMessages),
					NoWire: mergedlqmessages_NoWireHandler{impl},
				},
				Signature:    "MergeDLQMessages(Request *replicator.MergeDLQMessagesRequest) (*replicator.MergeDLQMessagesResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "NotifyFailoverMarkers",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.NotifyFailoverMarkers),
					NoWire: notifyfailovermarkers_NoWireHandler{impl},
				},
				Signature:    "NotifyFailoverMarkers(Request *history.NotifyFailoverMarkersRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "PollMutableState",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.PollMutableState),
					NoWire: pollmutablestate_NoWireHandler{impl},
				},
				Signature:    "PollMutableState(PollRequest *history.PollMutableStateRequest) (*history.PollMutableStateResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "PurgeDLQMessages",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.PurgeDLQMessages),
					NoWire: purgedlqmessages_NoWireHandler{impl},
				},
				Signature:    "PurgeDLQMessages(Request *replicator.PurgeDLQMessagesRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "QueryWorkflow",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.QueryWorkflow),
					NoWire: queryworkflow_NoWireHandler{impl},
				},
				Signature:    "QueryWorkflow(QueryRequest *history.QueryWorkflowRequest) (*history.QueryWorkflowResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RatelimitUpdate",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RatelimitUpdate),
					NoWire: ratelimitupdate_NoWireHandler{impl},
				},
				Signature:    "RatelimitUpdate(Request *history.RatelimitUpdateRequest) (*history.RatelimitUpdateResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "ReadDLQMessages",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.ReadDLQMessages),
					NoWire: readdlqmessages_NoWireHandler{impl},
				},
				Signature:    "ReadDLQMessages(Request *replicator.ReadDLQMessagesRequest) (*replicator.ReadDLQMessagesResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "ReapplyEvents",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.ReapplyEvents),
					NoWire: reapplyevents_NoWireHandler{impl},
				},
				Signature:    "ReapplyEvents(ReapplyEventsRequest *history.ReapplyEventsRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RecordActivityTaskHeartbeat",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RecordActivityTaskHeartbeat),
					NoWire: recordactivitytaskheartbeat_NoWireHandler{impl},
				},
				Signature:    "RecordActivityTaskHeartbeat(HeartbeatRequest *history.RecordActivityTaskHeartbeatRequest) (*shared.RecordActivityTaskHeartbeatResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RecordActivityTaskStarted",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RecordActivityTaskStarted),
					NoWire: recordactivitytaskstarted_NoWireHandler{impl},
				},
				Signature:    "RecordActivityTaskStarted(AddRequest *history.RecordActivityTaskStartedRequest) (*history.RecordActivityTaskStartedResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RecordChildExecutionCompleted",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RecordChildExecutionCompleted),
					NoWire: recordchildexecutioncompleted_NoWireHandler{impl},
				},
				Signature:    "RecordChildExecutionCompleted(CompletionRequest *history.RecordChildExecutionCompletedRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RecordDecisionTaskStarted",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RecordDecisionTaskStarted),
					NoWire: recorddecisiontaskstarted_NoWireHandler{impl},
				},
				Signature:    "RecordDecisionTaskStarted(AddRequest *history.RecordDecisionTaskStartedRequest) (*history.RecordDecisionTaskStartedResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RefreshWorkflowTasks",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RefreshWorkflowTasks),
					NoWire: refreshworkflowtasks_NoWireHandler{impl},
				},
				Signature:    "RefreshWorkflowTasks(Request *history.RefreshWorkflowTasksRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RemoveSignalMutableState",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RemoveSignalMutableState),
					NoWire: removesignalmutablestate_NoWireHandler{impl},
				},
				Signature:    "RemoveSignalMutableState(RemoveRequest *history.RemoveSignalMutableStateRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RemoveTask",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RemoveTask),
					NoWire: removetask_NoWireHandler{impl},
				},
				Signature:    "RemoveTask(Request *shared.RemoveTaskRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "ReplicateEventsV2",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.ReplicateEventsV2),
					NoWire: replicateeventsv2_NoWireHandler{impl},
				},
				Signature:    "ReplicateEventsV2(ReplicateV2Request *history.ReplicateEventsV2Request)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RequestCancelWorkflowExecution",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RequestCancelWorkflowExecution),
					NoWire: requestcancelworkflowexecution_NoWireHandler{impl},
				},
				Signature:    "RequestCancelWorkflowExecution(CancelRequest *history.RequestCancelWorkflowExecutionRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "ResetQueue",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.ResetQueue),
					NoWire: resetqueue_NoWireHandler{impl},
				},
				Signature:    "ResetQueue(Request *shared.ResetQueueRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "ResetStickyTaskList",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.ResetStickyTaskList),
					NoWire: resetstickytasklist_NoWireHandler{impl},
				},
				Signature:    "ResetStickyTaskList(ResetRequest *history.ResetStickyTaskListRequest) (*history.ResetStickyTaskListResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "ResetWorkflowExecution",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.ResetWorkflowExecution),
					NoWire: resetworkflowexecution_NoWireHandler{impl},
				},
				Signature:    "ResetWorkflowExecution(ResetRequest *history.ResetWorkflowExecutionRequest) (*shared.ResetWorkflowExecutionResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RespondActivityTaskCanceled",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RespondActivityTaskCanceled),
					NoWire: respondactivitytaskcanceled_NoWireHandler{impl},
				},
				Signature:    "RespondActivityTaskCanceled(CanceledRequest *history.RespondActivityTaskCanceledRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RespondActivityTaskCompleted",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RespondActivityTaskCompleted),
					NoWire: respondactivitytaskcompleted_NoWireHandler{impl},
				},
				Signature:    "RespondActivityTaskCompleted(CompleteRequest *history.RespondActivityTaskCompletedRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RespondActivityTaskFailed",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RespondActivityTaskFailed),
					NoWire: respondactivitytaskfailed_NoWireHandler{impl},
				},
				Signature:    "RespondActivityTaskFailed(FailRequest *history.RespondActivityTaskFailedRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RespondCrossClusterTasksCompleted",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RespondCrossClusterTasksCompleted),
					NoWire: respondcrossclustertaskscompleted_NoWireHandler{impl},
				},
				Signature:    "RespondCrossClusterTasksCompleted(Request *shared.RespondCrossClusterTasksCompletedRequest) (*shared.RespondCrossClusterTasksCompletedResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RespondDecisionTaskCompleted",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RespondDecisionTaskCompleted),
					NoWire: responddecisiontaskcompleted_NoWireHandler{impl},
				},
				Signature:    "RespondDecisionTaskCompleted(CompleteRequest *history.RespondDecisionTaskCompletedRequest) (*history.RespondDecisionTaskCompletedResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "RespondDecisionTaskFailed",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.RespondDecisionTaskFailed),
					NoWire: responddecisiontaskfailed_NoWireHandler{impl},
				},
				Signature:    "RespondDecisionTaskFailed(FailedRequest *history.RespondDecisionTaskFailedRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "ScheduleDecisionTask",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.ScheduleDecisionTask),
					NoWire: scheduledecisiontask_NoWireHandler{impl},
				},
				Signature:    "ScheduleDecisionTask(ScheduleRequest *history.ScheduleDecisionTaskRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "SignalWithStartWorkflowExecution",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.SignalWithStartWorkflowExecution),
					NoWire: signalwithstartworkflowexecution_NoWireHandler{impl},
				},
				Signature:    "SignalWithStartWorkflowExecution(SignalWithStartRequest *history.SignalWithStartWorkflowExecutionRequest) (*shared.StartWorkflowExecutionResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "SignalWorkflowExecution",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.SignalWorkflowExecution),
					NoWire: signalworkflowexecution_NoWireHandler{impl},
				},
				Signature:    "SignalWorkflowExecution(SignalRequest *history.SignalWorkflowExecutionRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "StartWorkflowExecution",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.StartWorkflowExecution),
					NoWire: startworkflowexecution_NoWireHandler{impl},
				},
				Signature:    "StartWorkflowExecution(StartRequest *history.StartWorkflowExecutionRequest) (*shared.StartWorkflowExecutionResponse)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "SyncActivity",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.SyncActivity),
					NoWire: syncactivity_NoWireHandler{impl},
				},
				Signature:    "SyncActivity(SyncActivityRequest *history.SyncActivityRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "SyncShardStatus",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.SyncShardStatus),
					NoWire: syncshardstatus_NoWireHandler{impl},
				},
				Signature:    "SyncShardStatus(SyncShardStatusRequest *history.SyncShardStatusRequest)",
				ThriftModule: history.ThriftModule,
			},

			thrift.Method{
				Name: "TerminateWorkflowExecution",
				HandlerSpec: thrift.HandlerSpec{

					Type:   transport.Unary,
					Unary:  thrift.UnaryHandler(h.TerminateWorkflowExecution),
					NoWire: terminateworkflowexecution_NoWireHandler{impl},
				},
				Signature:    "TerminateWorkflowExecution(TerminateRequest *history.TerminateWorkflowExecutionRequest)",
				ThriftModule: history.ThriftModule,
			},
		},
	}

	procedures := make([]transport.Procedure, 0, 43)
	procedures = append(procedures, thrift.BuildProcedures(service, opts...)...)
	return procedures
}

type handler struct{ impl Interface }

type yarpcErrorNamer interface{ YARPCErrorName() string }

type yarpcErrorCoder interface{ YARPCErrorCode() *yarpcerrors.Code }

func (h handler) CloseShard(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_CloseShard_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'CloseShard': %w", err)
	}

	appErr := h.impl.CloseShard(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_CloseShard_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) DescribeHistoryHost(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_DescribeHistoryHost_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'DescribeHistoryHost': %w", err)
	}

	success, appErr := h.impl.DescribeHistoryHost(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_DescribeHistoryHost_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) DescribeMutableState(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_DescribeMutableState_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'DescribeMutableState': %w", err)
	}

	success, appErr := h.impl.DescribeMutableState(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_DescribeMutableState_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) DescribeQueue(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_DescribeQueue_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'DescribeQueue': %w", err)
	}

	success, appErr := h.impl.DescribeQueue(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_DescribeQueue_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) DescribeWorkflowExecution(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_DescribeWorkflowExecution_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'DescribeWorkflowExecution': %w", err)
	}

	success, appErr := h.impl.DescribeWorkflowExecution(ctx, args.DescribeRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_DescribeWorkflowExecution_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) GetCrossClusterTasks(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_GetCrossClusterTasks_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'GetCrossClusterTasks': %w", err)
	}

	success, appErr := h.impl.GetCrossClusterTasks(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_GetCrossClusterTasks_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) GetDLQReplicationMessages(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_GetDLQReplicationMessages_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'GetDLQReplicationMessages': %w", err)
	}

	success, appErr := h.impl.GetDLQReplicationMessages(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_GetDLQReplicationMessages_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) GetFailoverInfo(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_GetFailoverInfo_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'GetFailoverInfo': %w", err)
	}

	success, appErr := h.impl.GetFailoverInfo(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_GetFailoverInfo_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) GetMutableState(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_GetMutableState_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'GetMutableState': %w", err)
	}

	success, appErr := h.impl.GetMutableState(ctx, args.GetRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_GetMutableState_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) GetReplicationMessages(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_GetReplicationMessages_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'GetReplicationMessages': %w", err)
	}

	success, appErr := h.impl.GetReplicationMessages(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_GetReplicationMessages_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) MergeDLQMessages(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_MergeDLQMessages_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'MergeDLQMessages': %w", err)
	}

	success, appErr := h.impl.MergeDLQMessages(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_MergeDLQMessages_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) NotifyFailoverMarkers(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_NotifyFailoverMarkers_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'NotifyFailoverMarkers': %w", err)
	}

	appErr := h.impl.NotifyFailoverMarkers(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_NotifyFailoverMarkers_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) PollMutableState(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_PollMutableState_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'PollMutableState': %w", err)
	}

	success, appErr := h.impl.PollMutableState(ctx, args.PollRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_PollMutableState_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) PurgeDLQMessages(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_PurgeDLQMessages_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'PurgeDLQMessages': %w", err)
	}

	appErr := h.impl.PurgeDLQMessages(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_PurgeDLQMessages_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) QueryWorkflow(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_QueryWorkflow_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'QueryWorkflow': %w", err)
	}

	success, appErr := h.impl.QueryWorkflow(ctx, args.QueryRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_QueryWorkflow_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RatelimitUpdate(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RatelimitUpdate_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RatelimitUpdate': %w", err)
	}

	success, appErr := h.impl.RatelimitUpdate(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_RatelimitUpdate_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) ReadDLQMessages(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_ReadDLQMessages_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'ReadDLQMessages': %w", err)
	}

	success, appErr := h.impl.ReadDLQMessages(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_ReadDLQMessages_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) ReapplyEvents(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_ReapplyEvents_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'ReapplyEvents': %w", err)
	}

	appErr := h.impl.ReapplyEvents(ctx, args.ReapplyEventsRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_ReapplyEvents_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RecordActivityTaskHeartbeat(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RecordActivityTaskHeartbeat_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RecordActivityTaskHeartbeat': %w", err)
	}

	success, appErr := h.impl.RecordActivityTaskHeartbeat(ctx, args.HeartbeatRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RecordActivityTaskHeartbeat_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RecordActivityTaskStarted(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RecordActivityTaskStarted_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RecordActivityTaskStarted': %w", err)
	}

	success, appErr := h.impl.RecordActivityTaskStarted(ctx, args.AddRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RecordActivityTaskStarted_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RecordChildExecutionCompleted(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RecordChildExecutionCompleted_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RecordChildExecutionCompleted': %w", err)
	}

	appErr := h.impl.RecordChildExecutionCompleted(ctx, args.CompletionRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RecordChildExecutionCompleted_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RecordDecisionTaskStarted(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RecordDecisionTaskStarted_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RecordDecisionTaskStarted': %w", err)
	}

	success, appErr := h.impl.RecordDecisionTaskStarted(ctx, args.AddRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RecordDecisionTaskStarted_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RefreshWorkflowTasks(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RefreshWorkflowTasks_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RefreshWorkflowTasks': %w", err)
	}

	appErr := h.impl.RefreshWorkflowTasks(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_RefreshWorkflowTasks_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RemoveSignalMutableState(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RemoveSignalMutableState_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RemoveSignalMutableState': %w", err)
	}

	appErr := h.impl.RemoveSignalMutableState(ctx, args.RemoveRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RemoveSignalMutableState_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RemoveTask(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RemoveTask_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RemoveTask': %w", err)
	}

	appErr := h.impl.RemoveTask(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_RemoveTask_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) ReplicateEventsV2(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_ReplicateEventsV2_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'ReplicateEventsV2': %w", err)
	}

	appErr := h.impl.ReplicateEventsV2(ctx, args.ReplicateV2Request)

	hadError := appErr != nil
	result, err := history.HistoryService_ReplicateEventsV2_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RequestCancelWorkflowExecution(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RequestCancelWorkflowExecution_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RequestCancelWorkflowExecution': %w", err)
	}

	appErr := h.impl.RequestCancelWorkflowExecution(ctx, args.CancelRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RequestCancelWorkflowExecution_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) ResetQueue(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_ResetQueue_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'ResetQueue': %w", err)
	}

	appErr := h.impl.ResetQueue(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_ResetQueue_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) ResetStickyTaskList(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_ResetStickyTaskList_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'ResetStickyTaskList': %w", err)
	}

	success, appErr := h.impl.ResetStickyTaskList(ctx, args.ResetRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_ResetStickyTaskList_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) ResetWorkflowExecution(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_ResetWorkflowExecution_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'ResetWorkflowExecution': %w", err)
	}

	success, appErr := h.impl.ResetWorkflowExecution(ctx, args.ResetRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_ResetWorkflowExecution_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RespondActivityTaskCanceled(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RespondActivityTaskCanceled_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RespondActivityTaskCanceled': %w", err)
	}

	appErr := h.impl.RespondActivityTaskCanceled(ctx, args.CanceledRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondActivityTaskCanceled_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RespondActivityTaskCompleted(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RespondActivityTaskCompleted_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RespondActivityTaskCompleted': %w", err)
	}

	appErr := h.impl.RespondActivityTaskCompleted(ctx, args.CompleteRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondActivityTaskCompleted_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RespondActivityTaskFailed(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RespondActivityTaskFailed_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RespondActivityTaskFailed': %w", err)
	}

	appErr := h.impl.RespondActivityTaskFailed(ctx, args.FailRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondActivityTaskFailed_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RespondCrossClusterTasksCompleted(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RespondCrossClusterTasksCompleted_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RespondCrossClusterTasksCompleted': %w", err)
	}

	success, appErr := h.impl.RespondCrossClusterTasksCompleted(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondCrossClusterTasksCompleted_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RespondDecisionTaskCompleted(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RespondDecisionTaskCompleted_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RespondDecisionTaskCompleted': %w", err)
	}

	success, appErr := h.impl.RespondDecisionTaskCompleted(ctx, args.CompleteRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondDecisionTaskCompleted_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) RespondDecisionTaskFailed(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_RespondDecisionTaskFailed_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'RespondDecisionTaskFailed': %w", err)
	}

	appErr := h.impl.RespondDecisionTaskFailed(ctx, args.FailedRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondDecisionTaskFailed_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) ScheduleDecisionTask(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_ScheduleDecisionTask_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'ScheduleDecisionTask': %w", err)
	}

	appErr := h.impl.ScheduleDecisionTask(ctx, args.ScheduleRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_ScheduleDecisionTask_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) SignalWithStartWorkflowExecution(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_SignalWithStartWorkflowExecution_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'SignalWithStartWorkflowExecution': %w", err)
	}

	success, appErr := h.impl.SignalWithStartWorkflowExecution(ctx, args.SignalWithStartRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_SignalWithStartWorkflowExecution_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) SignalWorkflowExecution(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_SignalWorkflowExecution_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'SignalWorkflowExecution': %w", err)
	}

	appErr := h.impl.SignalWorkflowExecution(ctx, args.SignalRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_SignalWorkflowExecution_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) StartWorkflowExecution(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_StartWorkflowExecution_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'StartWorkflowExecution': %w", err)
	}

	success, appErr := h.impl.StartWorkflowExecution(ctx, args.StartRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_StartWorkflowExecution_Helper.WrapResponse(success, appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) SyncActivity(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_SyncActivity_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'SyncActivity': %w", err)
	}

	appErr := h.impl.SyncActivity(ctx, args.SyncActivityRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_SyncActivity_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) SyncShardStatus(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_SyncShardStatus_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'SyncShardStatus': %w", err)
	}

	appErr := h.impl.SyncShardStatus(ctx, args.SyncShardStatusRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_SyncShardStatus_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

func (h handler) TerminateWorkflowExecution(ctx context.Context, body wire.Value) (thrift.Response, error) {
	var args history.HistoryService_TerminateWorkflowExecution_Args
	if err := args.FromWire(body); err != nil {
		return thrift.Response{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode Thrift request for service 'HistoryService' procedure 'TerminateWorkflowExecution': %w", err)
	}

	appErr := h.impl.TerminateWorkflowExecution(ctx, args.TerminateRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_TerminateWorkflowExecution_Helper.WrapResponse(appErr)

	var response thrift.Response
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}

	return response, err
}

type closeshard_NoWireHandler struct{ impl Interface }

func (h closeshard_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_CloseShard_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'CloseShard': %w", err)
	}

	appErr := h.impl.CloseShard(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_CloseShard_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type describehistoryhost_NoWireHandler struct{ impl Interface }

func (h describehistoryhost_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_DescribeHistoryHost_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'DescribeHistoryHost': %w", err)
	}

	success, appErr := h.impl.DescribeHistoryHost(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_DescribeHistoryHost_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type describemutablestate_NoWireHandler struct{ impl Interface }

func (h describemutablestate_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_DescribeMutableState_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'DescribeMutableState': %w", err)
	}

	success, appErr := h.impl.DescribeMutableState(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_DescribeMutableState_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type describequeue_NoWireHandler struct{ impl Interface }

func (h describequeue_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_DescribeQueue_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'DescribeQueue': %w", err)
	}

	success, appErr := h.impl.DescribeQueue(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_DescribeQueue_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type describeworkflowexecution_NoWireHandler struct{ impl Interface }

func (h describeworkflowexecution_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_DescribeWorkflowExecution_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'DescribeWorkflowExecution': %w", err)
	}

	success, appErr := h.impl.DescribeWorkflowExecution(ctx, args.DescribeRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_DescribeWorkflowExecution_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type getcrossclustertasks_NoWireHandler struct{ impl Interface }

func (h getcrossclustertasks_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_GetCrossClusterTasks_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'GetCrossClusterTasks': %w", err)
	}

	success, appErr := h.impl.GetCrossClusterTasks(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_GetCrossClusterTasks_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type getdlqreplicationmessages_NoWireHandler struct{ impl Interface }

func (h getdlqreplicationmessages_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_GetDLQReplicationMessages_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'GetDLQReplicationMessages': %w", err)
	}

	success, appErr := h.impl.GetDLQReplicationMessages(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_GetDLQReplicationMessages_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type getfailoverinfo_NoWireHandler struct{ impl Interface }

func (h getfailoverinfo_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_GetFailoverInfo_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'GetFailoverInfo': %w", err)
	}

	success, appErr := h.impl.GetFailoverInfo(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_GetFailoverInfo_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type getmutablestate_NoWireHandler struct{ impl Interface }

func (h getmutablestate_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_GetMutableState_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'GetMutableState': %w", err)
	}

	success, appErr := h.impl.GetMutableState(ctx, args.GetRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_GetMutableState_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type getreplicationmessages_NoWireHandler struct{ impl Interface }

func (h getreplicationmessages_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_GetReplicationMessages_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'GetReplicationMessages': %w", err)
	}

	success, appErr := h.impl.GetReplicationMessages(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_GetReplicationMessages_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type mergedlqmessages_NoWireHandler struct{ impl Interface }

func (h mergedlqmessages_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_MergeDLQMessages_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'MergeDLQMessages': %w", err)
	}

	success, appErr := h.impl.MergeDLQMessages(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_MergeDLQMessages_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type notifyfailovermarkers_NoWireHandler struct{ impl Interface }

func (h notifyfailovermarkers_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_NotifyFailoverMarkers_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'NotifyFailoverMarkers': %w", err)
	}

	appErr := h.impl.NotifyFailoverMarkers(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_NotifyFailoverMarkers_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type pollmutablestate_NoWireHandler struct{ impl Interface }

func (h pollmutablestate_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_PollMutableState_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'PollMutableState': %w", err)
	}

	success, appErr := h.impl.PollMutableState(ctx, args.PollRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_PollMutableState_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type purgedlqmessages_NoWireHandler struct{ impl Interface }

func (h purgedlqmessages_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_PurgeDLQMessages_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'PurgeDLQMessages': %w", err)
	}

	appErr := h.impl.PurgeDLQMessages(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_PurgeDLQMessages_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type queryworkflow_NoWireHandler struct{ impl Interface }

func (h queryworkflow_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_QueryWorkflow_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'QueryWorkflow': %w", err)
	}

	success, appErr := h.impl.QueryWorkflow(ctx, args.QueryRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_QueryWorkflow_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type ratelimitupdate_NoWireHandler struct{ impl Interface }

func (h ratelimitupdate_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RatelimitUpdate_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RatelimitUpdate': %w", err)
	}

	success, appErr := h.impl.RatelimitUpdate(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_RatelimitUpdate_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type readdlqmessages_NoWireHandler struct{ impl Interface }

func (h readdlqmessages_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_ReadDLQMessages_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'ReadDLQMessages': %w", err)
	}

	success, appErr := h.impl.ReadDLQMessages(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_ReadDLQMessages_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type reapplyevents_NoWireHandler struct{ impl Interface }

func (h reapplyevents_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_ReapplyEvents_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'ReapplyEvents': %w", err)
	}

	appErr := h.impl.ReapplyEvents(ctx, args.ReapplyEventsRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_ReapplyEvents_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type recordactivitytaskheartbeat_NoWireHandler struct{ impl Interface }

func (h recordactivitytaskheartbeat_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RecordActivityTaskHeartbeat_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RecordActivityTaskHeartbeat': %w", err)
	}

	success, appErr := h.impl.RecordActivityTaskHeartbeat(ctx, args.HeartbeatRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RecordActivityTaskHeartbeat_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type recordactivitytaskstarted_NoWireHandler struct{ impl Interface }

func (h recordactivitytaskstarted_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RecordActivityTaskStarted_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RecordActivityTaskStarted': %w", err)
	}

	success, appErr := h.impl.RecordActivityTaskStarted(ctx, args.AddRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RecordActivityTaskStarted_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type recordchildexecutioncompleted_NoWireHandler struct{ impl Interface }

func (h recordchildexecutioncompleted_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RecordChildExecutionCompleted_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RecordChildExecutionCompleted': %w", err)
	}

	appErr := h.impl.RecordChildExecutionCompleted(ctx, args.CompletionRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RecordChildExecutionCompleted_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type recorddecisiontaskstarted_NoWireHandler struct{ impl Interface }

func (h recorddecisiontaskstarted_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RecordDecisionTaskStarted_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RecordDecisionTaskStarted': %w", err)
	}

	success, appErr := h.impl.RecordDecisionTaskStarted(ctx, args.AddRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RecordDecisionTaskStarted_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type refreshworkflowtasks_NoWireHandler struct{ impl Interface }

func (h refreshworkflowtasks_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RefreshWorkflowTasks_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RefreshWorkflowTasks': %w", err)
	}

	appErr := h.impl.RefreshWorkflowTasks(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_RefreshWorkflowTasks_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type removesignalmutablestate_NoWireHandler struct{ impl Interface }

func (h removesignalmutablestate_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RemoveSignalMutableState_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RemoveSignalMutableState': %w", err)
	}

	appErr := h.impl.RemoveSignalMutableState(ctx, args.RemoveRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RemoveSignalMutableState_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type removetask_NoWireHandler struct{ impl Interface }

func (h removetask_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RemoveTask_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RemoveTask': %w", err)
	}

	appErr := h.impl.RemoveTask(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_RemoveTask_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type replicateeventsv2_NoWireHandler struct{ impl Interface }

func (h replicateeventsv2_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_ReplicateEventsV2_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'ReplicateEventsV2': %w", err)
	}

	appErr := h.impl.ReplicateEventsV2(ctx, args.ReplicateV2Request)

	hadError := appErr != nil
	result, err := history.HistoryService_ReplicateEventsV2_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type requestcancelworkflowexecution_NoWireHandler struct{ impl Interface }

func (h requestcancelworkflowexecution_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RequestCancelWorkflowExecution_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RequestCancelWorkflowExecution': %w", err)
	}

	appErr := h.impl.RequestCancelWorkflowExecution(ctx, args.CancelRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RequestCancelWorkflowExecution_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type resetqueue_NoWireHandler struct{ impl Interface }

func (h resetqueue_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_ResetQueue_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'ResetQueue': %w", err)
	}

	appErr := h.impl.ResetQueue(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_ResetQueue_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type resetstickytasklist_NoWireHandler struct{ impl Interface }

func (h resetstickytasklist_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_ResetStickyTaskList_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'ResetStickyTaskList': %w", err)
	}

	success, appErr := h.impl.ResetStickyTaskList(ctx, args.ResetRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_ResetStickyTaskList_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type resetworkflowexecution_NoWireHandler struct{ impl Interface }

func (h resetworkflowexecution_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_ResetWorkflowExecution_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'ResetWorkflowExecution': %w", err)
	}

	success, appErr := h.impl.ResetWorkflowExecution(ctx, args.ResetRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_ResetWorkflowExecution_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type respondactivitytaskcanceled_NoWireHandler struct{ impl Interface }

func (h respondactivitytaskcanceled_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RespondActivityTaskCanceled_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RespondActivityTaskCanceled': %w", err)
	}

	appErr := h.impl.RespondActivityTaskCanceled(ctx, args.CanceledRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondActivityTaskCanceled_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type respondactivitytaskcompleted_NoWireHandler struct{ impl Interface }

func (h respondactivitytaskcompleted_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RespondActivityTaskCompleted_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RespondActivityTaskCompleted': %w", err)
	}

	appErr := h.impl.RespondActivityTaskCompleted(ctx, args.CompleteRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondActivityTaskCompleted_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type respondactivitytaskfailed_NoWireHandler struct{ impl Interface }

func (h respondactivitytaskfailed_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RespondActivityTaskFailed_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RespondActivityTaskFailed': %w", err)
	}

	appErr := h.impl.RespondActivityTaskFailed(ctx, args.FailRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondActivityTaskFailed_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type respondcrossclustertaskscompleted_NoWireHandler struct{ impl Interface }

func (h respondcrossclustertaskscompleted_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RespondCrossClusterTasksCompleted_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RespondCrossClusterTasksCompleted': %w", err)
	}

	success, appErr := h.impl.RespondCrossClusterTasksCompleted(ctx, args.Request)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondCrossClusterTasksCompleted_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type responddecisiontaskcompleted_NoWireHandler struct{ impl Interface }

func (h responddecisiontaskcompleted_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RespondDecisionTaskCompleted_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RespondDecisionTaskCompleted': %w", err)
	}

	success, appErr := h.impl.RespondDecisionTaskCompleted(ctx, args.CompleteRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondDecisionTaskCompleted_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type responddecisiontaskfailed_NoWireHandler struct{ impl Interface }

func (h responddecisiontaskfailed_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_RespondDecisionTaskFailed_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'RespondDecisionTaskFailed': %w", err)
	}

	appErr := h.impl.RespondDecisionTaskFailed(ctx, args.FailedRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_RespondDecisionTaskFailed_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type scheduledecisiontask_NoWireHandler struct{ impl Interface }

func (h scheduledecisiontask_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_ScheduleDecisionTask_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'ScheduleDecisionTask': %w", err)
	}

	appErr := h.impl.ScheduleDecisionTask(ctx, args.ScheduleRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_ScheduleDecisionTask_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type signalwithstartworkflowexecution_NoWireHandler struct{ impl Interface }

func (h signalwithstartworkflowexecution_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_SignalWithStartWorkflowExecution_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'SignalWithStartWorkflowExecution': %w", err)
	}

	success, appErr := h.impl.SignalWithStartWorkflowExecution(ctx, args.SignalWithStartRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_SignalWithStartWorkflowExecution_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type signalworkflowexecution_NoWireHandler struct{ impl Interface }

func (h signalworkflowexecution_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_SignalWorkflowExecution_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'SignalWorkflowExecution': %w", err)
	}

	appErr := h.impl.SignalWorkflowExecution(ctx, args.SignalRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_SignalWorkflowExecution_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type startworkflowexecution_NoWireHandler struct{ impl Interface }

func (h startworkflowexecution_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_StartWorkflowExecution_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'StartWorkflowExecution': %w", err)
	}

	success, appErr := h.impl.StartWorkflowExecution(ctx, args.StartRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_StartWorkflowExecution_Helper.WrapResponse(success, appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type syncactivity_NoWireHandler struct{ impl Interface }

func (h syncactivity_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_SyncActivity_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'SyncActivity': %w", err)
	}

	appErr := h.impl.SyncActivity(ctx, args.SyncActivityRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_SyncActivity_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type syncshardstatus_NoWireHandler struct{ impl Interface }

func (h syncshardstatus_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_SyncShardStatus_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'SyncShardStatus': %w", err)
	}

	appErr := h.impl.SyncShardStatus(ctx, args.SyncShardStatusRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_SyncShardStatus_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}

type terminateworkflowexecution_NoWireHandler struct{ impl Interface }

func (h terminateworkflowexecution_NoWireHandler) HandleNoWire(ctx context.Context, nwc *thrift.NoWireCall) (thrift.NoWireResponse, error) {
	var (
		args history.HistoryService_TerminateWorkflowExecution_Args
		rw   stream.ResponseWriter
		err  error
	)

	rw, err = nwc.RequestReader.ReadRequest(ctx, nwc.EnvelopeType, nwc.Reader, &args)
	if err != nil {
		return thrift.NoWireResponse{}, yarpcerrors.InvalidArgumentErrorf(
			"could not decode (via no wire) Thrift request for service 'HistoryService' procedure 'TerminateWorkflowExecution': %w", err)
	}

	appErr := h.impl.TerminateWorkflowExecution(ctx, args.TerminateRequest)

	hadError := appErr != nil
	result, err := history.HistoryService_TerminateWorkflowExecution_Helper.WrapResponse(appErr)
	response := thrift.NoWireResponse{ResponseWriter: rw}
	if err == nil {
		response.IsApplicationError = hadError
		response.Body = result
		if namer, ok := appErr.(yarpcErrorNamer); ok {
			response.ApplicationErrorName = namer.YARPCErrorName()
		}
		if extractor, ok := appErr.(yarpcErrorCoder); ok {
			response.ApplicationErrorCode = extractor.YARPCErrorCode()
		}
		if appErr != nil {
			response.ApplicationErrorDetails = appErr.Error()
		}
	}
	return response, err

}
