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

namespace Google\Cloud\AlloyDb\V1beta\Instance;

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

/**
 * Metadata related to instance level network configuration.
 *
 * Generated from protobuf message <code>google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig</code>
 */
class InstanceNetworkConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. A list of external network authorized to access this instance.
     *
     * Generated from protobuf field <code>repeated .google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork authorized_external_networks = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $authorized_external_networks;
    /**
     * Optional. Enabling public ip for the instance.
     *
     * Generated from protobuf field <code>bool enable_public_ip = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $enable_public_ip = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\AlloyDb\V1beta\Instance\InstanceNetworkConfig\AuthorizedNetwork>|\Google\Protobuf\Internal\RepeatedField $authorized_external_networks
     *           Optional. A list of external network authorized to access this instance.
     *     @type bool $enable_public_ip
     *           Optional. Enabling public ip for the instance.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Alloydb\V1Beta\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. A list of external network authorized to access this instance.
     *
     * Generated from protobuf field <code>repeated .google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork authorized_external_networks = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAuthorizedExternalNetworks()
    {
        return $this->authorized_external_networks;
    }

    /**
     * Optional. A list of external network authorized to access this instance.
     *
     * Generated from protobuf field <code>repeated .google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork authorized_external_networks = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\AlloyDb\V1beta\Instance\InstanceNetworkConfig\AuthorizedNetwork>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAuthorizedExternalNetworks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1beta\Instance\InstanceNetworkConfig\AuthorizedNetwork::class);
        $this->authorized_external_networks = $arr;

        return $this;
    }

    /**
     * Optional. Enabling public ip for the instance.
     *
     * Generated from protobuf field <code>bool enable_public_ip = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getEnablePublicIp()
    {
        return $this->enable_public_ip;
    }

    /**
     * Optional. Enabling public ip for the instance.
     *
     * Generated from protobuf field <code>bool enable_public_ip = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setEnablePublicIp($var)
    {
        GPBUtil::checkBool($var);
        $this->enable_public_ip = $var;

        return $this;
    }

}


