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_idstrpathrequiredReturns: ResultsResponse[GraphSnapshotFile]
show properties (1)hide properties (1)
resultsarray of GraphSnapshotFileshow properties (10)hide properties (10)
idstringrequiredlanguageLanguagerequiredpathstringrequiredcontent_hashstringrequiredis_dependencybooleanis_configbooleanis_testbooleanis_scriptbooleanlabelsarray of stringinclude_in_graphbooleanget
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_idstrpathrequiredfile_idstrpathrequiredReturns: GraphSnapshotFile
show properties (10)hide properties (10)
idstringrequiredlanguageLanguagerequiredpathstringrequiredcontent_hashstringrequiredis_dependencybooleanis_configbooleanis_testbooleanis_scriptbooleanlabelsarray of stringinclude_in_graphbooleancontent
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_idstrpathrequiredfile_idstrpathrequiredReturns: str

