// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function sagemakerDeviceDeviceToTerraform(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 {
        description: cdktf.stringToTerraform(struct.description),
        device_name: cdktf.stringToTerraform(struct.deviceName),
        iot_thing_name: cdktf.stringToTerraform(struct.iotThingName),
    };
}
export class SagemakerDeviceDeviceOutputReference extends cdktf.ComplexObject {
    isEmptyObject = false;
    /**
    * @param terraformResource The parent resource
    * @param terraformAttribute The attribute on the parent resource this class is referencing
    * @param isSingleItem True if this is a block, false if it's a list
    */
    constructor(terraformResource, terraformAttribute, isSingleItem) {
        super(terraformResource, terraformAttribute, isSingleItem);
    }
    get internalValue() {
        let hasAnyValues = this.isEmptyObject;
        const internalValueResult = {};
        if (this._description !== undefined) {
            hasAnyValues = true;
            internalValueResult.description = this._description;
        }
        if (this._deviceName !== undefined) {
            hasAnyValues = true;
            internalValueResult.deviceName = this._deviceName;
        }
        if (this._iotThingName !== undefined) {
            hasAnyValues = true;
            internalValueResult.iotThingName = this._iotThingName;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._description = undefined;
            this._deviceName = undefined;
            this._iotThingName = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._description = value.description;
            this._deviceName = value.deviceName;
            this._iotThingName = value.iotThingName;
        }
    }
    // description - computed: false, optional: true, required: false
    _description;
    get description() {
        return this.getStringAttribute('description');
    }
    set description(value) {
        this._description = value;
    }
    resetDescription() {
        this._description = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get descriptionInput() {
        return this._description;
    }
    // device_name - computed: false, optional: false, required: true
    _deviceName;
    get deviceName() {
        return this.getStringAttribute('device_name');
    }
    set deviceName(value) {
        this._deviceName = value;
    }
    // Temporarily expose input value. Use with caution.
    get deviceNameInput() {
        return this._deviceName;
    }
    // iot_thing_name - computed: false, optional: true, required: false
    _iotThingName;
    get iotThingName() {
        return this.getStringAttribute('iot_thing_name');
    }
    set iotThingName(value) {
        this._iotThingName = value;
    }
    resetIotThingName() {
        this._iotThingName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get iotThingNameInput() {
        return this._iotThingName;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/sagemaker_device aws_sagemaker_device}
*/
export class SagemakerDevice extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_sagemaker_device";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/sagemaker_device aws_sagemaker_device} Resource
    *
    * @param scope The scope in which to define this construct
    * @param id The scoped construct ID. Must be unique amongst siblings in the same scope
    * @param options SagemakerDeviceConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_sagemaker_device',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._deviceFleetName = config.deviceFleetName;
        this._device.internalValue = config.device;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // agent_version - computed: true, optional: false, required: false
    get agentVersion() {
        return this.getStringAttribute('agent_version');
    }
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // device_fleet_name - computed: false, optional: false, required: true
    _deviceFleetName;
    get deviceFleetName() {
        return this.getStringAttribute('device_fleet_name');
    }
    set deviceFleetName(value) {
        this._deviceFleetName = value;
    }
    // Temporarily expose input value. Use with caution.
    get deviceFleetNameInput() {
        return this._deviceFleetName;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // device - computed: false, optional: false, required: true
    _device = new SagemakerDeviceDeviceOutputReference(this, "device", true);
    get device() {
        return this._device;
    }
    putDevice(value) {
        this._device.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get deviceInput() {
        return this._device.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            device_fleet_name: cdktf.stringToTerraform(this._deviceFleetName),
            device: sagemakerDeviceDeviceToTerraform(this._device.internalValue),
        };
    }
}
//# sourceMappingURL=sagemaker-device.js.map