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

class RandomId(pulumi.CustomResource):
    """
    The resource `random_id` generates random numbers that are intended to be
    used as unique identifiers for other resources.
    
    This resource *does* use a cryptographic random number generator in order
    to minimize the chance of collisions, making the results of this resource
    when a 16-byte identifier is requested of equivalent uniqueness to a
    type-4 UUID.
    
    This resource can be used in conjunction with resources that have
    the `create_before_destroy` lifecycle flag set to avoid conflicts with
    unique names during the brief period where both the old and new resources
    exist concurrently.
    """
    def __init__(__self__, __name__, __opts__=None, byte_length=None, keepers=None, prefix=None):
        """Create a RandomId resource with the given unique name, props, and options."""
        if not __name__:
            raise TypeError('Missing resource name argument (for URN creation)')
        if not isinstance(__name__, str):
            raise TypeError('Expected resource name to be a string')
        if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')

        __props__ = dict()

        if not byte_length:
            raise TypeError('Missing required property byte_length')
        __props__['byte_length'] = byte_length

        __props__['keepers'] = keepers

        __props__['prefix'] = prefix

        __props__['b64'] = None
        __props__['b64_std'] = None
        __props__['b64_url'] = None
        __props__['dec'] = None
        __props__['hex'] = None

        super(RandomId, __self__).__init__(
            'random:index/randomId:RandomId',
            __name__,
            __props__,
            __opts__)


    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

