# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class Function(pulumi.CustomResource):
    code_checksum: pulumi.Output[str]
    """
    The checksum (crc64) of the function code.
    """
    description: pulumi.Output[str]
    """
    The Function Compute function description.
    """
    environment_variables: pulumi.Output[dict]
    """
    A map that defines environment variables for the function.
    """
    filename: pulumi.Output[str]
    """
    The path to the function's deployment package within the local filesystem. It is conflict with the `oss_`-prefixed options.
    """
    function_id: pulumi.Output[str]
    """
    The Function Compute service ID.
    """
    handler: pulumi.Output[str]
    """
    The function [entry point](https://www.alibabacloud.com/help/doc-detail/62213.htm) in your code.
    """
    last_modified: pulumi.Output[str]
    """
    The date this resource was last modified.
    """
    memory_size: pulumi.Output[float]
    """
    Amount of memory in MB your Function can use at runtime. Defaults to `128`. Limits to [128, 3072].
    """
    name: pulumi.Output[str]
    """
    The Function Compute function name. It is the only in one service and is conflict with "name_prefix".
    """
    name_prefix: pulumi.Output[str]
    """
    Setting a prefix to get a only function name. It is conflict with "name".
    """
    oss_bucket: pulumi.Output[str]
    """
    The OSS bucket location containing the function's deployment package. Conflicts with `filename`. This bucket must reside in the same Alibaba Cloud region where you are creating the function.
    """
    oss_key: pulumi.Output[str]
    """
    The OSS key of an object containing the function's deployment package. Conflicts with `filename`.
    """
    runtime: pulumi.Output[str]
    """
    See [Runtimes][https://www.alibabacloud.com/help/doc-detail/52077.htm] for valid values.
    """
    service: pulumi.Output[str]
    """
    The Function Compute service name.
    """
    timeout: pulumi.Output[float]
    """
    The amount of time your Function has to run in seconds.
    """
    def __init__(__self__, resource_name, opts=None, code_checksum=None, description=None, environment_variables=None, filename=None, handler=None, memory_size=None, name=None, name_prefix=None, oss_bucket=None, oss_key=None, runtime=None, service=None, timeout=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a Function 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] code_checksum: The checksum (crc64) of the function code.
        :param pulumi.Input[str] description: The Function Compute function description.
        :param pulumi.Input[dict] environment_variables: A map that defines environment variables for the function.
        :param pulumi.Input[str] filename: The path to the function's deployment package within the local filesystem. It is conflict with the `oss_`-prefixed options.
        :param pulumi.Input[str] handler: The function [entry point](https://www.alibabacloud.com/help/doc-detail/62213.htm) in your code.
        :param pulumi.Input[float] memory_size: Amount of memory in MB your Function can use at runtime. Defaults to `128`. Limits to [128, 3072].
        :param pulumi.Input[str] name: The Function Compute function name. It is the only in one service and is conflict with "name_prefix".
        :param pulumi.Input[str] name_prefix: Setting a prefix to get a only function name. It is conflict with "name".
        :param pulumi.Input[str] oss_bucket: The OSS bucket location containing the function's deployment package. Conflicts with `filename`. This bucket must reside in the same Alibaba Cloud region where you are creating the function.
        :param pulumi.Input[str] oss_key: The OSS key of an object containing the function's deployment package. Conflicts with `filename`.
        :param pulumi.Input[str] runtime: See [Runtimes][https://www.alibabacloud.com/help/doc-detail/52077.htm] for valid values.
        :param pulumi.Input[str] service: The Function Compute service name.
        :param pulumi.Input[float] timeout: The amount of time your Function has to run in seconds.
        """
        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__['code_checksum'] = code_checksum
            __props__['description'] = description
            __props__['environment_variables'] = environment_variables
            __props__['filename'] = filename
            if handler is None:
                raise TypeError("Missing required property 'handler'")
            __props__['handler'] = handler
            __props__['memory_size'] = memory_size
            __props__['name'] = name
            __props__['name_prefix'] = name_prefix
            __props__['oss_bucket'] = oss_bucket
            __props__['oss_key'] = oss_key
            if runtime is None:
                raise TypeError("Missing required property 'runtime'")
            __props__['runtime'] = runtime
            if service is None:
                raise TypeError("Missing required property 'service'")
            __props__['service'] = service
            __props__['timeout'] = timeout
            __props__['function_id'] = None
            __props__['last_modified'] = None
        super(Function, __self__).__init__(
            'alicloud:fc/function:Function',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, code_checksum=None, description=None, environment_variables=None, filename=None, function_id=None, handler=None, last_modified=None, memory_size=None, name=None, name_prefix=None, oss_bucket=None, oss_key=None, runtime=None, service=None, timeout=None):
        """
        Get an existing Function 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 str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] code_checksum: The checksum (crc64) of the function code.
        :param pulumi.Input[str] description: The Function Compute function description.
        :param pulumi.Input[dict] environment_variables: A map that defines environment variables for the function.
        :param pulumi.Input[str] filename: The path to the function's deployment package within the local filesystem. It is conflict with the `oss_`-prefixed options.
        :param pulumi.Input[str] function_id: The Function Compute service ID.
        :param pulumi.Input[str] handler: The function [entry point](https://www.alibabacloud.com/help/doc-detail/62213.htm) in your code.
        :param pulumi.Input[str] last_modified: The date this resource was last modified.
        :param pulumi.Input[float] memory_size: Amount of memory in MB your Function can use at runtime. Defaults to `128`. Limits to [128, 3072].
        :param pulumi.Input[str] name: The Function Compute function name. It is the only in one service and is conflict with "name_prefix".
        :param pulumi.Input[str] name_prefix: Setting a prefix to get a only function name. It is conflict with "name".
        :param pulumi.Input[str] oss_bucket: The OSS bucket location containing the function's deployment package. Conflicts with `filename`. This bucket must reside in the same Alibaba Cloud region where you are creating the function.
        :param pulumi.Input[str] oss_key: The OSS key of an object containing the function's deployment package. Conflicts with `filename`.
        :param pulumi.Input[str] runtime: See [Runtimes][https://www.alibabacloud.com/help/doc-detail/52077.htm] for valid values.
        :param pulumi.Input[str] service: The Function Compute service name.
        :param pulumi.Input[float] timeout: The amount of time your Function has to run in seconds.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["code_checksum"] = code_checksum
        __props__["description"] = description
        __props__["environment_variables"] = environment_variables
        __props__["filename"] = filename
        __props__["function_id"] = function_id
        __props__["handler"] = handler
        __props__["last_modified"] = last_modified
        __props__["memory_size"] = memory_size
        __props__["name"] = name
        __props__["name_prefix"] = name_prefix
        __props__["oss_bucket"] = oss_bucket
        __props__["oss_key"] = oss_key
        __props__["runtime"] = runtime
        __props__["service"] = service
        __props__["timeout"] = timeout
        return Function(resource_name, opts=opts, __props__=__props__)
    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

