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

namespace Google\Cloud\CloudQuotas\V1;

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

/**
 * Message for creating a QuotaPreference
 *
 * Generated from protobuf message <code>google.api.cloudquotas.v1.CreateQuotaPreferenceRequest</code>
 */
class CreateQuotaPreferenceRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Value for parent.
     * Example:
     * `projects/123/locations/global`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Optional. Id of the requesting object, must be unique under its parent.
     * If client does not set this field, the service will generate one.
     *
     * Generated from protobuf field <code>string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $quota_preference_id = '';
    /**
     * Required. The resource being created
     *
     * Generated from protobuf field <code>.google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $quota_preference = null;
    /**
     * The list of quota safety checks to be ignored.
     *
     * Generated from protobuf field <code>repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4;</code>
     */
    private $ignore_safety_checks;

    /**
     * @param string                                       $parent            Required. Value for parent.
     *
     *                                                                        Example:
     *                                                                        `projects/123/locations/global`
     *                                                                        Please see {@see CloudQuotasClient::locationName()} for help formatting this field.
     * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference   Required. The resource being created
     * @param string                                       $quotaPreferenceId Optional. Id of the requesting object, must be unique under its parent.
     *                                                                        If client does not set this field, the service will generate one.
     *
     * @return \Google\Cloud\CloudQuotas\V1\CreateQuotaPreferenceRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference, string $quotaPreferenceId): self
    {
        return (new self())
            ->setParent($parent)
            ->setQuotaPreference($quotaPreference)
            ->setQuotaPreferenceId($quotaPreferenceId);
    }

    /**
     * @param string                                       $parent          Required. Value for parent.
     *
     *                                                                      Example:
     *                                                                      `projects/123/locations/global`
     *                                                                      Please see {@see CloudQuotasClient::locationName()} for help formatting this field.
     * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference Required. The resource being created
     *
     * @return \Google\Cloud\CloudQuotas\V1\CreateQuotaPreferenceRequest
     *
     * @experimental
     */
    public static function buildFromParentQuotaPreference(string $parent, \Google\Cloud\CloudQuotas\V1\QuotaPreference $quotaPreference): self
    {
        return (new self())
            ->setParent($parent)
            ->setQuotaPreference($quotaPreference);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. Value for parent.
     *           Example:
     *           `projects/123/locations/global`
     *     @type string $quota_preference_id
     *           Optional. Id of the requesting object, must be unique under its parent.
     *           If client does not set this field, the service will generate one.
     *     @type \Google\Cloud\CloudQuotas\V1\QuotaPreference $quota_preference
     *           Required. The resource being created
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $ignore_safety_checks
     *           The list of quota safety checks to be ignored.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Api\Cloudquotas\V1\Cloudquotas::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Value for parent.
     * Example:
     * `projects/123/locations/global`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. Value for parent.
     * Example:
     * `projects/123/locations/global`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Optional. Id of the requesting object, must be unique under its parent.
     * If client does not set this field, the service will generate one.
     *
     * Generated from protobuf field <code>string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getQuotaPreferenceId()
    {
        return $this->quota_preference_id;
    }

    /**
     * Optional. Id of the requesting object, must be unique under its parent.
     * If client does not set this field, the service will generate one.
     *
     * Generated from protobuf field <code>string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setQuotaPreferenceId($var)
    {
        GPBUtil::checkString($var, True);
        $this->quota_preference_id = $var;

        return $this;
    }

    /**
     * Required. The resource being created
     *
     * Generated from protobuf field <code>.google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\CloudQuotas\V1\QuotaPreference|null
     */
    public function getQuotaPreference()
    {
        return $this->quota_preference;
    }

    public function hasQuotaPreference()
    {
        return isset($this->quota_preference);
    }

    public function clearQuotaPreference()
    {
        unset($this->quota_preference);
    }

    /**
     * Required. The resource being created
     *
     * Generated from protobuf field <code>.google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\CloudQuotas\V1\QuotaPreference $var
     * @return $this
     */
    public function setQuotaPreference($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\CloudQuotas\V1\QuotaPreference::class);
        $this->quota_preference = $var;

        return $this;
    }

    /**
     * The list of quota safety checks to be ignored.
     *
     * Generated from protobuf field <code>repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getIgnoreSafetyChecks()
    {
        return $this->ignore_safety_checks;
    }

    /**
     * The list of quota safety checks to be ignored.
     *
     * Generated from protobuf field <code>repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setIgnoreSafetyChecks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\CloudQuotas\V1\QuotaSafetyCheck::class);
        $this->ignore_safety_checks = $arr;

        return $this;
    }

}

