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

namespace Google\Cloud\Recommender\V1;

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

/**
 * Information for state. Contains state and metadata.
 *
 * Generated from protobuf message <code>google.cloud.recommender.v1.RecommendationStateInfo</code>
 */
class RecommendationStateInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED.
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.RecommendationStateInfo.State state = 1;</code>
     */
    private $state = 0;
    /**
     * A map of metadata for the state, provided by user or automations systems.
     *
     * Generated from protobuf field <code>map<string, string> state_metadata = 2;</code>
     */
    private $state_metadata;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $state
     *           The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED.
     *     @type array|\Google\Protobuf\Internal\MapField $state_metadata
     *           A map of metadata for the state, provided by user or automations systems.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce();
        parent::__construct($data);
    }

    /**
     * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED.
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.RecommendationStateInfo.State state = 1;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED.
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.RecommendationStateInfo.State state = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\RecommendationStateInfo_State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * A map of metadata for the state, provided by user or automations systems.
     *
     * Generated from protobuf field <code>map<string, string> state_metadata = 2;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getStateMetadata()
    {
        return $this->state_metadata;
    }

    /**
     * A map of metadata for the state, provided by user or automations systems.
     *
     * Generated from protobuf field <code>map<string, string> state_metadata = 2;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setStateMetadata($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->state_metadata = $arr;

        return $this;
    }

}

