@cdktf/provider-upcloud
Version:
Prebuilt upcloud Provider for Terraform CDK (cdktf)
1,262 lines • 270 kB
JavaScript
"use strict";
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Server = exports.ServerTemplateList = exports.ServerTemplateOutputReference = exports.ServerTemplateBackupRuleList = exports.ServerTemplateBackupRuleOutputReference = exports.ServerStorageDevicesList = exports.ServerStorageDevicesOutputReference = exports.ServerSimpleBackupList = exports.ServerSimpleBackupOutputReference = exports.ServerNetworkInterfaceList = exports.ServerNetworkInterfaceOutputReference = exports.ServerNetworkInterfaceAdditionalIpAddressList = exports.ServerNetworkInterfaceAdditionalIpAddressOutputReference = exports.ServerLoginList = exports.ServerLoginOutputReference = void 0;
exports.serverLoginToTerraform = serverLoginToTerraform;
exports.serverLoginToHclTerraform = serverLoginToHclTerraform;
exports.serverNetworkInterfaceAdditionalIpAddressToTerraform = serverNetworkInterfaceAdditionalIpAddressToTerraform;
exports.serverNetworkInterfaceAdditionalIpAddressToHclTerraform = serverNetworkInterfaceAdditionalIpAddressToHclTerraform;
exports.serverNetworkInterfaceToTerraform = serverNetworkInterfaceToTerraform;
exports.serverNetworkInterfaceToHclTerraform = serverNetworkInterfaceToHclTerraform;
exports.serverSimpleBackupToTerraform = serverSimpleBackupToTerraform;
exports.serverSimpleBackupToHclTerraform = serverSimpleBackupToHclTerraform;
exports.serverStorageDevicesToTerraform = serverStorageDevicesToTerraform;
exports.serverStorageDevicesToHclTerraform = serverStorageDevicesToHclTerraform;
exports.serverTemplateBackupRuleToTerraform = serverTemplateBackupRuleToTerraform;
exports.serverTemplateBackupRuleToHclTerraform = serverTemplateBackupRuleToHclTerraform;
exports.serverTemplateToTerraform = serverTemplateToTerraform;
exports.serverTemplateToHclTerraform = serverTemplateToHclTerraform;
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
const cdktf = require("cdktf");
function serverLoginToTerraform(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 {
create_password: cdktf.booleanToTerraform(struct.createPassword),
keys: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.keys),
password_delivery: cdktf.stringToTerraform(struct.passwordDelivery),
user: cdktf.stringToTerraform(struct.user),
};
}
function serverLoginToHclTerraform(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 = {
create_password: {
value: cdktf.booleanToHclTerraform(struct.createPassword),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
keys: {
value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.keys),
isBlock: false,
type: "list",
storageClassType: "stringList",
},
password_delivery: {
value: cdktf.stringToHclTerraform(struct.passwordDelivery),
isBlock: false,
type: "simple",
storageClassType: "string",
},
user: {
value: cdktf.stringToHclTerraform(struct.user),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ServerLoginOutputReference 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._createPassword !== undefined) {
hasAnyValues = true;
internalValueResult.createPassword = this._createPassword;
}
if (this._keys !== undefined) {
hasAnyValues = true;
internalValueResult.keys = this._keys;
}
if (this._passwordDelivery !== undefined) {
hasAnyValues = true;
internalValueResult.passwordDelivery = this._passwordDelivery;
}
if (this._user !== undefined) {
hasAnyValues = true;
internalValueResult.user = this._user;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._createPassword = undefined;
this._keys = undefined;
this._passwordDelivery = undefined;
this._user = 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._createPassword = value.createPassword;
this._keys = value.keys;
this._passwordDelivery = value.passwordDelivery;
this._user = value.user;
}
}
get createPassword() {
return this.getBooleanAttribute('create_password');
}
set createPassword(value) {
this._createPassword = value;
}
resetCreatePassword() {
this._createPassword = undefined;
}
// Temporarily expose input value. Use with caution.
get createPasswordInput() {
return this._createPassword;
}
get keys() {
return this.getListAttribute('keys');
}
set keys(value) {
this._keys = value;
}
resetKeys() {
this._keys = undefined;
}
// Temporarily expose input value. Use with caution.
get keysInput() {
return this._keys;
}
get passwordDelivery() {
return this.getStringAttribute('password_delivery');
}
set passwordDelivery(value) {
this._passwordDelivery = value;
}
resetPasswordDelivery() {
this._passwordDelivery = undefined;
}
// Temporarily expose input value. Use with caution.
get passwordDeliveryInput() {
return this._passwordDelivery;
}
get user() {
return this.getStringAttribute('user');
}
set user(value) {
this._user = value;
}
resetUser() {
this._user = undefined;
}
// Temporarily expose input value. Use with caution.
get userInput() {
return this._user;
}
}
exports.ServerLoginOutputReference = ServerLoginOutputReference;
_a = JSII_RTTI_SYMBOL_1;
ServerLoginOutputReference[_a] = { fqn: "@cdktf/provider-upcloud.server.ServerLoginOutputReference", version: "15.1.3" };
class ServerLoginList 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 ServerLoginOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ServerLoginList = ServerLoginList;
_b = JSII_RTTI_SYMBOL_1;
ServerLoginList[_b] = { fqn: "@cdktf/provider-upcloud.server.ServerLoginList", version: "15.1.3" };
function serverNetworkInterfaceAdditionalIpAddressToTerraform(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 {
ip_address: cdktf.stringToTerraform(struct.ipAddress),
ip_address_family: cdktf.stringToTerraform(struct.ipAddressFamily),
};
}
function serverNetworkInterfaceAdditionalIpAddressToHclTerraform(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 = {
ip_address: {
value: cdktf.stringToHclTerraform(struct.ipAddress),
isBlock: false,
type: "simple",
storageClassType: "string",
},
ip_address_family: {
value: cdktf.stringToHclTerraform(struct.ipAddressFamily),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ServerNetworkInterfaceAdditionalIpAddressOutputReference 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._ipAddress !== undefined) {
hasAnyValues = true;
internalValueResult.ipAddress = this._ipAddress;
}
if (this._ipAddressFamily !== undefined) {
hasAnyValues = true;
internalValueResult.ipAddressFamily = this._ipAddressFamily;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._ipAddress = undefined;
this._ipAddressFamily = 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._ipAddress = value.ipAddress;
this._ipAddressFamily = value.ipAddressFamily;
}
}
get ipAddress() {
return this.getStringAttribute('ip_address');
}
set ipAddress(value) {
this._ipAddress = value;
}
resetIpAddress() {
this._ipAddress = undefined;
}
// Temporarily expose input value. Use with caution.
get ipAddressInput() {
return this._ipAddress;
}
get ipAddressFamily() {
return this.getStringAttribute('ip_address_family');
}
set ipAddressFamily(value) {
this._ipAddressFamily = value;
}
resetIpAddressFamily() {
this._ipAddressFamily = undefined;
}
// Temporarily expose input value. Use with caution.
get ipAddressFamilyInput() {
return this._ipAddressFamily;
}
// ip_address_floating - computed: true, optional: false, required: false
get ipAddressFloating() {
return this.getBooleanAttribute('ip_address_floating');
}
}
exports.ServerNetworkInterfaceAdditionalIpAddressOutputReference = ServerNetworkInterfaceAdditionalIpAddressOutputReference;
_c = JSII_RTTI_SYMBOL_1;
ServerNetworkInterfaceAdditionalIpAddressOutputReference[_c] = { fqn: "@cdktf/provider-upcloud.server.ServerNetworkInterfaceAdditionalIpAddressOutputReference", version: "15.1.3" };
class ServerNetworkInterfaceAdditionalIpAddressList 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 ServerNetworkInterfaceAdditionalIpAddressOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ServerNetworkInterfaceAdditionalIpAddressList = ServerNetworkInterfaceAdditionalIpAddressList;
_d = JSII_RTTI_SYMBOL_1;
ServerNetworkInterfaceAdditionalIpAddressList[_d] = { fqn: "@cdktf/provider-upcloud.server.ServerNetworkInterfaceAdditionalIpAddressList", version: "15.1.3" };
function serverNetworkInterfaceToTerraform(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 {
bootable: cdktf.booleanToTerraform(struct.bootable),
index: cdktf.numberToTerraform(struct.index),
ip_address: cdktf.stringToTerraform(struct.ipAddress),
ip_address_family: cdktf.stringToTerraform(struct.ipAddressFamily),
network: cdktf.stringToTerraform(struct.network),
source_ip_filtering: cdktf.booleanToTerraform(struct.sourceIpFiltering),
type: cdktf.stringToTerraform(struct.type),
additional_ip_address: cdktf.listMapper(serverNetworkInterfaceAdditionalIpAddressToTerraform, true)(struct.additionalIpAddress),
};
}
function serverNetworkInterfaceToHclTerraform(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 = {
bootable: {
value: cdktf.booleanToHclTerraform(struct.bootable),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
index: {
value: cdktf.numberToHclTerraform(struct.index),
isBlock: false,
type: "simple",
storageClassType: "number",
},
ip_address: {
value: cdktf.stringToHclTerraform(struct.ipAddress),
isBlock: false,
type: "simple",
storageClassType: "string",
},
ip_address_family: {
value: cdktf.stringToHclTerraform(struct.ipAddressFamily),
isBlock: false,
type: "simple",
storageClassType: "string",
},
network: {
value: cdktf.stringToHclTerraform(struct.network),
isBlock: false,
type: "simple",
storageClassType: "string",
},
source_ip_filtering: {
value: cdktf.booleanToHclTerraform(struct.sourceIpFiltering),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
type: {
value: cdktf.stringToHclTerraform(struct.type),
isBlock: false,
type: "simple",
storageClassType: "string",
},
additional_ip_address: {
value: cdktf.listMapperHcl(serverNetworkInterfaceAdditionalIpAddressToHclTerraform, true)(struct.additionalIpAddress),
isBlock: true,
type: "set",
storageClassType: "ServerNetworkInterfaceAdditionalIpAddressList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ServerNetworkInterfaceOutputReference 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;
// additional_ip_address - computed: false, optional: true, required: false
this._additionalIpAddress = new ServerNetworkInterfaceAdditionalIpAddressList(this, "additional_ip_address", true);
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._bootable !== undefined) {
hasAnyValues = true;
internalValueResult.bootable = this._bootable;
}
if (this._index !== undefined) {
hasAnyValues = true;
internalValueResult.index = this._index;
}
if (this._ipAddress !== undefined) {
hasAnyValues = true;
internalValueResult.ipAddress = this._ipAddress;
}
if (this._ipAddressFamily !== undefined) {
hasAnyValues = true;
internalValueResult.ipAddressFamily = this._ipAddressFamily;
}
if (this._network !== undefined) {
hasAnyValues = true;
internalValueResult.network = this._network;
}
if (this._sourceIpFiltering !== undefined) {
hasAnyValues = true;
internalValueResult.sourceIpFiltering = this._sourceIpFiltering;
}
if (this._type !== undefined) {
hasAnyValues = true;
internalValueResult.type = this._type;
}
if (this._additionalIpAddress?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.additionalIpAddress = this._additionalIpAddress?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._bootable = undefined;
this._index = undefined;
this._ipAddress = undefined;
this._ipAddressFamily = undefined;
this._network = undefined;
this._sourceIpFiltering = undefined;
this._type = undefined;
this._additionalIpAddress.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._bootable = value.bootable;
this._index = value.index;
this._ipAddress = value.ipAddress;
this._ipAddressFamily = value.ipAddressFamily;
this._network = value.network;
this._sourceIpFiltering = value.sourceIpFiltering;
this._type = value.type;
this._additionalIpAddress.internalValue = value.additionalIpAddress;
}
}
get bootable() {
return this.getBooleanAttribute('bootable');
}
set bootable(value) {
this._bootable = value;
}
resetBootable() {
this._bootable = undefined;
}
// Temporarily expose input value. Use with caution.
get bootableInput() {
return this._bootable;
}
get index() {
return this.getNumberAttribute('index');
}
set index(value) {
this._index = value;
}
resetIndex() {
this._index = undefined;
}
// Temporarily expose input value. Use with caution.
get indexInput() {
return this._index;
}
get ipAddress() {
return this.getStringAttribute('ip_address');
}
set ipAddress(value) {
this._ipAddress = value;
}
resetIpAddress() {
this._ipAddress = undefined;
}
// Temporarily expose input value. Use with caution.
get ipAddressInput() {
return this._ipAddress;
}
get ipAddressFamily() {
return this.getStringAttribute('ip_address_family');
}
set ipAddressFamily(value) {
this._ipAddressFamily = value;
}
resetIpAddressFamily() {
this._ipAddressFamily = undefined;
}
// Temporarily expose input value. Use with caution.
get ipAddressFamilyInput() {
return this._ipAddressFamily;
}
// ip_address_floating - computed: true, optional: false, required: false
get ipAddressFloating() {
return this.getBooleanAttribute('ip_address_floating');
}
// mac_address - computed: true, optional: false, required: false
get macAddress() {
return this.getStringAttribute('mac_address');
}
get network() {
return this.getStringAttribute('network');
}
set network(value) {
this._network = value;
}
resetNetwork() {
this._network = undefined;
}
// Temporarily expose input value. Use with caution.
get networkInput() {
return this._network;
}
get sourceIpFiltering() {
return this.getBooleanAttribute('source_ip_filtering');
}
set sourceIpFiltering(value) {
this._sourceIpFiltering = value;
}
resetSourceIpFiltering() {
this._sourceIpFiltering = undefined;
}
// Temporarily expose input value. Use with caution.
get sourceIpFilteringInput() {
return this._sourceIpFiltering;
}
get type() {
return this.getStringAttribute('type');
}
set type(value) {
this._type = value;
}
// Temporarily expose input value. Use with caution.
get typeInput() {
return this._type;
}
get additionalIpAddress() {
return this._additionalIpAddress;
}
putAdditionalIpAddress(value) {
this._additionalIpAddress.internalValue = value;
}
resetAdditionalIpAddress() {
this._additionalIpAddress.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get additionalIpAddressInput() {
return this._additionalIpAddress.internalValue;
}
}
exports.ServerNetworkInterfaceOutputReference = ServerNetworkInterfaceOutputReference;
_e = JSII_RTTI_SYMBOL_1;
ServerNetworkInterfaceOutputReference[_e] = { fqn: "@cdktf/provider-upcloud.server.ServerNetworkInterfaceOutputReference", version: "15.1.3" };
class ServerNetworkInterfaceList 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 ServerNetworkInterfaceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ServerNetworkInterfaceList = ServerNetworkInterfaceList;
_f = JSII_RTTI_SYMBOL_1;
ServerNetworkInterfaceList[_f] = { fqn: "@cdktf/provider-upcloud.server.ServerNetworkInterfaceList", version: "15.1.3" };
function serverSimpleBackupToTerraform(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 {
plan: cdktf.stringToTerraform(struct.plan),
time: cdktf.stringToTerraform(struct.time),
};
}
function serverSimpleBackupToHclTerraform(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 = {
plan: {
value: cdktf.stringToHclTerraform(struct.plan),
isBlock: false,
type: "simple",
storageClassType: "string",
},
time: {
value: cdktf.stringToHclTerraform(struct.time),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ServerSimpleBackupOutputReference 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._plan !== undefined) {
hasAnyValues = true;
internalValueResult.plan = this._plan;
}
if (this._time !== undefined) {
hasAnyValues = true;
internalValueResult.time = this._time;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._plan = undefined;
this._time = 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._plan = value.plan;
this._time = value.time;
}
}
get plan() {
return this.getStringAttribute('plan');
}
set plan(value) {
this._plan = value;
}
resetPlan() {
this._plan = undefined;
}
// Temporarily expose input value. Use with caution.
get planInput() {
return this._plan;
}
get time() {
return this.getStringAttribute('time');
}
set time(value) {
this._time = value;
}
resetTime() {
this._time = undefined;
}
// Temporarily expose input value. Use with caution.
get timeInput() {
return this._time;
}
}
exports.ServerSimpleBackupOutputReference = ServerSimpleBackupOutputReference;
_g = JSII_RTTI_SYMBOL_1;
ServerSimpleBackupOutputReference[_g] = { fqn: "@cdktf/provider-upcloud.server.ServerSimpleBackupOutputReference", version: "15.1.3" };
class ServerSimpleBackupList 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 ServerSimpleBackupOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ServerSimpleBackupList = ServerSimpleBackupList;
_h = JSII_RTTI_SYMBOL_1;
ServerSimpleBackupList[_h] = { fqn: "@cdktf/provider-upcloud.server.ServerSimpleBackupList", version: "15.1.3" };
function serverStorageDevicesToTerraform(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 {
address: cdktf.stringToTerraform(struct.address),
address_position: cdktf.stringToTerraform(struct.addressPosition),
storage: cdktf.stringToTerraform(struct.storage),
type: cdktf.stringToTerraform(struct.type),
};
}
function serverStorageDevicesToHclTerraform(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 = {
address: {
value: cdktf.stringToHclTerraform(struct.address),
isBlock: false,
type: "simple",
storageClassType: "string",
},
address_position: {
value: cdktf.stringToHclTerraform(struct.addressPosition),
isBlock: false,
type: "simple",
storageClassType: "string",
},
storage: {
value: cdktf.stringToHclTerraform(struct.storage),
isBlock: false,
type: "simple",
storageClassType: "string",
},
type: {
value: cdktf.stringToHclTerraform(struct.type),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ServerStorageDevicesOutputReference 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._address !== undefined) {
hasAnyValues = true;
internalValueResult.address = this._address;
}
if (this._addressPosition !== undefined) {
hasAnyValues = true;
internalValueResult.addressPosition = this._addressPosition;
}
if (this._storage !== undefined) {
hasAnyValues = true;
internalValueResult.storage = this._storage;
}
if (this._type !== undefined) {
hasAnyValues = true;
internalValueResult.type = this._type;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._address = undefined;
this._addressPosition = undefined;
this._storage = undefined;
this._type = 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._address = value.address;
this._addressPosition = value.addressPosition;
this._storage = value.storage;
this._type = value.type;
}
}
get address() {
return this.getStringAttribute('address');
}
set address(value) {
this._address = value;
}
resetAddress() {
this._address = undefined;
}
// Temporarily expose input value. Use with caution.
get addressInput() {
return this._address;
}
get addressPosition() {
return this.getStringAttribute('address_position');
}
set addressPosition(value) {
this._addressPosition = value;
}
resetAddressPosition() {
this._addressPosition = undefined;
}
// Temporarily expose input value. Use with caution.
get addressPositionInput() {
return this._addressPosition;
}
get storage() {
return this.getStringAttribute('storage');
}
set storage(value) {
this._storage = value;
}
resetStorage() {
this._storage = undefined;
}
// Temporarily expose input value. Use with caution.
get storageInput() {
return this._storage;
}
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;
}
}
exports.ServerStorageDevicesOutputReference = ServerStorageDevicesOutputReference;
_j = JSII_RTTI_SYMBOL_1;
ServerStorageDevicesOutputReference[_j] = { fqn: "@cdktf/provider-upcloud.server.ServerStorageDevicesOutputReference", version: "15.1.3" };
class ServerStorageDevicesList 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 ServerStorageDevicesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ServerStorageDevicesList = ServerStorageDevicesList;
_k = JSII_RTTI_SYMBOL_1;
ServerStorageDevicesList[_k] = { fqn: "@cdktf/provider-upcloud.server.ServerStorageDevicesList", version: "15.1.3" };
function serverTemplateBackupRuleToTerraform(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 {
interval: cdktf.stringToTerraform(struct.interval),
retention: cdktf.numberToTerraform(struct.retention),
time: cdktf.stringToTerraform(struct.time),
};
}
function serverTemplateBackupRuleToHclTerraform(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 = {
interval: {
value: cdktf.stringToHclTerraform(struct.interval),
isBlock: false,
type: "simple",
storageClassType: "string",
},
retention: {
value: cdktf.numberToHclTerraform(struct.retention),
isBlock: false,
type: "simple",
storageClassType: "number",
},
time: {
value: cdktf.stringToHclTerraform(struct.time),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ServerTemplateBackupRuleOutputReference 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._interval !== undefined) {
hasAnyValues = true;
internalValueResult.interval = this._interval;
}
if (this._retention !== undefined) {
hasAnyValues = true;
internalValueResult.retention = this._retention;
}
if (this._time !== undefined) {
hasAnyValues = true;
internalValueResult.time = this._time;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._interval = undefined;
this._retention = undefined;
this._time = 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._interval = value.interval;
this._retention = value.retention;
this._time = value.time;
}
}
get interval() {
return this.getStringAttribute('interval');
}
set interval(value) {
this._interval = value;
}
// Temporarily expose input value. Use with caution.
get intervalInput() {
return this._interval;
}
get retention() {
return this.getNumberAttribute('retention');
}
set retention(value) {
this._retention = value;
}
// Temporarily expose input value. Use with caution.
get retentionInput() {
return this._retention;
}
get time() {
return this.getStringAttribute('time');
}
set time(value) {
this._time = value;
}
// Temporarily expose input value. Use with caution.
get timeInput() {
return this._time;
}
}
exports.ServerTemplateBackupRuleOutputReference = ServerTemplateBackupRuleOutputReference;
_l = JSII_RTTI_SYMBOL_1;
ServerTemplateBackupRuleOutputReference[_l] = { fqn: "@cdktf/provider-upcloud.server.ServerTemplateBackupRuleOutputReference", version: "15.1.3" };
class ServerTemplateBackupRuleList 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 ServerTemplateBackupRuleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ServerTemplateBackupRuleList = ServerTemplateBackupRuleList;
_m = JSII_RTTI_SYMBOL_1;
ServerTemplateBackupRuleList[_m] = { fqn: "@cdktf/provider-upcloud.server.ServerTemplateBackupRuleList", version: "15.1.3" };
function serverTemplateToTerraform(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 {
address: cdktf.stringToTerraform(struct.address),
address_position: cdktf.stringToTerraform(struct.addressPosition),
delete_autoresize_backup: cdktf.booleanToTerraform(struct.deleteAutoresizeBackup),
encrypt: cdktf.booleanToTerraform(struct.encrypt),
filesystem_autoresize: cdktf.booleanToTerraform(struct.filesystemAutoresize),
size: cdktf.numberToTerraform(struct.size),
storage: cdktf.stringToTerraform(struct.storage),
tier: cdktf.stringToTerraform(struct.tier),
title: cdktf.stringToTerraform(struct.title),
backup_rule: cdktf.listMapper(serverTemplateBackupRuleToTerraform, true)(struct.backupRule),
};
}
function serverTemplateToHclTerraform(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 = {
address: {
value: cdktf.stringToHclTerraform(struct.address),
isBlock: false,
type: "simple",
storageClassType: "string",
},
address_position: {
value: cdktf.stringToHclTerraform(struct.addressPosition),
isBlock: false,
type: "simple",
storageClassType: "string",
},
delete_autoresize_backup: {
value: cdktf.booleanToHclTerraform(struct.deleteAutoresizeBackup),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
encrypt: {
value: cdktf.booleanToHclTerraform(struct.encrypt),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
filesystem_autoresize: {
value: cdktf.booleanToHclTerraform(struct.filesystemAutoresize),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
size: {
value: cdktf.numberToHclTerraform(struct.size),
isBlock: false,
type: "simple",
storageClassType: "number",
},
storage: {
value: cdktf.stringToHclTerraform(struct.storage),
isBlock: false,
type: "simple",
storageClassType: "string",
},
tier: {
value: cdktf.stringToHclTerraform(struct.tier),
isBlock: false,
type: "simple",
storageClassType: "string",
},
title: {
value: cdktf.stringToHclTerraform(struct.title),
isBlock: false,
type: "simple",
storageClassType: "string",
},
backup_rule: {
value: cdktf.listMapperHcl(serverTemplateBackupRuleToHclTerraform, true)(struct.backupRule),
isBlock: true,
type: "list",
storageClassType: "ServerTemplateBackupRuleList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ServerTemplateOutputReference 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;
// backup_rule - computed: false, optional: true, required: false
this._backupRule = new ServerTemplateBackupRuleList(this, "backup_rule", false);
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._address !== undefined) {
hasAnyValues = true;
internalValueResult.address = this._address;
}
if (this._addressPosition !== undefined) {
hasAnyValues = true;
internalValueResult.addressPosition = this._addressPosition;
}
if (this._deleteAutoresizeBackup !== undefined) {
hasAnyValues = true;
internalValueResult.deleteAutoresizeBackup = this._deleteAutoresizeBackup;
}
if (this._encrypt !== undefined) {
hasAnyValues = true;
internalValueResult.encrypt = this._encrypt;
}
if (this._filesystemAutoresize !== undefined) {
hasAnyValues = true;
internalValueResult.filesystemAutoresize = this._filesystemAutoresize;
}
if (this._size !== undefined) {
hasAnyValues = true;
internalValueResult.size = this._size;
}
if (this._storage !== undefined) {
hasAnyValues = true;
internalValueResult.storage = this._storage;
}
if (this._tier !== undefined) {
hasAnyValues = true;
internalValueResult.tier = this._tier;
}
if (this._title !== undefined) {
hasAnyValues = true;
internalValueResult.title = this._title;
}
if (this._backupRule?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.backupRule = this._backupRule?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmp