Module: Anthropic::Models::Beta::BetaEnvironment::Config

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

Overview

Environment configuration (either Anthropic Cloud or self-hosted)

See Also:

  • Anthropic::Models::Beta::BetaEnvironment#config

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:, networking:, packages:) ⇒ Anthropic::Beta::BetaCloudConfig .new(type:) ⇒ Anthropic::Beta::BetaSelfHostedConfig .new(type:, networking:, packages:) ⇒ Anthropic::Models::Beta::BetaEnvironment::config

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

Overloads:

  • .new(type:, networking:, packages:) ⇒ Anthropic::Beta::BetaCloudConfig

    Parameters:

    • type: (:cloud, "cloud")
    • networking: (Anthropic::Models::Beta::BetaCloudConfig::networking)
    • packages: (Anthropic::Beta::BetaPackages)

    Returns:

    • (Anthropic::Beta::BetaCloudConfig)
  • .new(type:) ⇒ Anthropic::Beta::BetaSelfHostedConfig

    Parameters:

    • type: (:self_hosted, "self_hosted")

    Returns:

    • (Anthropic::Beta::BetaSelfHostedConfig)
  • .new(type:, networking:, packages:) ⇒ Anthropic::Models::Beta::BetaEnvironment::config

    Parameters:

    • type: (Anthropic::Models::Beta::BetaEnvironment::Config::type_, String)
    • networking: (Anthropic::Models::Beta::BetaCloudConfig::networking)
    • packages: (Anthropic::Beta::BetaPackages)

    Returns:

    • (Anthropic::Models::Beta::BetaEnvironment::config)

Parameters:

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

    Attributes for the chosen variant.

    @option args [Anthropic::Models::Beta::BetaUnrestrictedNetwork, Anthropic::Models::Beta::BetaLimitedNetwork] :networking Network configuration policy.

    @option args [Anthropic::Models::Beta::BetaPackages] :packages Package manager configuration.

Returns:

Raises:

  • (ArgumentError)


135
136
137
138
139
140
141
142
143
144
# File 'lib/anthropic/models/beta/beta_environment.rb', line 135

def self.new(type:, **args)
  case type.to_sym
  when :cloud
    Anthropic::Beta::BetaCloudConfig.new(**args)
  when :self_hosted
    Anthropic::Beta::BetaSelfHostedConfig.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta/beta_environment.rb', line 115

.variants ⇒ Array(Anthropic::Models::Beta::BetaCloudConfig, Anthropic::Models::Beta::BetaSelfHostedConfig)



# File 'lib/anthropic/models/beta/beta_environment.rb', line 119