Files
stocklet/internal/pkg/protogen/warehouse/v1/service_grpc.pb.go
2024-04-16 22:27:52 +01:00

396 lines
17 KiB
Go

// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: stocklet/warehouse/v1/service.proto
package warehouse_v1
import (
context "context"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// 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 (
WarehouseService_ServiceInfo_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ServiceInfo"
WarehouseService_ViewProductStock_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ViewProductStock"
WarehouseService_ViewReservation_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ViewReservation"
WarehouseService_ProcessProductCreatedEvent_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ProcessProductCreatedEvent"
WarehouseService_ProcessOrderPendingEvent_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ProcessOrderPendingEvent"
WarehouseService_ProcessShipmentAllocationEvent_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ProcessShipmentAllocationEvent"
WarehouseService_ProcessPaymentProcessedEvent_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ProcessPaymentProcessedEvent"
)
// WarehouseServiceClient is the client API for WarehouseService 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 WarehouseServiceClient interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error)
ViewProductStock(ctx context.Context, in *ViewProductStockRequest, opts ...grpc.CallOption) (*ViewProductStockResponse, error)
ViewReservation(ctx context.Context, in *ViewReservationRequest, opts ...grpc.CallOption) (*ViewReservationResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessProductCreatedEvent(ctx context.Context, in *v11.ProductCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessOrderPendingEvent(ctx context.Context, in *v11.OrderPendingEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type warehouseServiceClient struct {
cc grpc.ClientConnInterface
}
func NewWarehouseServiceClient(cc grpc.ClientConnInterface) WarehouseServiceClient {
return &warehouseServiceClient{cc}
}
func (c *warehouseServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) {
out := new(v1.ServiceInfoResponse)
err := c.cc.Invoke(ctx, WarehouseService_ServiceInfo_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *warehouseServiceClient) ViewProductStock(ctx context.Context, in *ViewProductStockRequest, opts ...grpc.CallOption) (*ViewProductStockResponse, error) {
out := new(ViewProductStockResponse)
err := c.cc.Invoke(ctx, WarehouseService_ViewProductStock_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *warehouseServiceClient) ViewReservation(ctx context.Context, in *ViewReservationRequest, opts ...grpc.CallOption) (*ViewReservationResponse, error) {
out := new(ViewReservationResponse)
err := c.cc.Invoke(ctx, WarehouseService_ViewReservation_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *warehouseServiceClient) ProcessProductCreatedEvent(ctx context.Context, in *v11.ProductCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, WarehouseService_ProcessProductCreatedEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *warehouseServiceClient) ProcessOrderPendingEvent(ctx context.Context, in *v11.OrderPendingEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, WarehouseService_ProcessOrderPendingEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *warehouseServiceClient) ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, WarehouseService_ProcessShipmentAllocationEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *warehouseServiceClient) ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, WarehouseService_ProcessPaymentProcessedEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// WarehouseServiceServer is the server API for WarehouseService service.
// All implementations must embed UnimplementedWarehouseServiceServer
// for forward compatibility
type WarehouseServiceServer interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
ViewProductStock(context.Context, *ViewProductStockRequest) (*ViewProductStockResponse, error)
ViewReservation(context.Context, *ViewReservationRequest) (*ViewReservationResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessProductCreatedEvent(context.Context, *v11.ProductCreatedEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessOrderPendingEvent(context.Context, *v11.OrderPendingEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error)
mustEmbedUnimplementedWarehouseServiceServer()
}
// UnimplementedWarehouseServiceServer must be embedded to have forward compatible implementations.
type UnimplementedWarehouseServiceServer struct {
}
func (UnimplementedWarehouseServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented")
}
func (UnimplementedWarehouseServiceServer) ViewProductStock(context.Context, *ViewProductStockRequest) (*ViewProductStockResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewProductStock not implemented")
}
func (UnimplementedWarehouseServiceServer) ViewReservation(context.Context, *ViewReservationRequest) (*ViewReservationResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewReservation not implemented")
}
func (UnimplementedWarehouseServiceServer) ProcessProductCreatedEvent(context.Context, *v11.ProductCreatedEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessProductCreatedEvent not implemented")
}
func (UnimplementedWarehouseServiceServer) ProcessOrderPendingEvent(context.Context, *v11.OrderPendingEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessOrderPendingEvent not implemented")
}
func (UnimplementedWarehouseServiceServer) ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessShipmentAllocationEvent not implemented")
}
func (UnimplementedWarehouseServiceServer) ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessPaymentProcessedEvent not implemented")
}
func (UnimplementedWarehouseServiceServer) mustEmbedUnimplementedWarehouseServiceServer() {}
// UnsafeWarehouseServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WarehouseServiceServer will
// result in compilation errors.
type UnsafeWarehouseServiceServer interface {
mustEmbedUnimplementedWarehouseServiceServer()
}
func RegisterWarehouseServiceServer(s grpc.ServiceRegistrar, srv WarehouseServiceServer) {
s.RegisterService(&WarehouseService_ServiceDesc, srv)
}
func _WarehouseService_ServiceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.ServiceInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WarehouseServiceServer).ServiceInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WarehouseService_ServiceInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WarehouseServiceServer).ServiceInfo(ctx, req.(*v1.ServiceInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WarehouseService_ViewProductStock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewProductStockRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WarehouseServiceServer).ViewProductStock(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WarehouseService_ViewProductStock_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WarehouseServiceServer).ViewProductStock(ctx, req.(*ViewProductStockRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WarehouseService_ViewReservation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewReservationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WarehouseServiceServer).ViewReservation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WarehouseService_ViewReservation_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WarehouseServiceServer).ViewReservation(ctx, req.(*ViewReservationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WarehouseService_ProcessProductCreatedEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.ProductCreatedEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WarehouseServiceServer).ProcessProductCreatedEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WarehouseService_ProcessProductCreatedEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WarehouseServiceServer).ProcessProductCreatedEvent(ctx, req.(*v11.ProductCreatedEvent))
}
return interceptor(ctx, in, info, handler)
}
func _WarehouseService_ProcessOrderPendingEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.OrderPendingEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WarehouseServiceServer).ProcessOrderPendingEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WarehouseService_ProcessOrderPendingEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WarehouseServiceServer).ProcessOrderPendingEvent(ctx, req.(*v11.OrderPendingEvent))
}
return interceptor(ctx, in, info, handler)
}
func _WarehouseService_ProcessShipmentAllocationEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.ShipmentAllocationEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WarehouseServiceServer).ProcessShipmentAllocationEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WarehouseService_ProcessShipmentAllocationEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WarehouseServiceServer).ProcessShipmentAllocationEvent(ctx, req.(*v11.ShipmentAllocationEvent))
}
return interceptor(ctx, in, info, handler)
}
func _WarehouseService_ProcessPaymentProcessedEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.PaymentProcessedEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WarehouseServiceServer).ProcessPaymentProcessedEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WarehouseService_ProcessPaymentProcessedEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WarehouseServiceServer).ProcessPaymentProcessedEvent(ctx, req.(*v11.PaymentProcessedEvent))
}
return interceptor(ctx, in, info, handler)
}
// WarehouseService_ServiceDesc is the grpc.ServiceDesc for WarehouseService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WarehouseService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "stocklet.warehouse.v1.WarehouseService",
HandlerType: (*WarehouseServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ServiceInfo",
Handler: _WarehouseService_ServiceInfo_Handler,
},
{
MethodName: "ViewProductStock",
Handler: _WarehouseService_ViewProductStock_Handler,
},
{
MethodName: "ViewReservation",
Handler: _WarehouseService_ViewReservation_Handler,
},
{
MethodName: "ProcessProductCreatedEvent",
Handler: _WarehouseService_ProcessProductCreatedEvent_Handler,
},
{
MethodName: "ProcessOrderPendingEvent",
Handler: _WarehouseService_ProcessOrderPendingEvent_Handler,
},
{
MethodName: "ProcessShipmentAllocationEvent",
Handler: _WarehouseService_ProcessShipmentAllocationEvent_Handler,
},
{
MethodName: "ProcessPaymentProcessedEvent",
Handler: _WarehouseService_ProcessPaymentProcessedEvent_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "stocklet/warehouse/v1/service.proto",
}