Module: Anthropic::Models::Beta::Organization::RBACRoles::BetaRBACRolePermission::Resource

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

Overview

What the permission applies to.

A tagged union: type names the kind of resource and determines which identifier fields are present.

See Also:

  • Anthropic::Models::Beta::Organization::RBACRoles::BetaRBACRolePermission#resource

Defined Under Namespace

Modules: Type

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::Organization::RBACRoles::BetaRBACOrganizationPermissionResource, ...

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::Beta::Organization::RBACRoles::BetaRBACRolePermission::Resource for more details.

Parameters:

  • type (Symbol, Anthropic::Models::Beta::Organization::RBACRoles::BetaRBACRolePermission::Resource::Type, String)
  • args (Hash{Symbol=>Object}) —

    Attributes for the chosen variant.

    @option args [String] :organization_id UUID of the organization the permission applies to.

    @option args [String] :connector_id ID of the connector the permission applies to.

    @option args [String] :tool_name Published name of the connector tool the permission applies to.

    @option args [String] :scope OAuth scope the permission names — the role may receive this scope when

Returns:

Raises:

  • (ArgumentError)


122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/anthropic/models/beta/organization/rbac_roles/beta_rbac_role_permission.rb', line 122

def self.new(type:, **args)
  case type.to_sym
  when :organization
    Anthropic::Beta::Organization::RBACRoles::BetaRBACOrganizationPermissionResource.new(**args)
  when :connector_tool
    Anthropic::Beta::Organization::RBACRoles::BetaRBACConnectorToolPermissionResource.new(**args)
  when :connector_scope
    Anthropic::Beta::Organization::RBACRoles::BetaRBACConnectorScopePermissionResource.new(**args)
  when :connector
    Anthropic::Beta::Organization::RBACRoles::BetaRBACConnectorPermissionResource.new(**args)
  when :all_connectors
    Anthropic::Beta::Organization::RBACRoles::BetaRBACAllConnectorsPermissionResource.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta/organization/rbac_roles/beta_rbac_role_permission.rb', line 94

Instance Method Details

#self?.variants ⇒ ::Array[Anthropic::Models::Beta::Organization::RBACRoles::BetaRBACRolePermission::resource]

Returns:

  • (::Array[Anthropic::Models::Beta::Organization::RBACRoles::BetaRBACRolePermission::resource])


61
# File 'sig/anthropic/models/beta/organization/rbac_roles/beta_rbac_role_permission.rbs', line 61

def self?.variants: -> ::Array[Anthropic::Models::Beta::Organization::RBACRoles::BetaRBACRolePermission::resource]