package grpc

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

import (
	"context"

	adminv1 "github.com/uber/cadence-idl/go/proto/admin/v1"

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

type AdminHandler struct {
	h admin.Handler
}

func NewAdminHandler(h admin.Handler) AdminHandler {
	return AdminHandler{h}
}

func (g AdminHandler) AddSearchAttribute(ctx context.Context, request *adminv1.AddSearchAttributeRequest) (*adminv1.AddSearchAttributeResponse, error) {
	err := g.h.AddSearchAttribute(ctx, proto.ToAdminAddSearchAttributeRequest(request))
	return &adminv1.AddSearchAttributeResponse{}, proto.FromError(err)
}

func (g AdminHandler) CloseShard(ctx context.Context, request *adminv1.CloseShardRequest) (*adminv1.CloseShardResponse, error) {
	err := g.h.CloseShard(ctx, proto.ToAdminCloseShardRequest(request))
	return &adminv1.CloseShardResponse{}, proto.FromError(err)
}

func (g AdminHandler) CountDLQMessages(ctx context.Context, request *adminv1.CountDLQMessagesRequest) (*adminv1.CountDLQMessagesResponse, error) {
	response, err := g.h.CountDLQMessages(ctx, proto.ToAdminCountDLQMessagesRequest(request))
	return proto.FromAdminCountDLQMessagesResponse(response), proto.FromError(err)
}

func (g AdminHandler) DeleteWorkflow(ctx context.Context, request *adminv1.DeleteWorkflowRequest) (*adminv1.DeleteWorkflowResponse, error) {
	response, err := g.h.DeleteWorkflow(ctx, proto.ToAdminDeleteWorkflowRequest(request))
	return proto.FromAdminDeleteWorkflowResponse(response), proto.FromError(err)
}

func (g AdminHandler) DescribeCluster(ctx context.Context, request *adminv1.DescribeClusterRequest) (*adminv1.DescribeClusterResponse, error) {
	response, err := g.h.DescribeCluster(ctx)
	return proto.FromAdminDescribeClusterResponse(response), proto.FromError(err)
}

func (g AdminHandler) DescribeHistoryHost(ctx context.Context, request *adminv1.DescribeHistoryHostRequest) (*adminv1.DescribeHistoryHostResponse, error) {
	response, err := g.h.DescribeHistoryHost(ctx, proto.ToAdminDescribeHistoryHostRequest(request))
	return proto.FromAdminDescribeHistoryHostResponse(response), proto.FromError(err)
}

func (g AdminHandler) DescribeQueue(ctx context.Context, request *adminv1.DescribeQueueRequest) (*adminv1.DescribeQueueResponse, error) {
	response, err := g.h.DescribeQueue(ctx, proto.ToAdminDescribeQueueRequest(request))
	return proto.FromAdminDescribeQueueResponse(response), proto.FromError(err)
}

func (g AdminHandler) DescribeShardDistribution(ctx context.Context, request *adminv1.DescribeShardDistributionRequest) (*adminv1.DescribeShardDistributionResponse, error) {
	response, err := g.h.DescribeShardDistribution(ctx, proto.ToAdminDescribeShardDistributionRequest(request))
	return proto.FromAdminDescribeShardDistributionResponse(response), proto.FromError(err)
}

func (g AdminHandler) DescribeWorkflowExecution(ctx context.Context, request *adminv1.DescribeWorkflowExecutionRequest) (*adminv1.DescribeWorkflowExecutionResponse, error) {
	response, err := g.h.DescribeWorkflowExecution(ctx, proto.ToAdminDescribeWorkflowExecutionRequest(request))
	return proto.FromAdminDescribeWorkflowExecutionResponse(response), proto.FromError(err)
}

func (g AdminHandler) GetCrossClusterTasks(ctx context.Context, request *adminv1.GetCrossClusterTasksRequest) (*adminv1.GetCrossClusterTasksResponse, error) {
	response, err := g.h.GetCrossClusterTasks(ctx, proto.ToAdminGetCrossClusterTasksRequest(request))
	return proto.FromAdminGetCrossClusterTasksResponse(response), proto.FromError(err)
}

func (g AdminHandler) GetDLQReplicationMessages(ctx context.Context, request *adminv1.GetDLQReplicationMessagesRequest) (*adminv1.GetDLQReplicationMessagesResponse, error) {
	response, err := g.h.GetDLQReplicationMessages(ctx, proto.ToAdminGetDLQReplicationMessagesRequest(request))
	return proto.FromAdminGetDLQReplicationMessagesResponse(response), proto.FromError(err)
}

func (g AdminHandler) GetDomainAsyncWorkflowConfiguraton(ctx context.Context, request *adminv1.GetDomainAsyncWorkflowConfiguratonRequest) (*adminv1.GetDomainAsyncWorkflowConfiguratonResponse, error) {
	response, err := g.h.GetDomainAsyncWorkflowConfiguraton(ctx, proto.ToAdminGetDomainAsyncWorkflowConfiguratonRequest(request))
	return proto.FromAdminGetDomainAsyncWorkflowConfiguratonResponse(response), proto.FromError(err)
}

func (g AdminHandler) GetDomainIsolationGroups(ctx context.Context, request *adminv1.GetDomainIsolationGroupsRequest) (*adminv1.GetDomainIsolationGroupsResponse, error) {
	response, err := g.h.GetDomainIsolationGroups(ctx, proto.ToAdminGetDomainIsolationGroupsRequest(request))
	return proto.FromAdminGetDomainIsolationGroupsResponse(response), proto.FromError(err)
}

func (g AdminHandler) GetDomainReplicationMessages(ctx context.Context, request *adminv1.GetDomainReplicationMessagesRequest) (*adminv1.GetDomainReplicationMessagesResponse, error) {
	response, err := g.h.GetDomainReplicationMessages(ctx, proto.ToAdminGetDomainReplicationMessagesRequest(request))
	return proto.FromAdminGetDomainReplicationMessagesResponse(response), proto.FromError(err)
}

func (g AdminHandler) GetDynamicConfig(ctx context.Context, request *adminv1.GetDynamicConfigRequest) (*adminv1.GetDynamicConfigResponse, error) {
	response, err := g.h.GetDynamicConfig(ctx, proto.ToAdminGetDynamicConfigRequest(request))
	return proto.FromAdminGetDynamicConfigResponse(response), proto.FromError(err)
}

func (g AdminHandler) GetGlobalIsolationGroups(ctx context.Context, request *adminv1.GetGlobalIsolationGroupsRequest) (*adminv1.GetGlobalIsolationGroupsResponse, error) {
	response, err := g.h.GetGlobalIsolationGroups(ctx, proto.ToAdminGetGlobalIsolationGroupsRequest(request))
	return proto.FromAdminGetGlobalIsolationGroupsResponse(response), proto.FromError(err)
}

func (g AdminHandler) GetReplicationMessages(ctx context.Context, request *adminv1.GetReplicationMessagesRequest) (*adminv1.GetReplicationMessagesResponse, error) {
	response, err := g.h.GetReplicationMessages(ctx, proto.ToAdminGetReplicationMessagesRequest(request))
	return proto.FromAdminGetReplicationMessagesResponse(response), proto.FromError(err)
}

func (g AdminHandler) GetWorkflowExecutionRawHistoryV2(ctx context.Context, request *adminv1.GetWorkflowExecutionRawHistoryV2Request) (*adminv1.GetWorkflowExecutionRawHistoryV2Response, error) {
	response, err := g.h.GetWorkflowExecutionRawHistoryV2(ctx, proto.ToAdminGetWorkflowExecutionRawHistoryV2Request(request))
	return proto.FromAdminGetWorkflowExecutionRawHistoryV2Response(response), proto.FromError(err)
}

func (g AdminHandler) ListDynamicConfig(ctx context.Context, request *adminv1.ListDynamicConfigRequest) (*adminv1.ListDynamicConfigResponse, error) {
	response, err := g.h.ListDynamicConfig(ctx, proto.ToAdminListDynamicConfigRequest(request))
	return proto.FromAdminListDynamicConfigResponse(response), proto.FromError(err)
}

func (g AdminHandler) MaintainCorruptWorkflow(ctx context.Context, request *adminv1.MaintainCorruptWorkflowRequest) (*adminv1.MaintainCorruptWorkflowResponse, error) {
	response, err := g.h.MaintainCorruptWorkflow(ctx, proto.ToAdminMaintainCorruptWorkflowRequest(request))
	return proto.FromAdminMaintainCorruptWorkflowResponse(response), proto.FromError(err)
}

func (g AdminHandler) MergeDLQMessages(ctx context.Context, request *adminv1.MergeDLQMessagesRequest) (*adminv1.MergeDLQMessagesResponse, error) {
	response, err := g.h.MergeDLQMessages(ctx, proto.ToAdminMergeDLQMessagesRequest(request))
	return proto.FromAdminMergeDLQMessagesResponse(response), proto.FromError(err)
}

func (g AdminHandler) PurgeDLQMessages(ctx context.Context, request *adminv1.PurgeDLQMessagesRequest) (*adminv1.PurgeDLQMessagesResponse, error) {
	err := g.h.PurgeDLQMessages(ctx, proto.ToAdminPurgeDLQMessagesRequest(request))
	return &adminv1.PurgeDLQMessagesResponse{}, proto.FromError(err)
}

func (g AdminHandler) ReadDLQMessages(ctx context.Context, request *adminv1.ReadDLQMessagesRequest) (*adminv1.ReadDLQMessagesResponse, error) {
	response, err := g.h.ReadDLQMessages(ctx, proto.ToAdminReadDLQMessagesRequest(request))
	return proto.FromAdminReadDLQMessagesResponse(response), proto.FromError(err)
}

func (g AdminHandler) ReapplyEvents(ctx context.Context, request *adminv1.ReapplyEventsRequest) (*adminv1.ReapplyEventsResponse, error) {
	err := g.h.ReapplyEvents(ctx, proto.ToAdminReapplyEventsRequest(request))
	return &adminv1.ReapplyEventsResponse{}, proto.FromError(err)
}

func (g AdminHandler) RefreshWorkflowTasks(ctx context.Context, request *adminv1.RefreshWorkflowTasksRequest) (*adminv1.RefreshWorkflowTasksResponse, error) {
	err := g.h.RefreshWorkflowTasks(ctx, proto.ToAdminRefreshWorkflowTasksRequest(request))
	return &adminv1.RefreshWorkflowTasksResponse{}, proto.FromError(err)
}

func (g AdminHandler) RemoveTask(ctx context.Context, request *adminv1.RemoveTaskRequest) (*adminv1.RemoveTaskResponse, error) {
	err := g.h.RemoveTask(ctx, proto.ToAdminRemoveTaskRequest(request))
	return &adminv1.RemoveTaskResponse{}, proto.FromError(err)
}

func (g AdminHandler) ResendReplicationTasks(ctx context.Context, request *adminv1.ResendReplicationTasksRequest) (*adminv1.ResendReplicationTasksResponse, error) {
	err := g.h.ResendReplicationTasks(ctx, proto.ToAdminResendReplicationTasksRequest(request))
	return &adminv1.ResendReplicationTasksResponse{}, proto.FromError(err)
}

func (g AdminHandler) ResetQueue(ctx context.Context, request *adminv1.ResetQueueRequest) (*adminv1.ResetQueueResponse, error) {
	err := g.h.ResetQueue(ctx, proto.ToAdminResetQueueRequest(request))
	return &adminv1.ResetQueueResponse{}, proto.FromError(err)
}

func (g AdminHandler) RespondCrossClusterTasksCompleted(ctx context.Context, request *adminv1.RespondCrossClusterTasksCompletedRequest) (*adminv1.RespondCrossClusterTasksCompletedResponse, error) {
	response, err := g.h.RespondCrossClusterTasksCompleted(ctx, proto.ToAdminRespondCrossClusterTasksCompletedRequest(request))
	return proto.FromAdminRespondCrossClusterTasksCompletedResponse(response), proto.FromError(err)
}

func (g AdminHandler) RestoreDynamicConfig(ctx context.Context, request *adminv1.RestoreDynamicConfigRequest) (*adminv1.RestoreDynamicConfigResponse, error) {
	err := g.h.RestoreDynamicConfig(ctx, proto.ToAdminRestoreDynamicConfigRequest(request))
	return &adminv1.RestoreDynamicConfigResponse{}, proto.FromError(err)
}

func (g AdminHandler) UpdateDomainAsyncWorkflowConfiguraton(ctx context.Context, request *adminv1.UpdateDomainAsyncWorkflowConfiguratonRequest) (*adminv1.UpdateDomainAsyncWorkflowConfiguratonResponse, error) {
	response, err := g.h.UpdateDomainAsyncWorkflowConfiguraton(ctx, proto.ToAdminUpdateDomainAsyncWorkflowConfiguratonRequest(request))
	return proto.FromAdminUpdateDomainAsyncWorkflowConfiguratonResponse(response), proto.FromError(err)
}

func (g AdminHandler) UpdateDomainIsolationGroups(ctx context.Context, request *adminv1.UpdateDomainIsolationGroupsRequest) (*adminv1.UpdateDomainIsolationGroupsResponse, error) {
	response, err := g.h.UpdateDomainIsolationGroups(ctx, proto.ToAdminUpdateDomainIsolationGroupsRequest(request))
	return proto.FromAdminUpdateDomainIsolationGroupsResponse(response), proto.FromError(err)
}

func (g AdminHandler) UpdateDynamicConfig(ctx context.Context, request *adminv1.UpdateDynamicConfigRequest) (*adminv1.UpdateDynamicConfigResponse, error) {
	err := g.h.UpdateDynamicConfig(ctx, proto.ToAdminUpdateDynamicConfigRequest(request))
	return &adminv1.UpdateDynamicConfigResponse{}, proto.FromError(err)
}

func (g AdminHandler) UpdateGlobalIsolationGroups(ctx context.Context, request *adminv1.UpdateGlobalIsolationGroupsRequest) (*adminv1.UpdateGlobalIsolationGroupsResponse, error) {
	response, err := g.h.UpdateGlobalIsolationGroups(ctx, proto.ToAdminUpdateGlobalIsolationGroupsRequest(request))
	return proto.FromAdminUpdateGlobalIsolationGroupsResponse(response), proto.FromError(err)
}

func (g AdminHandler) UpdateTaskListPartitionConfig(ctx context.Context, request *adminv1.UpdateTaskListPartitionConfigRequest) (*adminv1.UpdateTaskListPartitionConfigResponse, error) {
	response, err := g.h.UpdateTaskListPartitionConfig(ctx, proto.ToAdminUpdateTaskListPartitionConfigRequest(request))
	return proto.FromAdminUpdateTaskListPartitionConfigResponse(response), proto.FromError(err)
}
