Class: Google::Apis::DatamigrationV1beta1::FieldViolation

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/datamigration_v1beta1/classes.rb,
lib/google/apis/datamigration_v1beta1/representations.rb,
lib/google/apis/datamigration_v1beta1/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.



689
690
691
# File 'lib/google/apis/datamigration_v1beta1/classes.rb', line 689

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)


654
655
656
# File 'lib/google/apis/datamigration_v1beta1/classes.rb', line 654

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)


672
673
674
# File 'lib/google/apis/datamigration_v1beta1/classes.rb', line 672

def field
  @field
end

#localized_messageGoogle::Apis::DatamigrationV1beta1::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



678
679
680
# File 'lib/google/apis/datamigration_v1beta1/classes.rb', line 678

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)


687
688
689
# File 'lib/google/apis/datamigration_v1beta1/classes.rb', line 687

def reason
  @reason
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



694
695
696
697
698
699
# File 'lib/google/apis/datamigration_v1beta1/classes.rb', line 694

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