// 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/identity/tenant/v1beta1/tenant_api.proto

package tenantv1beta1

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 (
	TenantAPI_GetTenant_FullMethodName        = "/cs3.identity.tenant.v1beta1.TenantAPI/GetTenant"
	TenantAPI_GetTenantByClaim_FullMethodName = "/cs3.identity.tenant.v1beta1.TenantAPI/GetTenantByClaim"
)

// TenantAPIClient is the client API for TenantAPI 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 TenantAPIClient interface {
	// Gets the information about a Tenant by the tenant id.
	GetTenant(ctx context.Context, in *GetTenantRequest, opts ...grpc.CallOption) (*GetTenantResponse, error)
	// Gets the information about a Tenant based on a specified claim.
	GetTenantByClaim(ctx context.Context, in *GetTenantByClaimRequest, opts ...grpc.CallOption) (*GetTenantByClaimResponse, error)
}

type tenantAPIClient struct {
	cc grpc.ClientConnInterface
}

func NewTenantAPIClient(cc grpc.ClientConnInterface) TenantAPIClient {
	return &tenantAPIClient{cc}
}

func (c *tenantAPIClient) GetTenant(ctx context.Context, in *GetTenantRequest, opts ...grpc.CallOption) (*GetTenantResponse, error) {
	out := new(GetTenantResponse)
	err := c.cc.Invoke(ctx, TenantAPI_GetTenant_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *tenantAPIClient) GetTenantByClaim(ctx context.Context, in *GetTenantByClaimRequest, opts ...grpc.CallOption) (*GetTenantByClaimResponse, error) {
	out := new(GetTenantByClaimResponse)
	err := c.cc.Invoke(ctx, TenantAPI_GetTenantByClaim_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// TenantAPIServer is the server API for TenantAPI service.
// All implementations should embed UnimplementedTenantAPIServer
// for forward compatibility
type TenantAPIServer interface {
	// Gets the information about a Tenant by the tenant id.
	GetTenant(context.Context, *GetTenantRequest) (*GetTenantResponse, error)
	// Gets the information about a Tenant based on a specified claim.
	GetTenantByClaim(context.Context, *GetTenantByClaimRequest) (*GetTenantByClaimResponse, error)
}

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

func (UnimplementedTenantAPIServer) GetTenant(context.Context, *GetTenantRequest) (*GetTenantResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetTenant not implemented")
}
func (UnimplementedTenantAPIServer) GetTenantByClaim(context.Context, *GetTenantByClaimRequest) (*GetTenantByClaimResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetTenantByClaim not implemented")
}

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

func RegisterTenantAPIServer(s grpc.ServiceRegistrar, srv TenantAPIServer) {
	s.RegisterService(&TenantAPI_ServiceDesc, srv)
}

func _TenantAPI_GetTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetTenantRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TenantAPIServer).GetTenant(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TenantAPI_GetTenant_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TenantAPIServer).GetTenant(ctx, req.(*GetTenantRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TenantAPI_GetTenantByClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetTenantByClaimRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TenantAPIServer).GetTenantByClaim(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TenantAPI_GetTenantByClaim_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TenantAPIServer).GetTenantByClaim(ctx, req.(*GetTenantByClaimRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// TenantAPI_ServiceDesc is the grpc.ServiceDesc for TenantAPI service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TenantAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cs3.identity.tenant.v1beta1.TenantAPI",
	HandlerType: (*TenantAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetTenant",
			Handler:    _TenantAPI_GetTenant_Handler,
		},
		{
			MethodName: "GetTenantByClaim",
			Handler:    _TenantAPI_GetTenantByClaim_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cs3/identity/tenant/v1beta1/tenant_api.proto",
}
