<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/analytics/data/v1alpha/analytics_data_api.proto

namespace Google\Analytics\Data\V1alpha;

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

/**
 * A request to create a report task.
 *
 * Generated from protobuf message <code>google.analytics.data.v1alpha.CreateReportTaskRequest</code>
 */
class CreateReportTaskRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent resource where this report task will be created.
     * Format: `properties/{propertyId}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The report task configuration to create.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.ReportTask report_task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $report_task = null;

    /**
     * @param string                                    $parent     Required. The parent resource where this report task will be created.
     *                                                              Format: `properties/{propertyId}`
     *                                                              Please see {@see AlphaAnalyticsDataClient::propertyName()} for help formatting this field.
     * @param \Google\Analytics\Data\V1alpha\ReportTask $reportTask Required. The report task configuration to create.
     *
     * @return \Google\Analytics\Data\V1alpha\CreateReportTaskRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Analytics\Data\V1alpha\ReportTask $reportTask): self
    {
        return (new self())
            ->setParent($parent)
            ->setReportTask($reportTask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent resource where this report task will be created.
     *           Format: `properties/{propertyId}`
     *     @type \Google\Analytics\Data\V1alpha\ReportTask $report_task
     *           Required. The report task configuration to create.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent resource where this report task will be created.
     * Format: `properties/{propertyId}`
     *
     * 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 report task will be created.
     * Format: `properties/{propertyId}`
     *
     * 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 report task configuration to create.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.ReportTask report_task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Analytics\Data\V1alpha\ReportTask|null
     */
    public function getReportTask()
    {
        return $this->report_task;
    }

    public function hasReportTask()
    {
        return isset($this->report_task);
    }

    public function clearReportTask()
    {
        unset($this->report_task);
    }

    /**
     * Required. The report task configuration to create.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.ReportTask report_task = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Analytics\Data\V1alpha\ReportTask $var
     * @return $this
     */
    public function setReportTask($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\ReportTask::class);
        $this->report_task = $var;

        return $this;
    }

}

