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

namespace Google\Cloud\Dialogflow\V2\Tool;

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

/**
 * An OpenAPI tool is a way to provide the Tool specifications in the Open API
 * schema format.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.Tool.OpenApiTool</code>
 */
class OpenApiTool extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Authentication information required by the API.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.Authentication authentication = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $authentication = null;
    /**
     * Optional. TLS configuration for the HTTPS verification.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.TLSConfig tls_config = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $tls_config = null;
    /**
     * Optional. Service Directory configuration.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfig service_directory_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $service_directory_config = null;
    protected $schema;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $text_schema
     *           Required. The OpenAPI schema specified as a text.
     *     @type \Google\Cloud\Dialogflow\V2\Tool\Authentication $authentication
     *           Optional. Authentication information required by the API.
     *     @type \Google\Cloud\Dialogflow\V2\Tool\TLSConfig $tls_config
     *           Optional. TLS configuration for the HTTPS verification.
     *     @type \Google\Cloud\Dialogflow\V2\Tool\ServiceDirectoryConfig $service_directory_config
     *           Optional. Service Directory configuration.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The OpenAPI schema specified as a text.
     *
     * Generated from protobuf field <code>string text_schema = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getTextSchema()
    {
        return $this->readOneof(1);
    }

    public function hasTextSchema()
    {
        return $this->hasOneof(1);
    }

    /**
     * Required. The OpenAPI schema specified as a text.
     *
     * Generated from protobuf field <code>string text_schema = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setTextSchema($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Optional. Authentication information required by the API.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.Authentication authentication = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Dialogflow\V2\Tool\Authentication|null
     */
    public function getAuthentication()
    {
        return $this->authentication;
    }

    public function hasAuthentication()
    {
        return isset($this->authentication);
    }

    public function clearAuthentication()
    {
        unset($this->authentication);
    }

    /**
     * Optional. Authentication information required by the API.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.Authentication authentication = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Dialogflow\V2\Tool\Authentication $var
     * @return $this
     */
    public function setAuthentication($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\Authentication::class);
        $this->authentication = $var;

        return $this;
    }

    /**
     * Optional. TLS configuration for the HTTPS verification.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.TLSConfig tls_config = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Dialogflow\V2\Tool\TLSConfig|null
     */
    public function getTlsConfig()
    {
        return $this->tls_config;
    }

    public function hasTlsConfig()
    {
        return isset($this->tls_config);
    }

    public function clearTlsConfig()
    {
        unset($this->tls_config);
    }

    /**
     * Optional. TLS configuration for the HTTPS verification.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.TLSConfig tls_config = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Dialogflow\V2\Tool\TLSConfig $var
     * @return $this
     */
    public function setTlsConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\TLSConfig::class);
        $this->tls_config = $var;

        return $this;
    }

    /**
     * Optional. Service Directory configuration.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfig service_directory_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Dialogflow\V2\Tool\ServiceDirectoryConfig|null
     */
    public function getServiceDirectoryConfig()
    {
        return $this->service_directory_config;
    }

    public function hasServiceDirectoryConfig()
    {
        return isset($this->service_directory_config);
    }

    public function clearServiceDirectoryConfig()
    {
        unset($this->service_directory_config);
    }

    /**
     * Optional. Service Directory configuration.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfig service_directory_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Dialogflow\V2\Tool\ServiceDirectoryConfig $var
     * @return $this
     */
    public function setServiceDirectoryConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\ServiceDirectoryConfig::class);
        $this->service_directory_config = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getSchema()
    {
        return $this->whichOneof("schema");
    }

}

