# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from . import _utilities, _tables

__all__ = ['VappEntity']


class VappEntity(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 container_id: Optional[pulumi.Input[str]] = None,
                 custom_attributes: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 start_action: Optional[pulumi.Input[str]] = None,
                 start_delay: Optional[pulumi.Input[int]] = None,
                 start_order: Optional[pulumi.Input[int]] = None,
                 stop_action: Optional[pulumi.Input[str]] = None,
                 stop_delay: Optional[pulumi.Input[int]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 target_id: Optional[pulumi.Input[str]] = None,
                 wait_for_guest: Optional[pulumi.Input[bool]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Create a VappEntity resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] container_id: Managed object ID of the vApp
               container the entity is a member of.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] custom_attributes: A list of custom attributes to set on this resource.
        :param pulumi.Input[str] start_action: How to start the entity. Valid settings are none
               or powerOn. If set to none, then the entity does not participate in auto-start.
               Default: powerOn
        :param pulumi.Input[int] start_delay: Delay in seconds before continuing with the next
               entity in the order of entities to be started. Default: 120
        :param pulumi.Input[int] start_order: Order to start and stop target in vApp. Default: 1
        :param pulumi.Input[str] stop_action: Defines the stop action for the entity. Can be set
               to none, powerOff, guestShutdown, or suspend. If set to none, then the entity
               does not participate in auto-stop. Default: powerOff
        :param pulumi.Input[int] stop_delay: Delay in seconds before continuing with the next
               entity in the order sequence. This is only used if the stopAction is
               guestShutdown. Default: 120
        :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: A list of tag IDs to apply to this object.
        :param pulumi.Input[str] target_id: Managed object ID of the entity
               to power on or power off. This can be a virtual machine or a vApp.
        :param pulumi.Input[bool] wait_for_guest: Determines if the VM should be marked as being
               started when VMware Tools are ready instead of waiting for `start_delay`. This
               property has no effect for vApps. Default: false
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            if container_id is None and not opts.urn:
                raise TypeError("Missing required property 'container_id'")
            __props__['container_id'] = container_id
            __props__['custom_attributes'] = custom_attributes
            __props__['start_action'] = start_action
            __props__['start_delay'] = start_delay
            __props__['start_order'] = start_order
            __props__['stop_action'] = stop_action
            __props__['stop_delay'] = stop_delay
            __props__['tags'] = tags
            if target_id is None and not opts.urn:
                raise TypeError("Missing required property 'target_id'")
            __props__['target_id'] = target_id
            __props__['wait_for_guest'] = wait_for_guest
        super(VappEntity, __self__).__init__(
            'vsphere:index/vappEntity:VappEntity',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            container_id: Optional[pulumi.Input[str]] = None,
            custom_attributes: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
            start_action: Optional[pulumi.Input[str]] = None,
            start_delay: Optional[pulumi.Input[int]] = None,
            start_order: Optional[pulumi.Input[int]] = None,
            stop_action: Optional[pulumi.Input[str]] = None,
            stop_delay: Optional[pulumi.Input[int]] = None,
            tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            target_id: Optional[pulumi.Input[str]] = None,
            wait_for_guest: Optional[pulumi.Input[bool]] = None) -> 'VappEntity':
        """
        Get an existing VappEntity resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] container_id: Managed object ID of the vApp
               container the entity is a member of.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] custom_attributes: A list of custom attributes to set on this resource.
        :param pulumi.Input[str] start_action: How to start the entity. Valid settings are none
               or powerOn. If set to none, then the entity does not participate in auto-start.
               Default: powerOn
        :param pulumi.Input[int] start_delay: Delay in seconds before continuing with the next
               entity in the order of entities to be started. Default: 120
        :param pulumi.Input[int] start_order: Order to start and stop target in vApp. Default: 1
        :param pulumi.Input[str] stop_action: Defines the stop action for the entity. Can be set
               to none, powerOff, guestShutdown, or suspend. If set to none, then the entity
               does not participate in auto-stop. Default: powerOff
        :param pulumi.Input[int] stop_delay: Delay in seconds before continuing with the next
               entity in the order sequence. This is only used if the stopAction is
               guestShutdown. Default: 120
        :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: A list of tag IDs to apply to this object.
        :param pulumi.Input[str] target_id: Managed object ID of the entity
               to power on or power off. This can be a virtual machine or a vApp.
        :param pulumi.Input[bool] wait_for_guest: Determines if the VM should be marked as being
               started when VMware Tools are ready instead of waiting for `start_delay`. This
               property has no effect for vApps. Default: false
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["container_id"] = container_id
        __props__["custom_attributes"] = custom_attributes
        __props__["start_action"] = start_action
        __props__["start_delay"] = start_delay
        __props__["start_order"] = start_order
        __props__["stop_action"] = stop_action
        __props__["stop_delay"] = stop_delay
        __props__["tags"] = tags
        __props__["target_id"] = target_id
        __props__["wait_for_guest"] = wait_for_guest
        return VappEntity(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="containerId")
    def container_id(self) -> pulumi.Output[str]:
        """
        Managed object ID of the vApp
        container the entity is a member of.
        """
        return pulumi.get(self, "container_id")

    @property
    @pulumi.getter(name="customAttributes")
    def custom_attributes(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
        """
        A list of custom attributes to set on this resource.
        """
        return pulumi.get(self, "custom_attributes")

    @property
    @pulumi.getter(name="startAction")
    def start_action(self) -> pulumi.Output[Optional[str]]:
        """
        How to start the entity. Valid settings are none
        or powerOn. If set to none, then the entity does not participate in auto-start.
        Default: powerOn
        """
        return pulumi.get(self, "start_action")

    @property
    @pulumi.getter(name="startDelay")
    def start_delay(self) -> pulumi.Output[Optional[int]]:
        """
        Delay in seconds before continuing with the next
        entity in the order of entities to be started. Default: 120
        """
        return pulumi.get(self, "start_delay")

    @property
    @pulumi.getter(name="startOrder")
    def start_order(self) -> pulumi.Output[Optional[int]]:
        """
        Order to start and stop target in vApp. Default: 1
        """
        return pulumi.get(self, "start_order")

    @property
    @pulumi.getter(name="stopAction")
    def stop_action(self) -> pulumi.Output[Optional[str]]:
        """
        Defines the stop action for the entity. Can be set
        to none, powerOff, guestShutdown, or suspend. If set to none, then the entity
        does not participate in auto-stop. Default: powerOff
        """
        return pulumi.get(self, "stop_action")

    @property
    @pulumi.getter(name="stopDelay")
    def stop_delay(self) -> pulumi.Output[Optional[int]]:
        """
        Delay in seconds before continuing with the next
        entity in the order sequence. This is only used if the stopAction is
        guestShutdown. Default: 120
        """
        return pulumi.get(self, "stop_delay")

    @property
    @pulumi.getter
    def tags(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        A list of tag IDs to apply to this object.
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="targetId")
    def target_id(self) -> pulumi.Output[str]:
        """
        Managed object ID of the entity
        to power on or power off. This can be a virtual machine or a vApp.
        """
        return pulumi.get(self, "target_id")

    @property
    @pulumi.getter(name="waitForGuest")
    def wait_for_guest(self) -> pulumi.Output[Optional[bool]]:
        """
        Determines if the VM should be marked as being
        started when VMware Tools are ready instead of waiting for `start_delay`. This
        property has no effect for vApps. Default: false
        """
        return pulumi.get(self, "wait_for_guest")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

