// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             (unknown)
// source: examples/internal/proto/examplepb/opaque.proto

package examplepb

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 (
	OpaqueEcommerceService_OpaqueGetProduct_FullMethodName             = "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueGetProduct"
	OpaqueEcommerceService_OpaqueSearchProducts_FullMethodName         = "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueSearchProducts"
	OpaqueEcommerceService_OpaqueCreateProduct_FullMethodName          = "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueCreateProduct"
	OpaqueEcommerceService_OpaqueCreateProductField_FullMethodName     = "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueCreateProductField"
	OpaqueEcommerceService_OpaqueProcessOrders_FullMethodName          = "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueProcessOrders"
	OpaqueEcommerceService_OpaqueStreamCustomerActivity_FullMethodName = "/grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService/OpaqueStreamCustomerActivity"
)

// OpaqueEcommerceServiceClient is the client API for OpaqueEcommerceService 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.
//
// OpaqueEcommerceService provides a comprehensive e-commerce API with various request/response patterns
type OpaqueEcommerceServiceClient interface {
	// OpaqueGetProduct - Unary request, unary response
	// Retrieves detailed information about a specific product
	OpaqueGetProduct(ctx context.Context, in *OpaqueGetProductRequest, opts ...grpc.CallOption) (*OpaqueGetProductResponse, error)
	// OpaqueSearchProducts - Unary request, stream response
	// Searches for products based on criteria and streams results back
	OpaqueSearchProducts(ctx context.Context, in *OpaqueSearchProductsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OpaqueSearchProductsResponse], error)
	// OpaqueCreateProduct - Unary request with body field, unary response
	// Creates a new product with the product details in the body
	OpaqueCreateProduct(ctx context.Context, in *OpaqueCreateProductRequest, opts ...grpc.CallOption) (*OpaqueCreateProductResponse, error)
	// OpaqueCreateProductField - same as above, but with body field mapping.
	OpaqueCreateProductField(ctx context.Context, in *OpaqueCreateProductFieldRequest, opts ...grpc.CallOption) (*OpaqueCreateProductFieldResponse, error)
	// OpaqueProcessOrders - Stream request, unary response
	// Processes multiple orders in a batch and returns a summary
	OpaqueProcessOrders(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse], error)
	// OpaqueStreamCustomerActivity - Stream request, stream response
	// Bidirectional streaming for real-time customer activity monitoring
	OpaqueStreamCustomerActivity(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse], error)
}

type opaqueEcommerceServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewOpaqueEcommerceServiceClient(cc grpc.ClientConnInterface) OpaqueEcommerceServiceClient {
	return &opaqueEcommerceServiceClient{cc}
}

func (c *opaqueEcommerceServiceClient) OpaqueGetProduct(ctx context.Context, in *OpaqueGetProductRequest, opts ...grpc.CallOption) (*OpaqueGetProductResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OpaqueGetProductResponse)
	err := c.cc.Invoke(ctx, OpaqueEcommerceService_OpaqueGetProduct_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *opaqueEcommerceServiceClient) OpaqueSearchProducts(ctx context.Context, in *OpaqueSearchProductsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OpaqueSearchProductsResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &OpaqueEcommerceService_ServiceDesc.Streams[0], OpaqueEcommerceService_OpaqueSearchProducts_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[OpaqueSearchProductsRequest, OpaqueSearchProductsResponse]{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type OpaqueEcommerceService_OpaqueSearchProductsClient = grpc.ServerStreamingClient[OpaqueSearchProductsResponse]

func (c *opaqueEcommerceServiceClient) OpaqueCreateProduct(ctx context.Context, in *OpaqueCreateProductRequest, opts ...grpc.CallOption) (*OpaqueCreateProductResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OpaqueCreateProductResponse)
	err := c.cc.Invoke(ctx, OpaqueEcommerceService_OpaqueCreateProduct_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *opaqueEcommerceServiceClient) OpaqueCreateProductField(ctx context.Context, in *OpaqueCreateProductFieldRequest, opts ...grpc.CallOption) (*OpaqueCreateProductFieldResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OpaqueCreateProductFieldResponse)
	err := c.cc.Invoke(ctx, OpaqueEcommerceService_OpaqueCreateProductField_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *opaqueEcommerceServiceClient) OpaqueProcessOrders(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &OpaqueEcommerceService_ServiceDesc.Streams[1], OpaqueEcommerceService_OpaqueProcessOrders_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type OpaqueEcommerceService_OpaqueProcessOrdersClient = grpc.ClientStreamingClient[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse]

func (c *opaqueEcommerceServiceClient) OpaqueStreamCustomerActivity(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &OpaqueEcommerceService_ServiceDesc.Streams[2], OpaqueEcommerceService_OpaqueStreamCustomerActivity_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type OpaqueEcommerceService_OpaqueStreamCustomerActivityClient = grpc.BidiStreamingClient[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse]

// OpaqueEcommerceServiceServer is the server API for OpaqueEcommerceService service.
// All implementations should embed UnimplementedOpaqueEcommerceServiceServer
// for forward compatibility.
//
// OpaqueEcommerceService provides a comprehensive e-commerce API with various request/response patterns
type OpaqueEcommerceServiceServer interface {
	// OpaqueGetProduct - Unary request, unary response
	// Retrieves detailed information about a specific product
	OpaqueGetProduct(context.Context, *OpaqueGetProductRequest) (*OpaqueGetProductResponse, error)
	// OpaqueSearchProducts - Unary request, stream response
	// Searches for products based on criteria and streams results back
	OpaqueSearchProducts(*OpaqueSearchProductsRequest, grpc.ServerStreamingServer[OpaqueSearchProductsResponse]) error
	// OpaqueCreateProduct - Unary request with body field, unary response
	// Creates a new product with the product details in the body
	OpaqueCreateProduct(context.Context, *OpaqueCreateProductRequest) (*OpaqueCreateProductResponse, error)
	// OpaqueCreateProductField - same as above, but with body field mapping.
	OpaqueCreateProductField(context.Context, *OpaqueCreateProductFieldRequest) (*OpaqueCreateProductFieldResponse, error)
	// OpaqueProcessOrders - Stream request, unary response
	// Processes multiple orders in a batch and returns a summary
	OpaqueProcessOrders(grpc.ClientStreamingServer[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse]) error
	// OpaqueStreamCustomerActivity - Stream request, stream response
	// Bidirectional streaming for real-time customer activity monitoring
	OpaqueStreamCustomerActivity(grpc.BidiStreamingServer[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse]) error
}

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

func (UnimplementedOpaqueEcommerceServiceServer) OpaqueGetProduct(context.Context, *OpaqueGetProductRequest) (*OpaqueGetProductResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method OpaqueGetProduct not implemented")
}
func (UnimplementedOpaqueEcommerceServiceServer) OpaqueSearchProducts(*OpaqueSearchProductsRequest, grpc.ServerStreamingServer[OpaqueSearchProductsResponse]) error {
	return status.Errorf(codes.Unimplemented, "method OpaqueSearchProducts not implemented")
}
func (UnimplementedOpaqueEcommerceServiceServer) OpaqueCreateProduct(context.Context, *OpaqueCreateProductRequest) (*OpaqueCreateProductResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method OpaqueCreateProduct not implemented")
}
func (UnimplementedOpaqueEcommerceServiceServer) OpaqueCreateProductField(context.Context, *OpaqueCreateProductFieldRequest) (*OpaqueCreateProductFieldResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method OpaqueCreateProductField not implemented")
}
func (UnimplementedOpaqueEcommerceServiceServer) OpaqueProcessOrders(grpc.ClientStreamingServer[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse]) error {
	return status.Errorf(codes.Unimplemented, "method OpaqueProcessOrders not implemented")
}
func (UnimplementedOpaqueEcommerceServiceServer) OpaqueStreamCustomerActivity(grpc.BidiStreamingServer[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse]) error {
	return status.Errorf(codes.Unimplemented, "method OpaqueStreamCustomerActivity not implemented")
}
func (UnimplementedOpaqueEcommerceServiceServer) testEmbeddedByValue() {}

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

func RegisterOpaqueEcommerceServiceServer(s grpc.ServiceRegistrar, srv OpaqueEcommerceServiceServer) {
	// If the following call pancis, it indicates UnimplementedOpaqueEcommerceServiceServer 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(&OpaqueEcommerceService_ServiceDesc, srv)
}

func _OpaqueEcommerceService_OpaqueGetProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OpaqueGetProductRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpaqueEcommerceServiceServer).OpaqueGetProduct(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: OpaqueEcommerceService_OpaqueGetProduct_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpaqueEcommerceServiceServer).OpaqueGetProduct(ctx, req.(*OpaqueGetProductRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _OpaqueEcommerceService_OpaqueSearchProducts_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(OpaqueSearchProductsRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(OpaqueEcommerceServiceServer).OpaqueSearchProducts(m, &grpc.GenericServerStream[OpaqueSearchProductsRequest, OpaqueSearchProductsResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type OpaqueEcommerceService_OpaqueSearchProductsServer = grpc.ServerStreamingServer[OpaqueSearchProductsResponse]

func _OpaqueEcommerceService_OpaqueCreateProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OpaqueCreateProductRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpaqueEcommerceServiceServer).OpaqueCreateProduct(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: OpaqueEcommerceService_OpaqueCreateProduct_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpaqueEcommerceServiceServer).OpaqueCreateProduct(ctx, req.(*OpaqueCreateProductRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _OpaqueEcommerceService_OpaqueCreateProductField_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OpaqueCreateProductFieldRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpaqueEcommerceServiceServer).OpaqueCreateProductField(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: OpaqueEcommerceService_OpaqueCreateProductField_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpaqueEcommerceServiceServer).OpaqueCreateProductField(ctx, req.(*OpaqueCreateProductFieldRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _OpaqueEcommerceService_OpaqueProcessOrders_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(OpaqueEcommerceServiceServer).OpaqueProcessOrders(&grpc.GenericServerStream[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type OpaqueEcommerceService_OpaqueProcessOrdersServer = grpc.ClientStreamingServer[OpaqueProcessOrdersRequest, OpaqueProcessOrdersResponse]

func _OpaqueEcommerceService_OpaqueStreamCustomerActivity_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(OpaqueEcommerceServiceServer).OpaqueStreamCustomerActivity(&grpc.GenericServerStream[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type OpaqueEcommerceService_OpaqueStreamCustomerActivityServer = grpc.BidiStreamingServer[OpaqueStreamCustomerActivityRequest, OpaqueStreamCustomerActivityResponse]

// OpaqueEcommerceService_ServiceDesc is the grpc.ServiceDesc for OpaqueEcommerceService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var OpaqueEcommerceService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.gateway.examples.internal.proto.examplepb.OpaqueEcommerceService",
	HandlerType: (*OpaqueEcommerceServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "OpaqueGetProduct",
			Handler:    _OpaqueEcommerceService_OpaqueGetProduct_Handler,
		},
		{
			MethodName: "OpaqueCreateProduct",
			Handler:    _OpaqueEcommerceService_OpaqueCreateProduct_Handler,
		},
		{
			MethodName: "OpaqueCreateProductField",
			Handler:    _OpaqueEcommerceService_OpaqueCreateProductField_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "OpaqueSearchProducts",
			Handler:       _OpaqueEcommerceService_OpaqueSearchProducts_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "OpaqueProcessOrders",
			Handler:       _OpaqueEcommerceService_OpaqueProcessOrders_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "OpaqueStreamCustomerActivity",
			Handler:       _OpaqueEcommerceService_OpaqueStreamCustomerActivity_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "examples/internal/proto/examplepb/opaque.proto",
}
