'use strict';
var formats = require('ajv/lib/compile/formats')();
var validate = (function() {
  var refVal = [];
  return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
    'use strict'; /*# sourceURL=https://formats.openag.io/oada/service/queue.schema.json */
    var vErrors = null;
    var errors = 0;
    if (rootData === undefined) rootData = data;
    if ((data && typeof data === "object" && !Array.isArray(data))) {
      if (true) {
        var errs__0 = errors;
        var valid1 = true;
        if (data.domain === undefined) {
          valid1 = false;
          validate.errors = [{
            keyword: 'required',
            dataPath: (dataPath || '') + "",
            schemaPath: '#/required',
            params: {
              missingProperty: 'domain'
            },
            message: 'should have required property \'domain\''
          }];
          return false;
        } else {
          var errs_1 = errors;
          if (typeof data.domain !== "string") {
            validate.errors = [{
              keyword: 'type',
              dataPath: (dataPath || '') + '.domain',
              schemaPath: '#/properties/domain/type',
              params: {
                type: 'string'
              },
              message: 'should be string'
            }];
            return false;
          }
          var valid1 = errors === errs_1;
        }
        if (valid1) {
          if (data.token === undefined) {
            valid1 = false;
            validate.errors = [{
              keyword: 'required',
              dataPath: (dataPath || '') + "",
              schemaPath: '#/required',
              params: {
                missingProperty: 'token'
              },
              message: 'should have required property \'token\''
            }];
            return false;
          } else {
            var errs_1 = errors;
            if (typeof data.token !== "string") {
              validate.errors = [{
                keyword: 'type',
                dataPath: (dataPath || '') + '.token',
                schemaPath: '#/properties/token/type',
                params: {
                  type: 'string'
                },
                message: 'should be string'
              }];
              return false;
            }
            var valid1 = errors === errs_1;
          }
          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/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"
  }]
};
validate.errors = null;
module.exports = validate;