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

class Volume(pulumi.CustomResource):
    attachments: pulumi.Output[list]
    """
    A list of attachments, each with it's own `href` attribute
    """
    billing_cycle: pulumi.Output[str]
    """
    The billing cycle, defaults to "hourly"
    """
    created: pulumi.Output[str]
    """
    The timestamp for when the volume was created
    """
    description: pulumi.Output[str]
    """
    Optional description for the volume
    """
    facility: pulumi.Output[str]
    """
    The facility to create the volume in
    """
    locked: pulumi.Output[bool]
    """
    Lock or unlock the volume
    """
    name: pulumi.Output[str]
    """
    The name of the volume
    """
    plan: pulumi.Output[str]
    """
    The service plan slug of the volume
    """
    project_id: pulumi.Output[str]
    """
    The packet project ID to deploy the volume in
    """
    size: pulumi.Output[int]
    """
    The size in GB to make the volume
    """
    snapshot_policies: pulumi.Output[list]
    """
    Optional list of snapshot policies
    """
    state: pulumi.Output[str]
    """
    The state of the volume
    """
    updated: pulumi.Output[str]
    """
    The timestamp for the last time the volume was updated
    """
    def __init__(__self__, resource_name, opts=None, billing_cycle=None, description=None, facility=None, locked=None, plan=None, project_id=None, size=None, snapshot_policies=None, __name__=None, __opts__=None):
        """
        Provides a Packet Block Storage Volume resource to allow you to
        manage block volumes on your account.
        Once created by Terraform, they must then be attached and mounted
        using the api and `packet_block_attach` and `packet_block_detach`
        scripts.
        
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] billing_cycle: The billing cycle, defaults to "hourly"
        :param pulumi.Input[str] description: Optional description for the volume
        :param pulumi.Input[str] facility: The facility to create the volume in
        :param pulumi.Input[bool] locked: Lock or unlock the volume
        :param pulumi.Input[str] plan: The service plan slug of the volume
        :param pulumi.Input[str] project_id: The packet project ID to deploy the volume in
        :param pulumi.Input[int] size: The size in GB to make the volume
        :param pulumi.Input[list] snapshot_policies: Optional list of snapshot policies
        """
        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 not resource_name:
            raise TypeError('Missing resource name argument (for URN creation)')
        if not isinstance(resource_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()

        __props__['billing_cycle'] = billing_cycle

        __props__['description'] = description

        if facility is None:
            raise TypeError('Missing required property facility')
        __props__['facility'] = facility

        __props__['locked'] = locked

        if plan is None:
            raise TypeError('Missing required property plan')
        __props__['plan'] = plan

        if project_id is None:
            raise TypeError('Missing required property project_id')
        __props__['project_id'] = project_id

        if size is None:
            raise TypeError('Missing required property size')
        __props__['size'] = size

        __props__['snapshot_policies'] = snapshot_policies

        __props__['attachments'] = None
        __props__['created'] = None
        __props__['name'] = None
        __props__['state'] = None
        __props__['updated'] = None

        super(Volume, __self__).__init__(
            'packet:index/volume:Volume',
            resource_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

