"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RestApiOrigin=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),utils_1=require("./private/utils"),cloudfront=require("../../aws-cloudfront"),cdk=require("../../core");class RestApiOrigin extends cloudfront.OriginBase{constructor(restApi,props={}){super(cdk.Fn.select(2,cdk.Fn.split("/",restApi.url)),{originPath:props.originPath??`/${cdk.Fn.select(3,cdk.Fn.split("/",restApi.url))}`,...props}),this.props=props;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_apigateway_RestApi(restApi),jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudfront_origins_RestApiOriginProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,RestApiOrigin),error}(0,utils_1.validateSecondsInRangeOrUndefined)("readTimeout",1,180,props.readTimeout),(0,utils_1.validateSecondsInRangeOrUndefined)("keepaliveTimeout",1,180,props.keepaliveTimeout)}renderCustomOriginConfig(){return{originSslProtocols:[cloudfront.OriginSslPolicy.TLS_V1_2],originProtocolPolicy:cloudfront.OriginProtocolPolicy.HTTPS_ONLY,originReadTimeout:this.props.readTimeout?.toSeconds(),originKeepaliveTimeout:this.props.keepaliveTimeout?.toSeconds()}}}exports.RestApiOrigin=RestApiOrigin,_a=JSII_RTTI_SYMBOL_1,RestApiOrigin[_a]={fqn:"aws-cdk-lib.aws_cloudfront_origins.RestApiOrigin",version:"2.96.1"};
