# 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
from . import outputs
from ._inputs import *

__all__ = ['Plugin']


class Plugin(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 alias: Optional[pulumi.Input[str]] = None,
                 enable_timeout: Optional[pulumi.Input[int]] = None,
                 enabled: Optional[pulumi.Input[bool]] = None,
                 envs: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 force_destroy: Optional[pulumi.Input[bool]] = None,
                 force_disable: Optional[pulumi.Input[bool]] = None,
                 grant_all_permissions: Optional[pulumi.Input[bool]] = None,
                 grant_permissions: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['PluginGrantPermissionArgs']]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Manages the lifecycle of a Docker plugin.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_docker as docker

        sample_volume_plugin = docker.Plugin("sample-volume-plugin")
        ```

        ```python
        import pulumi
        import pulumi_docker as docker

        sample_volume_plugin = docker.Plugin("sample-volume-plugin",
            alias="sample-volume-plugin",
            enable_timeout=60,
            enabled=False,
            envs=["DEBUG=1"],
            force_destroy=True,
            force_disable=True,
            grant_all_permissions=True)
        ```

        ## Import

        Docker plugins can be imported using the long id, e.g. for a plugin `tiborvass/sample-volume-plugin:latest`

        ```sh
         $ pulumi import docker:index/plugin:Plugin sample-volume-plugin $(docker plugin inspect -f "{{.ID}}" tiborvass/sample-volume-plugin:latest)
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] alias: The alias of the Docker plugin. If the tag is omitted, `:latest` is complemented to the attribute value.
        :param pulumi.Input[int] enable_timeout: HTTP client timeout to enable the plugin.
        :param pulumi.Input[bool] enabled: If true, the plugin is enabled. The default value is `true`.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] envs: . The environment variables.
        :param pulumi.Input[bool] force_destroy: If true, the plugin is removed forcibly when the plugin is removed.
        :param pulumi.Input[bool] force_disable: If true, then the plugin is disabled forcibly when the plugin is disabled.
        :param pulumi.Input[bool] grant_all_permissions: If true, grant all permissions necessary to run the plugin. This attribute conflicts with `grant_permissions`.
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['PluginGrantPermissionArgs']]]] grant_permissions: grant permissions necessary to run the plugin. This attribute conflicts with `grant_all_permissions`. See grant_permissions below for details.
        :param pulumi.Input[str] name: Docker Plugin name
        """
        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()

            __props__['alias'] = alias
            __props__['enable_timeout'] = enable_timeout
            __props__['enabled'] = enabled
            __props__['envs'] = envs
            __props__['force_destroy'] = force_destroy
            __props__['force_disable'] = force_disable
            __props__['grant_all_permissions'] = grant_all_permissions
            __props__['grant_permissions'] = grant_permissions
            __props__['name'] = name
            __props__['plugin_reference'] = None
        super(Plugin, __self__).__init__(
            'docker:index/plugin:Plugin',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            alias: Optional[pulumi.Input[str]] = None,
            enable_timeout: Optional[pulumi.Input[int]] = None,
            enabled: Optional[pulumi.Input[bool]] = None,
            envs: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            force_destroy: Optional[pulumi.Input[bool]] = None,
            force_disable: Optional[pulumi.Input[bool]] = None,
            grant_all_permissions: Optional[pulumi.Input[bool]] = None,
            grant_permissions: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['PluginGrantPermissionArgs']]]]] = None,
            name: Optional[pulumi.Input[str]] = None,
            plugin_reference: Optional[pulumi.Input[str]] = None) -> 'Plugin':
        """
        Get an existing Plugin 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] alias: The alias of the Docker plugin. If the tag is omitted, `:latest` is complemented to the attribute value.
        :param pulumi.Input[int] enable_timeout: HTTP client timeout to enable the plugin.
        :param pulumi.Input[bool] enabled: If true, the plugin is enabled. The default value is `true`.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] envs: . The environment variables.
        :param pulumi.Input[bool] force_destroy: If true, the plugin is removed forcibly when the plugin is removed.
        :param pulumi.Input[bool] force_disable: If true, then the plugin is disabled forcibly when the plugin is disabled.
        :param pulumi.Input[bool] grant_all_permissions: If true, grant all permissions necessary to run the plugin. This attribute conflicts with `grant_permissions`.
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['PluginGrantPermissionArgs']]]] grant_permissions: grant permissions necessary to run the plugin. This attribute conflicts with `grant_all_permissions`. See grant_permissions below for details.
        :param pulumi.Input[str] name: Docker Plugin name
        :param pulumi.Input[str] plugin_reference: (string) The plugin reference.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["alias"] = alias
        __props__["enable_timeout"] = enable_timeout
        __props__["enabled"] = enabled
        __props__["envs"] = envs
        __props__["force_destroy"] = force_destroy
        __props__["force_disable"] = force_disable
        __props__["grant_all_permissions"] = grant_all_permissions
        __props__["grant_permissions"] = grant_permissions
        __props__["name"] = name
        __props__["plugin_reference"] = plugin_reference
        return Plugin(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def alias(self) -> pulumi.Output[str]:
        """
        The alias of the Docker plugin. If the tag is omitted, `:latest` is complemented to the attribute value.
        """
        return pulumi.get(self, "alias")

    @property
    @pulumi.getter(name="enableTimeout")
    def enable_timeout(self) -> pulumi.Output[Optional[int]]:
        """
        HTTP client timeout to enable the plugin.
        """
        return pulumi.get(self, "enable_timeout")

    @property
    @pulumi.getter
    def enabled(self) -> pulumi.Output[Optional[bool]]:
        """
        If true, the plugin is enabled. The default value is `true`.
        """
        return pulumi.get(self, "enabled")

    @property
    @pulumi.getter
    def envs(self) -> pulumi.Output[Sequence[str]]:
        """
        . The environment variables.
        """
        return pulumi.get(self, "envs")

    @property
    @pulumi.getter(name="forceDestroy")
    def force_destroy(self) -> pulumi.Output[Optional[bool]]:
        """
        If true, the plugin is removed forcibly when the plugin is removed.
        """
        return pulumi.get(self, "force_destroy")

    @property
    @pulumi.getter(name="forceDisable")
    def force_disable(self) -> pulumi.Output[Optional[bool]]:
        """
        If true, then the plugin is disabled forcibly when the plugin is disabled.
        """
        return pulumi.get(self, "force_disable")

    @property
    @pulumi.getter(name="grantAllPermissions")
    def grant_all_permissions(self) -> pulumi.Output[Optional[bool]]:
        """
        If true, grant all permissions necessary to run the plugin. This attribute conflicts with `grant_permissions`.
        """
        return pulumi.get(self, "grant_all_permissions")

    @property
    @pulumi.getter(name="grantPermissions")
    def grant_permissions(self) -> pulumi.Output[Optional[Sequence['outputs.PluginGrantPermission']]]:
        """
        grant permissions necessary to run the plugin. This attribute conflicts with `grant_all_permissions`. See grant_permissions below for details.
        """
        return pulumi.get(self, "grant_permissions")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        Docker Plugin name
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="pluginReference")
    def plugin_reference(self) -> pulumi.Output[str]:
        """
        (string) The plugin reference.
        """
        return pulumi.get(self, "plugin_reference")

    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

