<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/api/apikeys/v2/resources.proto

namespace Google\Cloud\ApiKeys\V2;

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

/**
 * The HTTP referrers (websites) that are allowed to use the key.
 *
 * Generated from protobuf message <code>google.api.apikeys.v2.BrowserKeyRestrictions</code>
 */
class BrowserKeyRestrictions extends \Google\Protobuf\Internal\Message
{
    /**
     * A list of regular expressions for the referrer URLs that are allowed
     * to make API calls with this key.
     *
     * Generated from protobuf field <code>repeated string allowed_referrers = 1;</code>
     */
    private $allowed_referrers;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $allowed_referrers
     *           A list of regular expressions for the referrer URLs that are allowed
     *           to make API calls with this key.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Api\Apikeys\V2\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * A list of regular expressions for the referrer URLs that are allowed
     * to make API calls with this key.
     *
     * Generated from protobuf field <code>repeated string allowed_referrers = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAllowedReferrers()
    {
        return $this->allowed_referrers;
    }

    /**
     * A list of regular expressions for the referrer URLs that are allowed
     * to make API calls with this key.
     *
     * Generated from protobuf field <code>repeated string allowed_referrers = 1;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAllowedReferrers($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->allowed_referrers = $arr;

        return $this;
    }

}

