UNPKG

kubernetes-models

Version:
1 lines 3.32 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"validate",{enumerable:!0,get:function(){return validate}});let _validate=require("@kubernetes-models/validate"),_IoK8sApimachineryPkgApiResourceQuantity=require("@kubernetes-models/apimachinery/_schemas/IoK8sApimachineryPkgApiResourceQuantity"),validate=function validate21(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;if(data&&"object"==typeof data&&!Array.isArray(data)){if(void 0===data.name){let err0={instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"}};null===vErrors?vErrors=[err0]:vErrors.push(err0),errors++}if(void 0===data.currentAverageValue){let err1={instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty:"currentAverageValue"}};null===vErrors?vErrors=[err1]:vErrors.push(err1),errors++}void 0===data.currentAverageUtilization||validate22(data.currentAverageUtilization,{instancePath:instancePath+"/currentAverageUtilization",parentData:data,parentDataProperty:"currentAverageUtilization",rootData})||(errors=(vErrors=null===vErrors?validate22.errors:vErrors.concat(validate22.errors)).length),void 0===data.currentAverageValue||validate24(data.currentAverageValue,{instancePath:instancePath+"/currentAverageValue",parentData:data,parentDataProperty:"currentAverageValue",rootData})||(errors=(vErrors=null===vErrors?validate24.errors:vErrors.concat(validate24.errors)).length),void 0===data.name||validate28(data.name,{instancePath:instancePath+"/name",parentData:data,parentDataProperty:"name",rootData})||(errors=(vErrors=null===vErrors?validate28.errors:vErrors.concat(validate28.errors)).length)}else{let err2={instancePath,schemaPath:"#/type",keyword:"type",params:{type:"object"}};null===vErrors?vErrors=[err2]:vErrors.push(err2),errors++}return validate21.errors=vErrors,0===errors},formats0=_validate.formats.int32;function validate22(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;if(!("number"==typeof data&&!(data%1)&&!isNaN(data)&&isFinite(data))&&null!==data){let err0={instancePath,schemaPath:"#/type",keyword:"type",params:{type:"integer"}};null===vErrors?vErrors=[err0]:vErrors.push(err0),errors++}if("number"==typeof data&&isFinite(data)&&!formats0.validate(data)){let err1={instancePath,schemaPath:"#/format",keyword:"format",params:{format:"int32"}};null===vErrors?vErrors=[err1]:vErrors.push(err1),errors++}return validate22.errors=vErrors,0===errors}function validate24(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;return(0,_IoK8sApimachineryPkgApiResourceQuantity.validate)(data,{instancePath,parentData,parentDataProperty,rootData})||(errors=(vErrors=null===vErrors?_IoK8sApimachineryPkgApiResourceQuantity.validate.errors:vErrors.concat(_IoK8sApimachineryPkgApiResourceQuantity.validate.errors)).length),validate24.errors=vErrors,0===errors}function validate28(data,{instancePath="",parentData,parentDataProperty,rootData=data}={}){let vErrors=null,errors=0;if("string"!=typeof data){let err0={instancePath,schemaPath:"#/type",keyword:"type",params:{type:"string"}};null===vErrors?vErrors=[err0]:vErrors.push(err0),errors++}return validate28.errors=vErrors,0===errors}