Skip to content

cmem_client.models.resource¤

A file resource model

A resource is a file inside a DataIntegration project, such as the CSV a dataset reads from. The files of all projects are the items of client.files, keyed by {project_id}:{file_id}.

Classes:

Resource¤

Bases: Model, ReadRepositoryItem

A file resource.

Attributes:

  • file_id (str) – ID of the file, unique within its project.
  • project_id (str) – ID of the project holding the file.
  • name (str | None) – Name of the file, or None if the deployment did not report it.
  • full_path (str | None) – Path of the file inside the project.
  • modified (str | None) – When the file was last modified.
  • size (int | None) – Size of the file in bytes.

Functions:

  • get_id – Get the resource ID in format ‘project_id:file_id’

file_id¤

file_id: str

full_path¤

full_path: str | None = Field(alias='fullPath', default=None)

get_id¤

get_id()

Get the resource ID in format ‘project_id:file_id’

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

modified¤

modified: str | None = None

name¤

name: str | None = None

project_id¤

project_id: str

size¤

size: int | None = None

ResourceMetadata¤

Bases: Model

Resource metadata

Attributes:

  • name (str) – Name of the file.
  • relative_path (str) – Path of the file relative to the project.
  • absolute_path (str) – Path of the file on the deployment.
  • size (int) – Size of the file in bytes.
  • modified (str) – When the file was last modified.

absolute_path¤

absolute_path: str = Field(alias='absolutePath')

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

modified¤

modified: str

name¤

name: str

relative_path¤

relative_path: str = Field(alias='relativePath')

size¤

size: int

ResourceResponse¤

Bases: Model

API response model for a file resource

Attributes:

  • name (str) – Name of the file.
  • full_path (str) – Path of the file inside the project.
  • modified (str) – When the file was last modified.
  • size (int) – Size of the file in bytes.

full_path¤

full_path: str = Field(alias='fullPath')

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

modified¤

modified: str

name¤

name: str

size¤

size: int

ResourceUsage¤

Bases: Model

Resource usage

Attributes:

  • id (str) – ID of the task using the file.
  • label (str) – Human readable name of that task.
  • task_type (str) – Kind of task using the file, e.g. Dataset.

id¤

id: str

label¤

label: str

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

task_type¤

task_type: str = Field(alias='taskType')

Comments