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

namespace Google\Cloud\Billing\Budgets\V1;

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

/**
 * Request for CreateBudget
 *
 * Generated from protobuf message <code>google.cloud.billing.budgets.v1.CreateBudgetRequest</code>
 */
class CreateBudgetRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The name of the billing account to create the budget in. Values
     * are of the form `billingAccounts/{billingAccountId}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. Budget to create.
     *
     * Generated from protobuf field <code>.google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $budget = null;

    /**
     * @param string                                  $parent Required. The name of the billing account to create the budget in. Values
     *                                                        are of the form `billingAccounts/{billingAccountId}`. Please see
     *                                                        {@see BudgetServiceClient::billingAccountName()} for help formatting this field.
     * @param \Google\Cloud\Billing\Budgets\V1\Budget $budget Required. Budget to create.
     *
     * @return \Google\Cloud\Billing\Budgets\V1\CreateBudgetRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\Billing\Budgets\V1\Budget $budget): self
    {
        return (new self())
            ->setParent($parent)
            ->setBudget($budget);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The name of the billing account to create the budget in. Values
     *           are of the form `billingAccounts/{billingAccountId}`.
     *     @type \Google\Cloud\Billing\Budgets\V1\Budget $budget
     *           Required. Budget to create.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Billing\Budgets\V1\BudgetService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The name of the billing account to create the budget in. Values
     * are of the form `billingAccounts/{billingAccountId}`.
     *
     * 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. The name of the billing account to create the budget in. Values
     * are of the form `billingAccounts/{billingAccountId}`.
     *
     * 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;
    }

    /**
     * Required. Budget to create.
     *
     * Generated from protobuf field <code>.google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Billing\Budgets\V1\Budget|null
     */
    public function getBudget()
    {
        return $this->budget;
    }

    public function hasBudget()
    {
        return isset($this->budget);
    }

    public function clearBudget()
    {
        unset($this->budget);
    }

    /**
     * Required. Budget to create.
     *
     * Generated from protobuf field <code>.google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Billing\Budgets\V1\Budget $var
     * @return $this
     */
    public function setBudget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Billing\Budgets\V1\Budget::class);
        $this->budget = $var;

        return $this;
    }

}

