// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             (unknown)
// source: flyteidl/service/auth.proto

package service

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 (
	AuthMetadataService_GetOAuth2Metadata_FullMethodName     = "/flyteidl.service.AuthMetadataService/GetOAuth2Metadata"
	AuthMetadataService_GetPublicClientConfig_FullMethodName = "/flyteidl.service.AuthMetadataService/GetPublicClientConfig"
)

// AuthMetadataServiceClient is the client API for AuthMetadataService 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 AuthMetadataServiceClient interface {
	// Anonymously accessible. Retrieves local or external oauth authorization server metadata.
	GetOAuth2Metadata(ctx context.Context, in *OAuth2MetadataRequest, opts ...grpc.CallOption) (*OAuth2MetadataResponse, error)
	// Anonymously accessible. Retrieves the client information clients should use when initiating OAuth2 authorization
	// requests.
	GetPublicClientConfig(ctx context.Context, in *PublicClientAuthConfigRequest, opts ...grpc.CallOption) (*PublicClientAuthConfigResponse, error)
}

type authMetadataServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAuthMetadataServiceClient(cc grpc.ClientConnInterface) AuthMetadataServiceClient {
	return &authMetadataServiceClient{cc}
}

func (c *authMetadataServiceClient) GetOAuth2Metadata(ctx context.Context, in *OAuth2MetadataRequest, opts ...grpc.CallOption) (*OAuth2MetadataResponse, error) {
	out := new(OAuth2MetadataResponse)
	err := c.cc.Invoke(ctx, AuthMetadataService_GetOAuth2Metadata_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *authMetadataServiceClient) GetPublicClientConfig(ctx context.Context, in *PublicClientAuthConfigRequest, opts ...grpc.CallOption) (*PublicClientAuthConfigResponse, error) {
	out := new(PublicClientAuthConfigResponse)
	err := c.cc.Invoke(ctx, AuthMetadataService_GetPublicClientConfig_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AuthMetadataServiceServer is the server API for AuthMetadataService service.
// All implementations should embed UnimplementedAuthMetadataServiceServer
// for forward compatibility
type AuthMetadataServiceServer interface {
	// Anonymously accessible. Retrieves local or external oauth authorization server metadata.
	GetOAuth2Metadata(context.Context, *OAuth2MetadataRequest) (*OAuth2MetadataResponse, error)
	// Anonymously accessible. Retrieves the client information clients should use when initiating OAuth2 authorization
	// requests.
	GetPublicClientConfig(context.Context, *PublicClientAuthConfigRequest) (*PublicClientAuthConfigResponse, error)
}

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

func (UnimplementedAuthMetadataServiceServer) GetOAuth2Metadata(context.Context, *OAuth2MetadataRequest) (*OAuth2MetadataResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetOAuth2Metadata not implemented")
}
func (UnimplementedAuthMetadataServiceServer) GetPublicClientConfig(context.Context, *PublicClientAuthConfigRequest) (*PublicClientAuthConfigResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetPublicClientConfig not implemented")
}

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

func RegisterAuthMetadataServiceServer(s grpc.ServiceRegistrar, srv AuthMetadataServiceServer) {
	s.RegisterService(&AuthMetadataService_ServiceDesc, srv)
}

func _AuthMetadataService_GetOAuth2Metadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OAuth2MetadataRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthMetadataServiceServer).GetOAuth2Metadata(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthMetadataService_GetOAuth2Metadata_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthMetadataServiceServer).GetOAuth2Metadata(ctx, req.(*OAuth2MetadataRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AuthMetadataService_GetPublicClientConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PublicClientAuthConfigRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthMetadataServiceServer).GetPublicClientConfig(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthMetadataService_GetPublicClientConfig_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthMetadataServiceServer).GetPublicClientConfig(ctx, req.(*PublicClientAuthConfigRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// AuthMetadataService_ServiceDesc is the grpc.ServiceDesc for AuthMetadataService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AuthMetadataService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "flyteidl.service.AuthMetadataService",
	HandlerType: (*AuthMetadataServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetOAuth2Metadata",
			Handler:    _AuthMetadataService_GetOAuth2Metadata_Handler,
		},
		{
			MethodName: "GetPublicClientConfig",
			Handler:    _AuthMetadataService_GetPublicClientConfig_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "flyteidl/service/auth.proto",
}
