<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/merchant/datasources/v1beta/datasources.proto

namespace Google\Shopping\Merchant\DataSources\V1beta;

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

/**
 * Request message for the CreateDataSource method.
 *
 * Generated from protobuf message <code>google.shopping.merchant.datasources.v1beta.CreateDataSourceRequest</code>
 */
class CreateDataSourceRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The account where this data source will be created.
     * Format: `accounts/{account}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The data source to create.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $data_source = null;

    /**
     * @param string                                                  $parent     Required. The account where this data source will be created.
     *                                                                            Format: `accounts/{account}`
     *                                                                            Please see {@see DataSourcesServiceClient::accountName()} for help formatting this field.
     * @param \Google\Shopping\Merchant\DataSources\V1beta\DataSource $dataSource Required. The data source to create.
     *
     * @return \Google\Shopping\Merchant\DataSources\V1beta\CreateDataSourceRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Shopping\Merchant\DataSources\V1beta\DataSource $dataSource): self
    {
        return (new self())
            ->setParent($parent)
            ->setDataSource($dataSource);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The account where this data source will be created.
     *           Format: `accounts/{account}`
     *     @type \Google\Shopping\Merchant\DataSources\V1beta\DataSource $data_source
     *           Required. The data source to create.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasources::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The account where this data source will be created.
     * Format: `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 account where this data source will be created.
     * Format: `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 data source to create.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Shopping\Merchant\DataSources\V1beta\DataSource|null
     */
    public function getDataSource()
    {
        return $this->data_source;
    }

    public function hasDataSource()
    {
        return isset($this->data_source);
    }

    public function clearDataSource()
    {
        unset($this->data_source);
    }

    /**
     * Required. The data source to create.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Shopping\Merchant\DataSources\V1beta\DataSource $var
     * @return $this
     */
    public function setDataSource($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Merchant\DataSources\V1beta\DataSource::class);
        $this->data_source = $var;

        return $this;
    }

}

