// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function appmeshVirtualServiceSpecProviderVirtualNodeToTerraform(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 {
        virtual_node_name: cdktf.stringToTerraform(struct.virtualNodeName),
    };
}
export class AppmeshVirtualServiceSpecProviderVirtualNodeOutputReference 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._virtualNodeName !== undefined) {
            hasAnyValues = true;
            internalValueResult.virtualNodeName = this._virtualNodeName;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._virtualNodeName = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._virtualNodeName = value.virtualNodeName;
        }
    }
    // virtual_node_name - computed: false, optional: false, required: true
    _virtualNodeName;
    get virtualNodeName() {
        return this.getStringAttribute('virtual_node_name');
    }
    set virtualNodeName(value) {
        this._virtualNodeName = value;
    }
    // Temporarily expose input value. Use with caution.
    get virtualNodeNameInput() {
        return this._virtualNodeName;
    }
}
export function appmeshVirtualServiceSpecProviderVirtualRouterToTerraform(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 {
        virtual_router_name: cdktf.stringToTerraform(struct.virtualRouterName),
    };
}
export class AppmeshVirtualServiceSpecProviderVirtualRouterOutputReference 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._virtualRouterName !== undefined) {
            hasAnyValues = true;
            internalValueResult.virtualRouterName = this._virtualRouterName;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._virtualRouterName = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._virtualRouterName = value.virtualRouterName;
        }
    }
    // virtual_router_name - computed: false, optional: false, required: true
    _virtualRouterName;
    get virtualRouterName() {
        return this.getStringAttribute('virtual_router_name');
    }
    set virtualRouterName(value) {
        this._virtualRouterName = value;
    }
    // Temporarily expose input value. Use with caution.
    get virtualRouterNameInput() {
        return this._virtualRouterName;
    }
}
export function appmeshVirtualServiceSpecProviderToTerraform(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 {
        virtual_node: appmeshVirtualServiceSpecProviderVirtualNodeToTerraform(struct.virtualNode),
        virtual_router: appmeshVirtualServiceSpecProviderVirtualRouterToTerraform(struct.virtualRouter),
    };
}
export class AppmeshVirtualServiceSpecProviderOutputReference 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._virtualNode?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.virtualNode = this._virtualNode?.internalValue;
        }
        if (this._virtualRouter?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.virtualRouter = this._virtualRouter?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._virtualNode.internalValue = undefined;
            this._virtualRouter.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._virtualNode.internalValue = value.virtualNode;
            this._virtualRouter.internalValue = value.virtualRouter;
        }
    }
    // virtual_node - computed: false, optional: true, required: false
    _virtualNode = new AppmeshVirtualServiceSpecProviderVirtualNodeOutputReference(this, "virtual_node", true);
    get virtualNode() {
        return this._virtualNode;
    }
    putVirtualNode(value) {
        this._virtualNode.internalValue = value;
    }
    resetVirtualNode() {
        this._virtualNode.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get virtualNodeInput() {
        return this._virtualNode.internalValue;
    }
    // virtual_router - computed: false, optional: true, required: false
    _virtualRouter = new AppmeshVirtualServiceSpecProviderVirtualRouterOutputReference(this, "virtual_router", true);
    get virtualRouter() {
        return this._virtualRouter;
    }
    putVirtualRouter(value) {
        this._virtualRouter.internalValue = value;
    }
    resetVirtualRouter() {
        this._virtualRouter.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get virtualRouterInput() {
        return this._virtualRouter.internalValue;
    }
}
export function appmeshVirtualServiceSpecToTerraform(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 {
        provider: appmeshVirtualServiceSpecProviderToTerraform(struct.provider),
    };
}
export class AppmeshVirtualServiceSpecOutputReference 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._provider?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.provider = this._provider?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._provider.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._provider.internalValue = value.provider;
        }
    }
    // provider - computed: false, optional: true, required: false
    _provider = new AppmeshVirtualServiceSpecProviderOutputReference(this, "provider", true);
    get provider() {
        return this._provider;
    }
    putProvider(value) {
        this._provider.internalValue = value;
    }
    resetProvider() {
        this._provider.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get providerInput() {
        return this._provider.internalValue;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/appmesh_virtual_service aws_appmesh_virtual_service}
*/
export class AppmeshVirtualService extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_appmesh_virtual_service";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/appmesh_virtual_service aws_appmesh_virtual_service} 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 AppmeshVirtualServiceConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_appmesh_virtual_service',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._meshName = config.meshName;
        this._meshOwner = config.meshOwner;
        this._name = config.name;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._spec.internalValue = config.spec;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // created_date - computed: true, optional: false, required: false
    get createdDate() {
        return this.getStringAttribute('created_date');
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // last_updated_date - computed: true, optional: false, required: false
    get lastUpdatedDate() {
        return this.getStringAttribute('last_updated_date');
    }
    // mesh_name - computed: false, optional: false, required: true
    _meshName;
    get meshName() {
        return this.getStringAttribute('mesh_name');
    }
    set meshName(value) {
        this._meshName = value;
    }
    // Temporarily expose input value. Use with caution.
    get meshNameInput() {
        return this._meshName;
    }
    // mesh_owner - computed: true, optional: true, required: false
    _meshOwner;
    get meshOwner() {
        return this.getStringAttribute('mesh_owner');
    }
    set meshOwner(value) {
        this._meshOwner = value;
    }
    resetMeshOwner() {
        this._meshOwner = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get meshOwnerInput() {
        return this._meshOwner;
    }
    // name - computed: false, optional: false, required: true
    _name;
    get name() {
        return this.getStringAttribute('name');
    }
    set name(value) {
        this._name = value;
    }
    // Temporarily expose input value. Use with caution.
    get nameInput() {
        return this._name;
    }
    // resource_owner - computed: true, optional: false, required: false
    get resourceOwner() {
        return this.getStringAttribute('resource_owner');
    }
    // tags - computed: false, optional: true, required: false
    _tags;
    get tags() {
        return this.getStringMapAttribute('tags');
    }
    set tags(value) {
        this._tags = value;
    }
    resetTags() {
        this._tags = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagsInput() {
        return this._tags;
    }
    // tags_all - computed: true, optional: true, required: false
    _tagsAll;
    get tagsAll() {
        return this.getStringMapAttribute('tags_all');
    }
    set tagsAll(value) {
        this._tagsAll = value;
    }
    resetTagsAll() {
        this._tagsAll = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagsAllInput() {
        return this._tagsAll;
    }
    // spec - computed: false, optional: false, required: true
    _spec = new AppmeshVirtualServiceSpecOutputReference(this, "spec", true);
    get spec() {
        return this._spec;
    }
    putSpec(value) {
        this._spec.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get specInput() {
        return this._spec.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            mesh_name: cdktf.stringToTerraform(this._meshName),
            mesh_owner: cdktf.stringToTerraform(this._meshOwner),
            name: cdktf.stringToTerraform(this._name),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            spec: appmeshVirtualServiceSpecToTerraform(this._spec.internalValue),
        };
    }
}
//# sourceMappingURL=appmesh-virtual-service.js.map