types

Public data types returned by Modal APIs.

BillingReportItem 

Costs generated by a specific object during a specific time interval.

Attributes

object_id str
description str
environment_name str
interval_start datetime
cost Decimal
cost_by_resource dict[str, Decimal]
tags dict[str, str]

DictInfo 

Information about a Dict object.

Attributes

name str | None
created_at datetime
created_by str | None

FileEntry 

A file or directory entry listed from a Modal volume.

Attributes

path str
type FileEntryType
mtime int
size int

FileEntryType 

class FileEntryType(enum.IntEnum)

Type of a file entry listed from a Modal volume.

The possible values are:

  • UNSPECIFIED
  • FILE
  • DIRECTORY
  • SYMLINK
  • FIFO
  • SOCKET

FileInfo 

Metadata for a file or directory entry in a Sandbox.

Attributes

name str
path str
type FileType
size int
mode int
permissions str
owner str
group str
modified_time float
symlink_target str | None

is_file 

is_file(self)

Return True if this entry is a regular file.

is_dir 

is_dir(self)

Return True if this entry is a directory.

is_symlink(self)

Return True if this entry is a symbolic link.

FileType 

class FileType(enum.Enum)

Type of a filesystem entry.

The possible values are:

  • FILE
  • DIRECTORY
  • SYMLINK

FileWatchEvent 

A filesystem change event reported by Sandbox.filesystem.watch().

paths contains the absolute path(s) affected by the event. For most event types it holds a single entry. Rename operations are reported as Modify events: when both the source and destination fall within the watched scope, paths holds [source, destination]; when only one side of the rename is visible, paths holds that single path.

Attributes

paths list[str]
type FileWatchEventType

FileWatchEventType 

class FileWatchEventType(enum.Enum)

Type of a filesystem watch event reported by Sandbox.filesystem.watch().

The possible values are:

  • Unknown
  • Access
  • Create
  • Modify
  • Remove

FunctionStats 

Simple data structure storing stats for a running function.

Attributes

backlog int
num_total_runners int
num_running_inputs int
input_headroom int

InputInfo 

Simple data structure storing information about a function input.

Attributes

input_id str
function_call_id str
task_id str
status InputStatus
function_name str
module_name str
children list["InputInfo"]

InputStatus 

class InputStatus(enum.IntEnum)

Enum representing status of a function input.

The possible values are:

  • PENDING
  • SUCCESS
  • FAILURE
  • INIT_FAILURE
  • TERMINATED
  • TIMEOUT

ProxyTokenInfo 

Metadata about a proxy token, not including the token secret.

Attributes

token_id str
created_at datetime
scoped bool

QueueInfo 

Information about a Queue object.

Attributes

name str | None
created_at datetime
created_by str | None

SandboxConnectCredentials 

Simple data structure storing credentials for making HTTP connections to a sandbox.

Attributes

url str
token str

SecretInfo 

Information about a Secret object.

Attributes

name str | None
created_at datetime
created_by str | None

TokenData 

A token ID / secret pair.

Attributes

token_id str
token_secret str

VolumeCreateOptions 

Options used when creating a Volume.

Attributes

experimental_options NotRequired[dict[str, Any]]

VolumeInfo 

Information about a Volume object.

Attributes

name str | None
created_at datetime
created_by str | None

WorkspaceMemberInfo 

Metadata about a Workspace member.

Attributes

name str
email str
user_id str
role str
joined_at datetime
last_active_at Optional[datetime]

WorkspaceSettings 

Current settings for the workspace.

Attributes

default_environment str
image_builder_version str