Module: Anthropic::Models::BetaErrorObject

Extended by:
Internal::Type::Union
Defined in:
lib/anthropic/models/beta_error_object.rb,
sig/anthropic/models/beta_error_object.rbs

Defined Under Namespace

Modules: Type

Class Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Class Method Details

.new(type:, message:) ⇒ Anthropic::BetaInvalidRequestErrorObject .new(type:, message:) ⇒ Anthropic::BetaAuthenticationErrorObject .new(type:, message:) ⇒ Anthropic::BetaBillingErrorObject .new(type:, message:) ⇒ Anthropic::BetaPermissionErrorObject .new(type:, message:) ⇒ Anthropic::BetaNotFoundErrorObject .new(type:, message:) ⇒ Anthropic::BetaRateLimitErrorObject .new(type:, message:) ⇒ Anthropic::BetaGatewayTimeoutErrorObject .new(type:, message:) ⇒ Anthropic::BetaAPIErrorObject .new(type:, message:) ⇒ Anthropic::BetaOverloadedErrorObject .new(type:, message:) ⇒ Anthropic::Models::beta_error_object

Creates a new instance of the variant class whose type matches the given value, passing the remaining arguments to its constructor.

Some parameter documentations has been truncated, see Anthropic::Models::BetaErrorObject for more details.

Overloads:

Parameters:

  • type (Symbol, Anthropic::Models::BetaErrorObject::Type, String)
  • args (Hash{Symbol=>Object}) —

    Attributes for the chosen variant.

    @option args [String] :message A human-readable explanation of the error. Its wording can change, so don't matc

Returns:

Raises:

  • (ArgumentError)


62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/anthropic/models/beta_error_object.rb', line 62

def self.new(type:, **args)
  case type.to_sym
  when :invalid_request_error
    Anthropic::BetaInvalidRequestErrorObject.new(**args)
  when :authentication_error
    Anthropic::BetaAuthenticationErrorObject.new(**args)
  when :billing_error
    Anthropic::BetaBillingErrorObject.new(**args)
  when :permission_error
    Anthropic::BetaPermissionErrorObject.new(**args)
  when :not_found_error
    Anthropic::BetaNotFoundErrorObject.new(**args)
  when :rate_limit_error
    Anthropic::BetaRateLimitErrorObject.new(**args)
  when :timeout_error
    Anthropic::BetaGatewayTimeoutErrorObject.new(**args)
  when :api_error
    Anthropic::BetaAPIErrorObject.new(**args)
  when :overloaded_error
    Anthropic::BetaOverloadedErrorObject.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta_error_object.rb', line 41