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

namespace Google\Cloud\Asset\V1\IamPolicySearchResult;

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

/**
 * Explanation about the IAM policy search result.
 *
 * Generated from protobuf message <code>google.cloud.asset.v1.IamPolicySearchResult.Explanation</code>
 */
class Explanation extends \Google\Protobuf\Internal\Message
{
    /**
     * The map from roles to their included permissions that match the
     * permission query (i.e., a query containing `policy.role.permissions:`).
     * Example: if query `policy.role.permissions:compute.disk.get`
     * matches a policy binding that contains owner role, the
     * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The
     * roles can also be found in the returned `policy` bindings. Note that the
     * map is populated only for requests with permission queries.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1;</code>
     */
    private $matched_permissions;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array|\Google\Protobuf\Internal\MapField $matched_permissions
     *           The map from roles to their included permissions that match the
     *           permission query (i.e., a query containing `policy.role.permissions:`).
     *           Example: if query `policy.role.permissions:compute.disk.get`
     *           matches a policy binding that contains owner role, the
     *           matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The
     *           roles can also be found in the returned `policy` bindings. Note that the
     *           map is populated only for requests with permission queries.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce();
        parent::__construct($data);
    }

    /**
     * The map from roles to their included permissions that match the
     * permission query (i.e., a query containing `policy.role.permissions:`).
     * Example: if query `policy.role.permissions:compute.disk.get`
     * matches a policy binding that contains owner role, the
     * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The
     * roles can also be found in the returned `policy` bindings. Note that the
     * map is populated only for requests with permission queries.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getMatchedPermissions()
    {
        return $this->matched_permissions;
    }

    /**
     * The map from roles to their included permissions that match the
     * permission query (i.e., a query containing `policy.role.permissions:`).
     * Example: if query `policy.role.permissions:compute.disk.get`
     * matches a policy binding that contains owner role, the
     * matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The
     * roles can also be found in the returned `policy` bindings. Note that the
     * map is populated only for requests with permission queries.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions> matched_permissions = 1;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setMatchedPermissions($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\IamPolicySearchResult\Explanation\Permissions::class);
        $this->matched_permissions = $arr;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Explanation::class, \Google\Cloud\Asset\V1\IamPolicySearchResult_Explanation::class);

