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

namespace Google\Ads\AdManager\V1;

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

/**
 * The `Placement` resource.
 *
 * Generated from protobuf message <code>google.ads.admanager.v1.Placement</code>
 */
class Placement extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The resource name of the `Placement`.
     * Format: `networks/{network_code}/placements/{placement_id}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Output only. `Placement` ID.
     *
     * Generated from protobuf field <code>int64 placement_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $placement_id = 0;
    /**
     * Required. The display name of the placement. This attribute has a maximum
     * length of 255 characters.
     *
     * Generated from protobuf field <code>optional string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $display_name = null;
    /**
     * Optional. A description of the Placement. This attribute has a maximum
     * length of 65,535 characters.
     *
     * Generated from protobuf field <code>optional string description = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $description = null;
    /**
     * Output only. A string used to uniquely identify the Placement for purposes
     * of serving the ad. This attribute is assigned by Google.
     *
     * Generated from protobuf field <code>optional string placement_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $placement_code = null;
    /**
     * Output only. The status of the Placement.
     *
     * Generated from protobuf field <code>optional .google.ads.admanager.v1.PlacementStatusEnum.PlacementStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $status = null;
    /**
     * Optional. The resource names of AdUnits that constitute the Placement.
     * Format: "networks/{network_code}/adUnits/{ad_unit}"
     *
     * Generated from protobuf field <code>repeated string targeted_ad_units = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     */
    private $targeted_ad_units;
    /**
     * Output only. The instant this Placement was last modified.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The resource name of the `Placement`.
     *           Format: `networks/{network_code}/placements/{placement_id}`
     *     @type int|string $placement_id
     *           Output only. `Placement` ID.
     *     @type string $display_name
     *           Required. The display name of the placement. This attribute has a maximum
     *           length of 255 characters.
     *     @type string $description
     *           Optional. A description of the Placement. This attribute has a maximum
     *           length of 65,535 characters.
     *     @type string $placement_code
     *           Output only. A string used to uniquely identify the Placement for purposes
     *           of serving the ad. This attribute is assigned by Google.
     *     @type int $status
     *           Output only. The status of the Placement.
     *     @type string[] $targeted_ad_units
     *           Optional. The resource names of AdUnits that constitute the Placement.
     *           Format: "networks/{network_code}/adUnits/{ad_unit}"
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The instant this Placement was last modified.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Admanager\V1\PlacementMessages::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The resource name of the `Placement`.
     * Format: `networks/{network_code}/placements/{placement_id}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. The resource name of the `Placement`.
     * Format: `networks/{network_code}/placements/{placement_id}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. `Placement` ID.
     *
     * Generated from protobuf field <code>int64 placement_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getPlacementId()
    {
        return $this->placement_id;
    }

    /**
     * Output only. `Placement` ID.
     *
     * Generated from protobuf field <code>int64 placement_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setPlacementId($var)
    {
        GPBUtil::checkInt64($var);
        $this->placement_id = $var;

        return $this;
    }

    /**
     * Required. The display name of the placement. This attribute has a maximum
     * length of 255 characters.
     *
     * Generated from protobuf field <code>optional string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDisplayName()
    {
        return isset($this->display_name) ? $this->display_name : '';
    }

    public function hasDisplayName()
    {
        return isset($this->display_name);
    }

    public function clearDisplayName()
    {
        unset($this->display_name);
    }

    /**
     * Required. The display name of the placement. This attribute has a maximum
     * length of 255 characters.
     *
     * Generated from protobuf field <code>optional string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Optional. A description of the Placement. This attribute has a maximum
     * length of 65,535 characters.
     *
     * Generated from protobuf field <code>optional string description = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return isset($this->description) ? $this->description : '';
    }

    public function hasDescription()
    {
        return isset($this->description);
    }

    public function clearDescription()
    {
        unset($this->description);
    }

    /**
     * Optional. A description of the Placement. This attribute has a maximum
     * length of 65,535 characters.
     *
     * Generated from protobuf field <code>optional string description = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Output only. A string used to uniquely identify the Placement for purposes
     * of serving the ad. This attribute is assigned by Google.
     *
     * Generated from protobuf field <code>optional string placement_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getPlacementCode()
    {
        return isset($this->placement_code) ? $this->placement_code : '';
    }

    public function hasPlacementCode()
    {
        return isset($this->placement_code);
    }

    public function clearPlacementCode()
    {
        unset($this->placement_code);
    }

    /**
     * Output only. A string used to uniquely identify the Placement for purposes
     * of serving the ad. This attribute is assigned by Google.
     *
     * Generated from protobuf field <code>optional string placement_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setPlacementCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->placement_code = $var;

        return $this;
    }

    /**
     * Output only. The status of the Placement.
     *
     * Generated from protobuf field <code>optional .google.ads.admanager.v1.PlacementStatusEnum.PlacementStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getStatus()
    {
        return isset($this->status) ? $this->status : 0;
    }

    public function hasStatus()
    {
        return isset($this->status);
    }

    public function clearStatus()
    {
        unset($this->status);
    }

    /**
     * Output only. The status of the Placement.
     *
     * Generated from protobuf field <code>optional .google.ads.admanager.v1.PlacementStatusEnum.PlacementStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setStatus($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\PlacementStatusEnum\PlacementStatus::class);
        $this->status = $var;

        return $this;
    }

    /**
     * Optional. The resource names of AdUnits that constitute the Placement.
     * Format: "networks/{network_code}/adUnits/{ad_unit}"
     *
     * Generated from protobuf field <code>repeated string targeted_ad_units = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return RepeatedField<string>
     */
    public function getTargetedAdUnits()
    {
        return $this->targeted_ad_units;
    }

    /**
     * Optional. The resource names of AdUnits that constitute the Placement.
     * Format: "networks/{network_code}/adUnits/{ad_unit}"
     *
     * Generated from protobuf field <code>repeated string targeted_ad_units = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @param string[] $var
     * @return $this
     */
    public function setTargetedAdUnits($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->targeted_ad_units = $arr;

        return $this;
    }

    /**
     * Output only. The instant this Placement was last modified.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The instant this Placement was last modified.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

}

