//
// 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/org_metrics.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 (
	OrgMetricsService_Totals_FullMethodName                  = "/controlplane.v1.OrgMetricsService/Totals"
	OrgMetricsService_TopWorkflowsByRunsCount_FullMethodName = "/controlplane.v1.OrgMetricsService/TopWorkflowsByRunsCount"
	OrgMetricsService_DailyRunsCount_FullMethodName          = "/controlplane.v1.OrgMetricsService/DailyRunsCount"
)

// OrgMetricsServiceClient is the client API for OrgMetricsService 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 OrgMetricsServiceClient interface {
	Totals(ctx context.Context, in *OrgMetricsServiceTotalsRequest, opts ...grpc.CallOption) (*OrgMetricsServiceTotalsResponse, error)
	TopWorkflowsByRunsCount(ctx context.Context, in *TopWorkflowsByRunsCountRequest, opts ...grpc.CallOption) (*TopWorkflowsByRunsCountResponse, error)
	DailyRunsCount(ctx context.Context, in *DailyRunsCountRequest, opts ...grpc.CallOption) (*DailyRunsCountResponse, error)
}

type orgMetricsServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewOrgMetricsServiceClient(cc grpc.ClientConnInterface) OrgMetricsServiceClient {
	return &orgMetricsServiceClient{cc}
}

func (c *orgMetricsServiceClient) Totals(ctx context.Context, in *OrgMetricsServiceTotalsRequest, opts ...grpc.CallOption) (*OrgMetricsServiceTotalsResponse, error) {
	out := new(OrgMetricsServiceTotalsResponse)
	err := c.cc.Invoke(ctx, OrgMetricsService_Totals_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *orgMetricsServiceClient) TopWorkflowsByRunsCount(ctx context.Context, in *TopWorkflowsByRunsCountRequest, opts ...grpc.CallOption) (*TopWorkflowsByRunsCountResponse, error) {
	out := new(TopWorkflowsByRunsCountResponse)
	err := c.cc.Invoke(ctx, OrgMetricsService_TopWorkflowsByRunsCount_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *orgMetricsServiceClient) DailyRunsCount(ctx context.Context, in *DailyRunsCountRequest, opts ...grpc.CallOption) (*DailyRunsCountResponse, error) {
	out := new(DailyRunsCountResponse)
	err := c.cc.Invoke(ctx, OrgMetricsService_DailyRunsCount_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// OrgMetricsServiceServer is the server API for OrgMetricsService service.
// All implementations must embed UnimplementedOrgMetricsServiceServer
// for forward compatibility
type OrgMetricsServiceServer interface {
	Totals(context.Context, *OrgMetricsServiceTotalsRequest) (*OrgMetricsServiceTotalsResponse, error)
	TopWorkflowsByRunsCount(context.Context, *TopWorkflowsByRunsCountRequest) (*TopWorkflowsByRunsCountResponse, error)
	DailyRunsCount(context.Context, *DailyRunsCountRequest) (*DailyRunsCountResponse, error)
	mustEmbedUnimplementedOrgMetricsServiceServer()
}

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

func (UnimplementedOrgMetricsServiceServer) Totals(context.Context, *OrgMetricsServiceTotalsRequest) (*OrgMetricsServiceTotalsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Totals not implemented")
}
func (UnimplementedOrgMetricsServiceServer) TopWorkflowsByRunsCount(context.Context, *TopWorkflowsByRunsCountRequest) (*TopWorkflowsByRunsCountResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method TopWorkflowsByRunsCount not implemented")
}
func (UnimplementedOrgMetricsServiceServer) DailyRunsCount(context.Context, *DailyRunsCountRequest) (*DailyRunsCountResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DailyRunsCount not implemented")
}
func (UnimplementedOrgMetricsServiceServer) mustEmbedUnimplementedOrgMetricsServiceServer() {}

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

func RegisterOrgMetricsServiceServer(s grpc.ServiceRegistrar, srv OrgMetricsServiceServer) {
	s.RegisterService(&OrgMetricsService_ServiceDesc, srv)
}

func _OrgMetricsService_Totals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OrgMetricsServiceTotalsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OrgMetricsServiceServer).Totals(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: OrgMetricsService_Totals_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OrgMetricsServiceServer).Totals(ctx, req.(*OrgMetricsServiceTotalsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _OrgMetricsService_TopWorkflowsByRunsCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TopWorkflowsByRunsCountRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OrgMetricsServiceServer).TopWorkflowsByRunsCount(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: OrgMetricsService_TopWorkflowsByRunsCount_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OrgMetricsServiceServer).TopWorkflowsByRunsCount(ctx, req.(*TopWorkflowsByRunsCountRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _OrgMetricsService_DailyRunsCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DailyRunsCountRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OrgMetricsServiceServer).DailyRunsCount(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: OrgMetricsService_DailyRunsCount_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OrgMetricsServiceServer).DailyRunsCount(ctx, req.(*DailyRunsCountRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// OrgMetricsService_ServiceDesc is the grpc.ServiceDesc for OrgMetricsService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var OrgMetricsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "controlplane.v1.OrgMetricsService",
	HandlerType: (*OrgMetricsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Totals",
			Handler:    _OrgMetricsService_Totals_Handler,
		},
		{
			MethodName: "TopWorkflowsByRunsCount",
			Handler:    _OrgMetricsService_TopWorkflowsByRunsCount_Handler,
		},
		{
			MethodName: "DailyRunsCount",
			Handler:    _OrgMetricsService_DailyRunsCount_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "controlplane/v1/org_metrics.proto",
}
