<?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 Android apps that are allowed to use the key.
 *
 * Generated from protobuf message <code>google.api.apikeys.v2.AndroidKeyRestrictions</code>
 */
class AndroidKeyRestrictions extends \Google\Protobuf\Internal\Message
{
    /**
     * A list of Android applications that are allowed to make API calls with
     * this key.
     *
     * Generated from protobuf field <code>repeated .google.api.apikeys.v2.AndroidApplication allowed_applications = 1;</code>
     */
    private $allowed_applications;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\ApiKeys\V2\AndroidApplication>|\Google\Protobuf\Internal\RepeatedField $allowed_applications
     *           A list of Android applications 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 Android applications that are allowed to make API calls with
     * this key.
     *
     * Generated from protobuf field <code>repeated .google.api.apikeys.v2.AndroidApplication allowed_applications = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAllowedApplications()
    {
        return $this->allowed_applications;
    }

    /**
     * A list of Android applications that are allowed to make API calls with
     * this key.
     *
     * Generated from protobuf field <code>repeated .google.api.apikeys.v2.AndroidApplication allowed_applications = 1;</code>
     * @param array<\Google\Cloud\ApiKeys\V2\AndroidApplication>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAllowedApplications($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ApiKeys\V2\AndroidApplication::class);
        $this->allowed_applications = $arr;

        return $this;
    }

}

