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

namespace Google\Ads\AdManager\V1;

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

/**
 * Request object for `UpdateAdUnit` method.
 *
 * Generated from protobuf message <code>google.ads.admanager.v1.UpdateAdUnitRequest</code>
 */
class UpdateAdUnitRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The `AdUnit` to update.
     * The `AdUnit`'s name is used to identify the `AdUnit` to update. Format:
     * `networks/{network_code}/adUnits/{ad_unit_id}`
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.AdUnit ad_unit = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $ad_unit = null;
    /**
     * Required. The list of fields to update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $update_mask = null;

    /**
     * @param \Google\Ads\AdManager\V1\AdUnit $adUnit     Required. The `AdUnit` to update.
     *
     *                                                    The `AdUnit`'s name is used to identify the `AdUnit` to update. Format:
     *                                                    `networks/{network_code}/adUnits/{ad_unit_id}`
     * @param \Google\Protobuf\FieldMask      $updateMask Required. The list of fields to update.
     *
     * @return \Google\Ads\AdManager\V1\UpdateAdUnitRequest
     *
     * @experimental
     */
    public static function build(\Google\Ads\AdManager\V1\AdUnit $adUnit, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setAdUnit($adUnit)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Ads\AdManager\V1\AdUnit $ad_unit
     *           Required. The `AdUnit` to update.
     *           The `AdUnit`'s name is used to identify the `AdUnit` to update. Format:
     *           `networks/{network_code}/adUnits/{ad_unit_id}`
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Required. The list of fields to update.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Admanager\V1\AdUnitService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The `AdUnit` to update.
     * The `AdUnit`'s name is used to identify the `AdUnit` to update. Format:
     * `networks/{network_code}/adUnits/{ad_unit_id}`
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.AdUnit ad_unit = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Ads\AdManager\V1\AdUnit|null
     */
    public function getAdUnit()
    {
        return $this->ad_unit;
    }

    public function hasAdUnit()
    {
        return isset($this->ad_unit);
    }

    public function clearAdUnit()
    {
        unset($this->ad_unit);
    }

    /**
     * Required. The `AdUnit` to update.
     * The `AdUnit`'s name is used to identify the `AdUnit` to update. Format:
     * `networks/{network_code}/adUnits/{ad_unit_id}`
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.AdUnit ad_unit = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Ads\AdManager\V1\AdUnit $var
     * @return $this
     */
    public function setAdUnit($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\AdUnit::class);
        $this->ad_unit = $var;

        return $this;
    }

    /**
     * Required. The list of fields to update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * Required. The list of fields to update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

}

