# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities

__all__ = ['DNSRecordArgs', 'DNSRecord']

@pulumi.input_type
class DNSRecordArgs:
    def __init__(__self__, *,
                 domain: pulumi.Input[builtins.str],
                 name: pulumi.Input[builtins.str],
                 type: pulumi.Input[builtins.str],
                 value: pulumi.Input[builtins.str],
                 priority: Optional[pulumi.Input[builtins.str]] = None):
        """
        The set of arguments for constructing a DNSRecord resource.
        :param pulumi.Input[builtins.str] domain: The domain name for the DNS record (e.g., 'example.com')
        :param pulumi.Input[builtins.str] name: The hostname for the DNS record. Use '@' for root domain, or specify subdomain (e.g., 'www', 'mail')
        :param pulumi.Input[builtins.str] type: The DNS record type. Supported types: A, AAAA, CNAME, MX, TXT, SRV, CAA, TLSA, NS, DS, OPENPGPKEY, SMIMEA, SSHFP
        :param pulumi.Input[builtins.str] value: The value/destination for the DNS record (e.g., IP address for A records, hostname for CNAME)
        :param pulumi.Input[builtins.str] priority: The priority for MX and SRV records (required for these types, ignored for others)
        """
        pulumi.set(__self__, "domain", domain)
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "type", type)
        pulumi.set(__self__, "value", value)
        if priority is not None:
            pulumi.set(__self__, "priority", priority)

    @property
    @pulumi.getter
    def domain(self) -> pulumi.Input[builtins.str]:
        """
        The domain name for the DNS record (e.g., 'example.com')
        """
        return pulumi.get(self, "domain")

    @domain.setter
    def domain(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "domain", value)

    @property
    @pulumi.getter
    def name(self) -> pulumi.Input[builtins.str]:
        """
        The hostname for the DNS record. Use '@' for root domain, or specify subdomain (e.g., 'www', 'mail')
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter
    def type(self) -> pulumi.Input[builtins.str]:
        """
        The DNS record type. Supported types: A, AAAA, CNAME, MX, TXT, SRV, CAA, TLSA, NS, DS, OPENPGPKEY, SMIMEA, SSHFP
        """
        return pulumi.get(self, "type")

    @type.setter
    def type(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "type", value)

    @property
    @pulumi.getter
    def value(self) -> pulumi.Input[builtins.str]:
        """
        The value/destination for the DNS record (e.g., IP address for A records, hostname for CNAME)
        """
        return pulumi.get(self, "value")

    @value.setter
    def value(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "value", value)

    @property
    @pulumi.getter
    def priority(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        The priority for MX and SRV records (required for these types, ignored for others)
        """
        return pulumi.get(self, "priority")

    @priority.setter
    def priority(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "priority", value)


@pulumi.type_token("netcup:index:DNSRecord")
class DNSRecord(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 domain: Optional[pulumi.Input[builtins.str]] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 priority: Optional[pulumi.Input[builtins.str]] = None,
                 type: Optional[pulumi.Input[builtins.str]] = None,
                 value: Optional[pulumi.Input[builtins.str]] = None,
                 __props__=None):
        """
        A DNS record managed by Netcup DNS service

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] domain: The domain name for the DNS record (e.g., 'example.com')
        :param pulumi.Input[builtins.str] name: The hostname for the DNS record. Use '@' for root domain, or specify subdomain (e.g., 'www', 'mail')
        :param pulumi.Input[builtins.str] priority: The priority for MX and SRV records (required for these types, ignored for others)
        :param pulumi.Input[builtins.str] type: The DNS record type. Supported types: A, AAAA, CNAME, MX, TXT, SRV, CAA, TLSA, NS, DS, OPENPGPKEY, SMIMEA, SSHFP
        :param pulumi.Input[builtins.str] value: The value/destination for the DNS record (e.g., IP address for A records, hostname for CNAME)
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: DNSRecordArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        A DNS record managed by Netcup DNS service

        :param str resource_name: The name of the resource.
        :param DNSRecordArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(DNSRecordArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 domain: Optional[pulumi.Input[builtins.str]] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 priority: Optional[pulumi.Input[builtins.str]] = None,
                 type: Optional[pulumi.Input[builtins.str]] = None,
                 value: Optional[pulumi.Input[builtins.str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        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__ = DNSRecordArgs.__new__(DNSRecordArgs)

            if domain is None and not opts.urn:
                raise TypeError("Missing required property 'domain'")
            __props__.__dict__["domain"] = domain
            if name is None and not opts.urn:
                raise TypeError("Missing required property 'name'")
            __props__.__dict__["name"] = name
            __props__.__dict__["priority"] = priority
            if type is None and not opts.urn:
                raise TypeError("Missing required property 'type'")
            __props__.__dict__["type"] = type
            if value is None and not opts.urn:
                raise TypeError("Missing required property 'value'")
            __props__.__dict__["value"] = value
            __props__.__dict__["fqdn"] = None
            __props__.__dict__["record_id"] = None
        super(DNSRecord, __self__).__init__(
            'netcup:index:DNSRecord',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None) -> 'DNSRecord':
        """
        Get an existing DNSRecord 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 pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = DNSRecordArgs.__new__(DNSRecordArgs)

        __props__.__dict__["domain"] = None
        __props__.__dict__["fqdn"] = None
        __props__.__dict__["name"] = None
        __props__.__dict__["priority"] = None
        __props__.__dict__["record_id"] = None
        __props__.__dict__["type"] = None
        __props__.__dict__["value"] = None
        return DNSRecord(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def domain(self) -> pulumi.Output[builtins.str]:
        """
        The domain name for the DNS record
        """
        return pulumi.get(self, "domain")

    @property
    @pulumi.getter
    def fqdn(self) -> pulumi.Output[builtins.str]:
        """
        The fully qualified domain name
        """
        return pulumi.get(self, "fqdn")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[builtins.str]:
        """
        The hostname for the DNS record
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def priority(self) -> pulumi.Output[Optional[builtins.str]]:
        """
        The priority for the DNS record
        """
        return pulumi.get(self, "priority")

    @property
    @pulumi.getter(name="recordId")
    def record_id(self) -> pulumi.Output[builtins.str]:
        """
        The unique identifier for the DNS record
        """
        return pulumi.get(self, "record_id")

    @property
    @pulumi.getter
    def type(self) -> pulumi.Output[builtins.str]:
        """
        The DNS record type
        """
        return pulumi.get(self, "type")

    @property
    @pulumi.getter
    def value(self) -> pulumi.Output[builtins.str]:
        """
        The value/destination for the DNS record
        """
        return pulumi.get(self, "value")

