// Copyright IBM Corp. 2014, 2026
// SPDX-License-Identifier: BUSL-1.1

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v5.29.3
// source: packages.proto

package packages

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 (
	Packages_ProviderPackageVersions_FullMethodName = "/terraform1.packages.Packages/ProviderPackageVersions"
	Packages_FetchProviderPackage_FullMethodName    = "/terraform1.packages.Packages/FetchProviderPackage"
	Packages_ModulePackageVersions_FullMethodName   = "/terraform1.packages.Packages/ModulePackageVersions"
	Packages_ModulePackageSourceAddr_FullMethodName = "/terraform1.packages.Packages/ModulePackageSourceAddr"
	Packages_FetchModulePackage_FullMethodName      = "/terraform1.packages.Packages/FetchModulePackage"
)

// PackagesClient is the client API for Packages 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.
//
// The Packages service provides helper functions for retrieving Terraform
// modules and providers.
//
// Unlike the Dependencies service, the Packages service does not require any
// existing configuration or sourcebundle to function.
//
// This service is designed for use with a specific command-line tool, and is
//
//	currently experimental. It can be changed and removed without warning, even
//
// in patch releases.
type PackagesClient interface {
	ProviderPackageVersions(ctx context.Context, in *ProviderPackageVersions_Request, opts ...grpc.CallOption) (*ProviderPackageVersions_Response, error)
	FetchProviderPackage(ctx context.Context, in *FetchProviderPackage_Request, opts ...grpc.CallOption) (*FetchProviderPackage_Response, error)
	ModulePackageVersions(ctx context.Context, in *ModulePackageVersions_Request, opts ...grpc.CallOption) (*ModulePackageVersions_Response, error)
	ModulePackageSourceAddr(ctx context.Context, in *ModulePackageSourceAddr_Request, opts ...grpc.CallOption) (*ModulePackageSourceAddr_Response, error)
	FetchModulePackage(ctx context.Context, in *FetchModulePackage_Request, opts ...grpc.CallOption) (*FetchModulePackage_Response, error)
}

type packagesClient struct {
	cc grpc.ClientConnInterface
}

func NewPackagesClient(cc grpc.ClientConnInterface) PackagesClient {
	return &packagesClient{cc}
}

func (c *packagesClient) ProviderPackageVersions(ctx context.Context, in *ProviderPackageVersions_Request, opts ...grpc.CallOption) (*ProviderPackageVersions_Response, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ProviderPackageVersions_Response)
	err := c.cc.Invoke(ctx, Packages_ProviderPackageVersions_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *packagesClient) FetchProviderPackage(ctx context.Context, in *FetchProviderPackage_Request, opts ...grpc.CallOption) (*FetchProviderPackage_Response, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(FetchProviderPackage_Response)
	err := c.cc.Invoke(ctx, Packages_FetchProviderPackage_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *packagesClient) ModulePackageVersions(ctx context.Context, in *ModulePackageVersions_Request, opts ...grpc.CallOption) (*ModulePackageVersions_Response, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ModulePackageVersions_Response)
	err := c.cc.Invoke(ctx, Packages_ModulePackageVersions_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *packagesClient) ModulePackageSourceAddr(ctx context.Context, in *ModulePackageSourceAddr_Request, opts ...grpc.CallOption) (*ModulePackageSourceAddr_Response, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ModulePackageSourceAddr_Response)
	err := c.cc.Invoke(ctx, Packages_ModulePackageSourceAddr_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *packagesClient) FetchModulePackage(ctx context.Context, in *FetchModulePackage_Request, opts ...grpc.CallOption) (*FetchModulePackage_Response, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(FetchModulePackage_Response)
	err := c.cc.Invoke(ctx, Packages_FetchModulePackage_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PackagesServer is the server API for Packages service.
// All implementations must embed UnimplementedPackagesServer
// for forward compatibility.
//
// The Packages service provides helper functions for retrieving Terraform
// modules and providers.
//
// Unlike the Dependencies service, the Packages service does not require any
// existing configuration or sourcebundle to function.
//
// This service is designed for use with a specific command-line tool, and is
//
//	currently experimental. It can be changed and removed without warning, even
//
// in patch releases.
type PackagesServer interface {
	ProviderPackageVersions(context.Context, *ProviderPackageVersions_Request) (*ProviderPackageVersions_Response, error)
	FetchProviderPackage(context.Context, *FetchProviderPackage_Request) (*FetchProviderPackage_Response, error)
	ModulePackageVersions(context.Context, *ModulePackageVersions_Request) (*ModulePackageVersions_Response, error)
	ModulePackageSourceAddr(context.Context, *ModulePackageSourceAddr_Request) (*ModulePackageSourceAddr_Response, error)
	FetchModulePackage(context.Context, *FetchModulePackage_Request) (*FetchModulePackage_Response, error)
	mustEmbedUnimplementedPackagesServer()
}

// UnimplementedPackagesServer 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 UnimplementedPackagesServer struct{}

func (UnimplementedPackagesServer) ProviderPackageVersions(context.Context, *ProviderPackageVersions_Request) (*ProviderPackageVersions_Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ProviderPackageVersions not implemented")
}
func (UnimplementedPackagesServer) FetchProviderPackage(context.Context, *FetchProviderPackage_Request) (*FetchProviderPackage_Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method FetchProviderPackage not implemented")
}
func (UnimplementedPackagesServer) ModulePackageVersions(context.Context, *ModulePackageVersions_Request) (*ModulePackageVersions_Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ModulePackageVersions not implemented")
}
func (UnimplementedPackagesServer) ModulePackageSourceAddr(context.Context, *ModulePackageSourceAddr_Request) (*ModulePackageSourceAddr_Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ModulePackageSourceAddr not implemented")
}
func (UnimplementedPackagesServer) FetchModulePackage(context.Context, *FetchModulePackage_Request) (*FetchModulePackage_Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method FetchModulePackage not implemented")
}
func (UnimplementedPackagesServer) mustEmbedUnimplementedPackagesServer() {}
func (UnimplementedPackagesServer) testEmbeddedByValue()                  {}

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

func RegisterPackagesServer(s grpc.ServiceRegistrar, srv PackagesServer) {
	// If the following call pancis, it indicates UnimplementedPackagesServer 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(&Packages_ServiceDesc, srv)
}

func _Packages_ProviderPackageVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ProviderPackageVersions_Request)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PackagesServer).ProviderPackageVersions(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Packages_ProviderPackageVersions_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PackagesServer).ProviderPackageVersions(ctx, req.(*ProviderPackageVersions_Request))
	}
	return interceptor(ctx, in, info, handler)
}

func _Packages_FetchProviderPackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FetchProviderPackage_Request)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PackagesServer).FetchProviderPackage(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Packages_FetchProviderPackage_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PackagesServer).FetchProviderPackage(ctx, req.(*FetchProviderPackage_Request))
	}
	return interceptor(ctx, in, info, handler)
}

func _Packages_ModulePackageVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ModulePackageVersions_Request)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PackagesServer).ModulePackageVersions(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Packages_ModulePackageVersions_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PackagesServer).ModulePackageVersions(ctx, req.(*ModulePackageVersions_Request))
	}
	return interceptor(ctx, in, info, handler)
}

func _Packages_ModulePackageSourceAddr_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ModulePackageSourceAddr_Request)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PackagesServer).ModulePackageSourceAddr(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Packages_ModulePackageSourceAddr_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PackagesServer).ModulePackageSourceAddr(ctx, req.(*ModulePackageSourceAddr_Request))
	}
	return interceptor(ctx, in, info, handler)
}

func _Packages_FetchModulePackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FetchModulePackage_Request)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PackagesServer).FetchModulePackage(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Packages_FetchModulePackage_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PackagesServer).FetchModulePackage(ctx, req.(*FetchModulePackage_Request))
	}
	return interceptor(ctx, in, info, handler)
}

// Packages_ServiceDesc is the grpc.ServiceDesc for Packages service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Packages_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "terraform1.packages.Packages",
	HandlerType: (*PackagesServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ProviderPackageVersions",
			Handler:    _Packages_ProviderPackageVersions_Handler,
		},
		{
			MethodName: "FetchProviderPackage",
			Handler:    _Packages_FetchProviderPackage_Handler,
		},
		{
			MethodName: "ModulePackageVersions",
			Handler:    _Packages_ModulePackageVersions_Handler,
		},
		{
			MethodName: "ModulePackageSourceAddr",
			Handler:    _Packages_ModulePackageSourceAddr_Handler,
		},
		{
			MethodName: "FetchModulePackage",
			Handler:    _Packages_FetchModulePackage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "packages.proto",
}
