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


class Zone(pulumi.CustomResource):
    additional_primaries: pulumi.Output[list]
    """
    List of additional IPv4 addresses for the primary
    zone. Conflicts with `secondaries`.
    """
    autogenerate_ns_record: pulumi.Output[bool]
    dns_servers: pulumi.Output[str]
    """
    (Computed) Authoritative Name Servers.
    """
    dnssec: pulumi.Output[bool]
    """
    Whether or not DNSSEC is enabled for the zone.
    Note that DNSSEC must be enabled on the account by support for this to be set
    to `true`.
    """
    expiry: pulumi.Output[float]
    """
    The SOA Expiry. Conflicts with `primary` and
    `additional_primaries` (default must be accepted).
    """
    hostmaster: pulumi.Output[str]
    """
    (Computed) The SOA Hostmaster.
    """
    link: pulumi.Output[str]
    """
    The target zone(domain name) to link to.
    """
    networks: pulumi.Output[list]
    """
    - List of network IDs (`int`) for which the zone
    should be made available. Default is network 0, the primary NSONE Global
    Network. Normally, you should not have to worry about this.
    """
    nx_ttl: pulumi.Output[float]
    """
    The SOA NX TTL. Conflicts with `primary` and
    `additional_primaries` (default must be accepted).
    """
    primary: pulumi.Output[str]
    """
    The primary zones' IPv4 address. This makes the zone a
    secondary. Conflicts with `secondaries`.
    """
    refresh: pulumi.Output[float]
    """
    The SOA Refresh. Conflicts with `primary` and
    `additional_primaries` (default must be accepted).
    """
    retry: pulumi.Output[float]
    """
    The SOA Retry. Conflicts with `primary` and
    `additional_primaries` (default must be accepted).
    """
    secondaries: pulumi.Output[list]
    """
    List of secondary servers. This makes the zone a
    primary. Conflicts with `primary` and `additional_primaries`.
    Secondaries is documented below.

      * `ip` (`str`) - IPv4 address of the secondary server.
      * `networks` (`list`) - - List of network IDs (`int`) for which the zone
        should be made available. Default is network 0, the primary NSONE Global
        Network. Normally, you should not have to worry about this.
      * `notify` (`bool`) - Whether we send `NOTIFY` messages to the secondary host
        when the zone changes. Default `false`.
      * `port` (`float`) - Port of the the secondary server. Default `53`.
    """
    ttl: pulumi.Output[float]
    """
    The SOA TTL.
    """
    zone: pulumi.Output[str]
    """
    The domain name of the zone.
    """
    def __init__(__self__, resource_name, opts=None, additional_primaries=None, autogenerate_ns_record=None, dnssec=None, expiry=None, link=None, networks=None, nx_ttl=None, primary=None, refresh=None, retry=None, secondaries=None, ttl=None, zone=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a Zone 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[list] additional_primaries: List of additional IPv4 addresses for the primary
               zone. Conflicts with `secondaries`.
        :param pulumi.Input[bool] dnssec: Whether or not DNSSEC is enabled for the zone.
               Note that DNSSEC must be enabled on the account by support for this to be set
               to `true`.
        :param pulumi.Input[float] expiry: The SOA Expiry. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[str] link: The target zone(domain name) to link to.
        :param pulumi.Input[list] networks: - List of network IDs (`int`) for which the zone
               should be made available. Default is network 0, the primary NSONE Global
               Network. Normally, you should not have to worry about this.
        :param pulumi.Input[float] nx_ttl: The SOA NX TTL. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[str] primary: The primary zones' IPv4 address. This makes the zone a
               secondary. Conflicts with `secondaries`.
        :param pulumi.Input[float] refresh: The SOA Refresh. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[float] retry: The SOA Retry. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[list] secondaries: List of secondary servers. This makes the zone a
               primary. Conflicts with `primary` and `additional_primaries`.
               Secondaries is documented below.
        :param pulumi.Input[float] ttl: The SOA TTL.
        :param pulumi.Input[str] zone: The domain name of the zone.

        The **secondaries** object supports the following:

          * `ip` (`pulumi.Input[str]`) - IPv4 address of the secondary server.
          * `networks` (`pulumi.Input[list]`) - - List of network IDs (`int`) for which the zone
            should be made available. Default is network 0, the primary NSONE Global
            Network. Normally, you should not have to worry about this.
          * `notify` (`pulumi.Input[bool]`) - Whether we send `NOTIFY` messages to the secondary host
            when the zone changes. Default `false`.
          * `port` (`pulumi.Input[float]`) - Port of the the secondary server. Default `53`.
        """
        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__['additional_primaries'] = additional_primaries
            __props__['autogenerate_ns_record'] = autogenerate_ns_record
            __props__['dnssec'] = dnssec
            __props__['expiry'] = expiry
            __props__['link'] = link
            __props__['networks'] = networks
            __props__['nx_ttl'] = nx_ttl
            __props__['primary'] = primary
            __props__['refresh'] = refresh
            __props__['retry'] = retry
            __props__['secondaries'] = secondaries
            __props__['ttl'] = ttl
            if zone is None:
                raise TypeError("Missing required property 'zone'")
            __props__['zone'] = zone
            __props__['dns_servers'] = None
            __props__['hostmaster'] = None
        super(Zone, __self__).__init__(
            'ns1:index/zone:Zone',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, additional_primaries=None, autogenerate_ns_record=None, dns_servers=None, dnssec=None, expiry=None, hostmaster=None, link=None, networks=None, nx_ttl=None, primary=None, refresh=None, retry=None, secondaries=None, ttl=None, zone=None):
        """
        Get an existing Zone 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[list] additional_primaries: List of additional IPv4 addresses for the primary
               zone. Conflicts with `secondaries`.
        :param pulumi.Input[str] dns_servers: (Computed) Authoritative Name Servers.
        :param pulumi.Input[bool] dnssec: Whether or not DNSSEC is enabled for the zone.
               Note that DNSSEC must be enabled on the account by support for this to be set
               to `true`.
        :param pulumi.Input[float] expiry: The SOA Expiry. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[str] hostmaster: (Computed) The SOA Hostmaster.
        :param pulumi.Input[str] link: The target zone(domain name) to link to.
        :param pulumi.Input[list] networks: - List of network IDs (`int`) for which the zone
               should be made available. Default is network 0, the primary NSONE Global
               Network. Normally, you should not have to worry about this.
        :param pulumi.Input[float] nx_ttl: The SOA NX TTL. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[str] primary: The primary zones' IPv4 address. This makes the zone a
               secondary. Conflicts with `secondaries`.
        :param pulumi.Input[float] refresh: The SOA Refresh. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[float] retry: The SOA Retry. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[list] secondaries: List of secondary servers. This makes the zone a
               primary. Conflicts with `primary` and `additional_primaries`.
               Secondaries is documented below.
        :param pulumi.Input[float] ttl: The SOA TTL.
        :param pulumi.Input[str] zone: The domain name of the zone.

        The **secondaries** object supports the following:

          * `ip` (`pulumi.Input[str]`) - IPv4 address of the secondary server.
          * `networks` (`pulumi.Input[list]`) - - List of network IDs (`int`) for which the zone
            should be made available. Default is network 0, the primary NSONE Global
            Network. Normally, you should not have to worry about this.
          * `notify` (`pulumi.Input[bool]`) - Whether we send `NOTIFY` messages to the secondary host
            when the zone changes. Default `false`.
          * `port` (`pulumi.Input[float]`) - Port of the the secondary server. Default `53`.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["additional_primaries"] = additional_primaries
        __props__["autogenerate_ns_record"] = autogenerate_ns_record
        __props__["dns_servers"] = dns_servers
        __props__["dnssec"] = dnssec
        __props__["expiry"] = expiry
        __props__["hostmaster"] = hostmaster
        __props__["link"] = link
        __props__["networks"] = networks
        __props__["nx_ttl"] = nx_ttl
        __props__["primary"] = primary
        __props__["refresh"] = refresh
        __props__["retry"] = retry
        __props__["secondaries"] = secondaries
        __props__["ttl"] = ttl
        __props__["zone"] = zone
        return Zone(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
