google.api.HttpRule */ class HttpRule extends \Google\Protobuf\Internal\Message { /** * Selects a method to which this rule applies. * Refer to [selector][google.api.DocumentationRule.selector] for syntax * details. * * Generated from protobuf field string selector = 1; */ protected $selector = ''; /** * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. * NOTE: the referred field must be present at the top-level of the request * message type. * * Generated from protobuf field string body = 7; */ protected $body = ''; /** * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. * NOTE: The referred field must be present at the top-level of the response * message type. * * Generated from protobuf field string response_body = 12; */ protected $response_body = ''; /** * Additional HTTP bindings for the selector. Nested bindings must * not contain an `additional_bindings` field themselves (that is, * the nesting may only be one level deep). * * Generated from protobuf field repeated .google.api.HttpRule additional_bindings = 11; */ private $additional_bindings; protected $pattern; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $selector * Selects a method to which this rule applies. * Refer to [selector][google.api.DocumentationRule.selector] for syntax * details. * @type string $get * Maps to HTTP GET. Used for listing and getting information about * resources. * @type string $put * Maps to HTTP PUT. Used for replacing a resource. * @type string $post * Maps to HTTP POST. Used for creating a resource or performing an action. * @type string $delete * Maps to HTTP DELETE. Used for deleting a resource. * @type string $patch * Maps to HTTP PATCH. Used for updating a resource. * @type \Google\Api\CustomHttpPattern $custom * The custom pattern is used for specifying an HTTP method that is not * included in the `pattern` field, such as HEAD, or "*" to leave the * HTTP method unspecified for this rule. The wild-card rule is useful * for services that provide content to Web (HTML) clients. * @type string $body * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. * NOTE: the referred field must be present at the top-level of the request * message type. * @type string $response_body * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. * NOTE: The referred field must be present at the top-level of the response * message type. * @type array<\Google\Api\HttpRule>|\Google\Protobuf\Internal\RepeatedField $additional_bindings * Additional HTTP bindings for the selector. Nested bindings must * not contain an `additional_bindings` field themselves (that is, * the nesting may only be one level deep). * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Api\Http::initOnce(); parent::__construct($data); } /** * Selects a method to which this rule applies. * Refer to [selector][google.api.DocumentationRule.selector] for syntax * details. * * Generated from protobuf field string selector = 1; * @return string */ public function getSelector() { return $this->selector; } /** * Selects a method to which this rule applies. * Refer to [selector][google.api.DocumentationRule.selector] for syntax * details. * * Generated from protobuf field string selector = 1; * @param string $var * @return $this */ public function setSelector($var) { GPBUtil::checkString($var, True); $this->selector = $var; return $this; } /** * Maps to HTTP GET. Used for listing and getting information about * resources. * * Generated from protobuf field string get = 2; * @return string */ public function getGet() { return $this->readOneof(2); } public function hasGet() { return $this->hasOneof(2); } /** * Maps to HTTP GET. Used for listing and getting information about * resources. * * Generated from protobuf field string get = 2; * @param string $var * @return $this */ public function setGet($var) { GPBUtil::checkString($var, True); $this->writeOneof(2, $var); return $this; } /** * Maps to HTTP PUT. Used for replacing a resource. * * Generated from protobuf field string put = 3; * @return string */ public function getPut() { return $this->readOneof(3); } public function hasPut() { return $this->hasOneof(3); } /** * Maps to HTTP PUT. Used for replacing a resource. * * Generated from protobuf field string put = 3; * @param string $var * @return $this */ public function setPut($var) { GPBUtil::checkString($var, True); $this->writeOneof(3, $var); return $this; } /** * Maps to HTTP POST. Used for creating a resource or performing an action. * * Generated from protobuf field string post = 4; * @return string */ public function getPost() { return $this->readOneof(4); } public function hasPost() { return $this->hasOneof(4); } /** * Maps to HTTP POST. Used for creating a resource or performing an action. * * Generated from protobuf field string post = 4; * @param string $var * @return $this */ public function setPost($var) { GPBUtil::checkString($var, True); $this->writeOneof(4, $var); return $this; } /** * Maps to HTTP DELETE. Used for deleting a resource. * * Generated from protobuf field string delete = 5; * @return string */ public function getDelete() { return $this->readOneof(5); } public function hasDelete() { return $this->hasOneof(5); } /** * Maps to HTTP DELETE. Used for deleting a resource. * * Generated from protobuf field string delete = 5; * @param string $var * @return $this */ public function setDelete($var) { GPBUtil::checkString($var, True); $this->writeOneof(5, $var); return $this; } /** * Maps to HTTP PATCH. Used for updating a resource. * * Generated from protobuf field string patch = 6; * @return string */ public function getPatch() { return $this->readOneof(6); } public function hasPatch() { return $this->hasOneof(6); } /** * Maps to HTTP PATCH. Used for updating a resource. * * Generated from protobuf field string patch = 6; * @param string $var * @return $this */ public function setPatch($var) { GPBUtil::checkString($var, True); $this->writeOneof(6, $var); return $this; } /** * The custom pattern is used for specifying an HTTP method that is not * included in the `pattern` field, such as HEAD, or "*" to leave the * HTTP method unspecified for this rule. The wild-card rule is useful * for services that provide content to Web (HTML) clients. * * Generated from protobuf field .google.api.CustomHttpPattern custom = 8; * @return \Google\Api\CustomHttpPattern|null */ public function getCustom() { return $this->readOneof(8); } public function hasCustom() { return $this->hasOneof(8); } /** * The custom pattern is used for specifying an HTTP method that is not * included in the `pattern` field, such as HEAD, or "*" to leave the * HTTP method unspecified for this rule. The wild-card rule is useful * for services that provide content to Web (HTML) clients. * * Generated from protobuf field .google.api.CustomHttpPattern custom = 8; * @param \Google\Api\CustomHttpPattern $var * @return $this */ public function setCustom($var) { GPBUtil::checkMessage($var, \Google\Api\CustomHttpPattern::class); $this->writeOneof(8, $var); return $this; } /** * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. * NOTE: the referred field must be present at the top-level of the request * message type. * * Generated from protobuf field string body = 7; * @return string */ public function getBody() { return $this->body; } /** * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. * NOTE: the referred field must be present at the top-level of the request * message type. * * Generated from protobuf field string body = 7; * @param string $var * @return $this */ public function setBody($var) { GPBUtil::checkString($var, True); $this->body = $var; return $this; } /** * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. * NOTE: The referred field must be present at the top-level of the response * message type. * * Generated from protobuf field string response_body = 12; * @return string */ public function getResponseBody() { return $this->response_body; } /** * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. * NOTE: The referred field must be present at the top-level of the response * message type. * * Generated from protobuf field string response_body = 12; * @param string $var * @return $this */ public function setResponseBody($var) { GPBUtil::checkString($var, True); $this->response_body = $var; return $this; } /** * Additional HTTP bindings for the selector. Nested bindings must * not contain an `additional_bindings` field themselves (that is, * the nesting may only be one level deep). * * Generated from protobuf field repeated .google.api.HttpRule additional_bindings = 11; * @return \Google\Protobuf\Internal\RepeatedField */ public function getAdditionalBindings() { return $this->additional_bindings; } /** * Additional HTTP bindings for the selector. Nested bindings must * not contain an `additional_bindings` field themselves (that is, * the nesting may only be one level deep). * * Generated from protobuf field repeated .google.api.HttpRule additional_bindings = 11; * @param array<\Google\Api\HttpRule>|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setAdditionalBindings($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\HttpRule::class); $this->additional_bindings = $arr; return $this; } /** * @return string */ public function getPattern() { return $this->whichOneof("pattern"); } }