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()
orResource.from_path()
instead.- rid: api_types.Rid#
- path: api_types.FoundryPath#
- created: api_types.Attribution | None#
- modified: api_types.Attribution | None#
- branches: set[api_types.CompassBranch] | None = None#
- default_branch: api_types.CompassBranch | None = None#
- default_branch_with_markings: api_types.BranchWithMarkings | None = None#
- backed_object_types: set[api_types.BackedObjectTypeInfo] | None = None#
- deprecation: api_types.Deprecation | None = None#
- named_collections: set[api_types.NamedResourceIdentifier] | None = None#
- named_tags: set[api_types.NamedResourceIdentifier] | 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#
- __init__(*args, **kwargs)[source]#
Not intended to be initialized directly. Use
Resource.from_rid()
orResource.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