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

namespace Google\Cloud\SecurityCenter\V1;

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

/**
 * Identity delegation history of an authenticated service account.
 *
 * Generated from protobuf message <code>google.cloud.securitycenter.v1.ServiceAccountDelegationInfo</code>
 */
class ServiceAccountDelegationInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * The email address of a Google account.
     *
     * Generated from protobuf field <code>string principal_email = 1;</code>
     */
    private $principal_email = '';
    /**
     * A string representing the principal_subject associated with the identity.
     * As compared to `principal_email`, supports principals that aren't
     * associated with email addresses, such as third party principals. For most
     * identities, the format will be `principal://iam.googleapis.com/{identity
     * pool name}/subjects/{subject}` except for some GKE identities
     * (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy
     * format `serviceAccount:{identity pool name}[{subject}]`
     *
     * Generated from protobuf field <code>string principal_subject = 2;</code>
     */
    private $principal_subject = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $principal_email
     *           The email address of a Google account.
     *     @type string $principal_subject
     *           A string representing the principal_subject associated with the identity.
     *           As compared to `principal_email`, supports principals that aren't
     *           associated with email addresses, such as third party principals. For most
     *           identities, the format will be `principal://iam.googleapis.com/{identity
     *           pool name}/subjects/{subject}` except for some GKE identities
     *           (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy
     *           format `serviceAccount:{identity pool name}[{subject}]`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Securitycenter\V1\Access::initOnce();
        parent::__construct($data);
    }

    /**
     * The email address of a Google account.
     *
     * Generated from protobuf field <code>string principal_email = 1;</code>
     * @return string
     */
    public function getPrincipalEmail()
    {
        return $this->principal_email;
    }

    /**
     * The email address of a Google account.
     *
     * Generated from protobuf field <code>string principal_email = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPrincipalEmail($var)
    {
        GPBUtil::checkString($var, True);
        $this->principal_email = $var;

        return $this;
    }

    /**
     * A string representing the principal_subject associated with the identity.
     * As compared to `principal_email`, supports principals that aren't
     * associated with email addresses, such as third party principals. For most
     * identities, the format will be `principal://iam.googleapis.com/{identity
     * pool name}/subjects/{subject}` except for some GKE identities
     * (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy
     * format `serviceAccount:{identity pool name}[{subject}]`
     *
     * Generated from protobuf field <code>string principal_subject = 2;</code>
     * @return string
     */
    public function getPrincipalSubject()
    {
        return $this->principal_subject;
    }

    /**
     * A string representing the principal_subject associated with the identity.
     * As compared to `principal_email`, supports principals that aren't
     * associated with email addresses, such as third party principals. For most
     * identities, the format will be `principal://iam.googleapis.com/{identity
     * pool name}/subjects/{subject}` except for some GKE identities
     * (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy
     * format `serviceAccount:{identity pool name}[{subject}]`
     *
     * Generated from protobuf field <code>string principal_subject = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setPrincipalSubject($var)
    {
        GPBUtil::checkString($var, True);
        $this->principal_subject = $var;

        return $this;
    }

}

