sfgboxapi

<back to all web services

ProductsMetricsAutoQueryLookup

"use strict";
export class QueryBase {
    /** @param {{skip?:number,take?:number,orderBy?:string,orderByDesc?:string,include?:string,fields?:string,meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {?number} */
    skip;
    /** @type {?number} */
    take;
    /** @type {string} */
    orderBy;
    /** @type {string} */
    orderByDesc;
    /** @type {string} */
    include;
    /** @type {string} */
    fields;
    /** @type {{ [index: string]: string; }} */
    meta;
}
/** @typedef T {any} */
export class QueryDb extends QueryBase {
    /** @param {{skip?:number,take?:number,orderBy?:string,orderByDesc?:string,include?:string,fields?:string,meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
}
export class ProductsMetrics {
    /** @param {{id?:number,tenantsId?:number,zonesId?:number,productsId?:number,priceKg?:number,priceDescription?:string,betaineMg?:number,calciumMg?:number,cholineMg?:number,copperMg?:number,fiberG?:number,fluorideMg?:number,folateMcg?:number,ironMg?:number,magnesiumMg?:number,mangeneseMg?:number,monoG?:number,niacinMg?:number,omega3Mg?:number,omega6Mg?:number,panthenicAcidMg?:number,phosphorusMg?:number,polyG?:number,potassiumMg?:number,proteinG?:number,riboflavinMg?:number,saturatedG?:number,seleniumMcg?:number,sodiumMg?:number,starchG?:number,sugarsG?:number,thiaminMg?:number,vitaminAMcg?:number,vitaminB12Mcg?:number,vitaminB6Mg?:number,vitaminCMg?:number,vitaminDMg?:number,vitaminEMg?:number,vitaminKMcg?:number,zincMg?:number,transG?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    id;
    /** @type {number} */
    tenantsId;
    /** @type {number} */
    zonesId;
    /** @type {number} */
    productsId;
    /** @type {number} */
    priceKg;
    /** @type {string} */
    priceDescription;
    /** @type {?number} */
    betaineMg;
    /** @type {?number} */
    calciumMg;
    /** @type {?number} */
    cholineMg;
    /** @type {?number} */
    copperMg;
    /** @type {?number} */
    fiberG;
    /** @type {?number} */
    fluorideMg;
    /** @type {?number} */
    folateMcg;
    /** @type {?number} */
    ironMg;
    /** @type {?number} */
    magnesiumMg;
    /** @type {?number} */
    mangeneseMg;
    /** @type {?number} */
    monoG;
    /** @type {?number} */
    niacinMg;
    /** @type {?number} */
    omega3Mg;
    /** @type {?number} */
    omega6Mg;
    /** @type {?number} */
    panthenicAcidMg;
    /** @type {?number} */
    phosphorusMg;
    /** @type {?number} */
    polyG;
    /** @type {?number} */
    potassiumMg;
    /** @type {?number} */
    proteinG;
    /** @type {?number} */
    riboflavinMg;
    /** @type {?number} */
    saturatedG;
    /** @type {?number} */
    seleniumMcg;
    /** @type {?number} */
    sodiumMg;
    /** @type {?number} */
    starchG;
    /** @type {?number} */
    sugarsG;
    /** @type {?number} */
    thiaminMg;
    /** @type {?number} */
    vitaminAMcg;
    /** @type {?number} */
    vitaminB12Mcg;
    /** @type {?number} */
    vitaminB6Mg;
    /** @type {?number} */
    vitaminCMg;
    /** @type {?number} */
    vitaminDMg;
    /** @type {?number} */
    vitaminEMg;
    /** @type {?number} */
    vitaminKMcg;
    /** @type {?number} */
    zincMg;
    /** @type {?number} */
    transG;
}
export class ProductsMetricsAutoQueryLookup extends QueryDb {
    /** @param {{skip?:number,take?:number,orderBy?:string,orderByDesc?:string,include?:string,fields?:string,meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
}
export class Tenants {
    /** @param {{id?:number,mainZonesId?:number,isPublic?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    id;
    /** @type {number} */
    mainZonesId;
    /** @type {boolean} */
    isPublic;
}
/** @typedef T {any} */
export class QueryResponse {
    /** @param {{offset?:number,total?:number,results?:T[],meta?:{ [index: string]: string; },responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    offset;
    /** @type {number} */
    total;
    /** @type {T[]} */
    results;
    /** @type {{ [index: string]: string; }} */
    meta;
    /** @type {ResponseStatus} */
    responseStatus;
}

JavaScript ProductsMetricsAutoQueryLookup DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /json/reply/ProductsMetricsAutoQueryLookup HTTP/1.1 
Host: api-stage.smartfarmertech.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"skip":0,"take":0,"orderBy":"String","orderByDesc":"String","include":"String","fields":"String","meta":{"String":"String"}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"offset":0,"total":0,"results":[{"id":0,"tenantsId":0,"zonesId":0,"productsId":0,"priceKg":0,"priceDescription":"String","betaineMg":0,"calciumMg":0,"cholineMg":0,"copperMg":0,"fiberG":0,"fluorideMg":0,"folateMcg":0,"ironMg":0,"magnesiumMg":0,"mangeneseMg":0,"monoG":0,"niacinMg":0,"omega3Mg":0,"omega6Mg":0,"panthenicAcidMg":0,"phosphorusMg":0,"polyG":0,"potassiumMg":0,"proteinG":0,"riboflavinMg":0,"saturatedG":0,"seleniumMcg":0,"sodiumMg":0,"starchG":0,"sugarsG":0,"thiaminMg":0,"vitaminAMcg":0,"vitaminB12Mcg":0,"vitaminB6Mg":0,"vitaminCMg":0,"vitaminDMg":0,"vitaminEMg":0,"vitaminKMcg":0,"zincMg":0,"transG":0}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}