# 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 builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs

__all__ = [
    'GetCommandResult',
    'AwaitableGetCommandResult',
    'get_command',
    'get_command_output',
]

@pulumi.output_type
class GetCommandResult:
    """
    A collection of values returned by getCommand.
    """
    def __init__(__self__, command_content=None, command_id=None, content_encoding=None, created_time=None, description=None, enable_parameter=None, id=None, invocation_times=None, name=None, parameter_definitions=None, project_name=None, provider_name=None, tags=None, timeout=None, type=None, updated_time=None, username=None, working_dir=None):
        if command_content and not isinstance(command_content, str):
            raise TypeError("Expected argument 'command_content' to be a str")
        pulumi.set(__self__, "command_content", command_content)
        if command_id and not isinstance(command_id, str):
            raise TypeError("Expected argument 'command_id' to be a str")
        pulumi.set(__self__, "command_id", command_id)
        if content_encoding and not isinstance(content_encoding, str):
            raise TypeError("Expected argument 'content_encoding' to be a str")
        pulumi.set(__self__, "content_encoding", content_encoding)
        if created_time and not isinstance(created_time, str):
            raise TypeError("Expected argument 'created_time' to be a str")
        pulumi.set(__self__, "created_time", created_time)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if enable_parameter and not isinstance(enable_parameter, bool):
            raise TypeError("Expected argument 'enable_parameter' to be a bool")
        pulumi.set(__self__, "enable_parameter", enable_parameter)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if invocation_times and not isinstance(invocation_times, int):
            raise TypeError("Expected argument 'invocation_times' to be a int")
        pulumi.set(__self__, "invocation_times", invocation_times)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if parameter_definitions and not isinstance(parameter_definitions, list):
            raise TypeError("Expected argument 'parameter_definitions' to be a list")
        pulumi.set(__self__, "parameter_definitions", parameter_definitions)
        if project_name and not isinstance(project_name, str):
            raise TypeError("Expected argument 'project_name' to be a str")
        pulumi.set(__self__, "project_name", project_name)
        if provider_name and not isinstance(provider_name, str):
            raise TypeError("Expected argument 'provider_name' to be a str")
        pulumi.set(__self__, "provider_name", provider_name)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if timeout and not isinstance(timeout, int):
            raise TypeError("Expected argument 'timeout' to be a int")
        pulumi.set(__self__, "timeout", timeout)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)
        if updated_time and not isinstance(updated_time, str):
            raise TypeError("Expected argument 'updated_time' to be a str")
        pulumi.set(__self__, "updated_time", updated_time)
        if username and not isinstance(username, str):
            raise TypeError("Expected argument 'username' to be a str")
        pulumi.set(__self__, "username", username)
        if working_dir and not isinstance(working_dir, str):
            raise TypeError("Expected argument 'working_dir' to be a str")
        pulumi.set(__self__, "working_dir", working_dir)

    @property
    @pulumi.getter(name="commandContent")
    def command_content(self) -> builtins.str:
        """
        命令内容。请根据ContentEncoding参数传入相应命令内容。命令内容不能超过16KB。
        """
        return pulumi.get(self, "command_content")

    @property
    @pulumi.getter(name="commandId")
    def command_id(self) -> builtins.str:
        """
        自定义命令ID。
        """
        return pulumi.get(self, "command_id")

    @property
    @pulumi.getter(name="contentEncoding")
    def content_encoding(self) -> builtins.str:
        """
        命令内容是否经过Base64编码处理。Base64（默认）：经过Base64编码处理。PlainText： 未进行编码处理。
        """
        return pulumi.get(self, "content_encoding")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> builtins.str:
        """
        创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter
    def description(self) -> builtins.str:
        """
        命令描述，默认为空字符串。字符长度0~256。不限制特殊字符。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="enableParameter")
    def enable_parameter(self) -> builtins.bool:
        """
        创建的命令是否使用自定义参数。false：默认，表示不使用自定义参数。true：表示使用自定义参数。
        """
        return pulumi.get(self, "enable_parameter")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="invocationTimes")
    def invocation_times(self) -> builtins.int:
        """
        命令被调用次数。
        """
        return pulumi.get(self, "invocation_times")

    @property
    @pulumi.getter
    def name(self) -> builtins.str:
        """
        命令名称。字符长度1~32。不限制特殊字符。
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="parameterDefinitions")
    def parameter_definitions(self) -> Sequence['outputs.GetCommandParameterDefinitionResult']:
        """
        自定义参数定义信息。
        """
        return pulumi.get(self, "parameter_definitions")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        资源所属项目，一个资源只能归属于一个项目。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter(name="providerName")
    def provider_name(self) -> builtins.str:
        """
        命令的提供方。
        """
        return pulumi.get(self, "provider_name")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetCommandTagResult']:
        """
        标签键值对。
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter
    def timeout(self) -> builtins.int:
        """
        创建的命令在ECS实例中执行时最大的超时时间，单位为秒。取值范围：30~86400。默认值：60。
        """
        return pulumi.get(self, "timeout")

    @property
    @pulumi.getter
    def type(self) -> builtins.str:
        """
        命令的类型。Shell：表示创建一个在Linux实例中运行的Shell脚本。Python：表示创建一个Python脚本。Bat：表示创建一个Bat脚本。PowerShell：表示创建一个PowerShell脚本。
        """
        return pulumi.get(self, "type")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> builtins.str:
        """
        更新时间。
        """
        return pulumi.get(self, "updated_time")

    @property
    @pulumi.getter
    def username(self) -> builtins.str:
        """
        执行命令时的用户名。
        """
        return pulumi.get(self, "username")

    @property
    @pulumi.getter(name="workingDir")
    def working_dir(self) -> builtins.str:
        """
        创建的命令在ECS实例中运行的目录。
        """
        return pulumi.get(self, "working_dir")


class AwaitableGetCommandResult(GetCommandResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetCommandResult(
            command_content=self.command_content,
            command_id=self.command_id,
            content_encoding=self.content_encoding,
            created_time=self.created_time,
            description=self.description,
            enable_parameter=self.enable_parameter,
            id=self.id,
            invocation_times=self.invocation_times,
            name=self.name,
            parameter_definitions=self.parameter_definitions,
            project_name=self.project_name,
            provider_name=self.provider_name,
            tags=self.tags,
            timeout=self.timeout,
            type=self.type,
            updated_time=self.updated_time,
            username=self.username,
            working_dir=self.working_dir)


def get_command(id: Optional[builtins.str] = None,
                opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCommandResult:
    """
    Data Source schema for Byteplus::ECS::Command


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:ecs/getCommand:getCommand', __args__, opts=opts, typ=GetCommandResult).value

    return AwaitableGetCommandResult(
        command_content=pulumi.get(__ret__, 'command_content'),
        command_id=pulumi.get(__ret__, 'command_id'),
        content_encoding=pulumi.get(__ret__, 'content_encoding'),
        created_time=pulumi.get(__ret__, 'created_time'),
        description=pulumi.get(__ret__, 'description'),
        enable_parameter=pulumi.get(__ret__, 'enable_parameter'),
        id=pulumi.get(__ret__, 'id'),
        invocation_times=pulumi.get(__ret__, 'invocation_times'),
        name=pulumi.get(__ret__, 'name'),
        parameter_definitions=pulumi.get(__ret__, 'parameter_definitions'),
        project_name=pulumi.get(__ret__, 'project_name'),
        provider_name=pulumi.get(__ret__, 'provider_name'),
        tags=pulumi.get(__ret__, 'tags'),
        timeout=pulumi.get(__ret__, 'timeout'),
        type=pulumi.get(__ret__, 'type'),
        updated_time=pulumi.get(__ret__, 'updated_time'),
        username=pulumi.get(__ret__, 'username'),
        working_dir=pulumi.get(__ret__, 'working_dir'))
def get_command_output(id: Optional[pulumi.Input[builtins.str]] = None,
                       opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetCommandResult]:
    """
    Data Source schema for Byteplus::ECS::Command


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:ecs/getCommand:getCommand', __args__, opts=opts, typ=GetCommandResult)
    return __ret__.apply(lambda __response__: GetCommandResult(
        command_content=pulumi.get(__response__, 'command_content'),
        command_id=pulumi.get(__response__, 'command_id'),
        content_encoding=pulumi.get(__response__, 'content_encoding'),
        created_time=pulumi.get(__response__, 'created_time'),
        description=pulumi.get(__response__, 'description'),
        enable_parameter=pulumi.get(__response__, 'enable_parameter'),
        id=pulumi.get(__response__, 'id'),
        invocation_times=pulumi.get(__response__, 'invocation_times'),
        name=pulumi.get(__response__, 'name'),
        parameter_definitions=pulumi.get(__response__, 'parameter_definitions'),
        project_name=pulumi.get(__response__, 'project_name'),
        provider_name=pulumi.get(__response__, 'provider_name'),
        tags=pulumi.get(__response__, 'tags'),
        timeout=pulumi.get(__response__, 'timeout'),
        type=pulumi.get(__response__, 'type'),
        updated_time=pulumi.get(__response__, 'updated_time'),
        username=pulumi.get(__response__, 'username'),
        working_dir=pulumi.get(__response__, 'working_dir')))
