<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/policytroubleshooter/iam/v3/troubleshooter.proto

namespace Google\Cloud\PolicyTroubleshooter\Iam\V3;

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

/**
 * Information about the principal, resource, and permission to check.
 *
 * Generated from protobuf message <code>google.cloud.policytroubleshooter.iam.v3.AccessTuple</code>
 */
class AccessTuple extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The email address of the principal whose access you want to
     * check. For example, `alice&#64;example.com` or
     * `my-service-account&#64;my-project.iam.gserviceaccount.com`.
     * The principal must be a Google Account or a service account. Other types of
     * principals are not supported.
     *
     * Generated from protobuf field <code>string principal = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $principal = '';
    /**
     * Required. The full resource name that identifies the resource. For example,
     * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`.
     * For examples of full resource names for Google Cloud services, see
     * https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
     *
     * Generated from protobuf field <code>string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $full_resource_name = '';
    /**
     * Required. The IAM permission to check for, either in the `v1` permission
     * format or the `v2` permission format.
     * For a complete list of IAM permissions in the `v1` format, see
     * https://cloud.google.com/iam/help/permissions/reference.
     * For a list of IAM permissions in the `v2` format, see
     * https://cloud.google.com/iam/help/deny/supported-permissions.
     * For a complete list of predefined IAM roles and the permissions in each
     * role, see https://cloud.google.com/iam/help/roles/reference.
     *
     * Generated from protobuf field <code>string permission = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $permission = '';
    /**
     * Output only. The permission that Policy Troubleshooter checked for, in
     * the `v2` format.
     *
     * Generated from protobuf field <code>string permission_fqdn = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $permission_fqdn = '';
    /**
     * Optional. Additional context for the request, such as the request time or
     * IP address. This context allows Policy Troubleshooter to troubleshoot
     * conditional role bindings and deny rules.
     *
     * Generated from protobuf field <code>.google.cloud.policytroubleshooter.iam.v3.ConditionContext condition_context = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $condition_context = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $principal
     *           Required. The email address of the principal whose access you want to
     *           check. For example, `alice&#64;example.com` or
     *           `my-service-account&#64;my-project.iam.gserviceaccount.com`.
     *           The principal must be a Google Account or a service account. Other types of
     *           principals are not supported.
     *     @type string $full_resource_name
     *           Required. The full resource name that identifies the resource. For example,
     *           `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`.
     *           For examples of full resource names for Google Cloud services, see
     *           https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
     *     @type string $permission
     *           Required. The IAM permission to check for, either in the `v1` permission
     *           format or the `v2` permission format.
     *           For a complete list of IAM permissions in the `v1` format, see
     *           https://cloud.google.com/iam/help/permissions/reference.
     *           For a list of IAM permissions in the `v2` format, see
     *           https://cloud.google.com/iam/help/deny/supported-permissions.
     *           For a complete list of predefined IAM roles and the permissions in each
     *           role, see https://cloud.google.com/iam/help/roles/reference.
     *     @type string $permission_fqdn
     *           Output only. The permission that Policy Troubleshooter checked for, in
     *           the `v2` format.
     *     @type \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext $condition_context
     *           Optional. Additional context for the request, such as the request time or
     *           IP address. This context allows Policy Troubleshooter to troubleshoot
     *           conditional role bindings and deny rules.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The email address of the principal whose access you want to
     * check. For example, `alice&#64;example.com` or
     * `my-service-account&#64;my-project.iam.gserviceaccount.com`.
     * The principal must be a Google Account or a service account. Other types of
     * principals are not supported.
     *
     * Generated from protobuf field <code>string principal = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getPrincipal()
    {
        return $this->principal;
    }

    /**
     * Required. The email address of the principal whose access you want to
     * check. For example, `alice&#64;example.com` or
     * `my-service-account&#64;my-project.iam.gserviceaccount.com`.
     * The principal must be a Google Account or a service account. Other types of
     * principals are not supported.
     *
     * Generated from protobuf field <code>string principal = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setPrincipal($var)
    {
        GPBUtil::checkString($var, True);
        $this->principal = $var;

        return $this;
    }

    /**
     * Required. The full resource name that identifies the resource. For example,
     * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`.
     * For examples of full resource names for Google Cloud services, see
     * https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
     *
     * Generated from protobuf field <code>string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getFullResourceName()
    {
        return $this->full_resource_name;
    }

    /**
     * Required. The full resource name that identifies the resource. For example,
     * `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`.
     * For examples of full resource names for Google Cloud services, see
     * https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
     *
     * Generated from protobuf field <code>string full_resource_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setFullResourceName($var)
    {
        GPBUtil::checkString($var, True);
        $this->full_resource_name = $var;

        return $this;
    }

    /**
     * Required. The IAM permission to check for, either in the `v1` permission
     * format or the `v2` permission format.
     * For a complete list of IAM permissions in the `v1` format, see
     * https://cloud.google.com/iam/help/permissions/reference.
     * For a list of IAM permissions in the `v2` format, see
     * https://cloud.google.com/iam/help/deny/supported-permissions.
     * For a complete list of predefined IAM roles and the permissions in each
     * role, see https://cloud.google.com/iam/help/roles/reference.
     *
     * Generated from protobuf field <code>string permission = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getPermission()
    {
        return $this->permission;
    }

    /**
     * Required. The IAM permission to check for, either in the `v1` permission
     * format or the `v2` permission format.
     * For a complete list of IAM permissions in the `v1` format, see
     * https://cloud.google.com/iam/help/permissions/reference.
     * For a list of IAM permissions in the `v2` format, see
     * https://cloud.google.com/iam/help/deny/supported-permissions.
     * For a complete list of predefined IAM roles and the permissions in each
     * role, see https://cloud.google.com/iam/help/roles/reference.
     *
     * Generated from protobuf field <code>string permission = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setPermission($var)
    {
        GPBUtil::checkString($var, True);
        $this->permission = $var;

        return $this;
    }

    /**
     * Output only. The permission that Policy Troubleshooter checked for, in
     * the `v2` format.
     *
     * Generated from protobuf field <code>string permission_fqdn = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getPermissionFqdn()
    {
        return $this->permission_fqdn;
    }

    /**
     * Output only. The permission that Policy Troubleshooter checked for, in
     * the `v2` format.
     *
     * Generated from protobuf field <code>string permission_fqdn = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setPermissionFqdn($var)
    {
        GPBUtil::checkString($var, True);
        $this->permission_fqdn = $var;

        return $this;
    }

    /**
     * Optional. Additional context for the request, such as the request time or
     * IP address. This context allows Policy Troubleshooter to troubleshoot
     * conditional role bindings and deny rules.
     *
     * Generated from protobuf field <code>.google.cloud.policytroubleshooter.iam.v3.ConditionContext condition_context = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext|null
     */
    public function getConditionContext()
    {
        return $this->condition_context;
    }

    public function hasConditionContext()
    {
        return isset($this->condition_context);
    }

    public function clearConditionContext()
    {
        unset($this->condition_context);
    }

    /**
     * Optional. Additional context for the request, such as the request time or
     * IP address. This context allows Policy Troubleshooter to troubleshoot
     * conditional role bindings and deny rules.
     *
     * Generated from protobuf field <code>.google.cloud.policytroubleshooter.iam.v3.ConditionContext condition_context = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext $var
     * @return $this
     */
    public function setConditionContext($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionContext::class);
        $this->condition_context = $var;

        return $this;
    }

}

