//
// Copyright 2023-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/cas_credentials.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 (
	CASCredentialsService_Get_FullMethodName = "/controlplane.v1.CASCredentialsService/Get"
)

// CASCredentialsServiceClient is the client API for CASCredentialsService 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 CASCredentialsServiceClient interface {
	Get(ctx context.Context, in *CASCredentialsServiceGetRequest, opts ...grpc.CallOption) (*CASCredentialsServiceGetResponse, error)
}

type cASCredentialsServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewCASCredentialsServiceClient(cc grpc.ClientConnInterface) CASCredentialsServiceClient {
	return &cASCredentialsServiceClient{cc}
}

func (c *cASCredentialsServiceClient) Get(ctx context.Context, in *CASCredentialsServiceGetRequest, opts ...grpc.CallOption) (*CASCredentialsServiceGetResponse, error) {
	out := new(CASCredentialsServiceGetResponse)
	err := c.cc.Invoke(ctx, CASCredentialsService_Get_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// CASCredentialsServiceServer is the server API for CASCredentialsService service.
// All implementations must embed UnimplementedCASCredentialsServiceServer
// for forward compatibility
type CASCredentialsServiceServer interface {
	Get(context.Context, *CASCredentialsServiceGetRequest) (*CASCredentialsServiceGetResponse, error)
	mustEmbedUnimplementedCASCredentialsServiceServer()
}

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

func (UnimplementedCASCredentialsServiceServer) Get(context.Context, *CASCredentialsServiceGetRequest) (*CASCredentialsServiceGetResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedCASCredentialsServiceServer) mustEmbedUnimplementedCASCredentialsServiceServer() {}

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

func RegisterCASCredentialsServiceServer(s grpc.ServiceRegistrar, srv CASCredentialsServiceServer) {
	s.RegisterService(&CASCredentialsService_ServiceDesc, srv)
}

func _CASCredentialsService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CASCredentialsServiceGetRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CASCredentialsServiceServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CASCredentialsService_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CASCredentialsServiceServer).Get(ctx, req.(*CASCredentialsServiceGetRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// CASCredentialsService_ServiceDesc is the grpc.ServiceDesc for CASCredentialsService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CASCredentialsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "controlplane.v1.CASCredentialsService",
	HandlerType: (*CASCredentialsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _CASCredentialsService_Get_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "controlplane/v1/cas_credentials.proto",
}
