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

namespace Google\Shopping\Merchant\DataSources\V1beta;

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

/**
 * The data specific for file data sources. This field is empty for other
 * data source inputs.
 *
 * Generated from protobuf message <code>google.shopping.merchant.datasources.v1beta.FileInput</code>
 */
class FileInput extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Fetch details to deliver the data source. It contains settings
     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
     * based on the frequency of fetching.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $fetch_settings = null;
    /**
     * Optional. The file name of the data source. Required for `UPLOAD` file
     * input type.
     *
     * Generated from protobuf field <code>string file_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $file_name = '';
    /**
     * Output only. The type of file input.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $file_input_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Shopping\Merchant\DataSources\V1beta\FileInput\FetchSettings $fetch_settings
     *           Optional. Fetch details to deliver the data source. It contains settings
     *           for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
     *           based on the frequency of fetching.
     *     @type string $file_name
     *           Optional. The file name of the data source. Required for `UPLOAD` file
     *           input type.
     *     @type int $file_input_type
     *           Output only. The type of file input.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Fileinputs::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Fetch details to deliver the data source. It contains settings
     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
     * based on the frequency of fetching.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Shopping\Merchant\DataSources\V1beta\FileInput\FetchSettings|null
     */
    public function getFetchSettings()
    {
        return $this->fetch_settings;
    }

    public function hasFetchSettings()
    {
        return isset($this->fetch_settings);
    }

    public function clearFetchSettings()
    {
        unset($this->fetch_settings);
    }

    /**
     * Optional. Fetch details to deliver the data source. It contains settings
     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
     * based on the frequency of fetching.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Shopping\Merchant\DataSources\V1beta\FileInput\FetchSettings $var
     * @return $this
     */
    public function setFetchSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Merchant\DataSources\V1beta\FileInput\FetchSettings::class);
        $this->fetch_settings = $var;

        return $this;
    }

    /**
     * Optional. The file name of the data source. Required for `UPLOAD` file
     * input type.
     *
     * Generated from protobuf field <code>string file_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getFileName()
    {
        return $this->file_name;
    }

    /**
     * Optional. The file name of the data source. Required for `UPLOAD` file
     * input type.
     *
     * Generated from protobuf field <code>string file_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setFileName($var)
    {
        GPBUtil::checkString($var, True);
        $this->file_name = $var;

        return $this;
    }

    /**
     * Output only. The type of file input.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getFileInputType()
    {
        return $this->file_input_type;
    }

    /**
     * Output only. The type of file input.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setFileInputType($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\DataSources\V1beta\FileInput\FileInputType::class);
        $this->file_input_type = $var;

        return $this;
    }

}

