<?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 IP addresses of callers that are allowed to use the key.
 *
 * Generated from protobuf message <code>google.api.apikeys.v2.ServerKeyRestrictions</code>
 */
class ServerKeyRestrictions extends \Google\Protobuf\Internal\Message
{
    /**
     * A list of the caller IP addresses that are allowed to make API calls
     * with this key.
     *
     * Generated from protobuf field <code>repeated string allowed_ips = 1;</code>
     */
    private $allowed_ips;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $allowed_ips
     *           A list of the caller IP addresses 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 the caller IP addresses that are allowed to make API calls
     * with this key.
     *
     * Generated from protobuf field <code>repeated string allowed_ips = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAllowedIps()
    {
        return $this->allowed_ips;
    }

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

        return $this;
    }

}

