value (::Google::Rpc::LocalizedMessage) — Provides a localized error message for field-level errors that is safe to
return to the API consumer.
Returns
(::Google::Rpc::LocalizedMessage) — Provides a localized error message for field-level errors that is safe to
return to the API consumer.
#reason
defreason()->::String
Returns
(::String) — The reason of the field-level error. This is a constant value that
identifies the proximate cause of the field-level error. It should
uniquely identify the type of the FieldViolation within the scope of the
google.rpc.ErrorInfo.domain. This should be at most 63
characters and match a regular expression of [A-Z][A-Z0-9_]+[A-Z0-9],
which represents UPPER_SNAKE_CASE.
#reason=
defreason=(value)->::String
Parameter
value (::String) — The reason of the field-level error. This is a constant value that
identifies the proximate cause of the field-level error. It should
uniquely identify the type of the FieldViolation within the scope of the
google.rpc.ErrorInfo.domain. This should be at most 63
characters and match a regular expression of [A-Z][A-Z0-9_]+[A-Z0-9],
which represents UPPER_SNAKE_CASE.
Returns
(::String) — The reason of the field-level error. This is a constant value that
identifies the proximate cause of the field-level error. It should
uniquely identify the type of the FieldViolation within the scope of the
google.rpc.ErrorInfo.domain. This should be at most 63
characters and match a regular expression of [A-Z][A-Z0-9_]+[A-Z0-9],
which represents UPPER_SNAKE_CASE.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Migrate for Compute Engine V1 API - Class Google::Rpc::BadRequest::FieldViolation (v2.2.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.2.0 (latest)](/ruby/docs/reference/google-cloud-vm_migration-v1/latest/Google-Rpc-BadRequest-FieldViolation)\n- [2.1.1](/ruby/docs/reference/google-cloud-vm_migration-v1/2.1.1/Google-Rpc-BadRequest-FieldViolation)\n- [2.0.0](/ruby/docs/reference/google-cloud-vm_migration-v1/2.0.0/Google-Rpc-BadRequest-FieldViolation)\n- [1.3.0](/ruby/docs/reference/google-cloud-vm_migration-v1/1.3.0/Google-Rpc-BadRequest-FieldViolation)\n- [1.2.0](/ruby/docs/reference/google-cloud-vm_migration-v1/1.2.0/Google-Rpc-BadRequest-FieldViolation)\n- [1.1.0](/ruby/docs/reference/google-cloud-vm_migration-v1/1.1.0/Google-Rpc-BadRequest-FieldViolation)\n- [1.0.2](/ruby/docs/reference/google-cloud-vm_migration-v1/1.0.2/Google-Rpc-BadRequest-FieldViolation)\n- [0.9.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.9.0/Google-Rpc-BadRequest-FieldViolation)\n- [0.8.2](/ruby/docs/reference/google-cloud-vm_migration-v1/0.8.2/Google-Rpc-BadRequest-FieldViolation)\n- [0.7.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.7.0/Google-Rpc-BadRequest-FieldViolation)\n- [0.6.1](/ruby/docs/reference/google-cloud-vm_migration-v1/0.6.1/Google-Rpc-BadRequest-FieldViolation)\n- [0.5.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.5.0/Google-Rpc-BadRequest-FieldViolation)\n- [0.4.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.4.0/Google-Rpc-BadRequest-FieldViolation)\n- [0.3.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.3.0/Google-Rpc-BadRequest-FieldViolation)\n- [0.2.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.2.0/Google-Rpc-BadRequest-FieldViolation)\n- [0.1.1](/ruby/docs/reference/google-cloud-vm_migration-v1/0.1.1/Google-Rpc-BadRequest-FieldViolation) \nReference documentation and code samples for the Migrate for Compute Engine V1 API class Google::Rpc::BadRequest::FieldViolation.\n\nA message type used to describe a single bad request field. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #description\n\n def description() -\u003e ::String\n\n**Returns**\n\n- (::String) --- A description of why the request element is bad.\n\n### #description=\n\n def description=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- A description of why the request element is bad. \n**Returns**\n\n- (::String) --- A description of why the request element is bad.\n\n### #field\n\n def field() -\u003e ::String\n\n**Returns**\n\n- (::String) --- A path that leads to a field in the request body. The value will be a\n sequence of dot-separated identifiers that identify a protocol buffer\n field.\n\n Consider the following: \n\n message CreateContactRequest {\n message EmailAddress {\n enum Type {\n TYPE_UNSPECIFIED = 0;\n HOME = 1;\n WORK = 2;\n }\n\n optional string email = 1;\n repeated EmailType type = 2;\n }\n\n string full_name = 1;\n repeated EmailAddress email_addresses = 2;\n }\n\n In this example, in proto `field` could take one of the following values:\n - `full_name` for a violation in the `full_name` value\n - `email_addresses[1].email` for a violation in the `email` field of the first `email_addresses` message\n - `email_addresses[3].type[2]` for a violation in the second `type` value in the third `email_addresses` message.\n\n In JSON, the same values are represented as:\n - `fullName` for a violation in the `fullName` value\n - `emailAddresses[1].email` for a violation in the `email` field of the first `emailAddresses` message\n - `emailAddresses[3].type[2]` for a violation in the second `type` value in the third `emailAddresses` message.\n\n### #field=\n\n def field=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) ---\n\n A path that leads to a field in the request body. The value will be a\n sequence of dot-separated identifiers that identify a protocol buffer\n field.\n\n Consider the following: \n\n message CreateContactRequest {\n message EmailAddress {\n enum Type {\n TYPE_UNSPECIFIED = 0;\n HOME = 1;\n WORK = 2;\n }\n\n optional string email = 1;\n repeated EmailType type = 2;\n }\n\n string full_name = 1;\n repeated EmailAddress email_addresses = 2;\n }\n\n In this example, in proto `field` could take one of the following values:\n - `full_name` for a violation in the `full_name` value\n - `email_addresses[1].email` for a violation in the `email` field of the first `email_addresses` message\n - `email_addresses[3].type[2]` for a violation in the second `type` value in the third `email_addresses` message.\n\n In JSON, the same values are represented as:\n - `fullName` for a violation in the `fullName` value\n - `emailAddresses[1].email` for a violation in the `email` field of the first `emailAddresses` message\n- `emailAddresses[3].type[2]` for a violation in the second `type` value in the third `emailAddresses` message. \n**Returns**\n\n- (::String) --- A path that leads to a field in the request body. The value will be a\n sequence of dot-separated identifiers that identify a protocol buffer\n field.\n\n Consider the following: \n\n message CreateContactRequest {\n message EmailAddress {\n enum Type {\n TYPE_UNSPECIFIED = 0;\n HOME = 1;\n WORK = 2;\n }\n\n optional string email = 1;\n repeated EmailType type = 2;\n }\n\n string full_name = 1;\n repeated EmailAddress email_addresses = 2;\n }\n\n In this example, in proto `field` could take one of the following values:\n - `full_name` for a violation in the `full_name` value\n - `email_addresses[1].email` for a violation in the `email` field of the first `email_addresses` message\n - `email_addresses[3].type[2]` for a violation in the second `type` value in the third `email_addresses` message.\n\n In JSON, the same values are represented as:\n - `fullName` for a violation in the `fullName` value\n - `emailAddresses[1].email` for a violation in the `email` field of the first `emailAddresses` message\n - `emailAddresses[3].type[2]` for a violation in the second `type` value in the third `emailAddresses` message.\n\n### #localized_message\n\n def localized_message() -\u003e ::Google::Rpc::LocalizedMessage\n\n**Returns**\n\n- ([::Google::Rpc::LocalizedMessage](./Google-Rpc-LocalizedMessage)) --- Provides a localized error message for field-level errors that is safe to return to the API consumer.\n\n### #localized_message=\n\n def localized_message=(value) -\u003e ::Google::Rpc::LocalizedMessage\n\n**Parameter**\n\n- **value** ([::Google::Rpc::LocalizedMessage](./Google-Rpc-LocalizedMessage)) --- Provides a localized error message for field-level errors that is safe to return to the API consumer. \n**Returns**\n\n- ([::Google::Rpc::LocalizedMessage](./Google-Rpc-LocalizedMessage)) --- Provides a localized error message for field-level errors that is safe to return to the API consumer.\n\n### #reason\n\n def reason() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The reason of the field-level error. This is a constant value that identifies the proximate cause of the field-level error. It should uniquely identify the type of the FieldViolation within the scope of the google.rpc.ErrorInfo.domain. This should be at most 63 characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents UPPER_SNAKE_CASE.\n\n### #reason=\n\n def reason=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The reason of the field-level error. This is a constant value that identifies the proximate cause of the field-level error. It should uniquely identify the type of the FieldViolation within the scope of the google.rpc.ErrorInfo.domain. This should be at most 63 characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. \n**Returns**\n\n- (::String) --- The reason of the field-level error. This is a constant value that identifies the proximate cause of the field-level error. It should uniquely identify the type of the FieldViolation within the scope of the google.rpc.ErrorInfo.domain. This should be at most 63 characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents UPPER_SNAKE_CASE."]]