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

namespace Google\Cloud\PrivilegedAccessManager\V1\ManualApprovals;

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

/**
 * Step represents a logical step in a manual approval workflow.
 *
 * Generated from protobuf message <code>google.cloud.privilegedaccessmanager.v1.ManualApprovals.Step</code>
 */
class Step extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The potential set of approvers in this step. This list must
     * contain at most one entry.
     *
     * Generated from protobuf field <code>repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry approvers = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $approvers;
    /**
     * Required. How many users from the above list need to approve. If there
     * aren't enough distinct users in the list, then the workflow indefinitely
     * blocks. Should always be greater than 0. 1 is the only supported value.
     *
     * Generated from protobuf field <code>int32 approvals_needed = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $approvals_needed = 0;
    /**
     * Optional. Additional email addresses to be notified when a grant is
     * pending approval.
     *
     * Generated from protobuf field <code>repeated string approver_email_recipients = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $approver_email_recipients;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry>|\Google\Protobuf\Internal\RepeatedField $approvers
     *           Optional. The potential set of approvers in this step. This list must
     *           contain at most one entry.
     *     @type int $approvals_needed
     *           Required. How many users from the above list need to approve. If there
     *           aren't enough distinct users in the list, then the workflow indefinitely
     *           blocks. Should always be greater than 0. 1 is the only supported value.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $approver_email_recipients
     *           Optional. Additional email addresses to be notified when a grant is
     *           pending approval.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The potential set of approvers in this step. This list must
     * contain at most one entry.
     *
     * Generated from protobuf field <code>repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry approvers = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getApprovers()
    {
        return $this->approvers;
    }

    /**
     * Optional. The potential set of approvers in this step. This list must
     * contain at most one entry.
     *
     * Generated from protobuf field <code>repeated .google.cloud.privilegedaccessmanager.v1.AccessControlEntry approvers = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setApprovers($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PrivilegedAccessManager\V1\AccessControlEntry::class);
        $this->approvers = $arr;

        return $this;
    }

    /**
     * Required. How many users from the above list need to approve. If there
     * aren't enough distinct users in the list, then the workflow indefinitely
     * blocks. Should always be greater than 0. 1 is the only supported value.
     *
     * Generated from protobuf field <code>int32 approvals_needed = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getApprovalsNeeded()
    {
        return $this->approvals_needed;
    }

    /**
     * Required. How many users from the above list need to approve. If there
     * aren't enough distinct users in the list, then the workflow indefinitely
     * blocks. Should always be greater than 0. 1 is the only supported value.
     *
     * Generated from protobuf field <code>int32 approvals_needed = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setApprovalsNeeded($var)
    {
        GPBUtil::checkInt32($var);
        $this->approvals_needed = $var;

        return $this;
    }

    /**
     * Optional. Additional email addresses to be notified when a grant is
     * pending approval.
     *
     * Generated from protobuf field <code>repeated string approver_email_recipients = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getApproverEmailRecipients()
    {
        return $this->approver_email_recipients;
    }

    /**
     * Optional. Additional email addresses to be notified when a grant is
     * pending approval.
     *
     * Generated from protobuf field <code>repeated string approver_email_recipients = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setApproverEmailRecipients($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->approver_email_recipients = $arr;

        return $this;
    }

}


