// Copyright 2018-2026 CERN
//
// 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.
//
// In applying this license, CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             (unknown)
// source: cs3/ocm/provider/v1beta1/provider_api.proto

package providerv1beta1

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 (
	ProviderAPI_IsProviderAllowed_FullMethodName = "/cs3.ocm.provider.v1beta1.ProviderAPI/IsProviderAllowed"
	ProviderAPI_GetInfoByDomain_FullMethodName   = "/cs3.ocm.provider.v1beta1.ProviderAPI/GetInfoByDomain"
	ProviderAPI_ListAllProviders_FullMethodName  = "/cs3.ocm.provider.v1beta1.ProviderAPI/ListAllProviders"
)

// ProviderAPIClient is the client API for ProviderAPI 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 ProviderAPIClient interface {
	// Check if a given system provider is registered in the mesh or not.
	// MUST return CODE_UNAUTHENTICATED if the system is not registered
	IsProviderAllowed(ctx context.Context, in *IsProviderAllowedRequest, opts ...grpc.CallOption) (*IsProviderAllowedResponse, error)
	// Get the information of the provider identified by a specific domain.
	// MUST return CODE_NOT_FOUND if the sync'n'share system provider does not exist.
	GetInfoByDomain(ctx context.Context, in *GetInfoByDomainRequest, opts ...grpc.CallOption) (*GetInfoByDomainResponse, error)
	// Get the information of all the providers registered in the mesh.
	ListAllProviders(ctx context.Context, in *ListAllProvidersRequest, opts ...grpc.CallOption) (*ListAllProvidersResponse, error)
}

type providerAPIClient struct {
	cc grpc.ClientConnInterface
}

func NewProviderAPIClient(cc grpc.ClientConnInterface) ProviderAPIClient {
	return &providerAPIClient{cc}
}

func (c *providerAPIClient) IsProviderAllowed(ctx context.Context, in *IsProviderAllowedRequest, opts ...grpc.CallOption) (*IsProviderAllowedResponse, error) {
	out := new(IsProviderAllowedResponse)
	err := c.cc.Invoke(ctx, ProviderAPI_IsProviderAllowed_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *providerAPIClient) GetInfoByDomain(ctx context.Context, in *GetInfoByDomainRequest, opts ...grpc.CallOption) (*GetInfoByDomainResponse, error) {
	out := new(GetInfoByDomainResponse)
	err := c.cc.Invoke(ctx, ProviderAPI_GetInfoByDomain_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *providerAPIClient) ListAllProviders(ctx context.Context, in *ListAllProvidersRequest, opts ...grpc.CallOption) (*ListAllProvidersResponse, error) {
	out := new(ListAllProvidersResponse)
	err := c.cc.Invoke(ctx, ProviderAPI_ListAllProviders_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ProviderAPIServer is the server API for ProviderAPI service.
// All implementations should embed UnimplementedProviderAPIServer
// for forward compatibility
type ProviderAPIServer interface {
	// Check if a given system provider is registered in the mesh or not.
	// MUST return CODE_UNAUTHENTICATED if the system is not registered
	IsProviderAllowed(context.Context, *IsProviderAllowedRequest) (*IsProviderAllowedResponse, error)
	// Get the information of the provider identified by a specific domain.
	// MUST return CODE_NOT_FOUND if the sync'n'share system provider does not exist.
	GetInfoByDomain(context.Context, *GetInfoByDomainRequest) (*GetInfoByDomainResponse, error)
	// Get the information of all the providers registered in the mesh.
	ListAllProviders(context.Context, *ListAllProvidersRequest) (*ListAllProvidersResponse, error)
}

// UnimplementedProviderAPIServer should be embedded to have forward compatible implementations.
type UnimplementedProviderAPIServer struct {
}

func (UnimplementedProviderAPIServer) IsProviderAllowed(context.Context, *IsProviderAllowedRequest) (*IsProviderAllowedResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method IsProviderAllowed not implemented")
}
func (UnimplementedProviderAPIServer) GetInfoByDomain(context.Context, *GetInfoByDomainRequest) (*GetInfoByDomainResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetInfoByDomain not implemented")
}
func (UnimplementedProviderAPIServer) ListAllProviders(context.Context, *ListAllProvidersRequest) (*ListAllProvidersResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListAllProviders not implemented")
}

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

func RegisterProviderAPIServer(s grpc.ServiceRegistrar, srv ProviderAPIServer) {
	s.RegisterService(&ProviderAPI_ServiceDesc, srv)
}

func _ProviderAPI_IsProviderAllowed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IsProviderAllowedRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ProviderAPIServer).IsProviderAllowed(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ProviderAPI_IsProviderAllowed_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ProviderAPIServer).IsProviderAllowed(ctx, req.(*IsProviderAllowedRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ProviderAPI_GetInfoByDomain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetInfoByDomainRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ProviderAPIServer).GetInfoByDomain(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ProviderAPI_GetInfoByDomain_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ProviderAPIServer).GetInfoByDomain(ctx, req.(*GetInfoByDomainRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ProviderAPI_ListAllProviders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListAllProvidersRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ProviderAPIServer).ListAllProviders(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ProviderAPI_ListAllProviders_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ProviderAPIServer).ListAllProviders(ctx, req.(*ListAllProvidersRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ProviderAPI_ServiceDesc is the grpc.ServiceDesc for ProviderAPI service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ProviderAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cs3.ocm.provider.v1beta1.ProviderAPI",
	HandlerType: (*ProviderAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "IsProviderAllowed",
			Handler:    _ProviderAPI_IsProviderAllowed_Handler,
		},
		{
			MethodName: "GetInfoByDomain",
			Handler:    _ProviderAPI_GetInfoByDomain_Handler,
		},
		{
			MethodName: "ListAllProviders",
			Handler:    _ProviderAPI_ListAllProviders_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cs3/ocm/provider/v1beta1/provider_api.proto",
}
