// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             (unknown)
// source: runtime/v1/authorization.proto

package runtimev1

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	AuthorizationLifecycleService_BeginAuthorization_FullMethodName         = "/nexuscrm.runtime.v1.AuthorizationLifecycleService/BeginAuthorization"
	AuthorizationLifecycleService_CompleteAuthorization_FullMethodName      = "/nexuscrm.runtime.v1.AuthorizationLifecycleService/CompleteAuthorization"
	AuthorizationLifecycleService_ExchangeAuthorizationToken_FullMethodName = "/nexuscrm.runtime.v1.AuthorizationLifecycleService/ExchangeAuthorizationToken"
)

// AuthorizationLifecycleServiceClient is the client API for AuthorizationLifecycleService 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.
//
// AuthorizationLifecycle exposes one coarse, app-blind authorization journey
// on the existing private Runtime endpoint. OAuth HTTP semantics remain owned
// by L1. Access and refresh tokens and presented exchange credentials are
// transport-only and deliberately absent from these messages. Machine-
// principal identity is resolved by Runtime from registered-client authority;
// no caller-selected Run As User enters this contract.
type AuthorizationLifecycleServiceClient interface {
	BeginAuthorization(ctx context.Context, in *BeginAuthorizationRequest, opts ...grpc.CallOption) (*BeginAuthorizationResponse, error)
	CompleteAuthorization(ctx context.Context, in *CompleteAuthorizationRequest, opts ...grpc.CallOption) (*CompleteAuthorizationResponse, error)
	ExchangeAuthorizationToken(ctx context.Context, in *ExchangeAuthorizationTokenRequest, opts ...grpc.CallOption) (*ExchangeAuthorizationTokenResponse, error)
}

type authorizationLifecycleServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAuthorizationLifecycleServiceClient(cc grpc.ClientConnInterface) AuthorizationLifecycleServiceClient {
	return &authorizationLifecycleServiceClient{cc}
}

func (c *authorizationLifecycleServiceClient) BeginAuthorization(ctx context.Context, in *BeginAuthorizationRequest, opts ...grpc.CallOption) (*BeginAuthorizationResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(BeginAuthorizationResponse)
	err := c.cc.Invoke(ctx, AuthorizationLifecycleService_BeginAuthorization_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *authorizationLifecycleServiceClient) CompleteAuthorization(ctx context.Context, in *CompleteAuthorizationRequest, opts ...grpc.CallOption) (*CompleteAuthorizationResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CompleteAuthorizationResponse)
	err := c.cc.Invoke(ctx, AuthorizationLifecycleService_CompleteAuthorization_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *authorizationLifecycleServiceClient) ExchangeAuthorizationToken(ctx context.Context, in *ExchangeAuthorizationTokenRequest, opts ...grpc.CallOption) (*ExchangeAuthorizationTokenResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ExchangeAuthorizationTokenResponse)
	err := c.cc.Invoke(ctx, AuthorizationLifecycleService_ExchangeAuthorizationToken_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AuthorizationLifecycleServiceServer is the server API for AuthorizationLifecycleService service.
// All implementations must embed UnimplementedAuthorizationLifecycleServiceServer
// for forward compatibility.
//
// AuthorizationLifecycle exposes one coarse, app-blind authorization journey
// on the existing private Runtime endpoint. OAuth HTTP semantics remain owned
// by L1. Access and refresh tokens and presented exchange credentials are
// transport-only and deliberately absent from these messages. Machine-
// principal identity is resolved by Runtime from registered-client authority;
// no caller-selected Run As User enters this contract.
type AuthorizationLifecycleServiceServer interface {
	BeginAuthorization(context.Context, *BeginAuthorizationRequest) (*BeginAuthorizationResponse, error)
	CompleteAuthorization(context.Context, *CompleteAuthorizationRequest) (*CompleteAuthorizationResponse, error)
	ExchangeAuthorizationToken(context.Context, *ExchangeAuthorizationTokenRequest) (*ExchangeAuthorizationTokenResponse, error)
	mustEmbedUnimplementedAuthorizationLifecycleServiceServer()
}

// UnimplementedAuthorizationLifecycleServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAuthorizationLifecycleServiceServer struct{}

func (UnimplementedAuthorizationLifecycleServiceServer) BeginAuthorization(context.Context, *BeginAuthorizationRequest) (*BeginAuthorizationResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method BeginAuthorization not implemented")
}
func (UnimplementedAuthorizationLifecycleServiceServer) CompleteAuthorization(context.Context, *CompleteAuthorizationRequest) (*CompleteAuthorizationResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method CompleteAuthorization not implemented")
}
func (UnimplementedAuthorizationLifecycleServiceServer) ExchangeAuthorizationToken(context.Context, *ExchangeAuthorizationTokenRequest) (*ExchangeAuthorizationTokenResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ExchangeAuthorizationToken not implemented")
}
func (UnimplementedAuthorizationLifecycleServiceServer) mustEmbedUnimplementedAuthorizationLifecycleServiceServer() {
}
func (UnimplementedAuthorizationLifecycleServiceServer) testEmbeddedByValue() {}

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

func RegisterAuthorizationLifecycleServiceServer(s grpc.ServiceRegistrar, srv AuthorizationLifecycleServiceServer) {
	// If the following call panics, it indicates UnimplementedAuthorizationLifecycleServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&AuthorizationLifecycleService_ServiceDesc, srv)
}

func _AuthorizationLifecycleService_BeginAuthorization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(BeginAuthorizationRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthorizationLifecycleServiceServer).BeginAuthorization(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthorizationLifecycleService_BeginAuthorization_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthorizationLifecycleServiceServer).BeginAuthorization(ctx, req.(*BeginAuthorizationRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AuthorizationLifecycleService_CompleteAuthorization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CompleteAuthorizationRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthorizationLifecycleServiceServer).CompleteAuthorization(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthorizationLifecycleService_CompleteAuthorization_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthorizationLifecycleServiceServer).CompleteAuthorization(ctx, req.(*CompleteAuthorizationRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AuthorizationLifecycleService_ExchangeAuthorizationToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ExchangeAuthorizationTokenRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AuthorizationLifecycleServiceServer).ExchangeAuthorizationToken(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AuthorizationLifecycleService_ExchangeAuthorizationToken_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AuthorizationLifecycleServiceServer).ExchangeAuthorizationToken(ctx, req.(*ExchangeAuthorizationTokenRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// AuthorizationLifecycleService_ServiceDesc is the grpc.ServiceDesc for AuthorizationLifecycleService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AuthorizationLifecycleService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "nexuscrm.runtime.v1.AuthorizationLifecycleService",
	HandlerType: (*AuthorizationLifecycleServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "BeginAuthorization",
			Handler:    _AuthorizationLifecycleService_BeginAuthorization_Handler,
		},
		{
			MethodName: "CompleteAuthorization",
			Handler:    _AuthorizationLifecycleService_CompleteAuthorization_Handler,
		},
		{
			MethodName: "ExchangeAuthorizationToken",
			Handler:    _AuthorizationLifecycleService_ExchangeAuthorizationToken_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "runtime/v1/authorization.proto",
}
