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

class GetDomainRecordResult:
    """
    A collection of values returned by getDomainRecord.
    """
    def __init__(__self__, domain_id=None, id=None, name=None, port=None, priority=None, protocol=None, service=None, tag=None, target=None, ttl_sec=None, type=None, weight=None):
        if domain_id and not isinstance(domain_id, float):
            raise TypeError("Expected argument 'domain_id' to be a float")
        __self__.domain_id = domain_id
        if id and not isinstance(id, float):
            raise TypeError("Expected argument 'id' to be a float")
        __self__.id = id
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        __self__.name = name
        if port and not isinstance(port, float):
            raise TypeError("Expected argument 'port' to be a float")
        __self__.port = port
        if priority and not isinstance(priority, float):
            raise TypeError("Expected argument 'priority' to be a float")
        __self__.priority = priority
        if protocol and not isinstance(protocol, str):
            raise TypeError("Expected argument 'protocol' to be a str")
        __self__.protocol = protocol
        if service and not isinstance(service, str):
            raise TypeError("Expected argument 'service' to be a str")
        __self__.service = service
        if tag and not isinstance(tag, str):
            raise TypeError("Expected argument 'tag' to be a str")
        __self__.tag = tag
        if target and not isinstance(target, str):
            raise TypeError("Expected argument 'target' to be a str")
        __self__.target = target
        if ttl_sec and not isinstance(ttl_sec, float):
            raise TypeError("Expected argument 'ttl_sec' to be a float")
        __self__.ttl_sec = ttl_sec
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        __self__.type = type
        if weight and not isinstance(weight, float):
            raise TypeError("Expected argument 'weight' to be a float")
        __self__.weight = weight
class AwaitableGetDomainRecordResult(GetDomainRecordResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDomainRecordResult(
            domain_id=self.domain_id,
            id=self.id,
            name=self.name,
            port=self.port,
            priority=self.priority,
            protocol=self.protocol,
            service=self.service,
            tag=self.tag,
            target=self.target,
            ttl_sec=self.ttl_sec,
            type=self.type,
            weight=self.weight)

def get_domain_record(domain_id=None,id=None,name=None,opts=None):
    """
    Provides information about a Linode Domain Record.


    ## Attributes

    The Linode Volume resource exports the following attributes:

    - `id` - The unique ID of the Domain Record.

    - `name` - The name of the Record.

    - `domain_id` - The associated domain's unique ID.

    - `type` - The type of Record this is in the DNS system.

    - `ttl_sec` - The amount of time in seconds that this Domain's records may be cached by resolvers or other domain servers.

    - `target` - The target for this Record. This field's actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to.

    - `priority` - The priority of the target host. Lower values are preferred.

    - `weight` - The relative weight of this Record. Higher values are preferred.

    - `port` - The port this Record points to.

    - `protocol` - The protocol this Record's service communicates with. Only valid for SRV records.

    - `service` - The service this Record identified. Only valid for SRV records.

    - `tag` - The tag portion of a CAA record.

    > This content is derived from https://github.com/terraform-providers/terraform-provider-linode/blob/master/website/docs/d/domain_record.html.md.
    """
    __args__ = dict()


    __args__['domainId'] = domain_id
    __args__['id'] = id
    __args__['name'] = name
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('linode:index/getDomainRecord:getDomainRecord', __args__, opts=opts).value

    return AwaitableGetDomainRecordResult(
        domain_id=__ret__.get('domainId'),
        id=__ret__.get('id'),
        name=__ret__.get('name'),
        port=__ret__.get('port'),
        priority=__ret__.get('priority'),
        protocol=__ret__.get('protocol'),
        service=__ret__.get('service'),
        tag=__ret__.get('tag'),
        target=__ret__.get('target'),
        ttl_sec=__ret__.get('ttlSec'),
        type=__ret__.get('type'),
        weight=__ret__.get('weight'))
