{"size": 1690, "ext": "js", "max_stars_repo_path": "dist/ride-hailing/BidParams.js", "max_stars_repo_name": "devkant/dav-js", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "dist/ride-hailing/BidParams.js", "max_issues_repo_name": "devkant/dav-js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dist/ride-hailing/BidParams.js", "max_forks_repo_name": "devkant/dav-js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.2962962963, "max_line_length": 88, "alphanum_fraction": 0.6384615385}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BidParams_1 = require("../BidParams");
const ProtocolTypes_1 = require("./ProtocolTypes");
/**
 * @class The Class ride-hailing/BidParams represent the parameters of ride-hailing bid.
 */
class BidParams extends BidParams_1.default {
    constructor(values) {
        if (!values) {
            super(BidParams._protocol, BidParams._type);
        }
        else {
            super(BidParams._protocol, BidParams._type, values);
            // TODO: throw if not enough details
            this.currentVehicleLocation = values.currentVehicleLocation;
            this.vehicle = values.vehicle;
            this.driverName = values.driverName;
        }
    }
    static getMessageType() {
        return BidParams._type;
    }
    static getMessageProtocol() {
        return BidParams._protocol;
    }
    serialize() {
        const formattedParams = super.serialize();
        Object.assign(formattedParams, {
            currentVehicleLocation: this.currentVehicleLocation,
            vehicle: this.vehicle,
            driverName: this.driverName,
        });
        return formattedParams;
    }
    deserialize(json) {
        super.deserialize(json);
        this.currentVehicleLocation = json.currentVehicleLocation;
        this.vehicle = json.vehicle;
        this.driverName = json.driverName;
    }
    equals(other) {
        return this.ttl === other.ttl && super.equals(other);
    }
    getProtocolTypes() {
        return ProtocolTypes_1.default;
    }
}
BidParams._protocol = 'ride_hailing';
BidParams._type = 'bid';
exports.default = BidParams;

//# sourceMappingURL=BidParams.js.map
