"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpOrigin=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),cloudfront=require("../../aws-cloudfront");class HttpOrigin extends cloudfront.OriginBase{constructor(domainName,props={}){super(domainName,props),this.props=props;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudfront_origins_HttpOriginProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.constructor),error}validateSecondsInRangeOrUndefined("readTimeout",1,180,props.readTimeout),validateSecondsInRangeOrUndefined("keepaliveTimeout",1,180,props.keepaliveTimeout)}renderCustomOriginConfig(){var _b,_c,_d,_e;return{originSslProtocols:(_b=this.props.originSslProtocols)!==null&&_b!==void 0?_b:[cloudfront.OriginSslPolicy.TLS_V1_2],originProtocolPolicy:(_c=this.props.protocolPolicy)!==null&&_c!==void 0?_c:cloudfront.OriginProtocolPolicy.HTTPS_ONLY,httpPort:this.props.httpPort,httpsPort:this.props.httpsPort,originReadTimeout:(_d=this.props.readTimeout)===null||_d===void 0?void 0:_d.toSeconds(),originKeepaliveTimeout:(_e=this.props.keepaliveTimeout)===null||_e===void 0?void 0:_e.toSeconds()}}}exports.HttpOrigin=HttpOrigin,_a=JSII_RTTI_SYMBOL_1,HttpOrigin[_a]={fqn:"aws-cdk-lib.aws_cloudfront_origins.HttpOrigin",version:"2.21.0"};function validateSecondsInRangeOrUndefined(name,min,max,duration){if(duration===void 0)return;const value=duration.toSeconds();if(!Number.isInteger(value)||value<min||value>max)throw new Error(`${name}: Must be an int between ${min} and ${max} seconds (inclusive); received ${value}.`)}
//# sourceMappingURL=http-origin.js.map
