Class: Google::Apis::DatastreamV1alpha1::FieldViolation

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



589
590
591
# File 'lib/google/apis/datastream_v1alpha1/classes.rb', line 589

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)


554
555
556
# File 'lib/google/apis/datastream_v1alpha1/classes.rb', line 554

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)


572
573
574
# File 'lib/google/apis/datastream_v1alpha1/classes.rb', line 572

def field
  @field
end

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



578
579
580
# File 'lib/google/apis/datastream_v1alpha1/classes.rb', line 578

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)


587
588
589
# File 'lib/google/apis/datastream_v1alpha1/classes.rb', line 587

def reason
  @reason
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



594
595
596
597
598
599
# File 'lib/google/apis/datastream_v1alpha1/classes.rb', line 594

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