|
| 1 | +<?php |
| 2 | +/* |
| 3 | + * Copyright 2014 Google Inc. |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 6 | + * use this file except in compliance with the License. You may obtain a copy of |
| 7 | + * the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | + * License for the specific language governing permissions and limitations under |
| 15 | + * the License. |
| 16 | + */ |
| 17 | + |
| 18 | +namespace Google\Service\DatabaseMigrationService; |
| 19 | + |
| 20 | +class FieldViolation extends \Google\Model |
| 21 | +{ |
| 22 | + /** |
| 23 | + * A description of why the request element is bad. |
| 24 | + * |
| 25 | + * @var string |
| 26 | + */ |
| 27 | + public $description; |
| 28 | + /** |
| 29 | + * A path that leads to a field in the request body. The value will be a |
| 30 | + * sequence of dot-separated identifiers that identify a protocol buffer |
| 31 | + * field. Consider the following: message CreateContactRequest { message |
| 32 | + * EmailAddress { enum Type { TYPE_UNSPECIFIED = 0; HOME = 1; WORK = 2; } |
| 33 | + * optional string email = 1; repeated EmailType type = 2; } string full_name |
| 34 | + * = 1; repeated EmailAddress email_addresses = 2; } In this example, in proto |
| 35 | + * `field` could take one of the following values: * `full_name` for a |
| 36 | + * violation in the `full_name` value * `email_addresses[1].email` for a |
| 37 | + * violation in the `email` field of the first `email_addresses` message * |
| 38 | + * `email_addresses[3].type[2]` for a violation in the second `type` value in |
| 39 | + * the third `email_addresses` message. In JSON, the same values are |
| 40 | + * represented as: * `fullName` for a violation in the `fullName` value * |
| 41 | + * `emailAddresses[1].email` for a violation in the `email` field of the first |
| 42 | + * `emailAddresses` message * `emailAddresses[3].type[2]` for a violation in |
| 43 | + * the second `type` value in the third `emailAddresses` message. |
| 44 | + * |
| 45 | + * @var string |
| 46 | + */ |
| 47 | + public $field; |
| 48 | + protected $localizedMessageType = LocalizedMessage::class; |
| 49 | + protected $localizedMessageDataType = ''; |
| 50 | + /** |
| 51 | + * The reason of the field-level error. This is a constant value that |
| 52 | + * identifies the proximate cause of the field-level error. It should uniquely |
| 53 | + * identify the type of the FieldViolation within the scope of the |
| 54 | + * google.rpc.ErrorInfo.domain. This should be at most 63 characters and match |
| 55 | + * a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. |
| 56 | + * |
| 57 | + * @var string |
| 58 | + */ |
| 59 | + public $reason; |
| 60 | + |
| 61 | + /** |
| 62 | + * A description of why the request element is bad. |
| 63 | + * |
| 64 | + * @param string $description |
| 65 | + */ |
| 66 | + public function setDescription($description) |
| 67 | + { |
| 68 | + $this->description = $description; |
| 69 | + } |
| 70 | + /** |
| 71 | + * @return string |
| 72 | + */ |
| 73 | + public function getDescription() |
| 74 | + { |
| 75 | + return $this->description; |
| 76 | + } |
| 77 | + /** |
| 78 | + * A path that leads to a field in the request body. The value will be a |
| 79 | + * sequence of dot-separated identifiers that identify a protocol buffer |
| 80 | + * field. Consider the following: message CreateContactRequest { message |
| 81 | + * EmailAddress { enum Type { TYPE_UNSPECIFIED = 0; HOME = 1; WORK = 2; } |
| 82 | + * optional string email = 1; repeated EmailType type = 2; } string full_name |
| 83 | + * = 1; repeated EmailAddress email_addresses = 2; } In this example, in proto |
| 84 | + * `field` could take one of the following values: * `full_name` for a |
| 85 | + * violation in the `full_name` value * `email_addresses[1].email` for a |
| 86 | + * violation in the `email` field of the first `email_addresses` message * |
| 87 | + * `email_addresses[3].type[2]` for a violation in the second `type` value in |
| 88 | + * the third `email_addresses` message. In JSON, the same values are |
| 89 | + * represented as: * `fullName` for a violation in the `fullName` value * |
| 90 | + * `emailAddresses[1].email` for a violation in the `email` field of the first |
| 91 | + * `emailAddresses` message * `emailAddresses[3].type[2]` for a violation in |
| 92 | + * the second `type` value in the third `emailAddresses` message. |
| 93 | + * |
| 94 | + * @param string $field |
| 95 | + */ |
| 96 | + public function setField($field) |
| 97 | + { |
| 98 | + $this->field = $field; |
| 99 | + } |
| 100 | + /** |
| 101 | + * @return string |
| 102 | + */ |
| 103 | + public function getField() |
| 104 | + { |
| 105 | + return $this->field; |
| 106 | + } |
| 107 | + /** |
| 108 | + * Provides a localized error message for field-level errors that is safe to |
| 109 | + * return to the API consumer. |
| 110 | + * |
| 111 | + * @param LocalizedMessage $localizedMessage |
| 112 | + */ |
| 113 | + public function setLocalizedMessage(LocalizedMessage $localizedMessage) |
| 114 | + { |
| 115 | + $this->localizedMessage = $localizedMessage; |
| 116 | + } |
| 117 | + /** |
| 118 | + * @return LocalizedMessage |
| 119 | + */ |
| 120 | + public function getLocalizedMessage() |
| 121 | + { |
| 122 | + return $this->localizedMessage; |
| 123 | + } |
| 124 | + /** |
| 125 | + * The reason of the field-level error. This is a constant value that |
| 126 | + * identifies the proximate cause of the field-level error. It should uniquely |
| 127 | + * identify the type of the FieldViolation within the scope of the |
| 128 | + * google.rpc.ErrorInfo.domain. This should be at most 63 characters and match |
| 129 | + * a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. |
| 130 | + * |
| 131 | + * @param string $reason |
| 132 | + */ |
| 133 | + public function setReason($reason) |
| 134 | + { |
| 135 | + $this->reason = $reason; |
| 136 | + } |
| 137 | + /** |
| 138 | + * @return string |
| 139 | + */ |
| 140 | + public function getReason() |
| 141 | + { |
| 142 | + return $this->reason; |
| 143 | + } |
| 144 | +} |
| 145 | + |
| 146 | +// Adding a class alias for backwards compatibility with the previous class name. |
| 147 | +class_alias(FieldViolation::class, 'Google_Service_DatabaseMigrationService_FieldViolation'); |
0 commit comments