@cdktf/provider-google
Version:
Prebuilt google Provider for Terraform CDK (cdktf)
1,136 lines • 244 kB
JavaScript
"use strict";
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NetworkServicesGrpcRoute = exports.NetworkServicesGrpcRouteTimeoutsOutputReference = exports.NetworkServicesGrpcRouteRulesList = exports.NetworkServicesGrpcRouteRulesOutputReference = exports.NetworkServicesGrpcRouteRulesMatchesList = exports.NetworkServicesGrpcRouteRulesMatchesOutputReference = exports.NetworkServicesGrpcRouteRulesMatchesMethodOutputReference = exports.NetworkServicesGrpcRouteRulesMatchesHeadersList = exports.NetworkServicesGrpcRouteRulesMatchesHeadersOutputReference = exports.NetworkServicesGrpcRouteRulesActionOutputReference = exports.NetworkServicesGrpcRouteRulesActionRetryPolicyOutputReference = exports.NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyOutputReference = exports.NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayOutputReference = exports.NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortOutputReference = exports.NetworkServicesGrpcRouteRulesActionDestinationsList = exports.NetworkServicesGrpcRouteRulesActionDestinationsOutputReference = void 0;
exports.networkServicesGrpcRouteRulesActionDestinationsToTerraform = networkServicesGrpcRouteRulesActionDestinationsToTerraform;
exports.networkServicesGrpcRouteRulesActionDestinationsToHclTerraform = networkServicesGrpcRouteRulesActionDestinationsToHclTerraform;
exports.networkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortToTerraform = networkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortToTerraform;
exports.networkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortToHclTerraform = networkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortToHclTerraform;
exports.networkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayToTerraform = networkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayToTerraform;
exports.networkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayToHclTerraform = networkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayToHclTerraform;
exports.networkServicesGrpcRouteRulesActionFaultInjectionPolicyToTerraform = networkServicesGrpcRouteRulesActionFaultInjectionPolicyToTerraform;
exports.networkServicesGrpcRouteRulesActionFaultInjectionPolicyToHclTerraform = networkServicesGrpcRouteRulesActionFaultInjectionPolicyToHclTerraform;
exports.networkServicesGrpcRouteRulesActionRetryPolicyToTerraform = networkServicesGrpcRouteRulesActionRetryPolicyToTerraform;
exports.networkServicesGrpcRouteRulesActionRetryPolicyToHclTerraform = networkServicesGrpcRouteRulesActionRetryPolicyToHclTerraform;
exports.networkServicesGrpcRouteRulesActionToTerraform = networkServicesGrpcRouteRulesActionToTerraform;
exports.networkServicesGrpcRouteRulesActionToHclTerraform = networkServicesGrpcRouteRulesActionToHclTerraform;
exports.networkServicesGrpcRouteRulesMatchesHeadersToTerraform = networkServicesGrpcRouteRulesMatchesHeadersToTerraform;
exports.networkServicesGrpcRouteRulesMatchesHeadersToHclTerraform = networkServicesGrpcRouteRulesMatchesHeadersToHclTerraform;
exports.networkServicesGrpcRouteRulesMatchesMethodToTerraform = networkServicesGrpcRouteRulesMatchesMethodToTerraform;
exports.networkServicesGrpcRouteRulesMatchesMethodToHclTerraform = networkServicesGrpcRouteRulesMatchesMethodToHclTerraform;
exports.networkServicesGrpcRouteRulesMatchesToTerraform = networkServicesGrpcRouteRulesMatchesToTerraform;
exports.networkServicesGrpcRouteRulesMatchesToHclTerraform = networkServicesGrpcRouteRulesMatchesToHclTerraform;
exports.networkServicesGrpcRouteRulesToTerraform = networkServicesGrpcRouteRulesToTerraform;
exports.networkServicesGrpcRouteRulesToHclTerraform = networkServicesGrpcRouteRulesToHclTerraform;
exports.networkServicesGrpcRouteTimeoutsToTerraform = networkServicesGrpcRouteTimeoutsToTerraform;
exports.networkServicesGrpcRouteTimeoutsToHclTerraform = networkServicesGrpcRouteTimeoutsToHclTerraform;
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
const cdktf = require("cdktf");
function networkServicesGrpcRouteRulesActionDestinationsToTerraform(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 {
service_name: cdktf.stringToTerraform(struct.serviceName),
weight: cdktf.numberToTerraform(struct.weight),
};
}
function networkServicesGrpcRouteRulesActionDestinationsToHclTerraform(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 = {
service_name: {
value: cdktf.stringToHclTerraform(struct.serviceName),
isBlock: false,
type: "simple",
storageClassType: "string",
},
weight: {
value: cdktf.numberToHclTerraform(struct.weight),
isBlock: false,
type: "simple",
storageClassType: "number",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkServicesGrpcRouteRulesActionDestinationsOutputReference 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._serviceName !== undefined) {
hasAnyValues = true;
internalValueResult.serviceName = this._serviceName;
}
if (this._weight !== undefined) {
hasAnyValues = true;
internalValueResult.weight = this._weight;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._serviceName = undefined;
this._weight = 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._serviceName = value.serviceName;
this._weight = value.weight;
}
}
get serviceName() {
return this.getStringAttribute('service_name');
}
set serviceName(value) {
this._serviceName = value;
}
resetServiceName() {
this._serviceName = undefined;
}
// Temporarily expose input value. Use with caution.
get serviceNameInput() {
return this._serviceName;
}
get weight() {
return this.getNumberAttribute('weight');
}
set weight(value) {
this._weight = value;
}
resetWeight() {
this._weight = undefined;
}
// Temporarily expose input value. Use with caution.
get weightInput() {
return this._weight;
}
}
exports.NetworkServicesGrpcRouteRulesActionDestinationsOutputReference = NetworkServicesGrpcRouteRulesActionDestinationsOutputReference;
_a = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesActionDestinationsOutputReference[_a] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesActionDestinationsOutputReference", version: "14.35.0" };
class NetworkServicesGrpcRouteRulesActionDestinationsList 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 NetworkServicesGrpcRouteRulesActionDestinationsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.NetworkServicesGrpcRouteRulesActionDestinationsList = NetworkServicesGrpcRouteRulesActionDestinationsList;
_b = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesActionDestinationsList[_b] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesActionDestinationsList", version: "14.35.0" };
function networkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortToTerraform(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 {
http_status: cdktf.numberToTerraform(struct.httpStatus),
percentage: cdktf.numberToTerraform(struct.percentage),
};
}
function networkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortToHclTerraform(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 = {
http_status: {
value: cdktf.numberToHclTerraform(struct.httpStatus),
isBlock: false,
type: "simple",
storageClassType: "number",
},
percentage: {
value: cdktf.numberToHclTerraform(struct.percentage),
isBlock: false,
type: "simple",
storageClassType: "number",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortOutputReference 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._httpStatus !== undefined) {
hasAnyValues = true;
internalValueResult.httpStatus = this._httpStatus;
}
if (this._percentage !== undefined) {
hasAnyValues = true;
internalValueResult.percentage = this._percentage;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._httpStatus = undefined;
this._percentage = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._httpStatus = value.httpStatus;
this._percentage = value.percentage;
}
}
get httpStatus() {
return this.getNumberAttribute('http_status');
}
set httpStatus(value) {
this._httpStatus = value;
}
resetHttpStatus() {
this._httpStatus = undefined;
}
// Temporarily expose input value. Use with caution.
get httpStatusInput() {
return this._httpStatus;
}
get percentage() {
return this.getNumberAttribute('percentage');
}
set percentage(value) {
this._percentage = value;
}
resetPercentage() {
this._percentage = undefined;
}
// Temporarily expose input value. Use with caution.
get percentageInput() {
return this._percentage;
}
}
exports.NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortOutputReference = NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortOutputReference;
_c = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortOutputReference[_c] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortOutputReference", version: "14.35.0" };
function networkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayToTerraform(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 {
fixed_delay: cdktf.stringToTerraform(struct.fixedDelay),
percentage: cdktf.numberToTerraform(struct.percentage),
};
}
function networkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayToHclTerraform(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 = {
fixed_delay: {
value: cdktf.stringToHclTerraform(struct.fixedDelay),
isBlock: false,
type: "simple",
storageClassType: "string",
},
percentage: {
value: cdktf.numberToHclTerraform(struct.percentage),
isBlock: false,
type: "simple",
storageClassType: "number",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayOutputReference 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._fixedDelay !== undefined) {
hasAnyValues = true;
internalValueResult.fixedDelay = this._fixedDelay;
}
if (this._percentage !== undefined) {
hasAnyValues = true;
internalValueResult.percentage = this._percentage;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._fixedDelay = undefined;
this._percentage = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._fixedDelay = value.fixedDelay;
this._percentage = value.percentage;
}
}
get fixedDelay() {
return this.getStringAttribute('fixed_delay');
}
set fixedDelay(value) {
this._fixedDelay = value;
}
resetFixedDelay() {
this._fixedDelay = undefined;
}
// Temporarily expose input value. Use with caution.
get fixedDelayInput() {
return this._fixedDelay;
}
get percentage() {
return this.getNumberAttribute('percentage');
}
set percentage(value) {
this._percentage = value;
}
resetPercentage() {
this._percentage = undefined;
}
// Temporarily expose input value. Use with caution.
get percentageInput() {
return this._percentage;
}
}
exports.NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayOutputReference = NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayOutputReference;
_d = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayOutputReference[_d] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayOutputReference", version: "14.35.0" };
function networkServicesGrpcRouteRulesActionFaultInjectionPolicyToTerraform(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 {
abort: networkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortToTerraform(struct.abort),
delay: networkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayToTerraform(struct.delay),
};
}
function networkServicesGrpcRouteRulesActionFaultInjectionPolicyToHclTerraform(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 = {
abort: {
value: networkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortToHclTerraform(struct.abort),
isBlock: true,
type: "list",
storageClassType: "NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortList",
},
delay: {
value: networkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayToHclTerraform(struct.delay),
isBlock: true,
type: "list",
storageClassType: "NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyOutputReference 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;
// abort - computed: false, optional: true, required: false
this._abort = new NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyAbortOutputReference(this, "abort");
// delay - computed: false, optional: true, required: false
this._delay = new NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyDelayOutputReference(this, "delay");
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._abort?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.abort = this._abort?.internalValue;
}
if (this._delay?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.delay = this._delay?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._abort.internalValue = undefined;
this._delay.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._abort.internalValue = value.abort;
this._delay.internalValue = value.delay;
}
}
get abort() {
return this._abort;
}
putAbort(value) {
this._abort.internalValue = value;
}
resetAbort() {
this._abort.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get abortInput() {
return this._abort.internalValue;
}
get delay() {
return this._delay;
}
putDelay(value) {
this._delay.internalValue = value;
}
resetDelay() {
this._delay.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get delayInput() {
return this._delay.internalValue;
}
}
exports.NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyOutputReference = NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyOutputReference;
_e = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyOutputReference[_e] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyOutputReference", version: "14.35.0" };
function networkServicesGrpcRouteRulesActionRetryPolicyToTerraform(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 {
num_retries: cdktf.numberToTerraform(struct.numRetries),
retry_conditions: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.retryConditions),
};
}
function networkServicesGrpcRouteRulesActionRetryPolicyToHclTerraform(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 = {
num_retries: {
value: cdktf.numberToHclTerraform(struct.numRetries),
isBlock: false,
type: "simple",
storageClassType: "number",
},
retry_conditions: {
value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.retryConditions),
isBlock: false,
type: "list",
storageClassType: "stringList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkServicesGrpcRouteRulesActionRetryPolicyOutputReference 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._numRetries !== undefined) {
hasAnyValues = true;
internalValueResult.numRetries = this._numRetries;
}
if (this._retryConditions !== undefined) {
hasAnyValues = true;
internalValueResult.retryConditions = this._retryConditions;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._numRetries = undefined;
this._retryConditions = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._numRetries = value.numRetries;
this._retryConditions = value.retryConditions;
}
}
get numRetries() {
return this.getNumberAttribute('num_retries');
}
set numRetries(value) {
this._numRetries = value;
}
resetNumRetries() {
this._numRetries = undefined;
}
// Temporarily expose input value. Use with caution.
get numRetriesInput() {
return this._numRetries;
}
get retryConditions() {
return this.getListAttribute('retry_conditions');
}
set retryConditions(value) {
this._retryConditions = value;
}
resetRetryConditions() {
this._retryConditions = undefined;
}
// Temporarily expose input value. Use with caution.
get retryConditionsInput() {
return this._retryConditions;
}
}
exports.NetworkServicesGrpcRouteRulesActionRetryPolicyOutputReference = NetworkServicesGrpcRouteRulesActionRetryPolicyOutputReference;
_f = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesActionRetryPolicyOutputReference[_f] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesActionRetryPolicyOutputReference", version: "14.35.0" };
function networkServicesGrpcRouteRulesActionToTerraform(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 {
timeout: cdktf.stringToTerraform(struct.timeout),
destinations: cdktf.listMapper(networkServicesGrpcRouteRulesActionDestinationsToTerraform, true)(struct.destinations),
fault_injection_policy: networkServicesGrpcRouteRulesActionFaultInjectionPolicyToTerraform(struct.faultInjectionPolicy),
retry_policy: networkServicesGrpcRouteRulesActionRetryPolicyToTerraform(struct.retryPolicy),
};
}
function networkServicesGrpcRouteRulesActionToHclTerraform(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 = {
timeout: {
value: cdktf.stringToHclTerraform(struct.timeout),
isBlock: false,
type: "simple",
storageClassType: "string",
},
destinations: {
value: cdktf.listMapperHcl(networkServicesGrpcRouteRulesActionDestinationsToHclTerraform, true)(struct.destinations),
isBlock: true,
type: "list",
storageClassType: "NetworkServicesGrpcRouteRulesActionDestinationsList",
},
fault_injection_policy: {
value: networkServicesGrpcRouteRulesActionFaultInjectionPolicyToHclTerraform(struct.faultInjectionPolicy),
isBlock: true,
type: "list",
storageClassType: "NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyList",
},
retry_policy: {
value: networkServicesGrpcRouteRulesActionRetryPolicyToHclTerraform(struct.retryPolicy),
isBlock: true,
type: "list",
storageClassType: "NetworkServicesGrpcRouteRulesActionRetryPolicyList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkServicesGrpcRouteRulesActionOutputReference 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;
// destinations - computed: false, optional: true, required: false
this._destinations = new NetworkServicesGrpcRouteRulesActionDestinationsList(this, "destinations", false);
// fault_injection_policy - computed: false, optional: true, required: false
this._faultInjectionPolicy = new NetworkServicesGrpcRouteRulesActionFaultInjectionPolicyOutputReference(this, "fault_injection_policy");
// retry_policy - computed: false, optional: true, required: false
this._retryPolicy = new NetworkServicesGrpcRouteRulesActionRetryPolicyOutputReference(this, "retry_policy");
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._timeout !== undefined) {
hasAnyValues = true;
internalValueResult.timeout = this._timeout;
}
if (this._destinations?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.destinations = this._destinations?.internalValue;
}
if (this._faultInjectionPolicy?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.faultInjectionPolicy = this._faultInjectionPolicy?.internalValue;
}
if (this._retryPolicy?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.retryPolicy = this._retryPolicy?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._timeout = undefined;
this._destinations.internalValue = undefined;
this._faultInjectionPolicy.internalValue = undefined;
this._retryPolicy.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._timeout = value.timeout;
this._destinations.internalValue = value.destinations;
this._faultInjectionPolicy.internalValue = value.faultInjectionPolicy;
this._retryPolicy.internalValue = value.retryPolicy;
}
}
get timeout() {
return this.getStringAttribute('timeout');
}
set timeout(value) {
this._timeout = value;
}
resetTimeout() {
this._timeout = undefined;
}
// Temporarily expose input value. Use with caution.
get timeoutInput() {
return this._timeout;
}
get destinations() {
return this._destinations;
}
putDestinations(value) {
this._destinations.internalValue = value;
}
resetDestinations() {
this._destinations.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get destinationsInput() {
return this._destinations.internalValue;
}
get faultInjectionPolicy() {
return this._faultInjectionPolicy;
}
putFaultInjectionPolicy(value) {
this._faultInjectionPolicy.internalValue = value;
}
resetFaultInjectionPolicy() {
this._faultInjectionPolicy.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get faultInjectionPolicyInput() {
return this._faultInjectionPolicy.internalValue;
}
get retryPolicy() {
return this._retryPolicy;
}
putRetryPolicy(value) {
this._retryPolicy.internalValue = value;
}
resetRetryPolicy() {
this._retryPolicy.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get retryPolicyInput() {
return this._retryPolicy.internalValue;
}
}
exports.NetworkServicesGrpcRouteRulesActionOutputReference = NetworkServicesGrpcRouteRulesActionOutputReference;
_g = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesActionOutputReference[_g] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesActionOutputReference", version: "14.35.0" };
function networkServicesGrpcRouteRulesMatchesHeadersToTerraform(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 {
key: cdktf.stringToTerraform(struct.key),
type: cdktf.stringToTerraform(struct.type),
value: cdktf.stringToTerraform(struct.value),
};
}
function networkServicesGrpcRouteRulesMatchesHeadersToHclTerraform(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 = {
key: {
value: cdktf.stringToHclTerraform(struct.key),
isBlock: false,
type: "simple",
storageClassType: "string",
},
type: {
value: cdktf.stringToHclTerraform(struct.type),
isBlock: false,
type: "simple",
storageClassType: "string",
},
value: {
value: cdktf.stringToHclTerraform(struct.value),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkServicesGrpcRouteRulesMatchesHeadersOutputReference 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._key !== undefined) {
hasAnyValues = true;
internalValueResult.key = this._key;
}
if (this._type !== undefined) {
hasAnyValues = true;
internalValueResult.type = this._type;
}
if (this._value !== undefined) {
hasAnyValues = true;
internalValueResult.value = this._value;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._key = undefined;
this._type = undefined;
this._value = 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._key = value.key;
this._type = value.type;
this._value = value.value;
}
}
get key() {
return this.getStringAttribute('key');
}
set key(value) {
this._key = value;
}
// Temporarily expose input value. Use with caution.
get keyInput() {
return this._key;
}
get type() {
return this.getStringAttribute('type');
}
set type(value) {
this._type = value;
}
resetType() {
this._type = undefined;
}
// Temporarily expose input value. Use with caution.
get typeInput() {
return this._type;
}
get value() {
return this.getStringAttribute('value');
}
set value(value) {
this._value = value;
}
// Temporarily expose input value. Use with caution.
get valueInput() {
return this._value;
}
}
exports.NetworkServicesGrpcRouteRulesMatchesHeadersOutputReference = NetworkServicesGrpcRouteRulesMatchesHeadersOutputReference;
_h = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesMatchesHeadersOutputReference[_h] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesMatchesHeadersOutputReference", version: "14.35.0" };
class NetworkServicesGrpcRouteRulesMatchesHeadersList 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 NetworkServicesGrpcRouteRulesMatchesHeadersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.NetworkServicesGrpcRouteRulesMatchesHeadersList = NetworkServicesGrpcRouteRulesMatchesHeadersList;
_j = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesMatchesHeadersList[_j] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesMatchesHeadersList", version: "14.35.0" };
function networkServicesGrpcRouteRulesMatchesMethodToTerraform(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 {
case_sensitive: cdktf.booleanToTerraform(struct.caseSensitive),
grpc_method: cdktf.stringToTerraform(struct.grpcMethod),
grpc_service: cdktf.stringToTerraform(struct.grpcService),
};
}
function networkServicesGrpcRouteRulesMatchesMethodToHclTerraform(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 = {
case_sensitive: {
value: cdktf.booleanToHclTerraform(struct.caseSensitive),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
grpc_method: {
value: cdktf.stringToHclTerraform(struct.grpcMethod),
isBlock: false,
type: "simple",
storageClassType: "string",
},
grpc_service: {
value: cdktf.stringToHclTerraform(struct.grpcService),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkServicesGrpcRouteRulesMatchesMethodOutputReference 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._caseSensitive !== undefined) {
hasAnyValues = true;
internalValueResult.caseSensitive = this._caseSensitive;
}
if (this._grpcMethod !== undefined) {
hasAnyValues = true;
internalValueResult.grpcMethod = this._grpcMethod;
}
if (this._grpcService !== undefined) {
hasAnyValues = true;
internalValueResult.grpcService = this._grpcService;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._caseSensitive = undefined;
this._grpcMethod = undefined;
this._grpcService = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._caseSensitive = value.caseSensitive;
this._grpcMethod = value.grpcMethod;
this._grpcService = value.grpcService;
}
}
get caseSensitive() {
return this.getBooleanAttribute('case_sensitive');
}
set caseSensitive(value) {
this._caseSensitive = value;
}
resetCaseSensitive() {
this._caseSensitive = undefined;
}
// Temporarily expose input value. Use with caution.
get caseSensitiveInput() {
return this._caseSensitive;
}
get grpcMethod() {
return this.getStringAttribute('grpc_method');
}
set grpcMethod(value) {
this._grpcMethod = value;
}
// Temporarily expose input value. Use with caution.
get grpcMethodInput() {
return this._grpcMethod;
}
get grpcService() {
return this.getStringAttribute('grpc_service');
}
set grpcService(value) {
this._grpcService = value;
}
// Temporarily expose input value. Use with caution.
get grpcServiceInput() {
return this._grpcService;
}
}
exports.NetworkServicesGrpcRouteRulesMatchesMethodOutputReference = NetworkServicesGrpcRouteRulesMatchesMethodOutputReference;
_k = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesMatchesMethodOutputReference[_k] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesMatchesMethodOutputReference", version: "14.35.0" };
function networkServicesGrpcRouteRulesMatchesToTerraform(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 {
headers: cdktf.listMapper(networkServicesGrpcRouteRulesMatchesHeadersToTerraform, true)(struct.headers),
method: networkServicesGrpcRouteRulesMatchesMethodToTerraform(struct.method),
};
}
function networkServicesGrpcRouteRulesMatchesToHclTerraform(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 = {
headers: {
value: cdktf.listMapperHcl(networkServicesGrpcRouteRulesMatchesHeadersToHclTerraform, true)(struct.headers),
isBlock: true,
type: "list",
storageClassType: "NetworkServicesGrpcRouteRulesMatchesHeadersList",
},
method: {
value: networkServicesGrpcRouteRulesMatchesMethodToHclTerraform(struct.method),
isBlock: true,
type: "list",
storageClassType: "NetworkServicesGrpcRouteRulesMatchesMethodList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkServicesGrpcRouteRulesMatchesOutputReference 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;
// headers - computed: false, optional: true, required: false
this._headers = new NetworkServicesGrpcRouteRulesMatchesHeadersList(this, "headers", false);
// method - computed: false, optional: true, required: false
this._method = new NetworkServicesGrpcRouteRulesMatchesMethodOutputReference(this, "method");
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._headers?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.headers = this._headers?.internalValue;
}
if (this._method?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.method = this._method?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._headers.internalValue = undefined;
this._method.internalValue = 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._headers.internalValue = value.headers;
this._method.internalValue = value.method;
}
}
get headers() {
return this._headers;
}
putHeaders(value) {
this._headers.internalValue = value;
}
resetHeaders() {
this._headers.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get headersInput() {
return this._headers.internalValue;
}
get method() {
return this._method;
}
putMethod(value) {
this._method.internalValue = value;
}
resetMethod() {
this._method.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get methodInput() {
return this._method.internalValue;
}
}
exports.NetworkServicesGrpcRouteRulesMatchesOutputReference = NetworkServicesGrpcRouteRulesMatchesOutputReference;
_l = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesMatchesOutputReference[_l] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesMatchesOutputReference", version: "14.35.0" };
class NetworkServicesGrpcRouteRulesMatchesList 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 NetworkServicesGrpcRouteRulesMatchesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.NetworkServicesGrpcRouteRulesMatchesList = NetworkServicesGrpcRouteRulesMatchesList;
_m = JSII_RTTI_SYMBOL_1;
NetworkServicesGrpcRouteRulesMatchesList[_m] = { fqn: "@cdktf/provider-google.networkServicesGrpcRoute.NetworkServicesGrpcRouteRulesMatchesList", version: "14.35.0" };
function networkServicesGrpcRouteRulesToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;