Esempio n. 1
0
def putCountriesConfig():
    body = request.get_json()
    MediationConfig.getCollection().update_one(MEDIATION_DOCUMENT,
                                               {"$set": {
                                                   "countries": body
                                               }})
    return jsonify(MediationConfig.getCountries())
Esempio n. 2
0
def enableCountry(country):
    body = request.get_json()
    enable = body["enable"]
    MediationConfig.getCollection().update_one(
        MEDIATION_DOCUMENT,
        {"$set": {
            "countries." + country + ".enabled": enable
        }})
    return getEnabledCountry(country)
Esempio n. 3
0
def enableLob(country, lobName):
    enable = request.get_json()["enable"]
    optionsPath = "lobs." + country + "." + lobName + ".options.enabled"
    MediationConfig.getCollection().update_one(MEDIATION_DOCUMENT,
                                               {"$set": {
                                                   optionsPath: enable
                                               }})
    return jsonify(
        MediationConfig.getLobWithCountry(country, lobName)["options"])
Esempio n. 4
0
def lobOptionsPUT(country, lobName):
    body = request.get_json()
    optionsPath = "lobs." + country + "." + lobName + ".options"
    MediationConfig.getCollection().update_one(MEDIATION_DOCUMENT,
                                               {"$set": {
                                                   optionsPath: body
                                               }})
    return jsonify(
        MediationConfig.getLobWithCountry(country, lobName)["options"])
Esempio n. 5
0
def enableFlow(country, lobName, flowName):
    body = request.get_json()
    enable = body["enable"]
    flow = MediationConfig.getLobWithCountry(country,
                                             lobName)["flows"][flowName]
    MediationConfig.getCollection().update_one(
        MEDIATION_DOCUMENT,
        {"$set": {
            "lobs." + flow["dataPath"] + ".enabled": enable
        }})
    return jsonify(
        MediationConfig.getLobWithCountry(
            country, lobName)["flows"][flowName]["options"])
Esempio n. 6
0
def putFlowOptions(country, lobName, flowName):
    body = request.get_json()
    flow = MediationConfig.getLobWithCountry(country,
                                             lobName)["flows"][flowName]
    res = MediationConfig.getCollection().update_one(
        MEDIATION_DOCUMENT, {"$set": {
            "lobs." + flow["dataPath"]: body
        }})
    return jsonify(
        MediationConfig.getLobWithCountry(
            country, lobName)["flows"][flowName]["options"])