Module: Anthropic::Models::Beta::Vaults::CredentialCreateParams::Auth

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

Overview

Authentication details for creating a credential.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

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

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:, **args) ⇒ Anthropic::Models::Beta::Vaults::BetaManagedAgentsMCPOAuthCreateParams, ...

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

Parameters:

  • type (Symbol, String)
  • args (Hash{Symbol=>Object})

    Attributes for the chosen variant.

    @option args [String] :access_token OAuth access token.

    @option args [String] :mcp_server_url URL of the MCP server this credential authenticates against.

    @option args [Time, nil] :expires_at A timestamp in RFC 3339 format

    @option args [Anthropic::Models::Beta::Vaults::BetaManagedAgentsMCPOAuthRefreshParams, nil] :refresh OAuth refresh token parameters for creating a credential with refresh support.

    @option args [String] :token Static bearer token value.

    @option args [Anthropic::Models::Beta::Vaults::BetaManagedAgentsUnrestrictedCredentialNetworkingParams, Anthropic::Models::Beta::Vaults::BetaManagedAgentsLimitedCredentialNetworkingParams] :networking Outbound hosts the secret value is substituted on.

    @option args [String] :secret_name Name of the environment variable. Immutable after create.

    @option args [String] :secret_value Secret value. Write-only; never returned in responses.

    @option args [Anthropic::Models::Beta::Vaults::BetaManagedAgentsInjectionLocationParams] :injection_location Where in the outbound request the secret value may be substituted.

Returns:

Raises:

  • (ArgumentError)


104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/anthropic/models/beta/vaults/credential_create_params.rb', line 104

def self.new(type:, **args)
  case type.to_sym
  when :mcp_oauth
    Anthropic::Beta::Vaults::BetaManagedAgentsMCPOAuthCreateParams.new(**args)
  when :static_bearer
    Anthropic::Beta::Vaults::BetaManagedAgentsStaticBearerCreateParams.new(**args)
  when :environment_variable
    Anthropic::Beta::Vaults::BetaManagedAgentsEnvironmentVariableCreateParams.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

Instance Method Details

#self?.variants::Array[Anthropic::Models::Beta::Vaults::CredentialCreateParams::auth]

Returns:

  • (::Array[Anthropic::Models::Beta::Vaults::CredentialCreateParams::auth])


61
# File 'sig/anthropic/models/beta/vaults/credential_create_params.rbs', line 61

def self?.variants: -> ::Array[Anthropic::Models::Beta::Vaults::CredentialCreateParams::auth]