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

namespace Google\Cloud\GkeHub\ConfigManagement\V1;

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

/**
 * State information for ConfigSync
 *
 * Generated from protobuf message <code>google.cloud.gkehub.configmanagement.v1.ConfigSyncState</code>
 */
class ConfigSyncState extends \Google\Protobuf\Internal\Message
{
    /**
     * The version of ConfigSync deployed
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion version = 1;</code>
     */
    protected $version = null;
    /**
     * Information about the deployment of ConfigSync, including the version
     * of the various Pods deployed
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState deployment_state = 2;</code>
     */
    protected $deployment_state = null;
    /**
     * The state of ConfigSync's process to sync configs to a cluster
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.SyncState sync_state = 3;</code>
     */
    protected $sync_state = null;
    /**
     * Errors pertaining to the installation of Config Sync.
     *
     * Generated from protobuf field <code>repeated .google.cloud.gkehub.configmanagement.v1.ConfigSyncError errors = 4;</code>
     */
    private $errors;
    /**
     * The state of the RootSync CRD
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState rootsync_crd = 5;</code>
     */
    protected $rootsync_crd = 0;
    /**
     * The state of the Reposync CRD
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState reposync_crd = 6;</code>
     */
    protected $reposync_crd = 0;
    /**
     * The state of CS
     * This field summarizes the other fields in this message.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State state = 7;</code>
     */
    protected $state = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncVersion $version
     *           The version of ConfigSync deployed
     *     @type \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncDeploymentState $deployment_state
     *           Information about the deployment of ConfigSync, including the version
     *           of the various Pods deployed
     *     @type \Google\Cloud\GkeHub\ConfigManagement\V1\SyncState $sync_state
     *           The state of ConfigSync's process to sync configs to a cluster
     *     @type array<\Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncError>|\Google\Protobuf\Internal\RepeatedField $errors
     *           Errors pertaining to the installation of Config Sync.
     *     @type int $rootsync_crd
     *           The state of the RootSync CRD
     *     @type int $reposync_crd
     *           The state of the Reposync CRD
     *     @type int $state
     *           The state of CS
     *           This field summarizes the other fields in this message.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Gkehub\V1\Configmanagement\Configmanagement::initOnce();
        parent::__construct($data);
    }

    /**
     * The version of ConfigSync deployed
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion version = 1;</code>
     * @return \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncVersion|null
     */
    public function getVersion()
    {
        return $this->version;
    }

    public function hasVersion()
    {
        return isset($this->version);
    }

    public function clearVersion()
    {
        unset($this->version);
    }

    /**
     * The version of ConfigSync deployed
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion version = 1;</code>
     * @param \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncVersion $var
     * @return $this
     */
    public function setVersion($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncVersion::class);
        $this->version = $var;

        return $this;
    }

    /**
     * Information about the deployment of ConfigSync, including the version
     * of the various Pods deployed
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState deployment_state = 2;</code>
     * @return \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncDeploymentState|null
     */
    public function getDeploymentState()
    {
        return $this->deployment_state;
    }

    public function hasDeploymentState()
    {
        return isset($this->deployment_state);
    }

    public function clearDeploymentState()
    {
        unset($this->deployment_state);
    }

    /**
     * Information about the deployment of ConfigSync, including the version
     * of the various Pods deployed
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState deployment_state = 2;</code>
     * @param \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncDeploymentState $var
     * @return $this
     */
    public function setDeploymentState($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncDeploymentState::class);
        $this->deployment_state = $var;

        return $this;
    }

    /**
     * The state of ConfigSync's process to sync configs to a cluster
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.SyncState sync_state = 3;</code>
     * @return \Google\Cloud\GkeHub\ConfigManagement\V1\SyncState|null
     */
    public function getSyncState()
    {
        return $this->sync_state;
    }

    public function hasSyncState()
    {
        return isset($this->sync_state);
    }

    public function clearSyncState()
    {
        unset($this->sync_state);
    }

    /**
     * The state of ConfigSync's process to sync configs to a cluster
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.SyncState sync_state = 3;</code>
     * @param \Google\Cloud\GkeHub\ConfigManagement\V1\SyncState $var
     * @return $this
     */
    public function setSyncState($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\ConfigManagement\V1\SyncState::class);
        $this->sync_state = $var;

        return $this;
    }

    /**
     * Errors pertaining to the installation of Config Sync.
     *
     * Generated from protobuf field <code>repeated .google.cloud.gkehub.configmanagement.v1.ConfigSyncError errors = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getErrors()
    {
        return $this->errors;
    }

    /**
     * Errors pertaining to the installation of Config Sync.
     *
     * Generated from protobuf field <code>repeated .google.cloud.gkehub.configmanagement.v1.ConfigSyncError errors = 4;</code>
     * @param array<\Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncError>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setErrors($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncError::class);
        $this->errors = $arr;

        return $this;
    }

    /**
     * The state of the RootSync CRD
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState rootsync_crd = 5;</code>
     * @return int
     */
    public function getRootsyncCrd()
    {
        return $this->rootsync_crd;
    }

    /**
     * The state of the RootSync CRD
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState rootsync_crd = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setRootsyncCrd($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncState\CRDState::class);
        $this->rootsync_crd = $var;

        return $this;
    }

    /**
     * The state of the Reposync CRD
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState reposync_crd = 6;</code>
     * @return int
     */
    public function getReposyncCrd()
    {
        return $this->reposync_crd;
    }

    /**
     * The state of the Reposync CRD
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState reposync_crd = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setReposyncCrd($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncState\CRDState::class);
        $this->reposync_crd = $var;

        return $this;
    }

    /**
     * The state of CS
     * This field summarizes the other fields in this message.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State state = 7;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * The state of CS
     * This field summarizes the other fields in this message.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State state = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\ConfigManagement\V1\ConfigSyncState\State::class);
        $this->state = $var;

        return $this;
    }

}

