Class: Google::Apis::TranslateV3::Status

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

Overview

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Status

Returns a new instance of Status.



995
996
997
# File 'lib/google/apis/translate_v3/classes.rb', line 995

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

Instance Attribute Details

#codeFixnum

The status code, which should be an enum value of google.rpc.Code. Corresponds to the JSON property code

Returns:

  • (Fixnum)


980
981
982
# File 'lib/google/apis/translate_v3/classes.rb', line 980

def code
  @code
end

#detailsArray<Hash<String,Object>>

A list of messages that carry the error details. There is a common set of message types for APIs to use. Corresponds to the JSON property details

Returns:

  • (Array<Hash<String,Object>>)


986
987
988
# File 'lib/google/apis/translate_v3/classes.rb', line 986

def details
  @details
end

#messageString

A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. Corresponds to the JSON property message

Returns:

  • (String)


993
994
995
# File 'lib/google/apis/translate_v3/classes.rb', line 993

def message
  @message
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1000
1001
1002
1003
1004
# File 'lib/google/apis/translate_v3/classes.rb', line 1000

def update!(**args)
  @code = args[:code] if args.key?(:code)
  @details = args[:details] if args.key?(:details)
  @message = args[:message] if args.key?(:message)
end