<?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;

/**
 * The request sent to the [UpdateCustomConstraintRequest]
 * [google.cloud.orgpolicy.v2.OrgPolicy.UpdateCustomConstraint] method.
 *
 * Generated from protobuf message <code>google.cloud.orgpolicy.v2.UpdateCustomConstraintRequest</code>
 */
class UpdateCustomConstraintRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. `CustomConstraint` to update.
     *
     * Generated from protobuf field <code>.google.cloud.orgpolicy.v2.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $custom_constraint = null;

    /**
     * @param \Google\Cloud\OrgPolicy\V2\CustomConstraint $customConstraint Required. `CustomConstraint` to update.
     *
     * @return \Google\Cloud\OrgPolicy\V2\UpdateCustomConstraintRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\OrgPolicy\V2\CustomConstraint $customConstraint): self
    {
        return (new self())
            ->setCustomConstraint($customConstraint);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\OrgPolicy\V2\CustomConstraint $custom_constraint
     *           Required. `CustomConstraint` to update.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Orgpolicy\V2\Orgpolicy::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. `CustomConstraint` to update.
     *
     * Generated from protobuf field <code>.google.cloud.orgpolicy.v2.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\OrgPolicy\V2\CustomConstraint|null
     */
    public function getCustomConstraint()
    {
        return $this->custom_constraint;
    }

    public function hasCustomConstraint()
    {
        return isset($this->custom_constraint);
    }

    public function clearCustomConstraint()
    {
        unset($this->custom_constraint);
    }

    /**
     * Required. `CustomConstraint` to update.
     *
     * Generated from protobuf field <code>.google.cloud.orgpolicy.v2.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\OrgPolicy\V2\CustomConstraint $var
     * @return $this
     */
    public function setCustomConstraint($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OrgPolicy\V2\CustomConstraint::class);
        $this->custom_constraint = $var;

        return $this;
    }

}

