Class: Google::Apis::ServiceusageV1beta1::CustomError

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

Overview

Customize service error responses. For example, list any service specific protobuf types that can appear in error detail lists of error responses. Example: custom_error: types: - google.foo.v1.CustomError - google.foo.v1. AnotherError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ CustomError

Returns a new instance of CustomError.



1516
1517
1518
# File 'lib/google/apis/serviceusage_v1beta1/classes.rb', line 1516

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

Instance Attribute Details

#rulesArray<Google::Apis::ServiceusageV1beta1::CustomErrorRule>

The list of custom error rules that apply to individual API messages. NOTE: All service configuration rules follow "last one wins" order. Corresponds to the JSON property rules



1509
1510
1511
# File 'lib/google/apis/serviceusage_v1beta1/classes.rb', line 1509

def rules
  @rules
end

#typesArray<String>

The list of custom error detail types, e.g. 'google.foo.v1.CustomError'. Corresponds to the JSON property types

Returns:

  • (Array<String>)


1514
1515
1516
# File 'lib/google/apis/serviceusage_v1beta1/classes.rb', line 1514

def types
  @types
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1521
1522
1523
1524
# File 'lib/google/apis/serviceusage_v1beta1/classes.rb', line 1521

def update!(**args)
  @rules = args[:rules] if args.key?(:rules)
  @types = args[:types] if args.key?(:types)
end