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

namespace Google\Cloud\AppEngine\V1;

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

/**
 * A certificate managed by App Engine.
 *
 * Generated from protobuf message <code>google.appengine.v1.ManagedCertificate</code>
 */
class ManagedCertificate extends \Google\Protobuf\Internal\Message
{
    /**
     * Time at which the certificate was last renewed. The renewal process is
     * fully managed. Certificate renewal will automatically occur before the
     * certificate expires. Renewal errors can be tracked via `ManagementStatus`.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_renewal_time = 1;</code>
     */
    protected $last_renewal_time = null;
    /**
     * Status of certificate management. Refers to the most recent certificate
     * acquisition or renewal attempt.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>.google.appengine.v1.ManagementStatus status = 2;</code>
     */
    protected $status = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $last_renewal_time
     *           Time at which the certificate was last renewed. The renewal process is
     *           fully managed. Certificate renewal will automatically occur before the
     *           certificate expires. Renewal errors can be tracked via `ManagementStatus`.
     *           &#64;OutputOnly
     *     @type int $status
     *           Status of certificate management. Refers to the most recent certificate
     *           acquisition or renewal attempt.
     *           &#64;OutputOnly
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Appengine\V1\Certificate::initOnce();
        parent::__construct($data);
    }

    /**
     * Time at which the certificate was last renewed. The renewal process is
     * fully managed. Certificate renewal will automatically occur before the
     * certificate expires. Renewal errors can be tracked via `ManagementStatus`.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_renewal_time = 1;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getLastRenewalTime()
    {
        return $this->last_renewal_time;
    }

    public function hasLastRenewalTime()
    {
        return isset($this->last_renewal_time);
    }

    public function clearLastRenewalTime()
    {
        unset($this->last_renewal_time);
    }

    /**
     * Time at which the certificate was last renewed. The renewal process is
     * fully managed. Certificate renewal will automatically occur before the
     * certificate expires. Renewal errors can be tracked via `ManagementStatus`.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_renewal_time = 1;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setLastRenewalTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->last_renewal_time = $var;

        return $this;
    }

    /**
     * Status of certificate management. Refers to the most recent certificate
     * acquisition or renewal attempt.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>.google.appengine.v1.ManagementStatus status = 2;</code>
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Status of certificate management. Refers to the most recent certificate
     * acquisition or renewal attempt.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>.google.appengine.v1.ManagementStatus status = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setStatus($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AppEngine\V1\ManagementStatus::class);
        $this->status = $var;

        return $this;
    }

}

