product_response.js 535 B

123456789101112131415161718192021222324
  1. import { bool_response } from "./bool_response";
  2. import { product } from "./product";
  3. export class product_response extends bool_response {
  4. #product;
  5. constructor(target) {
  6. super(target);
  7. this.#product = null;
  8. if (this.result) {
  9. if (!("product" in target)) {
  10. throw new Error(_("incomplete-request-with-good-status"));
  11. }
  12. this.#product = new product(target.product);
  13. }
  14. }
  15. get product() {
  16. return this.#product;
  17. }
  18. }