# 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

class Zone(pulumi.CustomResource):
    """
    Manages a DNS zone in the OpenStack DNS Service.
    """
    def __init__(__self__, __name__, __opts__=None, attributes=None, description=None, email=None, masters=None, name=None, region=None, ttl=None, type=None, value_specs=None):
        """Create a Zone 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__, basestring):
            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 attributes and not isinstance(attributes, dict):
            raise TypeError('Expected property attributes to be a dict')
        __self__.attributes = attributes
        """
        Attributes for the DNS Service scheduler.
        Changing this creates a new zone.
        """
        __props__['attributes'] = attributes

        if description and not isinstance(description, basestring):
            raise TypeError('Expected property description to be a basestring')
        __self__.description = description
        """
        A description of the zone.
        """
        __props__['description'] = description

        if email and not isinstance(email, basestring):
            raise TypeError('Expected property email to be a basestring')
        __self__.email = email
        """
        The email contact for the zone record.
        """
        __props__['email'] = email

        if masters and not isinstance(masters, list):
            raise TypeError('Expected property masters to be a list')
        __self__.masters = masters
        """
        An array of master DNS servers. For when `type` is
        `SECONDARY`.
        """
        __props__['masters'] = masters

        if name and not isinstance(name, basestring):
            raise TypeError('Expected property name to be a basestring')
        __self__.name = name
        """
        The name of the zone. Note the `.` at the end of the name.
        Changing this creates a new DNS zone.
        """
        __props__['name'] = name

        if region and not isinstance(region, basestring):
            raise TypeError('Expected property region to be a basestring')
        __self__.region = region
        """
        The region in which to obtain the V2 Compute client.
        Keypairs are associated with accounts, but a Compute client is needed to
        create one. If omitted, the `region` argument of the provider is used.
        Changing this creates a new DNS zone.
        """
        __props__['region'] = region

        if ttl and not isinstance(ttl, int):
            raise TypeError('Expected property ttl to be a int')
        __self__.ttl = ttl
        """
        The time to live (TTL) of the zone.
        """
        __props__['ttl'] = ttl

        if type and not isinstance(type, basestring):
            raise TypeError('Expected property type to be a basestring')
        __self__.type = type
        """
        The type of zone. Can either be `PRIMARY` or `SECONDARY`.
        Changing this creates a new zone.
        """
        __props__['type'] = type

        if value_specs and not isinstance(value_specs, dict):
            raise TypeError('Expected property value_specs to be a dict')
        __self__.value_specs = value_specs
        """
        Map of additional options. Changing this creates a
        new zone.
        """
        __props__['valueSpecs'] = value_specs

        super(Zone, __self__).__init__(
            'openstack:dns/zone:Zone',
            __name__,
            __props__,
            __opts__)

    def set_outputs(self, outs):
        if 'attributes' in outs:
            self.attributes = outs['attributes']
        if 'description' in outs:
            self.description = outs['description']
        if 'email' in outs:
            self.email = outs['email']
        if 'masters' in outs:
            self.masters = outs['masters']
        if 'name' in outs:
            self.name = outs['name']
        if 'region' in outs:
            self.region = outs['region']
        if 'ttl' in outs:
            self.ttl = outs['ttl']
        if 'type' in outs:
            self.type = outs['type']
        if 'valueSpecs' in outs:
            self.value_specs = outs['valueSpecs']
