<?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\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * 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. Its maximum length is 255
     * characters.
     *
     * Generated from protobuf field <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $display_name = '';
    /**
     * Optional. A description of the Placement. This value is optional and its
     * maximum length is 65,535 characters.
     *
     * Generated from protobuf field <code>string description = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $description = '';
    /**
     * Output only. A string used to uniquely identify the Placement for purposes
     * of serving the ad. This attribute is read-only and is assigned by Google
     * when a placement is created.
     *
     * Generated from protobuf field <code>string placement_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $placement_code = '';
    /**
     * Output only. The status of the Placement. This attribute is read-only.
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.PlacementStatusEnum.PlacementStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $status = 0;
    /**
     * Optional. The resource names of AdUnits that constitute the Placement.
     * Format: "networks/{network_code}/adUnits/{ad_unit_id}"
     *
     * 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>.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. Its maximum length is 255
     *           characters.
     *     @type string $description
     *           Optional. A description of the Placement. This value is optional and its
     *           maximum length is 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 read-only and is assigned by Google
     *           when a placement is created.
     *     @type int $status
     *           Output only. The status of the Placement. This attribute is read-only.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $targeted_ad_units
     *           Optional. The resource names of AdUnits that constitute the Placement.
     *           Format: "networks/{network_code}/adUnits/{ad_unit_id}"
     *     @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. Its maximum length is 255
     * characters.
     *
     * Generated from protobuf field <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Required. The display name of the placement. Its maximum length is 255
     * characters.
     *
     * Generated from protobuf field <code>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 value is optional and its
     * maximum length is 65,535 characters.
     *
     * Generated from protobuf field <code>string description = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. A description of the Placement. This value is optional and its
     * maximum length is 65,535 characters.
     *
     * Generated from protobuf field <code>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 read-only and is assigned by Google
     * when a placement is created.
     *
     * Generated from protobuf field <code>string placement_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getPlacementCode()
    {
        return $this->placement_code;
    }

    /**
     * Output only. A string used to uniquely identify the Placement for purposes
     * of serving the ad. This attribute is read-only and is assigned by Google
     * when a placement is created.
     *
     * Generated from protobuf field <code>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. This attribute is read-only.
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.PlacementStatusEnum.PlacementStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Output only. The status of the Placement. This attribute is read-only.
     *
     * Generated from protobuf field <code>.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_id}"
     *
     * Generated from protobuf field <code>repeated string targeted_ad_units = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    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_id}"
     *
     * Generated from protobuf field <code>repeated string targeted_ad_units = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $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>.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>.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;
    }

}

