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

namespace Google\Ads\AdManager\V1;

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

/**
 * Request object for `CreatePlacement` method.
 *
 * Generated from protobuf message <code>google.ads.admanager.v1.CreatePlacementRequest</code>
 */
class CreatePlacementRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent resource where this `Placement` will be created.
     * Format: `networks/{network_code}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The `Placement` to create.
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.Placement placement = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $placement = null;

    /**
     * @param string                             $parent    Required. The parent resource where this `Placement` will be created.
     *                                                      Format: `networks/{network_code}`
     *                                                      Please see {@see PlacementServiceClient::networkName()} for help formatting this field.
     * @param \Google\Ads\AdManager\V1\Placement $placement Required. The `Placement` to create.
     *
     * @return \Google\Ads\AdManager\V1\CreatePlacementRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Ads\AdManager\V1\Placement $placement): self
    {
        return (new self())
            ->setParent($parent)
            ->setPlacement($placement);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent resource where this `Placement` will be created.
     *           Format: `networks/{network_code}`
     *     @type \Google\Ads\AdManager\V1\Placement $placement
     *           Required. The `Placement` to create.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Admanager\V1\PlacementService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent resource where this `Placement` will be created.
     * Format: `networks/{network_code}`
     *
     * 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 parent resource where this `Placement` will be created.
     * Format: `networks/{network_code}`
     *
     * 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. The `Placement` to create.
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.Placement placement = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Ads\AdManager\V1\Placement|null
     */
    public function getPlacement()
    {
        return $this->placement;
    }

    public function hasPlacement()
    {
        return isset($this->placement);
    }

    public function clearPlacement()
    {
        unset($this->placement);
    }

    /**
     * Required. The `Placement` to create.
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.Placement placement = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Ads\AdManager\V1\Placement $var
     * @return $this
     */
    public function setPlacement($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Placement::class);
        $this->placement = $var;

        return $this;
    }

}

