Class: Google::Apis::DatamigrationV1::FieldViolation

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/datamigration_v1/classes.rb,
lib/google/apis/datamigration_v1/representations.rb,
lib/google/apis/datamigration_v1/representations.rb

Overview

A message type used to describe a single bad request field.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ FieldViolation

Returns a new instance of FieldViolation.



2179
2180
2181
# File 'lib/google/apis/datamigration_v1/classes.rb', line 2179

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#descriptionString

A description of why the request element is bad. Corresponds to the JSON property description

Returns:

  • (String)


2144
2145
2146
# File 'lib/google/apis/datamigration_v1/classes.rb', line 2144

def description
  @description
end

#fieldString

A path that leads to a field in the request body. The value will be a sequence of dot-separated identifiers that identify a protocol buffer field. Consider the following: message CreateContactRequest message EmailAddress enum Type TYPE_UNSPECIFIED = 0; HOME = 1; WORK = 2; optional string email = 1; repeated EmailType type = 2; string full_name = 1; repeated EmailAddress email_addresses = 2; In this example, in proto field could take one of the following values: * full_name for a violation in the full_name value * email_addresses[1].email for a violation in the email field of the first email_addresses message * email_addresses[3].type[2] for a violation in the second type value in the third email_addresses message. In JSON, the same values are represented as: * fullName for a violation in the fullName value * emailAddresses[1].email for a violation in the email field of the first emailAddresses message * emailAddresses[3].type[2] for a violation in the second type value in the third emailAddresses message. Corresponds to the JSON property field

Returns:

  • (String)


2162
2163
2164
# File 'lib/google/apis/datamigration_v1/classes.rb', line 2162

def field
  @field
end

#localized_messageGoogle::Apis::DatamigrationV1::LocalizedMessage

Provides a localized error message that is safe to return to the user which can be attached to an RPC error. Corresponds to the JSON property localizedMessage



2168
2169
2170
# File 'lib/google/apis/datamigration_v1/classes.rb', line 2168

def localized_message
  @localized_message
end

#reasonString

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], which represents UPPER_SNAKE_CASE. Corresponds to the JSON property reason

Returns:

  • (String)


2177
2178
2179
# File 'lib/google/apis/datamigration_v1/classes.rb', line 2177

def reason
  @reason
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2184
2185
2186
2187
2188
2189
# File 'lib/google/apis/datamigration_v1/classes.rb', line 2184

def update!(**args)
  @description = args[:description] if args.key?(:description)
  @field = args[:field] if args.key?(:field)
  @localized_message = args[:localized_message] if args.key?(:localized_message)
  @reason = args[:reason] if args.key?(:reason)
end