Graph Files

Python SDK reference for the codes.files resource

Warning

The SDKs are in research preview. Their interfaces may change between minor versions until 1.0.

Access this resource from client.codes.files. Both async and sync clients expose the same methods.

list

GET /v1/codes/{code_id}/files

result = await client.codes.files.list(
    code_id=code_id,
)

Arguments:

code_idstrpathrequired

Returns: ResultsResponse[GraphSnapshotFile]

show properties (1)hide properties (1)
resultsarray of GraphSnapshotFile
show properties (10)hide properties (10)
idstringrequired
languageLanguagerequired
pathstringrequired
content_hashstringrequired
is_dependencyboolean
is_configboolean
is_testboolean
is_scriptboolean
labelsarray of string
include_in_graphboolean

get

GET /v1/codes/{code_id}/files/{file_id}

A file's metadata.

result = await client.codes.files.get(
    code_id=code_id,
    file_id=file_id,
)

Arguments:

code_idstrpathrequired
file_idstrpathrequired

Returns: GraphSnapshotFile

show properties (10)hide properties (10)
idstringrequired
languageLanguagerequired
pathstringrequired
content_hashstringrequired
is_dependencyboolean
is_configboolean
is_testboolean
is_scriptboolean
labelsarray of string
include_in_graphboolean

content

GET /v1/codes/{code_id}/files/{file_id}/content

A file's text.

result = await client.codes.files.content(
    code_id=code_id,
    file_id=file_id,
)

Arguments:

code_idstrpathrequired
file_idstrpathrequired

Returns: str

On this page