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

namespace Google\Ads\DataManager\V1;

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

/**
 * Request to create a [PartnerLink][google.ads.datamanager.v1.PartnerLink]
 * resource. Returns a
 * [PartnerLink][google.ads.datamanager.v1.PartnerLink].
 *
 * Generated from protobuf message <code>google.ads.datamanager.v1.CreatePartnerLinkRequest</code>
 */
class CreatePartnerLinkRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent, which owns this collection of partner links.
     * Format: accountTypes/{account_type}/accounts/{account}
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The partner link to create.
     *
     * Generated from protobuf field <code>.google.ads.datamanager.v1.PartnerLink partner_link = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $partner_link = null;

    /**
     * @param string                                 $parent      Required. The parent, which owns this collection of partner links.
     *                                                            Format: accountTypes/{account_type}/accounts/{account}
     *                                                            Please see {@see PartnerLinkServiceClient::accountName()} for help formatting this field.
     * @param \Google\Ads\DataManager\V1\PartnerLink $partnerLink Required. The partner link to create.
     *
     * @return \Google\Ads\DataManager\V1\CreatePartnerLinkRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Ads\DataManager\V1\PartnerLink $partnerLink): self
    {
        return (new self())
            ->setParent($parent)
            ->setPartnerLink($partnerLink);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent, which owns this collection of partner links.
     *           Format: accountTypes/{account_type}/accounts/{account}
     *     @type \Google\Ads\DataManager\V1\PartnerLink $partner_link
     *           Required. The partner link to create.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Datamanager\V1\PartnerLinkService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent, which owns this collection of partner links.
     * Format: accountTypes/{account_type}/accounts/{account}
     *
     * 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, which owns this collection of partner links.
     * Format: accountTypes/{account_type}/accounts/{account}
     *
     * 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 partner link to create.
     *
     * Generated from protobuf field <code>.google.ads.datamanager.v1.PartnerLink partner_link = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Ads\DataManager\V1\PartnerLink|null
     */
    public function getPartnerLink()
    {
        return $this->partner_link;
    }

    public function hasPartnerLink()
    {
        return isset($this->partner_link);
    }

    public function clearPartnerLink()
    {
        unset($this->partner_link);
    }

    /**
     * Required. The partner link to create.
     *
     * Generated from protobuf field <code>.google.ads.datamanager.v1.PartnerLink partner_link = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Ads\DataManager\V1\PartnerLink $var
     * @return $this
     */
    public function setPartnerLink($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\DataManager\V1\PartnerLink::class);
        $this->partner_link = $var;

        return $this;
    }

}

