//
// 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/attestation_state.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 (
	AttestationStateService_Initialized_FullMethodName = "/controlplane.v1.AttestationStateService/Initialized"
	AttestationStateService_Save_FullMethodName        = "/controlplane.v1.AttestationStateService/Save"
	AttestationStateService_Read_FullMethodName        = "/controlplane.v1.AttestationStateService/Read"
	AttestationStateService_Reset_FullMethodName       = "/controlplane.v1.AttestationStateService/Reset"
)

// AttestationStateServiceClient is the client API for AttestationStateService 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 AttestationStateServiceClient interface {
	Initialized(ctx context.Context, in *AttestationStateServiceInitializedRequest, opts ...grpc.CallOption) (*AttestationStateServiceInitializedResponse, error)
	Save(ctx context.Context, in *AttestationStateServiceSaveRequest, opts ...grpc.CallOption) (*AttestationStateServiceSaveResponse, error)
	Read(ctx context.Context, in *AttestationStateServiceReadRequest, opts ...grpc.CallOption) (*AttestationStateServiceReadResponse, error)
	Reset(ctx context.Context, in *AttestationStateServiceResetRequest, opts ...grpc.CallOption) (*AttestationStateServiceResetResponse, error)
}

type attestationStateServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAttestationStateServiceClient(cc grpc.ClientConnInterface) AttestationStateServiceClient {
	return &attestationStateServiceClient{cc}
}

func (c *attestationStateServiceClient) Initialized(ctx context.Context, in *AttestationStateServiceInitializedRequest, opts ...grpc.CallOption) (*AttestationStateServiceInitializedResponse, error) {
	out := new(AttestationStateServiceInitializedResponse)
	err := c.cc.Invoke(ctx, AttestationStateService_Initialized_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *attestationStateServiceClient) Save(ctx context.Context, in *AttestationStateServiceSaveRequest, opts ...grpc.CallOption) (*AttestationStateServiceSaveResponse, error) {
	out := new(AttestationStateServiceSaveResponse)
	err := c.cc.Invoke(ctx, AttestationStateService_Save_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *attestationStateServiceClient) Read(ctx context.Context, in *AttestationStateServiceReadRequest, opts ...grpc.CallOption) (*AttestationStateServiceReadResponse, error) {
	out := new(AttestationStateServiceReadResponse)
	err := c.cc.Invoke(ctx, AttestationStateService_Read_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *attestationStateServiceClient) Reset(ctx context.Context, in *AttestationStateServiceResetRequest, opts ...grpc.CallOption) (*AttestationStateServiceResetResponse, error) {
	out := new(AttestationStateServiceResetResponse)
	err := c.cc.Invoke(ctx, AttestationStateService_Reset_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AttestationStateServiceServer is the server API for AttestationStateService service.
// All implementations must embed UnimplementedAttestationStateServiceServer
// for forward compatibility
type AttestationStateServiceServer interface {
	Initialized(context.Context, *AttestationStateServiceInitializedRequest) (*AttestationStateServiceInitializedResponse, error)
	Save(context.Context, *AttestationStateServiceSaveRequest) (*AttestationStateServiceSaveResponse, error)
	Read(context.Context, *AttestationStateServiceReadRequest) (*AttestationStateServiceReadResponse, error)
	Reset(context.Context, *AttestationStateServiceResetRequest) (*AttestationStateServiceResetResponse, error)
	mustEmbedUnimplementedAttestationStateServiceServer()
}

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

func (UnimplementedAttestationStateServiceServer) Initialized(context.Context, *AttestationStateServiceInitializedRequest) (*AttestationStateServiceInitializedResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Initialized not implemented")
}
func (UnimplementedAttestationStateServiceServer) Save(context.Context, *AttestationStateServiceSaveRequest) (*AttestationStateServiceSaveResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Save not implemented")
}
func (UnimplementedAttestationStateServiceServer) Read(context.Context, *AttestationStateServiceReadRequest) (*AttestationStateServiceReadResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Read not implemented")
}
func (UnimplementedAttestationStateServiceServer) Reset(context.Context, *AttestationStateServiceResetRequest) (*AttestationStateServiceResetResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Reset not implemented")
}
func (UnimplementedAttestationStateServiceServer) mustEmbedUnimplementedAttestationStateServiceServer() {
}

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

func RegisterAttestationStateServiceServer(s grpc.ServiceRegistrar, srv AttestationStateServiceServer) {
	s.RegisterService(&AttestationStateService_ServiceDesc, srv)
}

func _AttestationStateService_Initialized_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AttestationStateServiceInitializedRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AttestationStateServiceServer).Initialized(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AttestationStateService_Initialized_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AttestationStateServiceServer).Initialized(ctx, req.(*AttestationStateServiceInitializedRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AttestationStateService_Save_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AttestationStateServiceSaveRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AttestationStateServiceServer).Save(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AttestationStateService_Save_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AttestationStateServiceServer).Save(ctx, req.(*AttestationStateServiceSaveRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AttestationStateService_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AttestationStateServiceReadRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AttestationStateServiceServer).Read(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AttestationStateService_Read_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AttestationStateServiceServer).Read(ctx, req.(*AttestationStateServiceReadRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AttestationStateService_Reset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AttestationStateServiceResetRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AttestationStateServiceServer).Reset(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AttestationStateService_Reset_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AttestationStateServiceServer).Reset(ctx, req.(*AttestationStateServiceResetRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// AttestationStateService_ServiceDesc is the grpc.ServiceDesc for AttestationStateService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AttestationStateService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "controlplane.v1.AttestationStateService",
	HandlerType: (*AttestationStateServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Initialized",
			Handler:    _AttestationStateService_Initialized_Handler,
		},
		{
			MethodName: "Save",
			Handler:    _AttestationStateService_Save_Handler,
		},
		{
			MethodName: "Read",
			Handler:    _AttestationStateService_Read_Handler,
		},
		{
			MethodName: "Reset",
			Handler:    _AttestationStateService_Reset_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "controlplane/v1/attestation_state.proto",
}
