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

namespace Google\Cloud\Dialogflow\V2\Connection;

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

/**
 * The error details of Sip Trunk connection authentication.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.Connection.ErrorDetails</code>
 */
class ErrorDetails extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The status of the certificate authentication.
     *
     * Generated from protobuf field <code>optional .google.cloud.dialogflow.v2.Connection.CertificateState certificate_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $certificate_state = null;
    /**
     * The error message provided from SIP trunking auth service
     *
     * Generated from protobuf field <code>optional string error_message = 2;</code>
     */
    protected $error_message = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $certificate_state
     *           Output only. The status of the certificate authentication.
     *     @type string $error_message
     *           The error message provided from SIP trunking auth service
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\SipTrunk::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The status of the certificate authentication.
     *
     * Generated from protobuf field <code>optional .google.cloud.dialogflow.v2.Connection.CertificateState certificate_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getCertificateState()
    {
        return isset($this->certificate_state) ? $this->certificate_state : 0;
    }

    public function hasCertificateState()
    {
        return isset($this->certificate_state);
    }

    public function clearCertificateState()
    {
        unset($this->certificate_state);
    }

    /**
     * Output only. The status of the certificate authentication.
     *
     * Generated from protobuf field <code>optional .google.cloud.dialogflow.v2.Connection.CertificateState certificate_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setCertificateState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Connection\CertificateState::class);
        $this->certificate_state = $var;

        return $this;
    }

    /**
     * The error message provided from SIP trunking auth service
     *
     * Generated from protobuf field <code>optional string error_message = 2;</code>
     * @return string
     */
    public function getErrorMessage()
    {
        return isset($this->error_message) ? $this->error_message : '';
    }

    public function hasErrorMessage()
    {
        return isset($this->error_message);
    }

    public function clearErrorMessage()
    {
        unset($this->error_message);
    }

    /**
     * The error message provided from SIP trunking auth service
     *
     * Generated from protobuf field <code>optional string error_message = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setErrorMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->error_message = $var;

        return $this;
    }

}


