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

namespace Google\Cloud\OrgPolicy\V2;

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

/**
 * Similar to PolicySpec but with an extra 'launch' field for launch reference.
 * The PolicySpec here is specific for dry-run/darklaunch.
 *
 * Generated from protobuf message <code>google.cloud.orgpolicy.v2.AlternatePolicySpec</code>
 */
class AlternatePolicySpec extends \Google\Protobuf\Internal\Message
{
    /**
     * Reference to the launch that will be used while audit logging and to
     * control the launch.
     * Should be set only in the alternate policy.
     *
     * Generated from protobuf field <code>string launch = 1;</code>
     */
    private $launch = '';
    /**
     * Specify `Constraint` for configurations of Cloud Platform resources.
     *
     * Generated from protobuf field <code>.google.cloud.orgpolicy.v2.PolicySpec spec = 2;</code>
     */
    private $spec = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $launch
     *           Reference to the launch that will be used while audit logging and to
     *           control the launch.
     *           Should be set only in the alternate policy.
     *     @type \Google\Cloud\OrgPolicy\V2\PolicySpec $spec
     *           Specify `Constraint` for configurations of Cloud Platform resources.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Orgpolicy\V2\Orgpolicy::initOnce();
        parent::__construct($data);
    }

    /**
     * Reference to the launch that will be used while audit logging and to
     * control the launch.
     * Should be set only in the alternate policy.
     *
     * Generated from protobuf field <code>string launch = 1;</code>
     * @return string
     */
    public function getLaunch()
    {
        return $this->launch;
    }

    /**
     * Reference to the launch that will be used while audit logging and to
     * control the launch.
     * Should be set only in the alternate policy.
     *
     * Generated from protobuf field <code>string launch = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setLaunch($var)
    {
        GPBUtil::checkString($var, True);
        $this->launch = $var;

        return $this;
    }

    /**
     * Specify `Constraint` for configurations of Cloud Platform resources.
     *
     * Generated from protobuf field <code>.google.cloud.orgpolicy.v2.PolicySpec spec = 2;</code>
     * @return \Google\Cloud\OrgPolicy\V2\PolicySpec|null
     */
    public function getSpec()
    {
        return $this->spec;
    }

    public function hasSpec()
    {
        return isset($this->spec);
    }

    public function clearSpec()
    {
        unset($this->spec);
    }

    /**
     * Specify `Constraint` for configurations of Cloud Platform resources.
     *
     * Generated from protobuf field <code>.google.cloud.orgpolicy.v2.PolicySpec spec = 2;</code>
     * @param \Google\Cloud\OrgPolicy\V2\PolicySpec $var
     * @return $this
     */
    public function setSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OrgPolicy\V2\PolicySpec::class);
        $this->spec = $var;

        return $this;
    }

}

