Module: Anthropic::Models::UserProfileEnforcementAction

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

Overview

A limit Anthropic has placed on the entity this profile represents and not yet resolved, discriminated by type: restriction or ban. More types may be added; read a type you do not recognize as restriction.

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:, id:, action:, expires_at:, opened_at:, reason:) ⇒ Anthropic::UserProfileEnforcementActionRestriction .new(type:, id:, action:, expires_at:, opened_at:, reason:) ⇒ Anthropic::UserProfileEnforcementActionBan .new(type:, id:, action:, expires_at:, opened_at:, reason:) ⇒ Anthropic::Models::user_profile_enforcement_action

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::UserProfileEnforcementAction for more details.

Overloads:

  • .new(type:, id:, action:, expires_at:, opened_at:, reason:) ⇒ Anthropic::UserProfileEnforcementActionRestriction

    Parameters:

    • type: (:restriction, "restriction")
    • id: (String)
    • action: (Anthropic::Models::user_profile_enforcement_action_next_step, nil)
    • expires_at: (Time, nil)
    • opened_at: (Time)
    • reason: (Anthropic::Models::user_profile_enforcement_action_reason)

    Returns:

  • .new(type:, id:, action:, expires_at:, opened_at:, reason:) ⇒ Anthropic::UserProfileEnforcementActionBan

    Parameters:

    • type: (:ban, "ban")
    • id: (String)
    • action: (Anthropic::Models::user_profile_enforcement_action_next_step, nil)
    • expires_at: (Time, nil)
    • opened_at: (Time)
    • reason: (Anthropic::Models::user_profile_enforcement_action_reason)

    Returns:

  • .new(type:, id:, action:, expires_at:, opened_at:, reason:) ⇒ Anthropic::Models::user_profile_enforcement_action

    Parameters:

    • type: (Anthropic::Models::UserProfileEnforcementAction::type_, String)
    • id: (String)
    • action: (Anthropic::Models::user_profile_enforcement_action_next_step, nil)
    • expires_at: (Time, nil)
    • opened_at: (Time)
    • reason: (Anthropic::Models::user_profile_enforcement_action_reason)

    Returns:

    • (Anthropic::Models::user_profile_enforcement_action)

Parameters:

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

    Attributes for the chosen variant.

    @option args [String] :id The action's ID (enac_...), stable while the action is open.

    @option args [Symbol, Anthropic::Models::UserProfileEnforcementActionNextStep, nil] :action The next step on the action: verify or null. verify: the end user can clea

    @option args [Time, nil] :expires_at When the action ends on its own, in RFC 3339 format; it stops showing once this

    @option args [Time] :opened_at When Anthropic opened the action, in RFC 3339 format.

    @option args [Symbol, Anthropic::Models::UserProfileEnforcementActionReason] :reason Why Anthropic placed the limit: unsupported_region, fraud_or_abuse,

Returns:

Raises:

  • (ArgumentError)


54
55
56
57
58
59
60
61
62
63
# File 'lib/anthropic/models/user_profile_enforcement_action.rb', line 54

def self.new(type:, **args)
  case type.to_sym
  when :restriction
    Anthropic::UserProfileEnforcementActionRestriction.new(**args)
  when :ban
    Anthropic::UserProfileEnforcementActionBan.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/user_profile_enforcement_action.rb', line 25

.variants ⇒ Array(Anthropic::Models::UserProfileEnforcementActionRestriction, Anthropic::Models::UserProfileEnforcementActionBan)



# File 'lib/anthropic/models/user_profile_enforcement_action.rb', line 29