UNPKG

@cdktf/provider-google

Version:

Prebuilt google Provider for Terraform CDK (cdktf)

1,145 lines (1,144 loc) 525 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v; Object.defineProperty(exports, "__esModule", { value: true }); exports.ComputeRegionBackendServiceStrongSessionAffinityCookieOutputReference = exports.computeRegionBackendServiceStrongSessionAffinityCookieToHclTerraform = exports.computeRegionBackendServiceStrongSessionAffinityCookieToTerraform = exports.ComputeRegionBackendServiceStrongSessionAffinityCookieTtlOutputReference = exports.computeRegionBackendServiceStrongSessionAffinityCookieTtlToHclTerraform = exports.computeRegionBackendServiceStrongSessionAffinityCookieTtlToTerraform = exports.ComputeRegionBackendServiceOutlierDetectionOutputReference = exports.computeRegionBackendServiceOutlierDetectionToHclTerraform = exports.computeRegionBackendServiceOutlierDetectionToTerraform = exports.ComputeRegionBackendServiceOutlierDetectionIntervalOutputReference = exports.computeRegionBackendServiceOutlierDetectionIntervalToHclTerraform = exports.computeRegionBackendServiceOutlierDetectionIntervalToTerraform = exports.ComputeRegionBackendServiceOutlierDetectionBaseEjectionTimeOutputReference = exports.computeRegionBackendServiceOutlierDetectionBaseEjectionTimeToHclTerraform = exports.computeRegionBackendServiceOutlierDetectionBaseEjectionTimeToTerraform = exports.ComputeRegionBackendServiceLogConfigOutputReference = exports.computeRegionBackendServiceLogConfigToHclTerraform = exports.computeRegionBackendServiceLogConfigToTerraform = exports.ComputeRegionBackendServiceIapOutputReference = exports.computeRegionBackendServiceIapToHclTerraform = exports.computeRegionBackendServiceIapToTerraform = exports.ComputeRegionBackendServiceFailoverPolicyOutputReference = exports.computeRegionBackendServiceFailoverPolicyToHclTerraform = exports.computeRegionBackendServiceFailoverPolicyToTerraform = exports.ComputeRegionBackendServiceConsistentHashOutputReference = exports.computeRegionBackendServiceConsistentHashToHclTerraform = exports.computeRegionBackendServiceConsistentHashToTerraform = exports.ComputeRegionBackendServiceConsistentHashHttpCookieOutputReference = exports.computeRegionBackendServiceConsistentHashHttpCookieToHclTerraform = exports.computeRegionBackendServiceConsistentHashHttpCookieToTerraform = exports.ComputeRegionBackendServiceConsistentHashHttpCookieTtlOutputReference = exports.computeRegionBackendServiceConsistentHashHttpCookieTtlToHclTerraform = exports.computeRegionBackendServiceConsistentHashHttpCookieTtlToTerraform = exports.ComputeRegionBackendServiceCircuitBreakersOutputReference = exports.computeRegionBackendServiceCircuitBreakersToHclTerraform = exports.computeRegionBackendServiceCircuitBreakersToTerraform = exports.ComputeRegionBackendServiceCdnPolicyOutputReference = exports.computeRegionBackendServiceCdnPolicyToHclTerraform = exports.computeRegionBackendServiceCdnPolicyToTerraform = exports.ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyList = exports.ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyOutputReference = exports.computeRegionBackendServiceCdnPolicyNegativeCachingPolicyToHclTerraform = exports.computeRegionBackendServiceCdnPolicyNegativeCachingPolicyToTerraform = exports.ComputeRegionBackendServiceCdnPolicyCacheKeyPolicyOutputReference = exports.computeRegionBackendServiceCdnPolicyCacheKeyPolicyToHclTerraform = exports.computeRegionBackendServiceCdnPolicyCacheKeyPolicyToTerraform = exports.ComputeRegionBackendServiceBackendList = exports.ComputeRegionBackendServiceBackendOutputReference = exports.computeRegionBackendServiceBackendToHclTerraform = exports.computeRegionBackendServiceBackendToTerraform = void 0; exports.ComputeRegionBackendService = exports.ComputeRegionBackendServiceTimeoutsOutputReference = exports.computeRegionBackendServiceTimeoutsToHclTerraform = exports.computeRegionBackendServiceTimeoutsToTerraform = void 0; const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); const cdktf = require("cdktf"); function computeRegionBackendServiceBackendToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { balancing_mode: cdktf.stringToTerraform(struct.balancingMode), capacity_scaler: cdktf.numberToTerraform(struct.capacityScaler), description: cdktf.stringToTerraform(struct.description), failover: cdktf.booleanToTerraform(struct.failover), group: cdktf.stringToTerraform(struct.group), max_connections: cdktf.numberToTerraform(struct.maxConnections), max_connections_per_endpoint: cdktf.numberToTerraform(struct.maxConnectionsPerEndpoint), max_connections_per_instance: cdktf.numberToTerraform(struct.maxConnectionsPerInstance), max_rate: cdktf.numberToTerraform(struct.maxRate), max_rate_per_endpoint: cdktf.numberToTerraform(struct.maxRatePerEndpoint), max_rate_per_instance: cdktf.numberToTerraform(struct.maxRatePerInstance), max_utilization: cdktf.numberToTerraform(struct.maxUtilization), }; } exports.computeRegionBackendServiceBackendToTerraform = computeRegionBackendServiceBackendToTerraform; function computeRegionBackendServiceBackendToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { balancing_mode: { value: cdktf.stringToHclTerraform(struct.balancingMode), isBlock: false, type: "simple", storageClassType: "string", }, capacity_scaler: { value: cdktf.numberToHclTerraform(struct.capacityScaler), isBlock: false, type: "simple", storageClassType: "number", }, description: { value: cdktf.stringToHclTerraform(struct.description), isBlock: false, type: "simple", storageClassType: "string", }, failover: { value: cdktf.booleanToHclTerraform(struct.failover), isBlock: false, type: "simple", storageClassType: "boolean", }, group: { value: cdktf.stringToHclTerraform(struct.group), isBlock: false, type: "simple", storageClassType: "string", }, max_connections: { value: cdktf.numberToHclTerraform(struct.maxConnections), isBlock: false, type: "simple", storageClassType: "number", }, max_connections_per_endpoint: { value: cdktf.numberToHclTerraform(struct.maxConnectionsPerEndpoint), isBlock: false, type: "simple", storageClassType: "number", }, max_connections_per_instance: { value: cdktf.numberToHclTerraform(struct.maxConnectionsPerInstance), isBlock: false, type: "simple", storageClassType: "number", }, max_rate: { value: cdktf.numberToHclTerraform(struct.maxRate), isBlock: false, type: "simple", storageClassType: "number", }, max_rate_per_endpoint: { value: cdktf.numberToHclTerraform(struct.maxRatePerEndpoint), isBlock: false, type: "simple", storageClassType: "number", }, max_rate_per_instance: { value: cdktf.numberToHclTerraform(struct.maxRatePerInstance), isBlock: false, type: "simple", storageClassType: "number", }, max_utilization: { value: cdktf.numberToHclTerraform(struct.maxUtilization), isBlock: false, type: "simple", storageClassType: "number", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.computeRegionBackendServiceBackendToHclTerraform = computeRegionBackendServiceBackendToHclTerraform; class ComputeRegionBackendServiceBackendOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param complexObjectIndex the index of this item in the list * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource, terraformAttribute, complexObjectIndex, complexObjectIsFromSet) { super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); this.isEmptyObject = false; } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._balancingMode !== undefined) { hasAnyValues = true; internalValueResult.balancingMode = this._balancingMode; } if (this._capacityScaler !== undefined) { hasAnyValues = true; internalValueResult.capacityScaler = this._capacityScaler; } if (this._description !== undefined) { hasAnyValues = true; internalValueResult.description = this._description; } if (this._failover !== undefined) { hasAnyValues = true; internalValueResult.failover = this._failover; } if (this._group !== undefined) { hasAnyValues = true; internalValueResult.group = this._group; } if (this._maxConnections !== undefined) { hasAnyValues = true; internalValueResult.maxConnections = this._maxConnections; } if (this._maxConnectionsPerEndpoint !== undefined) { hasAnyValues = true; internalValueResult.maxConnectionsPerEndpoint = this._maxConnectionsPerEndpoint; } if (this._maxConnectionsPerInstance !== undefined) { hasAnyValues = true; internalValueResult.maxConnectionsPerInstance = this._maxConnectionsPerInstance; } if (this._maxRate !== undefined) { hasAnyValues = true; internalValueResult.maxRate = this._maxRate; } if (this._maxRatePerEndpoint !== undefined) { hasAnyValues = true; internalValueResult.maxRatePerEndpoint = this._maxRatePerEndpoint; } if (this._maxRatePerInstance !== undefined) { hasAnyValues = true; internalValueResult.maxRatePerInstance = this._maxRatePerInstance; } if (this._maxUtilization !== undefined) { hasAnyValues = true; internalValueResult.maxUtilization = this._maxUtilization; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._balancingMode = undefined; this._capacityScaler = undefined; this._description = undefined; this._failover = undefined; this._group = undefined; this._maxConnections = undefined; this._maxConnectionsPerEndpoint = undefined; this._maxConnectionsPerInstance = undefined; this._maxRate = undefined; this._maxRatePerEndpoint = undefined; this._maxRatePerInstance = undefined; this._maxUtilization = undefined; } else if (cdktf.Tokenization.isResolvable(value)) { this.isEmptyObject = false; this.resolvableValue = value; } else { this.isEmptyObject = Object.keys(value).length === 0; this.resolvableValue = undefined; this._balancingMode = value.balancingMode; this._capacityScaler = value.capacityScaler; this._description = value.description; this._failover = value.failover; this._group = value.group; this._maxConnections = value.maxConnections; this._maxConnectionsPerEndpoint = value.maxConnectionsPerEndpoint; this._maxConnectionsPerInstance = value.maxConnectionsPerInstance; this._maxRate = value.maxRate; this._maxRatePerEndpoint = value.maxRatePerEndpoint; this._maxRatePerInstance = value.maxRatePerInstance; this._maxUtilization = value.maxUtilization; } } get balancingMode() { return this.getStringAttribute('balancing_mode'); } set balancingMode(value) { this._balancingMode = value; } resetBalancingMode() { this._balancingMode = undefined; } // Temporarily expose input value. Use with caution. get balancingModeInput() { return this._balancingMode; } get capacityScaler() { return this.getNumberAttribute('capacity_scaler'); } set capacityScaler(value) { this._capacityScaler = value; } resetCapacityScaler() { this._capacityScaler = undefined; } // Temporarily expose input value. Use with caution. get capacityScalerInput() { return this._capacityScaler; } get description() { return this.getStringAttribute('description'); } set description(value) { this._description = value; } resetDescription() { this._description = undefined; } // Temporarily expose input value. Use with caution. get descriptionInput() { return this._description; } get failover() { return this.getBooleanAttribute('failover'); } set failover(value) { this._failover = value; } resetFailover() { this._failover = undefined; } // Temporarily expose input value. Use with caution. get failoverInput() { return this._failover; } get group() { return this.getStringAttribute('group'); } set group(value) { this._group = value; } // Temporarily expose input value. Use with caution. get groupInput() { return this._group; } get maxConnections() { return this.getNumberAttribute('max_connections'); } set maxConnections(value) { this._maxConnections = value; } resetMaxConnections() { this._maxConnections = undefined; } // Temporarily expose input value. Use with caution. get maxConnectionsInput() { return this._maxConnections; } get maxConnectionsPerEndpoint() { return this.getNumberAttribute('max_connections_per_endpoint'); } set maxConnectionsPerEndpoint(value) { this._maxConnectionsPerEndpoint = value; } resetMaxConnectionsPerEndpoint() { this._maxConnectionsPerEndpoint = undefined; } // Temporarily expose input value. Use with caution. get maxConnectionsPerEndpointInput() { return this._maxConnectionsPerEndpoint; } get maxConnectionsPerInstance() { return this.getNumberAttribute('max_connections_per_instance'); } set maxConnectionsPerInstance(value) { this._maxConnectionsPerInstance = value; } resetMaxConnectionsPerInstance() { this._maxConnectionsPerInstance = undefined; } // Temporarily expose input value. Use with caution. get maxConnectionsPerInstanceInput() { return this._maxConnectionsPerInstance; } get maxRate() { return this.getNumberAttribute('max_rate'); } set maxRate(value) { this._maxRate = value; } resetMaxRate() { this._maxRate = undefined; } // Temporarily expose input value. Use with caution. get maxRateInput() { return this._maxRate; } get maxRatePerEndpoint() { return this.getNumberAttribute('max_rate_per_endpoint'); } set maxRatePerEndpoint(value) { this._maxRatePerEndpoint = value; } resetMaxRatePerEndpoint() { this._maxRatePerEndpoint = undefined; } // Temporarily expose input value. Use with caution. get maxRatePerEndpointInput() { return this._maxRatePerEndpoint; } get maxRatePerInstance() { return this.getNumberAttribute('max_rate_per_instance'); } set maxRatePerInstance(value) { this._maxRatePerInstance = value; } resetMaxRatePerInstance() { this._maxRatePerInstance = undefined; } // Temporarily expose input value. Use with caution. get maxRatePerInstanceInput() { return this._maxRatePerInstance; } get maxUtilization() { return this.getNumberAttribute('max_utilization'); } set maxUtilization(value) { this._maxUtilization = value; } resetMaxUtilization() { this._maxUtilization = undefined; } // Temporarily expose input value. Use with caution. get maxUtilizationInput() { return this._maxUtilization; } } exports.ComputeRegionBackendServiceBackendOutputReference = ComputeRegionBackendServiceBackendOutputReference; _a = JSII_RTTI_SYMBOL_1; ComputeRegionBackendServiceBackendOutputReference[_a] = { fqn: "@cdktf/provider-google.computeRegionBackendService.ComputeRegionBackendServiceBackendOutputReference", version: "14.12.0" }; class ComputeRegionBackendServiceBackendList extends cdktf.ComplexList { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource, terraformAttribute, wrapsSet) { super(terraformResource, terraformAttribute, wrapsSet); this.terraformResource = terraformResource; this.terraformAttribute = terraformAttribute; this.wrapsSet = wrapsSet; } /** * @param index the index of the item to return */ get(index) { return new ComputeRegionBackendServiceBackendOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.ComputeRegionBackendServiceBackendList = ComputeRegionBackendServiceBackendList; _b = JSII_RTTI_SYMBOL_1; ComputeRegionBackendServiceBackendList[_b] = { fqn: "@cdktf/provider-google.computeRegionBackendService.ComputeRegionBackendServiceBackendList", version: "14.12.0" }; function computeRegionBackendServiceCdnPolicyCacheKeyPolicyToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { include_host: cdktf.booleanToTerraform(struct.includeHost), include_named_cookies: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.includeNamedCookies), include_protocol: cdktf.booleanToTerraform(struct.includeProtocol), include_query_string: cdktf.booleanToTerraform(struct.includeQueryString), query_string_blacklist: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.queryStringBlacklist), query_string_whitelist: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.queryStringWhitelist), }; } exports.computeRegionBackendServiceCdnPolicyCacheKeyPolicyToTerraform = computeRegionBackendServiceCdnPolicyCacheKeyPolicyToTerraform; function computeRegionBackendServiceCdnPolicyCacheKeyPolicyToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { include_host: { value: cdktf.booleanToHclTerraform(struct.includeHost), isBlock: false, type: "simple", storageClassType: "boolean", }, include_named_cookies: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.includeNamedCookies), isBlock: false, type: "list", storageClassType: "stringList", }, include_protocol: { value: cdktf.booleanToHclTerraform(struct.includeProtocol), isBlock: false, type: "simple", storageClassType: "boolean", }, include_query_string: { value: cdktf.booleanToHclTerraform(struct.includeQueryString), isBlock: false, type: "simple", storageClassType: "boolean", }, query_string_blacklist: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.queryStringBlacklist), isBlock: false, type: "set", storageClassType: "stringList", }, query_string_whitelist: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.queryStringWhitelist), isBlock: false, type: "set", storageClassType: "stringList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.computeRegionBackendServiceCdnPolicyCacheKeyPolicyToHclTerraform = computeRegionBackendServiceCdnPolicyCacheKeyPolicyToHclTerraform; class ComputeRegionBackendServiceCdnPolicyCacheKeyPolicyOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._includeHost !== undefined) { hasAnyValues = true; internalValueResult.includeHost = this._includeHost; } if (this._includeNamedCookies !== undefined) { hasAnyValues = true; internalValueResult.includeNamedCookies = this._includeNamedCookies; } if (this._includeProtocol !== undefined) { hasAnyValues = true; internalValueResult.includeProtocol = this._includeProtocol; } if (this._includeQueryString !== undefined) { hasAnyValues = true; internalValueResult.includeQueryString = this._includeQueryString; } if (this._queryStringBlacklist !== undefined) { hasAnyValues = true; internalValueResult.queryStringBlacklist = this._queryStringBlacklist; } if (this._queryStringWhitelist !== undefined) { hasAnyValues = true; internalValueResult.queryStringWhitelist = this._queryStringWhitelist; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._includeHost = undefined; this._includeNamedCookies = undefined; this._includeProtocol = undefined; this._includeQueryString = undefined; this._queryStringBlacklist = undefined; this._queryStringWhitelist = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._includeHost = value.includeHost; this._includeNamedCookies = value.includeNamedCookies; this._includeProtocol = value.includeProtocol; this._includeQueryString = value.includeQueryString; this._queryStringBlacklist = value.queryStringBlacklist; this._queryStringWhitelist = value.queryStringWhitelist; } } get includeHost() { return this.getBooleanAttribute('include_host'); } set includeHost(value) { this._includeHost = value; } resetIncludeHost() { this._includeHost = undefined; } // Temporarily expose input value. Use with caution. get includeHostInput() { return this._includeHost; } get includeNamedCookies() { return this.getListAttribute('include_named_cookies'); } set includeNamedCookies(value) { this._includeNamedCookies = value; } resetIncludeNamedCookies() { this._includeNamedCookies = undefined; } // Temporarily expose input value. Use with caution. get includeNamedCookiesInput() { return this._includeNamedCookies; } get includeProtocol() { return this.getBooleanAttribute('include_protocol'); } set includeProtocol(value) { this._includeProtocol = value; } resetIncludeProtocol() { this._includeProtocol = undefined; } // Temporarily expose input value. Use with caution. get includeProtocolInput() { return this._includeProtocol; } get includeQueryString() { return this.getBooleanAttribute('include_query_string'); } set includeQueryString(value) { this._includeQueryString = value; } resetIncludeQueryString() { this._includeQueryString = undefined; } // Temporarily expose input value. Use with caution. get includeQueryStringInput() { return this._includeQueryString; } get queryStringBlacklist() { return cdktf.Fn.tolist(this.getListAttribute('query_string_blacklist')); } set queryStringBlacklist(value) { this._queryStringBlacklist = value; } resetQueryStringBlacklist() { this._queryStringBlacklist = undefined; } // Temporarily expose input value. Use with caution. get queryStringBlacklistInput() { return this._queryStringBlacklist; } get queryStringWhitelist() { return cdktf.Fn.tolist(this.getListAttribute('query_string_whitelist')); } set queryStringWhitelist(value) { this._queryStringWhitelist = value; } resetQueryStringWhitelist() { this._queryStringWhitelist = undefined; } // Temporarily expose input value. Use with caution. get queryStringWhitelistInput() { return this._queryStringWhitelist; } } exports.ComputeRegionBackendServiceCdnPolicyCacheKeyPolicyOutputReference = ComputeRegionBackendServiceCdnPolicyCacheKeyPolicyOutputReference; _c = JSII_RTTI_SYMBOL_1; ComputeRegionBackendServiceCdnPolicyCacheKeyPolicyOutputReference[_c] = { fqn: "@cdktf/provider-google.computeRegionBackendService.ComputeRegionBackendServiceCdnPolicyCacheKeyPolicyOutputReference", version: "14.12.0" }; function computeRegionBackendServiceCdnPolicyNegativeCachingPolicyToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { code: cdktf.numberToTerraform(struct.code), }; } exports.computeRegionBackendServiceCdnPolicyNegativeCachingPolicyToTerraform = computeRegionBackendServiceCdnPolicyNegativeCachingPolicyToTerraform; function computeRegionBackendServiceCdnPolicyNegativeCachingPolicyToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { code: { value: cdktf.numberToHclTerraform(struct.code), isBlock: false, type: "simple", storageClassType: "number", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.computeRegionBackendServiceCdnPolicyNegativeCachingPolicyToHclTerraform = computeRegionBackendServiceCdnPolicyNegativeCachingPolicyToHclTerraform; class ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param complexObjectIndex the index of this item in the list * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource, terraformAttribute, complexObjectIndex, complexObjectIsFromSet) { super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); this.isEmptyObject = false; } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._code !== undefined) { hasAnyValues = true; internalValueResult.code = this._code; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._code = undefined; } else if (cdktf.Tokenization.isResolvable(value)) { this.isEmptyObject = false; this.resolvableValue = value; } else { this.isEmptyObject = Object.keys(value).length === 0; this.resolvableValue = undefined; this._code = value.code; } } get code() { return this.getNumberAttribute('code'); } set code(value) { this._code = value; } resetCode() { this._code = undefined; } // Temporarily expose input value. Use with caution. get codeInput() { return this._code; } } exports.ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyOutputReference = ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyOutputReference; _d = JSII_RTTI_SYMBOL_1; ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyOutputReference[_d] = { fqn: "@cdktf/provider-google.computeRegionBackendService.ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyOutputReference", version: "14.12.0" }; class ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyList extends cdktf.ComplexList { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource, terraformAttribute, wrapsSet) { super(terraformResource, terraformAttribute, wrapsSet); this.terraformResource = terraformResource; this.terraformAttribute = terraformAttribute; this.wrapsSet = wrapsSet; } /** * @param index the index of the item to return */ get(index) { return new ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyList = ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyList; _e = JSII_RTTI_SYMBOL_1; ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyList[_e] = { fqn: "@cdktf/provider-google.computeRegionBackendService.ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyList", version: "14.12.0" }; function computeRegionBackendServiceCdnPolicyToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { cache_mode: cdktf.stringToTerraform(struct.cacheMode), client_ttl: cdktf.numberToTerraform(struct.clientTtl), default_ttl: cdktf.numberToTerraform(struct.defaultTtl), max_ttl: cdktf.numberToTerraform(struct.maxTtl), negative_caching: cdktf.booleanToTerraform(struct.negativeCaching), serve_while_stale: cdktf.numberToTerraform(struct.serveWhileStale), signed_url_cache_max_age_sec: cdktf.numberToTerraform(struct.signedUrlCacheMaxAgeSec), cache_key_policy: computeRegionBackendServiceCdnPolicyCacheKeyPolicyToTerraform(struct.cacheKeyPolicy), negative_caching_policy: cdktf.listMapper(computeRegionBackendServiceCdnPolicyNegativeCachingPolicyToTerraform, true)(struct.negativeCachingPolicy), }; } exports.computeRegionBackendServiceCdnPolicyToTerraform = computeRegionBackendServiceCdnPolicyToTerraform; function computeRegionBackendServiceCdnPolicyToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { cache_mode: { value: cdktf.stringToHclTerraform(struct.cacheMode), isBlock: false, type: "simple", storageClassType: "string", }, client_ttl: { value: cdktf.numberToHclTerraform(struct.clientTtl), isBlock: false, type: "simple", storageClassType: "number", }, default_ttl: { value: cdktf.numberToHclTerraform(struct.defaultTtl), isBlock: false, type: "simple", storageClassType: "number", }, max_ttl: { value: cdktf.numberToHclTerraform(struct.maxTtl), isBlock: false, type: "simple", storageClassType: "number", }, negative_caching: { value: cdktf.booleanToHclTerraform(struct.negativeCaching), isBlock: false, type: "simple", storageClassType: "boolean", }, serve_while_stale: { value: cdktf.numberToHclTerraform(struct.serveWhileStale), isBlock: false, type: "simple", storageClassType: "number", }, signed_url_cache_max_age_sec: { value: cdktf.numberToHclTerraform(struct.signedUrlCacheMaxAgeSec), isBlock: false, type: "simple", storageClassType: "number", }, cache_key_policy: { value: computeRegionBackendServiceCdnPolicyCacheKeyPolicyToHclTerraform(struct.cacheKeyPolicy), isBlock: true, type: "list", storageClassType: "ComputeRegionBackendServiceCdnPolicyCacheKeyPolicyList", }, negative_caching_policy: { value: cdktf.listMapperHcl(computeRegionBackendServiceCdnPolicyNegativeCachingPolicyToHclTerraform, true)(struct.negativeCachingPolicy), isBlock: true, type: "list", storageClassType: "ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.computeRegionBackendServiceCdnPolicyToHclTerraform = computeRegionBackendServiceCdnPolicyToHclTerraform; class ComputeRegionBackendServiceCdnPolicyOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; // cache_key_policy - computed: false, optional: true, required: false this._cacheKeyPolicy = new ComputeRegionBackendServiceCdnPolicyCacheKeyPolicyOutputReference(this, "cache_key_policy"); // negative_caching_policy - computed: false, optional: true, required: false this._negativeCachingPolicy = new ComputeRegionBackendServiceCdnPolicyNegativeCachingPolicyList(this, "negative_caching_policy", false); } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._cacheMode !== undefined) { hasAnyValues = true; internalValueResult.cacheMode = this._cacheMode; } if (this._clientTtl !== undefined) { hasAnyValues = true; internalValueResult.clientTtl = this._clientTtl; } if (this._defaultTtl !== undefined) { hasAnyValues = true; internalValueResult.defaultTtl = this._defaultTtl; } if (this._maxTtl !== undefined) { hasAnyValues = true; internalValueResult.maxTtl = this._maxTtl; } if (this._negativeCaching !== undefined) { hasAnyValues = true; internalValueResult.negativeCaching = this._negativeCaching; } if (this._serveWhileStale !== undefined) { hasAnyValues = true; internalValueResult.serveWhileStale = this._serveWhileStale; } if (this._signedUrlCacheMaxAgeSec !== undefined) { hasAnyValues = true; internalValueResult.signedUrlCacheMaxAgeSec = this._signedUrlCacheMaxAgeSec; } if (this._cacheKeyPolicy?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.cacheKeyPolicy = this._cacheKeyPolicy?.internalValue; } if (this._negativeCachingPolicy?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.negativeCachingPolicy = this._negativeCachingPolicy?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._cacheMode = undefined; this._clientTtl = undefined; this._defaultTtl = undefined; this._maxTtl = undefined; this._negativeCaching = undefined; this._serveWhileStale = undefined; this._signedUrlCacheMaxAgeSec = undefined; this._cacheKeyPolicy.internalValue = undefined; this._negativeCachingPolicy.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._cacheMode = value.cacheMode; this._clientTtl = value.clientTtl; this._defaultTtl = value.defaultTtl; this._maxTtl = value.maxTtl; this._negativeCaching = value.negativeCaching; this._serveWhileStale = value.serveWhileStale; this._signedUrlCacheMaxAgeSec = value.signedUrlCacheMaxAgeSec; this._cacheKeyPolicy.internalValue = value.cacheKeyPolicy; this._negativeCachingPolicy.internalValue = value.negativeCachingPolicy; } } get cacheMode() { return this.getStringAttribute('cache_mode'); } set cacheMode(value) { this._cacheMode = value; } resetCacheMode() { this._cacheMode = undefined; } // Temporarily expose input value. Use with caution. get cacheModeInput() { return this._cacheMode; } get clientTtl() { return this.getNumberAttribute('client_ttl'); } set clientTtl(value) { this._clientTtl = value; } resetClientTtl() { this._clientTtl = undefined; } // Temporarily expose input value. Use with caution. get clientTtlInput() { return this._clientTtl; } get defaultTtl() { return this.getNumberAttribute('default_ttl'); } set defaultTtl(value) { this._defaultTtl = value; } resetDefaultTtl() { this._defaultTtl = undefined; } // Temporarily expose input value. Use with caution. get defaultTtlInput() { return this._defaultTtl; } get maxTtl() { return this.getNumberAttribute('max_ttl'); } set maxTtl(value) { this._maxTtl = value; } resetMaxTtl() { this._maxTtl = undefined; } // Temporarily expose input value. Use with caution. get maxTtlInput() { return this._maxTtl; } get negativeCaching() { return this.getBooleanAttribute('negative_caching'); } set negativeCaching(value) { this._negativeCaching = value; } resetNegativeCaching() { this._negativeCaching = undefined; } // Temporarily expose input value. Use with caution. get negativeCachingInput() { return this._negativeCaching; } get serveWhileStale() { return this.getNumberAttribute('serve_while_stale'); } set serveWhileStale(value) { this._serveWhileStale = value; } resetServeWhileStale() { this._serveWhileStale = undefined; } // Temporarily expose input value. Use with caution. get serveWhileStaleInput() { return this._serveWhileStale; } get signedUrlCacheMaxAgeSec() { return this.getNumberAttribute('signed_url_cache_max_age_sec'); } set signedUrlCacheMaxAgeSec(value) { this._signedUrlCacheMaxAgeSec = value; } resetSignedUrlCacheMaxAgeSec() { this._signedUrlCacheMaxAgeSec = undefined; } // Temporarily expose input value. Use with caution. get signedUrlCacheMaxAgeSecInput() { return this._signedUrlCacheMaxAgeSec; } get cacheKeyPolicy() { return this._cacheKeyPolicy; } putCacheKeyPolicy(value) { this._cacheKeyPolicy.internalValue = value; } resetCacheKeyPolicy() { this._cacheKeyPolicy.internalValue = undefined; } // Temporarily expose input value. Use with caution. get cacheKeyPolicyInput() { return this._cacheKeyPolicy.internalValue; } get negativeCachingPolicy() { return this._negativeCachingPolicy; } putNegativeCachingPolicy(value) { this._negativeCachingPolicy.internalValue = value; } resetNegativeCachingPolicy() { this._negativeCachingPolicy.internalValue = undefined; } // Temporarily expose input value. Use with caution. get negativeCachingPolicyInput() { return this._negativeCachingPolicy.internalValue; } } exports.ComputeRegionBackendServiceCdnPolicyOutputReference = ComputeRegionBackendServiceCdnPolicyOutputReference; _f = JSII_RTTI_SYMBOL_1; ComputeRegionBackendServiceCdnPolicyOutputReference[_f] = { fqn: "@cdktf/provider-google.computeRegionBackendService.ComputeRegionBackendServiceCdnPolicyOutputReference", version: "14.12.0" }; function computeRegionBackendServiceCircuitBreakersToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { max_connections: cdktf.numberToTerraform(struct.maxConnections), max_pending_requests: cdktf.numberToTerraform(struct.maxPendingRequests), max_requests: cdktf.numberToTerraform(struct.maxRequests), max_requests_per_connection: cdktf.numberToTerraform(struct.maxRequestsPerConnection), max_retries: cdktf.numberToTerraform(struct.maxRetries), }; } exports.computeRegionBackendServiceCircuitBreakersToTerraform = computeRegionBackendServiceCircuitBreakersToTerraform; function computeRegionBackendServiceCircuitBreakersToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { max_connections: { value: cdktf.numberToHclTerraform(struct.maxConnections), isBlock: false, type: "simple", storageClassType: "number", }, max_pending_requests: { value: cdktf.numberToHclTerraform(struct.maxPendingRequests), isBlock: false, type: "simple", storageClassType: "number", }, max_requests: { value: cdktf.numberToHclTerraform(struct.maxRequests), isBlock: false, type: "simple", storageClassType: "number", }, max_requests_per_connection: { value: cdktf.numberToHclTerraform(struct.maxRequestsPerConnection), isBlock: false, type: "simple", storageClassType: "number", }, max_retries: { value: cdktf.numberToHclTerraform(struct.maxRetries), isBlock: false, type: "simple", storageClassType: "number", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.computeRegionBackendServiceCircuitBreakersToHclTerraform = computeRegionBackendServiceCircuitBreakersToHclTerraform; class ComputeRegionBackendServiceCircuitBreakersOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._maxConnections !== undefined) { hasAnyValues = true; internalValueResult.maxConnections = this._maxConnections; } if (this._maxPendingRequests !== undefined) { hasAnyValues = true; internalValueResult.maxPendingRequests = this._maxPendingRequests; } if (this._maxRequests !== undefined) { hasAnyValues = true; internalValueResult.maxRequests = this._maxRequests; } if (this._maxRequestsPerConnection !== undefined) { hasAnyValues = true; internalValueResult.maxRequestsPerConnection = this._maxRequestsPerConnection; } if (this._maxRetries !== undefined) { hasAnyValues = true; internalValueResult.maxRetries = this._maxRetries; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._maxConnections = undefined; this._maxPendingRequests = undefined; this._maxRequests = undefined; this._maxRequestsPerConnection = undefined; this._maxRetries = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._maxConnections = value.maxConnections; this._maxPendingRequests = value.maxPendingRequests; this._maxRequests = value.maxRequests; this._maxRequestsPerConnection = value.maxRequestsPerConnection; this._maxRetries = value.maxRetries; } } get maxConnections() { return this.getNumberAttribute('max_connections'); } set maxConnections(value) { this._maxConnections = value; } resetMaxConnections() { this._maxConnections = undefined; } // Temporarily expose input value. Use with caution. get maxConnectionsInput() { return this._maxConnections; } get maxPendingRequests() { return this.getNumberAttribute('max_pending_requests'); } set maxPendingRequests(value) { this._maxPendingRequests = value; } resetMaxPendingRequests() { this._maxPendingRequests = undefined; } // Temporarily expose input value. Use with caution. get maxPendingRequestsInput() { return this._maxPendingRequests; } get maxRequests() { return this.getNumberAttribute('max_requests'); } set maxRequests(value) { this._maxRequests = value;