(message: CartItem)
| 340 | }, |
| 341 | |
| 342 | toJSON(message: CartItem): unknown { |
| 343 | const obj: any = {}; |
| 344 | if (message.productId !== "") { |
| 345 | obj.productId = message.productId; |
| 346 | } |
| 347 | if (message.quantity !== 0) { |
| 348 | obj.quantity = Math.round(message.quantity); |
| 349 | } |
| 350 | return obj; |
| 351 | }, |
| 352 | |
| 353 | create<I extends Exact<DeepPartial<CartItem>, I>>(base?: I): CartItem { |
| 354 | return CartItem.fromPartial(base ?? ({} as any)); |