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

namespace Google\Cloud\NetworkServices\V1\HttpRoute;

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

/**
 * Static HTTP response object to be returned.
 *
 * Generated from protobuf message <code>google.cloud.networkservices.v1.HttpRoute.HttpDirectResponse</code>
 */
class HttpDirectResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Status to return as part of HTTP Response. Must be a positive
     * integer.
     *
     * Generated from protobuf field <code>int32 status = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $status = 0;
    protected $HttpBody;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $string_body
     *           Optional. Response body as a string. Maximum body length is 1024
     *           characters.
     *     @type string $bytes_body
     *           Optional. Response body as bytes. Maximum body size is 4096B.
     *     @type int $status
     *           Required. Status to return as part of HTTP Response. Must be a positive
     *           integer.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Response body as a string. Maximum body length is 1024
     * characters.
     *
     * Generated from protobuf field <code>string string_body = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getStringBody()
    {
        return $this->readOneof(2);
    }

    public function hasStringBody()
    {
        return $this->hasOneof(2);
    }

    /**
     * Optional. Response body as a string. Maximum body length is 1024
     * characters.
     *
     * Generated from protobuf field <code>string string_body = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setStringBody($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Optional. Response body as bytes. Maximum body size is 4096B.
     *
     * Generated from protobuf field <code>bytes bytes_body = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getBytesBody()
    {
        return $this->readOneof(3);
    }

    public function hasBytesBody()
    {
        return $this->hasOneof(3);
    }

    /**
     * Optional. Response body as bytes. Maximum body size is 4096B.
     *
     * Generated from protobuf field <code>bytes bytes_body = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setBytesBody($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Required. Status to return as part of HTTP Response. Must be a positive
     * integer.
     *
     * Generated from protobuf field <code>int32 status = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Required. Status to return as part of HTTP Response. Must be a positive
     * integer.
     *
     * Generated from protobuf field <code>int32 status = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setStatus($var)
    {
        GPBUtil::checkInt32($var);
        $this->status = $var;

        return $this;
    }

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

}


