@cdktf/provider-google
Version:
Prebuilt google Provider for Terraform CDK (cdktf)
1,045 lines (1,044 loc) • 282 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.ComputeResourcePolicy = exports.ComputeResourcePolicyTimeoutsOutputReference = exports.computeResourcePolicyTimeoutsToHclTerraform = exports.computeResourcePolicyTimeoutsToTerraform = exports.ComputeResourcePolicySnapshotSchedulePolicyOutputReference = exports.computeResourcePolicySnapshotSchedulePolicyToHclTerraform = exports.computeResourcePolicySnapshotSchedulePolicyToTerraform = exports.ComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesOutputReference = exports.computeResourcePolicySnapshotSchedulePolicySnapshotPropertiesToHclTerraform = exports.computeResourcePolicySnapshotSchedulePolicySnapshotPropertiesToTerraform = exports.ComputeResourcePolicySnapshotSchedulePolicyScheduleOutputReference = exports.computeResourcePolicySnapshotSchedulePolicyScheduleToHclTerraform = exports.computeResourcePolicySnapshotSchedulePolicyScheduleToTerraform = exports.ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleOutputReference = exports.computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleToHclTerraform = exports.computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleToTerraform = exports.ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksList = exports.ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksOutputReference = exports.computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksToHclTerraform = exports.computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksToTerraform = exports.ComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleOutputReference = exports.computeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleToHclTerraform = exports.computeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleToTerraform = exports.ComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleOutputReference = exports.computeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleToHclTerraform = exports.computeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleToTerraform = exports.ComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyOutputReference = exports.computeResourcePolicySnapshotSchedulePolicyRetentionPolicyToHclTerraform = exports.computeResourcePolicySnapshotSchedulePolicyRetentionPolicyToTerraform = exports.ComputeResourcePolicyInstanceSchedulePolicyOutputReference = exports.computeResourcePolicyInstanceSchedulePolicyToHclTerraform = exports.computeResourcePolicyInstanceSchedulePolicyToTerraform = exports.ComputeResourcePolicyInstanceSchedulePolicyVmStopScheduleOutputReference = exports.computeResourcePolicyInstanceSchedulePolicyVmStopScheduleToHclTerraform = exports.computeResourcePolicyInstanceSchedulePolicyVmStopScheduleToTerraform = exports.ComputeResourcePolicyInstanceSchedulePolicyVmStartScheduleOutputReference = exports.computeResourcePolicyInstanceSchedulePolicyVmStartScheduleToHclTerraform = exports.computeResourcePolicyInstanceSchedulePolicyVmStartScheduleToTerraform = exports.ComputeResourcePolicyGroupPlacementPolicyOutputReference = exports.computeResourcePolicyGroupPlacementPolicyToHclTerraform = exports.computeResourcePolicyGroupPlacementPolicyToTerraform = exports.ComputeResourcePolicyDiskConsistencyGroupPolicyOutputReference = exports.computeResourcePolicyDiskConsistencyGroupPolicyToHclTerraform = exports.computeResourcePolicyDiskConsistencyGroupPolicyToTerraform = void 0;
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
const cdktf = require("cdktf");
function computeResourcePolicyDiskConsistencyGroupPolicyToTerraform(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 {
enabled: cdktf.booleanToTerraform(struct.enabled),
};
}
exports.computeResourcePolicyDiskConsistencyGroupPolicyToTerraform = computeResourcePolicyDiskConsistencyGroupPolicyToTerraform;
function computeResourcePolicyDiskConsistencyGroupPolicyToHclTerraform(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 = {
enabled: {
value: cdktf.booleanToHclTerraform(struct.enabled),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeResourcePolicyDiskConsistencyGroupPolicyToHclTerraform = computeResourcePolicyDiskConsistencyGroupPolicyToHclTerraform;
class ComputeResourcePolicyDiskConsistencyGroupPolicyOutputReference 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._enabled !== undefined) {
hasAnyValues = true;
internalValueResult.enabled = this._enabled;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._enabled = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._enabled = value.enabled;
}
}
get enabled() {
return this.getBooleanAttribute('enabled');
}
set enabled(value) {
this._enabled = value;
}
// Temporarily expose input value. Use with caution.
get enabledInput() {
return this._enabled;
}
}
exports.ComputeResourcePolicyDiskConsistencyGroupPolicyOutputReference = ComputeResourcePolicyDiskConsistencyGroupPolicyOutputReference;
_a = JSII_RTTI_SYMBOL_1;
ComputeResourcePolicyDiskConsistencyGroupPolicyOutputReference[_a] = { fqn: "@cdktf/provider-google.computeResourcePolicy.ComputeResourcePolicyDiskConsistencyGroupPolicyOutputReference", version: "14.12.0" };
function computeResourcePolicyGroupPlacementPolicyToTerraform(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 {
availability_domain_count: cdktf.numberToTerraform(struct.availabilityDomainCount),
collocation: cdktf.stringToTerraform(struct.collocation),
vm_count: cdktf.numberToTerraform(struct.vmCount),
};
}
exports.computeResourcePolicyGroupPlacementPolicyToTerraform = computeResourcePolicyGroupPlacementPolicyToTerraform;
function computeResourcePolicyGroupPlacementPolicyToHclTerraform(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 = {
availability_domain_count: {
value: cdktf.numberToHclTerraform(struct.availabilityDomainCount),
isBlock: false,
type: "simple",
storageClassType: "number",
},
collocation: {
value: cdktf.stringToHclTerraform(struct.collocation),
isBlock: false,
type: "simple",
storageClassType: "string",
},
vm_count: {
value: cdktf.numberToHclTerraform(struct.vmCount),
isBlock: false,
type: "simple",
storageClassType: "number",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeResourcePolicyGroupPlacementPolicyToHclTerraform = computeResourcePolicyGroupPlacementPolicyToHclTerraform;
class ComputeResourcePolicyGroupPlacementPolicyOutputReference 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._availabilityDomainCount !== undefined) {
hasAnyValues = true;
internalValueResult.availabilityDomainCount = this._availabilityDomainCount;
}
if (this._collocation !== undefined) {
hasAnyValues = true;
internalValueResult.collocation = this._collocation;
}
if (this._vmCount !== undefined) {
hasAnyValues = true;
internalValueResult.vmCount = this._vmCount;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._availabilityDomainCount = undefined;
this._collocation = undefined;
this._vmCount = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._availabilityDomainCount = value.availabilityDomainCount;
this._collocation = value.collocation;
this._vmCount = value.vmCount;
}
}
get availabilityDomainCount() {
return this.getNumberAttribute('availability_domain_count');
}
set availabilityDomainCount(value) {
this._availabilityDomainCount = value;
}
resetAvailabilityDomainCount() {
this._availabilityDomainCount = undefined;
}
// Temporarily expose input value. Use with caution.
get availabilityDomainCountInput() {
return this._availabilityDomainCount;
}
get collocation() {
return this.getStringAttribute('collocation');
}
set collocation(value) {
this._collocation = value;
}
resetCollocation() {
this._collocation = undefined;
}
// Temporarily expose input value. Use with caution.
get collocationInput() {
return this._collocation;
}
get vmCount() {
return this.getNumberAttribute('vm_count');
}
set vmCount(value) {
this._vmCount = value;
}
resetVmCount() {
this._vmCount = undefined;
}
// Temporarily expose input value. Use with caution.
get vmCountInput() {
return this._vmCount;
}
}
exports.ComputeResourcePolicyGroupPlacementPolicyOutputReference = ComputeResourcePolicyGroupPlacementPolicyOutputReference;
_b = JSII_RTTI_SYMBOL_1;
ComputeResourcePolicyGroupPlacementPolicyOutputReference[_b] = { fqn: "@cdktf/provider-google.computeResourcePolicy.ComputeResourcePolicyGroupPlacementPolicyOutputReference", version: "14.12.0" };
function computeResourcePolicyInstanceSchedulePolicyVmStartScheduleToTerraform(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 {
schedule: cdktf.stringToTerraform(struct.schedule),
};
}
exports.computeResourcePolicyInstanceSchedulePolicyVmStartScheduleToTerraform = computeResourcePolicyInstanceSchedulePolicyVmStartScheduleToTerraform;
function computeResourcePolicyInstanceSchedulePolicyVmStartScheduleToHclTerraform(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 = {
schedule: {
value: cdktf.stringToHclTerraform(struct.schedule),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeResourcePolicyInstanceSchedulePolicyVmStartScheduleToHclTerraform = computeResourcePolicyInstanceSchedulePolicyVmStartScheduleToHclTerraform;
class ComputeResourcePolicyInstanceSchedulePolicyVmStartScheduleOutputReference 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._schedule !== undefined) {
hasAnyValues = true;
internalValueResult.schedule = this._schedule;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._schedule = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._schedule = value.schedule;
}
}
get schedule() {
return this.getStringAttribute('schedule');
}
set schedule(value) {
this._schedule = value;
}
// Temporarily expose input value. Use with caution.
get scheduleInput() {
return this._schedule;
}
}
exports.ComputeResourcePolicyInstanceSchedulePolicyVmStartScheduleOutputReference = ComputeResourcePolicyInstanceSchedulePolicyVmStartScheduleOutputReference;
_c = JSII_RTTI_SYMBOL_1;
ComputeResourcePolicyInstanceSchedulePolicyVmStartScheduleOutputReference[_c] = { fqn: "@cdktf/provider-google.computeResourcePolicy.ComputeResourcePolicyInstanceSchedulePolicyVmStartScheduleOutputReference", version: "14.12.0" };
function computeResourcePolicyInstanceSchedulePolicyVmStopScheduleToTerraform(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 {
schedule: cdktf.stringToTerraform(struct.schedule),
};
}
exports.computeResourcePolicyInstanceSchedulePolicyVmStopScheduleToTerraform = computeResourcePolicyInstanceSchedulePolicyVmStopScheduleToTerraform;
function computeResourcePolicyInstanceSchedulePolicyVmStopScheduleToHclTerraform(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 = {
schedule: {
value: cdktf.stringToHclTerraform(struct.schedule),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeResourcePolicyInstanceSchedulePolicyVmStopScheduleToHclTerraform = computeResourcePolicyInstanceSchedulePolicyVmStopScheduleToHclTerraform;
class ComputeResourcePolicyInstanceSchedulePolicyVmStopScheduleOutputReference 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._schedule !== undefined) {
hasAnyValues = true;
internalValueResult.schedule = this._schedule;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._schedule = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._schedule = value.schedule;
}
}
get schedule() {
return this.getStringAttribute('schedule');
}
set schedule(value) {
this._schedule = value;
}
// Temporarily expose input value. Use with caution.
get scheduleInput() {
return this._schedule;
}
}
exports.ComputeResourcePolicyInstanceSchedulePolicyVmStopScheduleOutputReference = ComputeResourcePolicyInstanceSchedulePolicyVmStopScheduleOutputReference;
_d = JSII_RTTI_SYMBOL_1;
ComputeResourcePolicyInstanceSchedulePolicyVmStopScheduleOutputReference[_d] = { fqn: "@cdktf/provider-google.computeResourcePolicy.ComputeResourcePolicyInstanceSchedulePolicyVmStopScheduleOutputReference", version: "14.12.0" };
function computeResourcePolicyInstanceSchedulePolicyToTerraform(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 {
expiration_time: cdktf.stringToTerraform(struct.expirationTime),
start_time: cdktf.stringToTerraform(struct.startTime),
time_zone: cdktf.stringToTerraform(struct.timeZone),
vm_start_schedule: computeResourcePolicyInstanceSchedulePolicyVmStartScheduleToTerraform(struct.vmStartSchedule),
vm_stop_schedule: computeResourcePolicyInstanceSchedulePolicyVmStopScheduleToTerraform(struct.vmStopSchedule),
};
}
exports.computeResourcePolicyInstanceSchedulePolicyToTerraform = computeResourcePolicyInstanceSchedulePolicyToTerraform;
function computeResourcePolicyInstanceSchedulePolicyToHclTerraform(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 = {
expiration_time: {
value: cdktf.stringToHclTerraform(struct.expirationTime),
isBlock: false,
type: "simple",
storageClassType: "string",
},
start_time: {
value: cdktf.stringToHclTerraform(struct.startTime),
isBlock: false,
type: "simple",
storageClassType: "string",
},
time_zone: {
value: cdktf.stringToHclTerraform(struct.timeZone),
isBlock: false,
type: "simple",
storageClassType: "string",
},
vm_start_schedule: {
value: computeResourcePolicyInstanceSchedulePolicyVmStartScheduleToHclTerraform(struct.vmStartSchedule),
isBlock: true,
type: "list",
storageClassType: "ComputeResourcePolicyInstanceSchedulePolicyVmStartScheduleList",
},
vm_stop_schedule: {
value: computeResourcePolicyInstanceSchedulePolicyVmStopScheduleToHclTerraform(struct.vmStopSchedule),
isBlock: true,
type: "list",
storageClassType: "ComputeResourcePolicyInstanceSchedulePolicyVmStopScheduleList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeResourcePolicyInstanceSchedulePolicyToHclTerraform = computeResourcePolicyInstanceSchedulePolicyToHclTerraform;
class ComputeResourcePolicyInstanceSchedulePolicyOutputReference 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;
// vm_start_schedule - computed: false, optional: true, required: false
this._vmStartSchedule = new ComputeResourcePolicyInstanceSchedulePolicyVmStartScheduleOutputReference(this, "vm_start_schedule");
// vm_stop_schedule - computed: false, optional: true, required: false
this._vmStopSchedule = new ComputeResourcePolicyInstanceSchedulePolicyVmStopScheduleOutputReference(this, "vm_stop_schedule");
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._expirationTime !== undefined) {
hasAnyValues = true;
internalValueResult.expirationTime = this._expirationTime;
}
if (this._startTime !== undefined) {
hasAnyValues = true;
internalValueResult.startTime = this._startTime;
}
if (this._timeZone !== undefined) {
hasAnyValues = true;
internalValueResult.timeZone = this._timeZone;
}
if (this._vmStartSchedule?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.vmStartSchedule = this._vmStartSchedule?.internalValue;
}
if (this._vmStopSchedule?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.vmStopSchedule = this._vmStopSchedule?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._expirationTime = undefined;
this._startTime = undefined;
this._timeZone = undefined;
this._vmStartSchedule.internalValue = undefined;
this._vmStopSchedule.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._expirationTime = value.expirationTime;
this._startTime = value.startTime;
this._timeZone = value.timeZone;
this._vmStartSchedule.internalValue = value.vmStartSchedule;
this._vmStopSchedule.internalValue = value.vmStopSchedule;
}
}
get expirationTime() {
return this.getStringAttribute('expiration_time');
}
set expirationTime(value) {
this._expirationTime = value;
}
resetExpirationTime() {
this._expirationTime = undefined;
}
// Temporarily expose input value. Use with caution.
get expirationTimeInput() {
return this._expirationTime;
}
get startTime() {
return this.getStringAttribute('start_time');
}
set startTime(value) {
this._startTime = value;
}
resetStartTime() {
this._startTime = undefined;
}
// Temporarily expose input value. Use with caution.
get startTimeInput() {
return this._startTime;
}
get timeZone() {
return this.getStringAttribute('time_zone');
}
set timeZone(value) {
this._timeZone = value;
}
// Temporarily expose input value. Use with caution.
get timeZoneInput() {
return this._timeZone;
}
get vmStartSchedule() {
return this._vmStartSchedule;
}
putVmStartSchedule(value) {
this._vmStartSchedule.internalValue = value;
}
resetVmStartSchedule() {
this._vmStartSchedule.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get vmStartScheduleInput() {
return this._vmStartSchedule.internalValue;
}
get vmStopSchedule() {
return this._vmStopSchedule;
}
putVmStopSchedule(value) {
this._vmStopSchedule.internalValue = value;
}
resetVmStopSchedule() {
this._vmStopSchedule.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get vmStopScheduleInput() {
return this._vmStopSchedule.internalValue;
}
}
exports.ComputeResourcePolicyInstanceSchedulePolicyOutputReference = ComputeResourcePolicyInstanceSchedulePolicyOutputReference;
_e = JSII_RTTI_SYMBOL_1;
ComputeResourcePolicyInstanceSchedulePolicyOutputReference[_e] = { fqn: "@cdktf/provider-google.computeResourcePolicy.ComputeResourcePolicyInstanceSchedulePolicyOutputReference", version: "14.12.0" };
function computeResourcePolicySnapshotSchedulePolicyRetentionPolicyToTerraform(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_retention_days: cdktf.numberToTerraform(struct.maxRetentionDays),
on_source_disk_delete: cdktf.stringToTerraform(struct.onSourceDiskDelete),
};
}
exports.computeResourcePolicySnapshotSchedulePolicyRetentionPolicyToTerraform = computeResourcePolicySnapshotSchedulePolicyRetentionPolicyToTerraform;
function computeResourcePolicySnapshotSchedulePolicyRetentionPolicyToHclTerraform(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_retention_days: {
value: cdktf.numberToHclTerraform(struct.maxRetentionDays),
isBlock: false,
type: "simple",
storageClassType: "number",
},
on_source_disk_delete: {
value: cdktf.stringToHclTerraform(struct.onSourceDiskDelete),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeResourcePolicySnapshotSchedulePolicyRetentionPolicyToHclTerraform = computeResourcePolicySnapshotSchedulePolicyRetentionPolicyToHclTerraform;
class ComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyOutputReference 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._maxRetentionDays !== undefined) {
hasAnyValues = true;
internalValueResult.maxRetentionDays = this._maxRetentionDays;
}
if (this._onSourceDiskDelete !== undefined) {
hasAnyValues = true;
internalValueResult.onSourceDiskDelete = this._onSourceDiskDelete;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._maxRetentionDays = undefined;
this._onSourceDiskDelete = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._maxRetentionDays = value.maxRetentionDays;
this._onSourceDiskDelete = value.onSourceDiskDelete;
}
}
get maxRetentionDays() {
return this.getNumberAttribute('max_retention_days');
}
set maxRetentionDays(value) {
this._maxRetentionDays = value;
}
// Temporarily expose input value. Use with caution.
get maxRetentionDaysInput() {
return this._maxRetentionDays;
}
get onSourceDiskDelete() {
return this.getStringAttribute('on_source_disk_delete');
}
set onSourceDiskDelete(value) {
this._onSourceDiskDelete = value;
}
resetOnSourceDiskDelete() {
this._onSourceDiskDelete = undefined;
}
// Temporarily expose input value. Use with caution.
get onSourceDiskDeleteInput() {
return this._onSourceDiskDelete;
}
}
exports.ComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyOutputReference = ComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyOutputReference;
_f = JSII_RTTI_SYMBOL_1;
ComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyOutputReference[_f] = { fqn: "@cdktf/provider-google.computeResourcePolicy.ComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyOutputReference", version: "14.12.0" };
function computeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleToTerraform(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 {
days_in_cycle: cdktf.numberToTerraform(struct.daysInCycle),
start_time: cdktf.stringToTerraform(struct.startTime),
};
}
exports.computeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleToTerraform = computeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleToTerraform;
function computeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleToHclTerraform(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 = {
days_in_cycle: {
value: cdktf.numberToHclTerraform(struct.daysInCycle),
isBlock: false,
type: "simple",
storageClassType: "number",
},
start_time: {
value: cdktf.stringToHclTerraform(struct.startTime),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleToHclTerraform = computeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleToHclTerraform;
class ComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleOutputReference 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._daysInCycle !== undefined) {
hasAnyValues = true;
internalValueResult.daysInCycle = this._daysInCycle;
}
if (this._startTime !== undefined) {
hasAnyValues = true;
internalValueResult.startTime = this._startTime;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._daysInCycle = undefined;
this._startTime = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._daysInCycle = value.daysInCycle;
this._startTime = value.startTime;
}
}
get daysInCycle() {
return this.getNumberAttribute('days_in_cycle');
}
set daysInCycle(value) {
this._daysInCycle = value;
}
// Temporarily expose input value. Use with caution.
get daysInCycleInput() {
return this._daysInCycle;
}
get startTime() {
return this.getStringAttribute('start_time');
}
set startTime(value) {
this._startTime = value;
}
// Temporarily expose input value. Use with caution.
get startTimeInput() {
return this._startTime;
}
}
exports.ComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleOutputReference = ComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleOutputReference;
_g = JSII_RTTI_SYMBOL_1;
ComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleOutputReference[_g] = { fqn: "@cdktf/provider-google.computeResourcePolicy.ComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleOutputReference", version: "14.12.0" };
function computeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleToTerraform(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 {
hours_in_cycle: cdktf.numberToTerraform(struct.hoursInCycle),
start_time: cdktf.stringToTerraform(struct.startTime),
};
}
exports.computeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleToTerraform = computeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleToTerraform;
function computeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleToHclTerraform(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 = {
hours_in_cycle: {
value: cdktf.numberToHclTerraform(struct.hoursInCycle),
isBlock: false,
type: "simple",
storageClassType: "number",
},
start_time: {
value: cdktf.stringToHclTerraform(struct.startTime),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleToHclTerraform = computeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleToHclTerraform;
class ComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleOutputReference 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._hoursInCycle !== undefined) {
hasAnyValues = true;
internalValueResult.hoursInCycle = this._hoursInCycle;
}
if (this._startTime !== undefined) {
hasAnyValues = true;
internalValueResult.startTime = this._startTime;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._hoursInCycle = undefined;
this._startTime = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._hoursInCycle = value.hoursInCycle;
this._startTime = value.startTime;
}
}
get hoursInCycle() {
return this.getNumberAttribute('hours_in_cycle');
}
set hoursInCycle(value) {
this._hoursInCycle = value;
}
// Temporarily expose input value. Use with caution.
get hoursInCycleInput() {
return this._hoursInCycle;
}
get startTime() {
return this.getStringAttribute('start_time');
}
set startTime(value) {
this._startTime = value;
}
// Temporarily expose input value. Use with caution.
get startTimeInput() {
return this._startTime;
}
}
exports.ComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleOutputReference = ComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleOutputReference;
_h = JSII_RTTI_SYMBOL_1;
ComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleOutputReference[_h] = { fqn: "@cdktf/provider-google.computeResourcePolicy.ComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleOutputReference", version: "14.12.0" };
function computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksToTerraform(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 {
day: cdktf.stringToTerraform(struct.day),
start_time: cdktf.stringToTerraform(struct.startTime),
};
}
exports.computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksToTerraform = computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksToTerraform;
function computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksToHclTerraform(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 = {
day: {
value: cdktf.stringToHclTerraform(struct.day),
isBlock: false,
type: "simple",
storageClassType: "string",
},
start_time: {
value: cdktf.stringToHclTerraform(struct.startTime),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksToHclTerraform = computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksToHclTerraform;
class ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksOutputReference 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._day !== undefined) {
hasAnyValues = true;
internalValueResult.day = this._day;
}
if (this._startTime !== undefined) {
hasAnyValues = true;
internalValueResult.startTime = this._startTime;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._day = undefined;
this._startTime = 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._day = value.day;
this._startTime = value.startTime;
}
}
get day() {
return this.getStringAttribute('day');
}
set day(value) {
this._day = value;
}
// Temporarily expose input value. Use with caution.
get dayInput() {
return this._day;
}
get startTime() {
return this.getStringAttribute('start_time');
}
set startTime(value) {
this._startTime = value;
}
// Temporarily expose input value. Use with caution.
get startTimeInput() {
return this._startTime;
}
}
exports.ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksOutputReference = ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksOutputReference;
_j = JSII_RTTI_SYMBOL_1;
ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksOutputReference[_j] = { fqn: "@cdktf/provider-google.computeResourcePolicy.ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksOutputReference", version: "14.12.0" };
class ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksList 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 ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksList = ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksList;
_k = JSII_RTTI_SYMBOL_1;
ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksList[_k] = { fqn: "@cdktf/provider-google.computeResourcePolicy.ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksList", version: "14.12.0" };
function computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleToTerraform(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 {
day_of_weeks: cdktf.listMapper(computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksToTerraform, true)(struct.dayOfWeeks),
};
}
exports.computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleToTerraform = computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleToTerraform;
function computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleToHclTerraform(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 = {
day_of_weeks: {
value: cdktf.listMapperHcl(computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksToHclTerraform, true)(struct.dayOfWeeks),
isBlock: true,
type: "set",
storageClassType: "ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleToHclTerraform = computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleToHclTerraform;
class ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleOutputReference 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;
// day_of_weeks - computed: false, optional: false, required: true
this._dayOfWeeks = new ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksList(this, "day_of_weeks", true);
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._dayOfWeeks?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.dayOfWeeks = this._dayOfWeeks?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._dayOfWeeks.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._dayOfWeeks.internalValue = value.dayOfWeeks;
}
}
get dayOfWeeks() {
return this._dayOfWeeks;
}
putDayOfWeeks(value) {
this._dayOfWeeks.internalValue = value;
}
// Temporarily expose input value. Use with caution.
get dayOfWeeksInput() {
return this._dayOfWeeks.internalValue;
}
}
exports.ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleOutputReference = ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleOutputReference;
_l = JSII_RTTI_SYMBOL_1;
ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleOutputReference[_l] = { fqn: "@cdktf/provider-google.computeResourcePolicy.ComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleOutputReference", version: "14.12.0" };
function computeResourcePolicySnapshotSchedulePolicyScheduleToTerraform(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 {
daily_schedule: computeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleToTerraform(struct.dailySchedule),
hourly_schedule: computeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleToTerraform(struct.hourlySchedule),
weekly_schedule: computeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleToTerraform(struct.weeklySchedule),
};
}
exports.computeResourcePolicySnapshotSchedulePolicyScheduleToTerraform = computeResourcePolicySnapshotSchedulePolicyScheduleToTerraform;
function computeResourcePolicySnapshotSchedulePolicyScheduleToHclTerraform(struct) {