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

namespace Google\Cloud\MigrationCenter\V1;

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

/**
 * Source represents an object from which asset information is
 * streamed to Migration Center.
 *
 * Generated from protobuf message <code>google.cloud.migrationcenter.v1.Source</code>
 */
class Source extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The full name of the source.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $name = '';
    /**
     * Output only. The timestamp when the source was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. The timestamp when the source was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * User-friendly display name.
     *
     * Generated from protobuf field <code>string display_name = 4;</code>
     */
    protected $display_name = '';
    /**
     * Free-text description.
     *
     * Generated from protobuf field <code>string description = 5;</code>
     */
    protected $description = '';
    /**
     * Data source type.
     *
     * Generated from protobuf field <code>.google.cloud.migrationcenter.v1.Source.SourceType type = 6;</code>
     */
    protected $type = 0;
    /**
     * The information confidence of the source.
     * The higher the value, the higher the confidence.
     *
     * Generated from protobuf field <code>int32 priority = 7;</code>
     */
    protected $priority = 0;
    /**
     * If `true`, the source is managed by other service(s).
     *
     * Generated from protobuf field <code>bool managed = 8;</code>
     */
    protected $managed = false;
    /**
     * Output only. Number of frames that are still being processed.
     *
     * Generated from protobuf field <code>int32 pending_frame_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $pending_frame_count = 0;
    /**
     * Output only. The number of frames that were reported by the source and
     * contained errors.
     *
     * Generated from protobuf field <code>int32 error_frame_count = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $error_frame_count = 0;
    /**
     * Output only. The state of the source.
     *
     * Generated from protobuf field <code>.google.cloud.migrationcenter.v1.Source.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The full name of the source.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The timestamp when the source was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The timestamp when the source was last updated.
     *     @type string $display_name
     *           User-friendly display name.
     *     @type string $description
     *           Free-text description.
     *     @type int $type
     *           Data source type.
     *     @type int $priority
     *           The information confidence of the source.
     *           The higher the value, the higher the confidence.
     *     @type bool $managed
     *           If `true`, the source is managed by other service(s).
     *     @type int $pending_frame_count
     *           Output only. Number of frames that are still being processed.
     *     @type int $error_frame_count
     *           Output only. The number of frames that were reported by the source and
     *           contained errors.
     *     @type int $state
     *           Output only. The state of the source.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Migrationcenter\V1\Migrationcenter::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The full name of the source.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The full name of the source.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. The timestamp when the source was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The timestamp when the source was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The timestamp when the source was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The timestamp when the source was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * User-friendly display name.
     *
     * Generated from protobuf field <code>string display_name = 4;</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * User-friendly display name.
     *
     * Generated from protobuf field <code>string display_name = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Free-text description.
     *
     * Generated from protobuf field <code>string description = 5;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Free-text description.
     *
     * Generated from protobuf field <code>string description = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Data source type.
     *
     * Generated from protobuf field <code>.google.cloud.migrationcenter.v1.Source.SourceType type = 6;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Data source type.
     *
     * Generated from protobuf field <code>.google.cloud.migrationcenter.v1.Source.SourceType type = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\MigrationCenter\V1\Source\SourceType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * The information confidence of the source.
     * The higher the value, the higher the confidence.
     *
     * Generated from protobuf field <code>int32 priority = 7;</code>
     * @return int
     */
    public function getPriority()
    {
        return $this->priority;
    }

    /**
     * The information confidence of the source.
     * The higher the value, the higher the confidence.
     *
     * Generated from protobuf field <code>int32 priority = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setPriority($var)
    {
        GPBUtil::checkInt32($var);
        $this->priority = $var;

        return $this;
    }

    /**
     * If `true`, the source is managed by other service(s).
     *
     * Generated from protobuf field <code>bool managed = 8;</code>
     * @return bool
     */
    public function getManaged()
    {
        return $this->managed;
    }

    /**
     * If `true`, the source is managed by other service(s).
     *
     * Generated from protobuf field <code>bool managed = 8;</code>
     * @param bool $var
     * @return $this
     */
    public function setManaged($var)
    {
        GPBUtil::checkBool($var);
        $this->managed = $var;

        return $this;
    }

    /**
     * Output only. Number of frames that are still being processed.
     *
     * Generated from protobuf field <code>int32 pending_frame_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getPendingFrameCount()
    {
        return $this->pending_frame_count;
    }

    /**
     * Output only. Number of frames that are still being processed.
     *
     * Generated from protobuf field <code>int32 pending_frame_count = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setPendingFrameCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->pending_frame_count = $var;

        return $this;
    }

    /**
     * Output only. The number of frames that were reported by the source and
     * contained errors.
     *
     * Generated from protobuf field <code>int32 error_frame_count = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getErrorFrameCount()
    {
        return $this->error_frame_count;
    }

    /**
     * Output only. The number of frames that were reported by the source and
     * contained errors.
     *
     * Generated from protobuf field <code>int32 error_frame_count = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setErrorFrameCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->error_frame_count = $var;

        return $this;
    }

    /**
     * Output only. The state of the source.
     *
     * Generated from protobuf field <code>.google.cloud.migrationcenter.v1.Source.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. The state of the source.
     *
     * Generated from protobuf field <code>.google.cloud.migrationcenter.v1.Source.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\MigrationCenter\V1\Source\State::class);
        $this->state = $var;

        return $this;
    }

}

