//
// Copyright 2024 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/integrations.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 (
	IntegrationsService_ListAvailable_FullMethodName        = "/controlplane.v1.IntegrationsService/ListAvailable"
	IntegrationsService_Register_FullMethodName             = "/controlplane.v1.IntegrationsService/Register"
	IntegrationsService_Deregister_FullMethodName           = "/controlplane.v1.IntegrationsService/Deregister"
	IntegrationsService_ListRegistrations_FullMethodName    = "/controlplane.v1.IntegrationsService/ListRegistrations"
	IntegrationsService_DescribeRegistration_FullMethodName = "/controlplane.v1.IntegrationsService/DescribeRegistration"
	IntegrationsService_Attach_FullMethodName               = "/controlplane.v1.IntegrationsService/Attach"
	IntegrationsService_Detach_FullMethodName               = "/controlplane.v1.IntegrationsService/Detach"
	IntegrationsService_ListAttachments_FullMethodName      = "/controlplane.v1.IntegrationsService/ListAttachments"
)

// IntegrationsServiceClient is the client API for IntegrationsService 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 IntegrationsServiceClient interface {
	// Integrations available and loaded in the controlplane ready to be used during registration
	ListAvailable(ctx context.Context, in *IntegrationsServiceListAvailableRequest, opts ...grpc.CallOption) (*IntegrationsServiceListAvailableResponse, error)
	// Registration Related operations
	// Register a new integration in the organization
	Register(ctx context.Context, in *IntegrationsServiceRegisterRequest, opts ...grpc.CallOption) (*IntegrationsServiceRegisterResponse, error)
	// Delete registered integrations
	Deregister(ctx context.Context, in *IntegrationsServiceDeregisterRequest, opts ...grpc.CallOption) (*IntegrationsServiceDeregisterResponse, error)
	// List registered integrations
	ListRegistrations(ctx context.Context, in *IntegrationsServiceListRegistrationsRequest, opts ...grpc.CallOption) (*IntegrationsServiceListRegistrationsResponse, error)
	// View registered integration
	DescribeRegistration(ctx context.Context, in *IntegrationsServiceDescribeRegistrationRequest, opts ...grpc.CallOption) (*IntegrationsServiceDescribeRegistrationResponse, error)
	// Attachment Related operations
	// Attach an integration to a workflow
	Attach(ctx context.Context, in *IntegrationsServiceAttachRequest, opts ...grpc.CallOption) (*IntegrationsServiceAttachResponse, error)
	// Detach integration from a workflow
	Detach(ctx context.Context, in *IntegrationsServiceDetachRequest, opts ...grpc.CallOption) (*IntegrationsServiceDetachResponse, error)
	// List attachments
	ListAttachments(ctx context.Context, in *ListAttachmentsRequest, opts ...grpc.CallOption) (*ListAttachmentsResponse, error)
}

type integrationsServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewIntegrationsServiceClient(cc grpc.ClientConnInterface) IntegrationsServiceClient {
	return &integrationsServiceClient{cc}
}

func (c *integrationsServiceClient) ListAvailable(ctx context.Context, in *IntegrationsServiceListAvailableRequest, opts ...grpc.CallOption) (*IntegrationsServiceListAvailableResponse, error) {
	out := new(IntegrationsServiceListAvailableResponse)
	err := c.cc.Invoke(ctx, IntegrationsService_ListAvailable_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *integrationsServiceClient) Register(ctx context.Context, in *IntegrationsServiceRegisterRequest, opts ...grpc.CallOption) (*IntegrationsServiceRegisterResponse, error) {
	out := new(IntegrationsServiceRegisterResponse)
	err := c.cc.Invoke(ctx, IntegrationsService_Register_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *integrationsServiceClient) Deregister(ctx context.Context, in *IntegrationsServiceDeregisterRequest, opts ...grpc.CallOption) (*IntegrationsServiceDeregisterResponse, error) {
	out := new(IntegrationsServiceDeregisterResponse)
	err := c.cc.Invoke(ctx, IntegrationsService_Deregister_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *integrationsServiceClient) ListRegistrations(ctx context.Context, in *IntegrationsServiceListRegistrationsRequest, opts ...grpc.CallOption) (*IntegrationsServiceListRegistrationsResponse, error) {
	out := new(IntegrationsServiceListRegistrationsResponse)
	err := c.cc.Invoke(ctx, IntegrationsService_ListRegistrations_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *integrationsServiceClient) DescribeRegistration(ctx context.Context, in *IntegrationsServiceDescribeRegistrationRequest, opts ...grpc.CallOption) (*IntegrationsServiceDescribeRegistrationResponse, error) {
	out := new(IntegrationsServiceDescribeRegistrationResponse)
	err := c.cc.Invoke(ctx, IntegrationsService_DescribeRegistration_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *integrationsServiceClient) Attach(ctx context.Context, in *IntegrationsServiceAttachRequest, opts ...grpc.CallOption) (*IntegrationsServiceAttachResponse, error) {
	out := new(IntegrationsServiceAttachResponse)
	err := c.cc.Invoke(ctx, IntegrationsService_Attach_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *integrationsServiceClient) Detach(ctx context.Context, in *IntegrationsServiceDetachRequest, opts ...grpc.CallOption) (*IntegrationsServiceDetachResponse, error) {
	out := new(IntegrationsServiceDetachResponse)
	err := c.cc.Invoke(ctx, IntegrationsService_Detach_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *integrationsServiceClient) ListAttachments(ctx context.Context, in *ListAttachmentsRequest, opts ...grpc.CallOption) (*ListAttachmentsResponse, error) {
	out := new(ListAttachmentsResponse)
	err := c.cc.Invoke(ctx, IntegrationsService_ListAttachments_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// IntegrationsServiceServer is the server API for IntegrationsService service.
// All implementations must embed UnimplementedIntegrationsServiceServer
// for forward compatibility
type IntegrationsServiceServer interface {
	// Integrations available and loaded in the controlplane ready to be used during registration
	ListAvailable(context.Context, *IntegrationsServiceListAvailableRequest) (*IntegrationsServiceListAvailableResponse, error)
	// Registration Related operations
	// Register a new integration in the organization
	Register(context.Context, *IntegrationsServiceRegisterRequest) (*IntegrationsServiceRegisterResponse, error)
	// Delete registered integrations
	Deregister(context.Context, *IntegrationsServiceDeregisterRequest) (*IntegrationsServiceDeregisterResponse, error)
	// List registered integrations
	ListRegistrations(context.Context, *IntegrationsServiceListRegistrationsRequest) (*IntegrationsServiceListRegistrationsResponse, error)
	// View registered integration
	DescribeRegistration(context.Context, *IntegrationsServiceDescribeRegistrationRequest) (*IntegrationsServiceDescribeRegistrationResponse, error)
	// Attachment Related operations
	// Attach an integration to a workflow
	Attach(context.Context, *IntegrationsServiceAttachRequest) (*IntegrationsServiceAttachResponse, error)
	// Detach integration from a workflow
	Detach(context.Context, *IntegrationsServiceDetachRequest) (*IntegrationsServiceDetachResponse, error)
	// List attachments
	ListAttachments(context.Context, *ListAttachmentsRequest) (*ListAttachmentsResponse, error)
	mustEmbedUnimplementedIntegrationsServiceServer()
}

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

func (UnimplementedIntegrationsServiceServer) ListAvailable(context.Context, *IntegrationsServiceListAvailableRequest) (*IntegrationsServiceListAvailableResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListAvailable not implemented")
}
func (UnimplementedIntegrationsServiceServer) Register(context.Context, *IntegrationsServiceRegisterRequest) (*IntegrationsServiceRegisterResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
}
func (UnimplementedIntegrationsServiceServer) Deregister(context.Context, *IntegrationsServiceDeregisterRequest) (*IntegrationsServiceDeregisterResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Deregister not implemented")
}
func (UnimplementedIntegrationsServiceServer) ListRegistrations(context.Context, *IntegrationsServiceListRegistrationsRequest) (*IntegrationsServiceListRegistrationsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListRegistrations not implemented")
}
func (UnimplementedIntegrationsServiceServer) DescribeRegistration(context.Context, *IntegrationsServiceDescribeRegistrationRequest) (*IntegrationsServiceDescribeRegistrationResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DescribeRegistration not implemented")
}
func (UnimplementedIntegrationsServiceServer) Attach(context.Context, *IntegrationsServiceAttachRequest) (*IntegrationsServiceAttachResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Attach not implemented")
}
func (UnimplementedIntegrationsServiceServer) Detach(context.Context, *IntegrationsServiceDetachRequest) (*IntegrationsServiceDetachResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Detach not implemented")
}
func (UnimplementedIntegrationsServiceServer) ListAttachments(context.Context, *ListAttachmentsRequest) (*ListAttachmentsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListAttachments not implemented")
}
func (UnimplementedIntegrationsServiceServer) mustEmbedUnimplementedIntegrationsServiceServer() {}

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

func RegisterIntegrationsServiceServer(s grpc.ServiceRegistrar, srv IntegrationsServiceServer) {
	s.RegisterService(&IntegrationsService_ServiceDesc, srv)
}

func _IntegrationsService_ListAvailable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IntegrationsServiceListAvailableRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IntegrationsServiceServer).ListAvailable(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IntegrationsService_ListAvailable_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IntegrationsServiceServer).ListAvailable(ctx, req.(*IntegrationsServiceListAvailableRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _IntegrationsService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IntegrationsServiceRegisterRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IntegrationsServiceServer).Register(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IntegrationsService_Register_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IntegrationsServiceServer).Register(ctx, req.(*IntegrationsServiceRegisterRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _IntegrationsService_Deregister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IntegrationsServiceDeregisterRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IntegrationsServiceServer).Deregister(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IntegrationsService_Deregister_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IntegrationsServiceServer).Deregister(ctx, req.(*IntegrationsServiceDeregisterRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _IntegrationsService_ListRegistrations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IntegrationsServiceListRegistrationsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IntegrationsServiceServer).ListRegistrations(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IntegrationsService_ListRegistrations_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IntegrationsServiceServer).ListRegistrations(ctx, req.(*IntegrationsServiceListRegistrationsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _IntegrationsService_DescribeRegistration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IntegrationsServiceDescribeRegistrationRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IntegrationsServiceServer).DescribeRegistration(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IntegrationsService_DescribeRegistration_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IntegrationsServiceServer).DescribeRegistration(ctx, req.(*IntegrationsServiceDescribeRegistrationRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _IntegrationsService_Attach_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IntegrationsServiceAttachRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IntegrationsServiceServer).Attach(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IntegrationsService_Attach_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IntegrationsServiceServer).Attach(ctx, req.(*IntegrationsServiceAttachRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _IntegrationsService_Detach_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IntegrationsServiceDetachRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IntegrationsServiceServer).Detach(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IntegrationsService_Detach_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IntegrationsServiceServer).Detach(ctx, req.(*IntegrationsServiceDetachRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _IntegrationsService_ListAttachments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListAttachmentsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IntegrationsServiceServer).ListAttachments(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IntegrationsService_ListAttachments_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IntegrationsServiceServer).ListAttachments(ctx, req.(*ListAttachmentsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// IntegrationsService_ServiceDesc is the grpc.ServiceDesc for IntegrationsService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var IntegrationsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "controlplane.v1.IntegrationsService",
	HandlerType: (*IntegrationsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListAvailable",
			Handler:    _IntegrationsService_ListAvailable_Handler,
		},
		{
			MethodName: "Register",
			Handler:    _IntegrationsService_Register_Handler,
		},
		{
			MethodName: "Deregister",
			Handler:    _IntegrationsService_Deregister_Handler,
		},
		{
			MethodName: "ListRegistrations",
			Handler:    _IntegrationsService_ListRegistrations_Handler,
		},
		{
			MethodName: "DescribeRegistration",
			Handler:    _IntegrationsService_DescribeRegistration_Handler,
		},
		{
			MethodName: "Attach",
			Handler:    _IntegrationsService_Attach_Handler,
		},
		{
			MethodName: "Detach",
			Handler:    _IntegrationsService_Detach_Handler,
		},
		{
			MethodName: "ListAttachments",
			Handler:    _IntegrationsService_ListAttachments_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "controlplane/v1/integrations.proto",
}
