<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: google/protobuf/api.proto

namespace Google\Protobuf;

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

/**
 * Method represents a method of an API interface.
 * New usages of this message as an alternative to MethodDescriptorProto are
 * strongly discouraged. This message does not reliability preserve all
 * information necessary to model the schema and preserve semantics. Instead
 * make use of FileDescriptorSet which preserves the necessary information.
 *
 * Generated from protobuf message <code>google.protobuf.Method</code>
 */
class Method extends \Google\Protobuf\Internal\Message
{
    /**
     * The simple name of this method.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * A URL of the input message type.
     *
     * Generated from protobuf field <code>string request_type_url = 2;</code>
     */
    protected $request_type_url = '';
    /**
     * If true, the request is streamed.
     *
     * Generated from protobuf field <code>bool request_streaming = 3;</code>
     */
    protected $request_streaming = false;
    /**
     * The URL of the output message type.
     *
     * Generated from protobuf field <code>string response_type_url = 4;</code>
     */
    protected $response_type_url = '';
    /**
     * If true, the response is streamed.
     *
     * Generated from protobuf field <code>bool response_streaming = 5;</code>
     */
    protected $response_streaming = false;
    /**
     * Any metadata attached to the method.
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 6;</code>
     */
    private $options;
    /**
     * The source syntax of this method.
     * This field should be ignored, instead the syntax should be inherited from
     * Api. This is similar to Field and EnumValue.
     *
     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7 [deprecated = true];</code>
     * @deprecated
     */
    protected $syntax = 0;
    /**
     * The source edition string, only valid when syntax is SYNTAX_EDITIONS.
     * This field should be ignored, instead the edition should be inherited from
     * Api. This is similar to Field and EnumValue.
     *
     * Generated from protobuf field <code>string edition = 8 [deprecated = true];</code>
     * @deprecated
     */
    protected $edition = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The simple name of this method.
     *     @type string $request_type_url
     *           A URL of the input message type.
     *     @type bool $request_streaming
     *           If true, the request is streamed.
     *     @type string $response_type_url
     *           The URL of the output message type.
     *     @type bool $response_streaming
     *           If true, the response is streamed.
     *     @type \Google\Protobuf\Option[] $options
     *           Any metadata attached to the method.
     *     @type int $syntax
     *           The source syntax of this method.
     *           This field should be ignored, instead the syntax should be inherited from
     *           Api. This is similar to Field and EnumValue.
     *     @type string $edition
     *           The source edition string, only valid when syntax is SYNTAX_EDITIONS.
     *           This field should be ignored, instead the edition should be inherited from
     *           Api. This is similar to Field and EnumValue.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Protobuf\Api::initOnce();
        parent::__construct($data);
    }

    /**
     * The simple name of this method.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The simple name of this method.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName(string $var)
    {
        GPBUtil::checkString($var, true);
        $this->name = $var;

        return $this;
    }

    /**
     * A URL of the input message type.
     *
     * Generated from protobuf field <code>string request_type_url = 2;</code>
     * @return string
     */
    public function getRequestTypeUrl()
    {
        return $this->request_type_url;
    }

    /**
     * A URL of the input message type.
     *
     * Generated from protobuf field <code>string request_type_url = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setRequestTypeUrl(string $var)
    {
        GPBUtil::checkString($var, true);
        $this->request_type_url = $var;

        return $this;
    }

    /**
     * If true, the request is streamed.
     *
     * Generated from protobuf field <code>bool request_streaming = 3;</code>
     * @return bool
     */
    public function getRequestStreaming()
    {
        return $this->request_streaming;
    }

    /**
     * If true, the request is streamed.
     *
     * Generated from protobuf field <code>bool request_streaming = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setRequestStreaming(bool $var)
    {
        $this->request_streaming = $var;

        return $this;
    }

    /**
     * The URL of the output message type.
     *
     * Generated from protobuf field <code>string response_type_url = 4;</code>
     * @return string
     */
    public function getResponseTypeUrl()
    {
        return $this->response_type_url;
    }

    /**
     * The URL of the output message type.
     *
     * Generated from protobuf field <code>string response_type_url = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setResponseTypeUrl(string $var)
    {
        GPBUtil::checkString($var, true);
        $this->response_type_url = $var;

        return $this;
    }

    /**
     * If true, the response is streamed.
     *
     * Generated from protobuf field <code>bool response_streaming = 5;</code>
     * @return bool
     */
    public function getResponseStreaming()
    {
        return $this->response_streaming;
    }

    /**
     * If true, the response is streamed.
     *
     * Generated from protobuf field <code>bool response_streaming = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setResponseStreaming(bool $var)
    {
        $this->response_streaming = $var;

        return $this;
    }

    /**
     * Any metadata attached to the method.
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 6;</code>
     * @return RepeatedField<\Google\Protobuf\Option>
     */
    public function getOptions()
    {
        return $this->options;
    }

    /**
     * Any metadata attached to the method.
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 6;</code>
     * @param \Google\Protobuf\Option[] $var
     * @return $this
     */
    public function setOptions(array|RepeatedField $var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
        $this->options = $arr;

        return $this;
    }

    /**
     * The source syntax of this method.
     * This field should be ignored, instead the syntax should be inherited from
     * Api. This is similar to Field and EnumValue.
     *
     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7 [deprecated = true];</code>
     * @return int one of the values in {@see \Google\Protobuf\Syntax}
     * @deprecated
     */
    public function getSyntax()
    {
        if ($this->syntax !== 0) {
            @trigger_error('syntax is deprecated.', E_USER_DEPRECATED);
        }
        return $this->syntax;
    }

    /**
     * The source syntax of this method.
     * This field should be ignored, instead the syntax should be inherited from
     * Api. This is similar to Field and EnumValue.
     *
     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7 [deprecated = true];</code>
     * @param int $var one of the values in {@see \Google\Protobuf\Syntax}
     * @return $this
     * @deprecated
     */
    public function setSyntax(int $var)
    {
        @trigger_error('syntax is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class);
        $this->syntax = $var;

        return $this;
    }

    /**
     * The source edition string, only valid when syntax is SYNTAX_EDITIONS.
     * This field should be ignored, instead the edition should be inherited from
     * Api. This is similar to Field and EnumValue.
     *
     * Generated from protobuf field <code>string edition = 8 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getEdition()
    {
        if ($this->edition !== '') {
            @trigger_error('edition is deprecated.', E_USER_DEPRECATED);
        }
        return $this->edition;
    }

    /**
     * The source edition string, only valid when syntax is SYNTAX_EDITIONS.
     * This field should be ignored, instead the edition should be inherited from
     * Api. This is similar to Field and EnumValue.
     *
     * Generated from protobuf field <code>string edition = 8 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setEdition(string $var)
    {
        @trigger_error('edition is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, true);
        $this->edition = $var;

        return $this;
    }

}

