foundry_dev_tools.resources.resource module#

Resource helper class.

class foundry_dev_tools.resources.resource.Resource[source]#

Bases: object

Not intended to be initialized directly. Use Resource.from_rid() or Resource.from_path() instead.

rid: api_types.Rid#
name: str#
path: api_types.FoundryPath#
created: api_types.Attribution | None#
modified: api_types.Attribution | None#
last_modified: float | None#
directly_trashed: bool#
is_autosave: bool#
is_hidden: bool#
operations: set[str] | None#
url_variables: dict[str, str]#
description: str | None = None#
favorite: bool | None = None#
branches: set[api_types.CompassBranch] | None = None#
default_branch: api_types.CompassBranch | None = None#
default_branch_with_markings: api_types.BranchWithMarkings | None = None#
branches_count: int | None = None#
has_branches: bool | None = None#
has_multiple_branches: bool | None = None#
backed_object_types: set[api_types.BackedObjectTypeInfo] | None = None#
long_description: str | None = None#
in_trash: bool | None = None#
deprecation: api_types.Deprecation | None = None#
collections: set[str] | None = None#
named_collections: set[api_types.NamedResourceIdentifier] | None = None#
tags: set[str] | None = None#
named_tags: set[api_types.NamedResourceIdentifier] | None = None#
alias: str | None = None#
collaborators: set[api_types.Attribution] | None = None#
named_ancestors: list[api_types.NamedResourceIdentifier] | None = None#
markings: set[api_types.MarkingInfo] | None = None#
project_access_markings: set[api_types.MarkingInfo] | None = None#
linked_items: set[api_types.LinkedItem] | None = None#
contact_information: api_types.ContactInformation | None = None#
classification: api_types.Classification | None = None#
disable_inherited_permissions: api_types.DisableInheritedPermissionsType | None = None#
propagate_permissions: bool | None = None#
resource_level_role_grants_allowed: bool | None = None#
rid_start: ClassVar[str] = ''#
__init__(*args, **kwargs)[source]#

Not intended to be initialized directly. Use Resource.from_rid() or Resource.from_path() instead.

classmethod from_path(context, path, /, *, decoration=None, **_kwargs)[source]#

Returns resource at path.

Parameters:
  • context (FoundryContext) – the foundry context for the resource

  • path (api_types.FoundryPath) – the path where the resource is located on foundry

  • decoration (api_types.ResourceDecorationSetAll | None) – extra decoration for this resource

  • **_kwargs – not used in base class

Return type:

Self

classmethod from_rid(context, rid, /, *, decoration=None, **_kwargs)[source]#

Returns resource from rid.

Parameters:
  • context (FoundryContext) – the foundry context for the resource

  • rid (api_types.Rid) – the rid of the resource on foundry

  • decoration (api_types.ResourceDecorationSetAll | None) – extra decoration for this resource

  • **_kwargs – not used in base class

Return type:

Self

add_to_trash()[source]#

Adds resource to trash.

Return type:

Self

restore()[source]#

Restores resource from trash.

Return type:

Self

delete_permanently()[source]#

Deletes resource permanently.

Return type:

Self

sync()[source]#

Fetches the attributes again.

Return type:

Self