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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * The response message for [Agents.ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent].
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.ExportAgentResponse</code>
 */
class ExportAgentResponse extends \Google\Protobuf\Internal\Message
{
    protected $agent;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $agent_uri
     *           The URI to a file containing the exported agent. This field is populated
     *           only if `agent_uri` is specified in `ExportAgentRequest`.
     *     @type string $agent_content
     *           The exported agent.
     *           Example for how to export an agent to a zip file via a command line:
     *           <pre>curl \
     *             'https://dialogflow.googleapis.com/v2/projects/&lt;project_name&gt;/agent:export'\
     *             -X POST \
     *             -H 'Authorization: Bearer '$(gcloud auth application-default
     *             print-access-token) \
     *             -H 'Accept: application/json' \
     *             -H 'Content-Type: application/json' \
     *             --compressed \
     *             --data-binary '{}' \
     *           | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*&#47;\1/' \
     *           | base64 --decode > &lt;agent zip file&gt;</pre>
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Agent::initOnce();
        parent::__construct($data);
    }

    /**
     * The URI to a file containing the exported agent. This field is populated
     * only if `agent_uri` is specified in `ExportAgentRequest`.
     *
     * Generated from protobuf field <code>string agent_uri = 1;</code>
     * @return string
     */
    public function getAgentUri()
    {
        return $this->readOneof(1);
    }

    /**
     * The URI to a file containing the exported agent. This field is populated
     * only if `agent_uri` is specified in `ExportAgentRequest`.
     *
     * Generated from protobuf field <code>string agent_uri = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setAgentUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The exported agent.
     * Example for how to export an agent to a zip file via a command line:
     * <pre>curl \
     *   'https://dialogflow.googleapis.com/v2/projects/&lt;project_name&gt;/agent:export'\
     *   -X POST \
     *   -H 'Authorization: Bearer '$(gcloud auth application-default
     *   print-access-token) \
     *   -H 'Accept: application/json' \
     *   -H 'Content-Type: application/json' \
     *   --compressed \
     *   --data-binary '{}' \
     * | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*&#47;\1/' \
     * | base64 --decode > &lt;agent zip file&gt;</pre>
     *
     * Generated from protobuf field <code>bytes agent_content = 2;</code>
     * @return string
     */
    public function getAgentContent()
    {
        return $this->readOneof(2);
    }

    /**
     * The exported agent.
     * Example for how to export an agent to a zip file via a command line:
     * <pre>curl \
     *   'https://dialogflow.googleapis.com/v2/projects/&lt;project_name&gt;/agent:export'\
     *   -X POST \
     *   -H 'Authorization: Bearer '$(gcloud auth application-default
     *   print-access-token) \
     *   -H 'Accept: application/json' \
     *   -H 'Content-Type: application/json' \
     *   --compressed \
     *   --data-binary '{}' \
     * | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*&#47;\1/' \
     * | base64 --decode > &lt;agent zip file&gt;</pre>
     *
     * Generated from protobuf field <code>bytes agent_content = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setAgentContent($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

