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

namespace Google\Cloud\ApigeeConnect\V1;

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

/**
 * The proto definition of http request.
 *
 * Generated from protobuf message <code>google.cloud.apigeeconnect.v1.HttpRequest</code>
 */
class HttpRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * A unique identifier for the request.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     */
    protected $id = '';
    /**
     * The HTTP request method.
     * Valid methods: "GET", "HEAD", "POST", "PUT", "PATCH","DELETE".
     *
     * Generated from protobuf field <code>string method = 2;</code>
     */
    protected $method = '';
    /**
     * The HTTP request URL.
     *
     * Generated from protobuf field <code>.google.cloud.apigeeconnect.v1.Url url = 3;</code>
     */
    protected $url = null;
    /**
     * The HTTP request headers.
     *
     * Generated from protobuf field <code>repeated .google.cloud.apigeeconnect.v1.Header headers = 4;</code>
     */
    private $headers;
    /**
     * HTTP request body.
     *
     * Generated from protobuf field <code>bytes body = 5;</code>
     */
    protected $body = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           A unique identifier for the request.
     *     @type string $method
     *           The HTTP request method.
     *           Valid methods: "GET", "HEAD", "POST", "PUT", "PATCH","DELETE".
     *     @type \Google\Cloud\ApigeeConnect\V1\Url $url
     *           The HTTP request URL.
     *     @type array<\Google\Cloud\ApigeeConnect\V1\Header>|\Google\Protobuf\Internal\RepeatedField $headers
     *           The HTTP request headers.
     *     @type string $body
     *           HTTP request body.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Apigeeconnect\V1\Tether::initOnce();
        parent::__construct($data);
    }

    /**
     * A unique identifier for the request.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * A unique identifier for the request.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * The HTTP request method.
     * Valid methods: "GET", "HEAD", "POST", "PUT", "PATCH","DELETE".
     *
     * Generated from protobuf field <code>string method = 2;</code>
     * @return string
     */
    public function getMethod()
    {
        return $this->method;
    }

    /**
     * The HTTP request method.
     * Valid methods: "GET", "HEAD", "POST", "PUT", "PATCH","DELETE".
     *
     * Generated from protobuf field <code>string method = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setMethod($var)
    {
        GPBUtil::checkString($var, True);
        $this->method = $var;

        return $this;
    }

    /**
     * The HTTP request URL.
     *
     * Generated from protobuf field <code>.google.cloud.apigeeconnect.v1.Url url = 3;</code>
     * @return \Google\Cloud\ApigeeConnect\V1\Url|null
     */
    public function getUrl()
    {
        return $this->url;
    }

    public function hasUrl()
    {
        return isset($this->url);
    }

    public function clearUrl()
    {
        unset($this->url);
    }

    /**
     * The HTTP request URL.
     *
     * Generated from protobuf field <code>.google.cloud.apigeeconnect.v1.Url url = 3;</code>
     * @param \Google\Cloud\ApigeeConnect\V1\Url $var
     * @return $this
     */
    public function setUrl($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ApigeeConnect\V1\Url::class);
        $this->url = $var;

        return $this;
    }

    /**
     * The HTTP request headers.
     *
     * Generated from protobuf field <code>repeated .google.cloud.apigeeconnect.v1.Header headers = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getHeaders()
    {
        return $this->headers;
    }

    /**
     * The HTTP request headers.
     *
     * Generated from protobuf field <code>repeated .google.cloud.apigeeconnect.v1.Header headers = 4;</code>
     * @param array<\Google\Cloud\ApigeeConnect\V1\Header>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setHeaders($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ApigeeConnect\V1\Header::class);
        $this->headers = $arr;

        return $this;
    }

    /**
     * HTTP request body.
     *
     * Generated from protobuf field <code>bytes body = 5;</code>
     * @return string
     */
    public function getBody()
    {
        return $this->body;
    }

    /**
     * HTTP request body.
     *
     * Generated from protobuf field <code>bytes body = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setBody($var)
    {
        GPBUtil::checkString($var, False);
        $this->body = $var;

        return $this;
    }

}

