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

namespace Google\Shopping\Merchant\DataSources\V1beta;

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

/**
 * The file upload of a specific data source, that is, the result of the
 * retrieval of the data source at a certain timestamp computed asynchronously
 * when the data source processing is finished. Only applicable to file data
 * sources.
 *
 * Generated from protobuf message <code>google.shopping.merchant.datasources.v1beta.FileUpload</code>
 */
class FileUpload extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The name of the data source file upload.
     * Format:
     * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Output only. The data source id.
     *
     * Generated from protobuf field <code>int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $data_source_id = 0;
    /**
     * Output only. The processing state of the data source.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $processing_state = 0;
    /**
     * Output only. The list of issues occurring in the data source.
     *
     * Generated from protobuf field <code>repeated .google.shopping.merchant.datasources.v1beta.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $issues;
    /**
     * Output only. The number of items in the data source that were processed.
     *
     * Generated from protobuf field <code>int64 items_total = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $items_total = 0;
    /**
     * Output only. The number of items in the data source that were created.
     *
     * Generated from protobuf field <code>int64 items_created = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $items_created = 0;
    /**
     * Output only. The number of items in the data source that were updated.
     *
     * Generated from protobuf field <code>int64 items_updated = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $items_updated = 0;
    /**
     * Output only. The date at which the file of the data source was uploaded.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $upload_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The name of the data source file upload.
     *           Format:
     *           `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
     *     @type int|string $data_source_id
     *           Output only. The data source id.
     *     @type int $processing_state
     *           Output only. The processing state of the data source.
     *     @type \Google\Shopping\Merchant\DataSources\V1beta\FileUpload\Issue[] $issues
     *           Output only. The list of issues occurring in the data source.
     *     @type int|string $items_total
     *           Output only. The number of items in the data source that were processed.
     *     @type int|string $items_created
     *           Output only. The number of items in the data source that were created.
     *     @type int|string $items_updated
     *           Output only. The number of items in the data source that were updated.
     *     @type \Google\Protobuf\Timestamp $upload_time
     *           Output only. The date at which the file of the data source was uploaded.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Fileuploads::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The name of the data source file upload.
     * Format:
     * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. The name of the data source file upload.
     * Format:
     * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
     *
     * 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. The data source id.
     *
     * Generated from protobuf field <code>int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getDataSourceId()
    {
        return $this->data_source_id;
    }

    /**
     * Output only. The data source id.
     *
     * Generated from protobuf field <code>int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setDataSourceId($var)
    {
        GPBUtil::checkInt64($var);
        $this->data_source_id = $var;

        return $this;
    }

    /**
     * Output only. The processing state of the data source.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getProcessingState()
    {
        return $this->processing_state;
    }

    /**
     * Output only. The processing state of the data source.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setProcessingState($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\DataSources\V1beta\FileUpload\ProcessingState::class);
        $this->processing_state = $var;

        return $this;
    }

    /**
     * Output only. The list of issues occurring in the data source.
     *
     * Generated from protobuf field <code>repeated .google.shopping.merchant.datasources.v1beta.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return RepeatedField<\Google\Shopping\Merchant\DataSources\V1beta\FileUpload\Issue>
     */
    public function getIssues()
    {
        return $this->issues;
    }

    /**
     * Output only. The list of issues occurring in the data source.
     *
     * Generated from protobuf field <code>repeated .google.shopping.merchant.datasources.v1beta.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Shopping\Merchant\DataSources\V1beta\FileUpload\Issue[] $var
     * @return $this
     */
    public function setIssues($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\DataSources\V1beta\FileUpload\Issue::class);
        $this->issues = $arr;

        return $this;
    }

    /**
     * Output only. The number of items in the data source that were processed.
     *
     * Generated from protobuf field <code>int64 items_total = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getItemsTotal()
    {
        return $this->items_total;
    }

    /**
     * Output only. The number of items in the data source that were processed.
     *
     * Generated from protobuf field <code>int64 items_total = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setItemsTotal($var)
    {
        GPBUtil::checkInt64($var);
        $this->items_total = $var;

        return $this;
    }

    /**
     * Output only. The number of items in the data source that were created.
     *
     * Generated from protobuf field <code>int64 items_created = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getItemsCreated()
    {
        return $this->items_created;
    }

    /**
     * Output only. The number of items in the data source that were created.
     *
     * Generated from protobuf field <code>int64 items_created = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setItemsCreated($var)
    {
        GPBUtil::checkInt64($var);
        $this->items_created = $var;

        return $this;
    }

    /**
     * Output only. The number of items in the data source that were updated.
     *
     * Generated from protobuf field <code>int64 items_updated = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getItemsUpdated()
    {
        return $this->items_updated;
    }

    /**
     * Output only. The number of items in the data source that were updated.
     *
     * Generated from protobuf field <code>int64 items_updated = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setItemsUpdated($var)
    {
        GPBUtil::checkInt64($var);
        $this->items_updated = $var;

        return $this;
    }

    /**
     * Output only. The date at which the file of the data source was uploaded.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUploadTime()
    {
        return $this->upload_time;
    }

    public function hasUploadTime()
    {
        return isset($this->upload_time);
    }

    public function clearUploadTime()
    {
        unset($this->upload_time);
    }

    /**
     * Output only. The date at which the file of the data source was uploaded.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUploadTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->upload_time = $var;

        return $this;
    }

}

