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

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             (unknown)
// source: controlplane/v1/workflow.proto

package v1

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

const (
	WorkflowService_Create_FullMethodName = "/controlplane.v1.WorkflowService/Create"
	WorkflowService_Update_FullMethodName = "/controlplane.v1.WorkflowService/Update"
	WorkflowService_List_FullMethodName   = "/controlplane.v1.WorkflowService/List"
	WorkflowService_View_FullMethodName   = "/controlplane.v1.WorkflowService/View"
	WorkflowService_Delete_FullMethodName = "/controlplane.v1.WorkflowService/Delete"
)

// WorkflowServiceClient is the client API for WorkflowService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type WorkflowServiceClient interface {
	Create(ctx context.Context, in *WorkflowServiceCreateRequest, opts ...grpc.CallOption) (*WorkflowServiceCreateResponse, error)
	Update(ctx context.Context, in *WorkflowServiceUpdateRequest, opts ...grpc.CallOption) (*WorkflowServiceUpdateResponse, error)
	List(ctx context.Context, in *WorkflowServiceListRequest, opts ...grpc.CallOption) (*WorkflowServiceListResponse, error)
	View(ctx context.Context, in *WorkflowServiceViewRequest, opts ...grpc.CallOption) (*WorkflowServiceViewResponse, error)
	Delete(ctx context.Context, in *WorkflowServiceDeleteRequest, opts ...grpc.CallOption) (*WorkflowServiceDeleteResponse, error)
}

type workflowServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewWorkflowServiceClient(cc grpc.ClientConnInterface) WorkflowServiceClient {
	return &workflowServiceClient{cc}
}

func (c *workflowServiceClient) Create(ctx context.Context, in *WorkflowServiceCreateRequest, opts ...grpc.CallOption) (*WorkflowServiceCreateResponse, error) {
	out := new(WorkflowServiceCreateResponse)
	err := c.cc.Invoke(ctx, WorkflowService_Create_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *workflowServiceClient) Update(ctx context.Context, in *WorkflowServiceUpdateRequest, opts ...grpc.CallOption) (*WorkflowServiceUpdateResponse, error) {
	out := new(WorkflowServiceUpdateResponse)
	err := c.cc.Invoke(ctx, WorkflowService_Update_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *workflowServiceClient) List(ctx context.Context, in *WorkflowServiceListRequest, opts ...grpc.CallOption) (*WorkflowServiceListResponse, error) {
	out := new(WorkflowServiceListResponse)
	err := c.cc.Invoke(ctx, WorkflowService_List_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *workflowServiceClient) View(ctx context.Context, in *WorkflowServiceViewRequest, opts ...grpc.CallOption) (*WorkflowServiceViewResponse, error) {
	out := new(WorkflowServiceViewResponse)
	err := c.cc.Invoke(ctx, WorkflowService_View_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *workflowServiceClient) Delete(ctx context.Context, in *WorkflowServiceDeleteRequest, opts ...grpc.CallOption) (*WorkflowServiceDeleteResponse, error) {
	out := new(WorkflowServiceDeleteResponse)
	err := c.cc.Invoke(ctx, WorkflowService_Delete_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// WorkflowServiceServer is the server API for WorkflowService service.
// All implementations must embed UnimplementedWorkflowServiceServer
// for forward compatibility
type WorkflowServiceServer interface {
	Create(context.Context, *WorkflowServiceCreateRequest) (*WorkflowServiceCreateResponse, error)
	Update(context.Context, *WorkflowServiceUpdateRequest) (*WorkflowServiceUpdateResponse, error)
	List(context.Context, *WorkflowServiceListRequest) (*WorkflowServiceListResponse, error)
	View(context.Context, *WorkflowServiceViewRequest) (*WorkflowServiceViewResponse, error)
	Delete(context.Context, *WorkflowServiceDeleteRequest) (*WorkflowServiceDeleteResponse, error)
	mustEmbedUnimplementedWorkflowServiceServer()
}

// UnimplementedWorkflowServiceServer must be embedded to have forward compatible implementations.
type UnimplementedWorkflowServiceServer struct {
}

func (UnimplementedWorkflowServiceServer) Create(context.Context, *WorkflowServiceCreateRequest) (*WorkflowServiceCreateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedWorkflowServiceServer) Update(context.Context, *WorkflowServiceUpdateRequest) (*WorkflowServiceUpdateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedWorkflowServiceServer) List(context.Context, *WorkflowServiceListRequest) (*WorkflowServiceListResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedWorkflowServiceServer) View(context.Context, *WorkflowServiceViewRequest) (*WorkflowServiceViewResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method View not implemented")
}
func (UnimplementedWorkflowServiceServer) Delete(context.Context, *WorkflowServiceDeleteRequest) (*WorkflowServiceDeleteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedWorkflowServiceServer) mustEmbedUnimplementedWorkflowServiceServer() {}

// UnsafeWorkflowServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WorkflowServiceServer will
// result in compilation errors.
type UnsafeWorkflowServiceServer interface {
	mustEmbedUnimplementedWorkflowServiceServer()
}

func RegisterWorkflowServiceServer(s grpc.ServiceRegistrar, srv WorkflowServiceServer) {
	s.RegisterService(&WorkflowService_ServiceDesc, srv)
}

func _WorkflowService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(WorkflowServiceCreateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(WorkflowServiceServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WorkflowService_Create_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WorkflowServiceServer).Create(ctx, req.(*WorkflowServiceCreateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _WorkflowService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(WorkflowServiceUpdateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(WorkflowServiceServer).Update(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WorkflowService_Update_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WorkflowServiceServer).Update(ctx, req.(*WorkflowServiceUpdateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _WorkflowService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(WorkflowServiceListRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(WorkflowServiceServer).List(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WorkflowService_List_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WorkflowServiceServer).List(ctx, req.(*WorkflowServiceListRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _WorkflowService_View_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(WorkflowServiceViewRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(WorkflowServiceServer).View(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WorkflowService_View_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WorkflowServiceServer).View(ctx, req.(*WorkflowServiceViewRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _WorkflowService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(WorkflowServiceDeleteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(WorkflowServiceServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WorkflowService_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WorkflowServiceServer).Delete(ctx, req.(*WorkflowServiceDeleteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// WorkflowService_ServiceDesc is the grpc.ServiceDesc for WorkflowService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WorkflowService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "controlplane.v1.WorkflowService",
	HandlerType: (*WorkflowServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _WorkflowService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _WorkflowService_Update_Handler,
		},
		{
			MethodName: "List",
			Handler:    _WorkflowService_List_Handler,
		},
		{
			MethodName: "View",
			Handler:    _WorkflowService_View_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _WorkflowService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "controlplane/v1/workflow.proto",
}
