<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/domains/v1beta1/domains.proto

namespace Google\Cloud\Domains\V1beta1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Defines the DNS configuration of a `Registration`, including name servers,
 * DNSSEC, and glue records.
 *
 * Generated from protobuf message <code>google.cloud.domains.v1beta1.DnsSettings</code>
 */
class DnsSettings extends \Google\Protobuf\Internal\Message
{
    /**
     * The list of glue records for this `Registration`. Commonly empty.
     *
     * Generated from protobuf field <code>repeated .google.cloud.domains.v1beta1.DnsSettings.GlueRecord glue_records = 4;</code>
     */
    private $glue_records;
    protected $dns_provider;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Domains\V1beta1\DnsSettings\CustomDns $custom_dns
     *           An arbitrary DNS provider identified by its name servers.
     *     @type \Google\Cloud\Domains\V1beta1\DnsSettings\GoogleDomainsDns $google_domains_dns
     *           The free DNS zone provided by
     *           [Google Domains](https://domains.google/).
     *     @type array<\Google\Cloud\Domains\V1beta1\DnsSettings\GlueRecord>|\Google\Protobuf\Internal\RepeatedField $glue_records
     *           The list of glue records for this `Registration`. Commonly empty.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Domains\V1Beta1\Domains::initOnce();
        parent::__construct($data);
    }

    /**
     * An arbitrary DNS provider identified by its name servers.
     *
     * Generated from protobuf field <code>.google.cloud.domains.v1beta1.DnsSettings.CustomDns custom_dns = 1;</code>
     * @return \Google\Cloud\Domains\V1beta1\DnsSettings\CustomDns|null
     */
    public function getCustomDns()
    {
        return $this->readOneof(1);
    }

    public function hasCustomDns()
    {
        return $this->hasOneof(1);
    }

    /**
     * An arbitrary DNS provider identified by its name servers.
     *
     * Generated from protobuf field <code>.google.cloud.domains.v1beta1.DnsSettings.CustomDns custom_dns = 1;</code>
     * @param \Google\Cloud\Domains\V1beta1\DnsSettings\CustomDns $var
     * @return $this
     */
    public function setCustomDns($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Domains\V1beta1\DnsSettings\CustomDns::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The free DNS zone provided by
     * [Google Domains](https://domains.google/).
     *
     * Generated from protobuf field <code>.google.cloud.domains.v1beta1.DnsSettings.GoogleDomainsDns google_domains_dns = 2;</code>
     * @return \Google\Cloud\Domains\V1beta1\DnsSettings\GoogleDomainsDns|null
     */
    public function getGoogleDomainsDns()
    {
        return $this->readOneof(2);
    }

    public function hasGoogleDomainsDns()
    {
        return $this->hasOneof(2);
    }

    /**
     * The free DNS zone provided by
     * [Google Domains](https://domains.google/).
     *
     * Generated from protobuf field <code>.google.cloud.domains.v1beta1.DnsSettings.GoogleDomainsDns google_domains_dns = 2;</code>
     * @param \Google\Cloud\Domains\V1beta1\DnsSettings\GoogleDomainsDns $var
     * @return $this
     */
    public function setGoogleDomainsDns($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Domains\V1beta1\DnsSettings\GoogleDomainsDns::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The list of glue records for this `Registration`. Commonly empty.
     *
     * Generated from protobuf field <code>repeated .google.cloud.domains.v1beta1.DnsSettings.GlueRecord glue_records = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getGlueRecords()
    {
        return $this->glue_records;
    }

    /**
     * The list of glue records for this `Registration`. Commonly empty.
     *
     * Generated from protobuf field <code>repeated .google.cloud.domains.v1beta1.DnsSettings.GlueRecord glue_records = 4;</code>
     * @param array<\Google\Cloud\Domains\V1beta1\DnsSettings\GlueRecord>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setGlueRecords($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Domains\V1beta1\DnsSettings\GlueRecord::class);
        $this->glue_records = $arr;

        return $this;
    }

    /**
     * @return string
     */
    public function getDnsProvider()
    {
        return $this->whichOneof("dns_provider");
    }

}

