// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 // - protoc (unknown) // source: discount/service.proto package discount import ( context "context" 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 ( DiscountService_GetAllDiscounts_FullMethodName = "/discount.DiscountService/GetAllDiscounts" DiscountService_GetUserDiscounts_FullMethodName = "/discount.DiscountService/GetUserDiscounts" DiscountService_DetermineDiscounts_FullMethodName = "/discount.DiscountService/DetermineDiscounts" DiscountService_ApplyDiscounts_FullMethodName = "/discount.DiscountService/ApplyDiscounts" DiscountService_GetDiscountByID_FullMethodName = "/discount.DiscountService/GetDiscountByID" DiscountService_CreateDiscount_FullMethodName = "/discount.DiscountService/CreateDiscount" DiscountService_ReplaceDiscount_FullMethodName = "/discount.DiscountService/ReplaceDiscount" DiscountService_UpdateDiscount_FullMethodName = "/discount.DiscountService/UpdateDiscount" DiscountService_DeleteDiscount_FullMethodName = "/discount.DiscountService/DeleteDiscount" ) // DiscountServiceClient is the client API for DiscountService 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 DiscountServiceClient interface { GetAllDiscounts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Discounts, error) GetUserDiscounts(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discounts, error) DetermineDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*Discounts, error) ApplyDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*ApplyDiscountResponse, error) GetDiscountByID(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) CreateDiscount(ctx context.Context, in *CreateDiscountRequest, opts ...grpc.CallOption) (*Discount, error) ReplaceDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) UpdateDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) DeleteDiscount(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) } type discountServiceClient struct { cc grpc.ClientConnInterface } func NewDiscountServiceClient(cc grpc.ClientConnInterface) DiscountServiceClient { return &discountServiceClient{cc} } func (c *discountServiceClient) GetAllDiscounts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Discounts, error) { out := new(Discounts) err := c.cc.Invoke(ctx, DiscountService_GetAllDiscounts_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *discountServiceClient) GetUserDiscounts(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discounts, error) { out := new(Discounts) err := c.cc.Invoke(ctx, DiscountService_GetUserDiscounts_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *discountServiceClient) DetermineDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*Discounts, error) { out := new(Discounts) err := c.cc.Invoke(ctx, DiscountService_DetermineDiscounts_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *discountServiceClient) ApplyDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*ApplyDiscountResponse, error) { out := new(ApplyDiscountResponse) err := c.cc.Invoke(ctx, DiscountService_ApplyDiscounts_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *discountServiceClient) GetDiscountByID(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) { out := new(Discount) err := c.cc.Invoke(ctx, DiscountService_GetDiscountByID_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *discountServiceClient) CreateDiscount(ctx context.Context, in *CreateDiscountRequest, opts ...grpc.CallOption) (*Discount, error) { out := new(Discount) err := c.cc.Invoke(ctx, DiscountService_CreateDiscount_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *discountServiceClient) ReplaceDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) { out := new(Discount) err := c.cc.Invoke(ctx, DiscountService_ReplaceDiscount_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *discountServiceClient) UpdateDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) { out := new(Discount) err := c.cc.Invoke(ctx, DiscountService_UpdateDiscount_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *discountServiceClient) DeleteDiscount(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) { out := new(Discount) err := c.cc.Invoke(ctx, DiscountService_DeleteDiscount_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } // DiscountServiceServer is the server API for DiscountService service. // All implementations should embed UnimplementedDiscountServiceServer // for forward compatibility type DiscountServiceServer interface { GetAllDiscounts(context.Context, *emptypb.Empty) (*Discounts, error) GetUserDiscounts(context.Context, *GetDiscountByIDRequest) (*Discounts, error) DetermineDiscounts(context.Context, *ApplyDiscountRequest) (*Discounts, error) ApplyDiscounts(context.Context, *ApplyDiscountRequest) (*ApplyDiscountResponse, error) GetDiscountByID(context.Context, *GetDiscountByIDRequest) (*Discount, error) CreateDiscount(context.Context, *CreateDiscountRequest) (*Discount, error) ReplaceDiscount(context.Context, *DiscountOptional) (*Discount, error) UpdateDiscount(context.Context, *DiscountOptional) (*Discount, error) DeleteDiscount(context.Context, *GetDiscountByIDRequest) (*Discount, error) } // UnimplementedDiscountServiceServer should be embedded to have forward compatible implementations. type UnimplementedDiscountServiceServer struct { } func (UnimplementedDiscountServiceServer) GetAllDiscounts(context.Context, *emptypb.Empty) (*Discounts, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAllDiscounts not implemented") } func (UnimplementedDiscountServiceServer) GetUserDiscounts(context.Context, *GetDiscountByIDRequest) (*Discounts, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserDiscounts not implemented") } func (UnimplementedDiscountServiceServer) DetermineDiscounts(context.Context, *ApplyDiscountRequest) (*Discounts, error) { return nil, status.Errorf(codes.Unimplemented, "method DetermineDiscounts not implemented") } func (UnimplementedDiscountServiceServer) ApplyDiscounts(context.Context, *ApplyDiscountRequest) (*ApplyDiscountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ApplyDiscounts not implemented") } func (UnimplementedDiscountServiceServer) GetDiscountByID(context.Context, *GetDiscountByIDRequest) (*Discount, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDiscountByID not implemented") } func (UnimplementedDiscountServiceServer) CreateDiscount(context.Context, *CreateDiscountRequest) (*Discount, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateDiscount not implemented") } func (UnimplementedDiscountServiceServer) ReplaceDiscount(context.Context, *DiscountOptional) (*Discount, error) { return nil, status.Errorf(codes.Unimplemented, "method ReplaceDiscount not implemented") } func (UnimplementedDiscountServiceServer) UpdateDiscount(context.Context, *DiscountOptional) (*Discount, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateDiscount not implemented") } func (UnimplementedDiscountServiceServer) DeleteDiscount(context.Context, *GetDiscountByIDRequest) (*Discount, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteDiscount not implemented") } // UnsafeDiscountServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to DiscountServiceServer will // result in compilation errors. type UnsafeDiscountServiceServer interface { mustEmbedUnimplementedDiscountServiceServer() } func RegisterDiscountServiceServer(s grpc.ServiceRegistrar, srv DiscountServiceServer) { s.RegisterService(&DiscountService_ServiceDesc, srv) } func _DiscountService_GetAllDiscounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DiscountServiceServer).GetAllDiscounts(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: DiscountService_GetAllDiscounts_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscountServiceServer).GetAllDiscounts(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _DiscountService_GetUserDiscounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetDiscountByIDRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DiscountServiceServer).GetUserDiscounts(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: DiscountService_GetUserDiscounts_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscountServiceServer).GetUserDiscounts(ctx, req.(*GetDiscountByIDRequest)) } return interceptor(ctx, in, info, handler) } func _DiscountService_DetermineDiscounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ApplyDiscountRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DiscountServiceServer).DetermineDiscounts(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: DiscountService_DetermineDiscounts_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscountServiceServer).DetermineDiscounts(ctx, req.(*ApplyDiscountRequest)) } return interceptor(ctx, in, info, handler) } func _DiscountService_ApplyDiscounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ApplyDiscountRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DiscountServiceServer).ApplyDiscounts(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: DiscountService_ApplyDiscounts_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscountServiceServer).ApplyDiscounts(ctx, req.(*ApplyDiscountRequest)) } return interceptor(ctx, in, info, handler) } func _DiscountService_GetDiscountByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetDiscountByIDRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DiscountServiceServer).GetDiscountByID(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: DiscountService_GetDiscountByID_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscountServiceServer).GetDiscountByID(ctx, req.(*GetDiscountByIDRequest)) } return interceptor(ctx, in, info, handler) } func _DiscountService_CreateDiscount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateDiscountRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DiscountServiceServer).CreateDiscount(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: DiscountService_CreateDiscount_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscountServiceServer).CreateDiscount(ctx, req.(*CreateDiscountRequest)) } return interceptor(ctx, in, info, handler) } func _DiscountService_ReplaceDiscount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DiscountOptional) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DiscountServiceServer).ReplaceDiscount(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: DiscountService_ReplaceDiscount_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscountServiceServer).ReplaceDiscount(ctx, req.(*DiscountOptional)) } return interceptor(ctx, in, info, handler) } func _DiscountService_UpdateDiscount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DiscountOptional) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DiscountServiceServer).UpdateDiscount(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: DiscountService_UpdateDiscount_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscountServiceServer).UpdateDiscount(ctx, req.(*DiscountOptional)) } return interceptor(ctx, in, info, handler) } func _DiscountService_DeleteDiscount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetDiscountByIDRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(DiscountServiceServer).DeleteDiscount(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: DiscountService_DeleteDiscount_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscountServiceServer).DeleteDiscount(ctx, req.(*GetDiscountByIDRequest)) } return interceptor(ctx, in, info, handler) } // DiscountService_ServiceDesc is the grpc.ServiceDesc for DiscountService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var DiscountService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "discount.DiscountService", HandlerType: (*DiscountServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetAllDiscounts", Handler: _DiscountService_GetAllDiscounts_Handler, }, { MethodName: "GetUserDiscounts", Handler: _DiscountService_GetUserDiscounts_Handler, }, { MethodName: "DetermineDiscounts", Handler: _DiscountService_DetermineDiscounts_Handler, }, { MethodName: "ApplyDiscounts", Handler: _DiscountService_ApplyDiscounts_Handler, }, { MethodName: "GetDiscountByID", Handler: _DiscountService_GetDiscountByID_Handler, }, { MethodName: "CreateDiscount", Handler: _DiscountService_CreateDiscount_Handler, }, { MethodName: "ReplaceDiscount", Handler: _DiscountService_ReplaceDiscount_Handler, }, { MethodName: "UpdateDiscount", Handler: _DiscountService_UpdateDiscount_Handler, }, { MethodName: "DeleteDiscount", Handler: _DiscountService_DeleteDiscount_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "discount/service.proto", }