'use strict';
var formats = require('ajv/lib/compile/formats')();
var validate = (function() {
  var pattern0 = new RegExp('^.*$');
  var refVal = [];
  var refVal1 = {
    "$id": "https://formats.openag.io/oada/service/queue.schema.json",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "description": "The format for @oada/jobs queue a job queue request",
    "type": "object",
    "properties": {
      "domain": {
        "description": "OADA domain of the job queue",
        "type": "string"
      },
      "token": {
        "description": "Token to use when interacting with job queue",
        "type": "string"
      }
    },
    "required": ["domain", "token"],
    "examples": [{
      "domain": "dev.trellis.one",
      "token": "abc1234321cba"
    }]
  };
  refVal[1] = refVal1;
  return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
    'use strict'; /*# sourceURL=https://formats.openag.io/oada/service/queues.schema.json */
    var vErrors = null;
    var errors = 0;
    if (rootData === undefined) rootData = data;
    if ((data && typeof data === "object" && !Array.isArray(data))) {
      var errs__0 = errors;
      var valid1 = true;
      for (var key0 in data) {
        var isAdditional0 = !(false || pattern0.test(key0));
        if (isAdditional0) {
          valid1 = false;
          validate.errors = [{
            keyword: 'additionalProperties',
            dataPath: (dataPath || '') + "",
            schemaPath: '#/additionalProperties',
            params: {
              additionalProperty: '' + key0 + ''
            },
            message: 'should NOT have additional properties'
          }];
          return false;
          break;
        }
      }
      if (valid1) {
        for (var key0 in data) {
          if (pattern0.test(key0)) {
            var data1 = data[key0];
            var errs_1 = errors;
            var errs_2 = errors;
            if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
              if (true) {
                var errs__2 = errors;
                var valid3 = true;
                if (data1.domain === undefined) {
                  valid3 = false;
                  validate.errors = [{
                    keyword: 'required',
                    dataPath: (dataPath || '') + '[\'' + key0 + '\']',
                    schemaPath: './queue.schema.json/required',
                    params: {
                      missingProperty: 'domain'
                    },
                    message: 'should have required property \'domain\''
                  }];
                  return false;
                } else {
                  var errs_3 = errors;
                  if (typeof data1.domain !== "string") {
                    validate.errors = [{
                      keyword: 'type',
                      dataPath: (dataPath || '') + '[\'' + key0 + '\'].domain',
                      schemaPath: './queue.schema.json/properties/domain/type',
                      params: {
                        type: 'string'
                      },
                      message: 'should be string'
                    }];
                    return false;
                  }
                  var valid3 = errors === errs_3;
                }
                if (valid3) {
                  if (data1.token === undefined) {
                    valid3 = false;
                    validate.errors = [{
                      keyword: 'required',
                      dataPath: (dataPath || '') + '[\'' + key0 + '\']',
                      schemaPath: './queue.schema.json/required',
                      params: {
                        missingProperty: 'token'
                      },
                      message: 'should have required property \'token\''
                    }];
                    return false;
                  } else {
                    var errs_3 = errors;
                    if (typeof data1.token !== "string") {
                      validate.errors = [{
                        keyword: 'type',
                        dataPath: (dataPath || '') + '[\'' + key0 + '\'].token',
                        schemaPath: './queue.schema.json/properties/token/type',
                        params: {
                          type: 'string'
                        },
                        message: 'should be string'
                      }];
                      return false;
                    }
                    var valid3 = errors === errs_3;
                  }
                  if (valid3) {}
                }
                if (errs__2 == errors) {}
              }
            } else {
              validate.errors = [{
                keyword: 'type',
                dataPath: (dataPath || '') + '[\'' + key0 + '\']',
                schemaPath: './queue.schema.json/type',
                params: {
                  type: 'object'
                },
                message: 'should be object'
              }];
              return false;
            }
            if (errors === errs_2) {}
            var valid2 = errors === errs_2;
            if (valid2) {}
            if (errors === errs_1) {}
            var valid1 = errors === errs_1;
            if (!valid1) break;
          } else valid1 = true;
        }
        if (valid1) {}
      }
      if (errs__0 == errors) {}
    } else {
      validate.errors = [{
        keyword: 'type',
        dataPath: (dataPath || '') + "",
        schemaPath: '#/type',
        params: {
          type: 'object'
        },
        message: 'should be object'
      }];
      return false;
    }
    if (errors === 0) {}
    validate.errors = vErrors;
    return errors === 0;
  };
})();
validate.schema = {
  "$id": "https://formats.openag.io/oada/service/queues.schema.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "The format for @oada/jobs queues list",
  "type": "object",
  "patternProperties": {
    "^.*$": {
      "$ref": "./queue.schema.json"
    }
  },
  "additionalProperties": false,
  "examples": [{
    "asdxjkacsdj": {
      "domain": "https://dev.trellis.one",
      "token": "abc1234321cba",
      "path": "/bookmarks/services/MyCoolService"
    }
  }]
};
validate.errors = null;
module.exports = validate;