archastro.platform.v1.resources.artifacts
1# Copyright (c) 2026 ArchAstro Inc. All Rights Reserved. 2# This file is auto-generated by @archastro/sdk-generator. Do not edit. 3# Content hash: 5f178ebddcbe 4 5from __future__ import annotations 6 7from typing import Required, TypedDict 8 9from ...runtime.http_client import HttpClient, SyncHttpClient 10from ...types.artifacts import Artifact 11 12 13class ArtifactReplaceInputFile(TypedDict, total=False): 14 data: Required[str] 15 "Base64-encoded binary content." 16 filename: str | None 17 "Original filename for the uploaded file." 18 mime_type: str | None 19 "MIME type of the uploaded file." 20 21 22class ArtifactReplaceInput(TypedDict, total=False): 23 "Update an artifact" 24 25 description: str | None 26 "New description for the artifact. Omit to leave the existing description unchanged." 27 file: ArtifactReplaceInputFile | None 28 "Replacement file payload. Omit to leave the current file unchanged." 29 file_content: str | None 30 "Legacy flat Base64 file content. Prefer `file.data`." 31 file_content_type: str | None 32 "Legacy flat MIME type. Prefer `file.mime_type`." 33 file_name: str | None 34 "Legacy flat filename. Prefer `file.filename`." 35 from_version: Required[int] 36 "The artifact's current version number, used for optimistic concurrency control. Returns 409 if this value does not match the server's current version." 37 name: str | None 38 "New display name for the artifact. Omit to leave the existing name unchanged." 39 40 41class AsyncArtifactResource: 42 def __init__(self, http: HttpClient): 43 self._http = http 44 45 async def delete(self, artifact: str) -> None: 46 """ 47 Delete an artifact 48 Permanently deletes the artifact and all associated file versions. This 49 operation is irreversible deleted artifacts and their file content cannot 50 be recovered. 51 The authenticated user must have write access to the artifact's owning team 52 or organization. Returns 404 if the artifact does not exist or is not 53 accessible to the caller. 54 55 Args: 56 artifact: Artifact ID (`art_...`) of the artifact to delete. 57 58 Returns: 59 Empty body. HTTP 204 indicates the artifact and all associated file versions were permanently deleted. 60 """ 61 await self._http.request(f"/api/v1/artifacts/{artifact}", method="DELETE") 62 63 async def get(self, artifact: str) -> Artifact: 64 """ 65 Retrieve an artifact 66 Returns the artifact identified by `artifact`. The response includes metadata 67 such as name, description, version, and a signed `file_url` for downloading 68 the current file version. Image artifacts also include an `image_source` object 69 with display-ready metadata. 70 The authenticated user must have read access to the artifact's owning team or 71 organization. Returns 404 if the artifact does not exist or is not accessible 72 to the caller. 73 74 Args: 75 artifact: Artifact ID (`art_...`) of the artifact to retrieve. 76 77 Returns: 78 The requested artifact, including its current version's file metadata and signed download URL. 79 """ 80 return await self._http.request(f"/api/v1/artifacts/{artifact}", response_type=Artifact) 81 82 async def replace(self, artifact: str, input: ArtifactReplaceInput) -> Artifact: 83 """ 84 Update an artifact 85 Updates the metadata and, optionally, the file content of an existing artifact. 86 This endpoint uses optimistic concurrency control: you must supply the artifact's 87 current `version` number as `from_version`. If another update has incremented the 88 version since you last fetched the artifact, the request returns 409. 89 To replace the artifact's file, include a nested `file` object with Base64 90 `data`, `filename`, and `mime_type`. Omitting `file` leaves the existing file 91 unchanged. The authenticated user or developer must have write access to the 92 artifact's owner. 93 94 Args: 95 artifact: Artifact ID (`art_...`) of the artifact to update. 96 input: Request body. 97 input.description: New description for the artifact. Omit to leave the existing description unchanged. 98 input.file: Replacement file payload. Omit to leave the current file unchanged. 99 input.file_content: Legacy flat Base64 file content. Prefer `file.data`. 100 input.file_content_type: Legacy flat MIME type. Prefer `file.mime_type`. 101 input.file_name: Legacy flat filename. Prefer `file.filename`. 102 input.from_version: The artifact's current version number, used for optimistic concurrency control. Returns 409 if this value does not match the server's current version. 103 input.name: New display name for the artifact. Omit to leave the existing name unchanged. 104 105 Returns: 106 The artifact after applying the update, reflecting the new version number and any changed metadata or file. 107 """ 108 return await self._http.request( 109 f"/api/v1/artifacts/{artifact}", 110 method="PUT", 111 body=input, 112 response_type=Artifact, 113 ) 114 115 async def archive(self, artifact: str) -> None: 116 """ 117 Archive an artifact 118 Soft-deletes the artifact identified by `artifact`. The artifact record is 119 retained in storage but is no longer returned by the list or show endpoints. 120 The authenticated user must have write access to the artifact's owning team or 121 organization. Attempting to archive an artifact you do not own returns 403. 122 Attempting to archive an artifact that does not exist or is already archived 123 returns 404. 124 125 Args: 126 artifact: Artifact ID (`art_...`) of the artifact to archive. 127 128 Returns: 129 Returns 204 No Content on success. The artifact is soft-deleted and no longer accessible through the API. 130 """ 131 await self._http.request(f"/api/v1/artifacts/{artifact}/archive", method="POST") 132 133 async def content(self, artifact: str, *, version: int | None = None) -> dict[str, str]: 134 """ 135 Retrieve raw artifact file content 136 Returns the raw binary content of the file stored for the specified artifact. 137 The response `Content-Type` header reflects the artifact file's MIME type, so 138 you can pipe the response body directly to disk or display it in a browser. 139 By default the endpoint serves the artifact's current version. Pass the 140 `version` parameter to retrieve a specific historical version. The authenticated 141 user must have read access to the artifact's owning team or organization. 142 143 Args: 144 artifact: Artifact ID (`art_...`) of the artifact whose content to retrieve. 145 version: Version number to retrieve. Omit to return the artifact's current version. 146 147 Returns: 148 Raw binary content of the artifact file. The `Content-Type` header is set to the artifact's stored MIME type. 149 """ 150 query: dict[str, object] = {} 151 if version is not None: 152 query["version"] = version 153 return await self._http.request_raw(f"/api/v1/artifacts/{artifact}/content", query=query) 154 155 156class ArtifactResource: 157 def __init__(self, http: SyncHttpClient): 158 self._http = http 159 160 def delete(self, artifact: str) -> None: 161 """ 162 Delete an artifact 163 Permanently deletes the artifact and all associated file versions. This 164 operation is irreversible deleted artifacts and their file content cannot 165 be recovered. 166 The authenticated user must have write access to the artifact's owning team 167 or organization. Returns 404 if the artifact does not exist or is not 168 accessible to the caller. 169 170 Args: 171 artifact: Artifact ID (`art_...`) of the artifact to delete. 172 173 Returns: 174 Empty body. HTTP 204 indicates the artifact and all associated file versions were permanently deleted. 175 """ 176 self._http.request(f"/api/v1/artifacts/{artifact}", method="DELETE") 177 178 def get(self, artifact: str) -> Artifact: 179 """ 180 Retrieve an artifact 181 Returns the artifact identified by `artifact`. The response includes metadata 182 such as name, description, version, and a signed `file_url` for downloading 183 the current file version. Image artifacts also include an `image_source` object 184 with display-ready metadata. 185 The authenticated user must have read access to the artifact's owning team or 186 organization. Returns 404 if the artifact does not exist or is not accessible 187 to the caller. 188 189 Args: 190 artifact: Artifact ID (`art_...`) of the artifact to retrieve. 191 192 Returns: 193 The requested artifact, including its current version's file metadata and signed download URL. 194 """ 195 return self._http.request(f"/api/v1/artifacts/{artifact}", response_type=Artifact) 196 197 def replace(self, artifact: str, input: ArtifactReplaceInput) -> Artifact: 198 """ 199 Update an artifact 200 Updates the metadata and, optionally, the file content of an existing artifact. 201 This endpoint uses optimistic concurrency control: you must supply the artifact's 202 current `version` number as `from_version`. If another update has incremented the 203 version since you last fetched the artifact, the request returns 409. 204 To replace the artifact's file, include a nested `file` object with Base64 205 `data`, `filename`, and `mime_type`. Omitting `file` leaves the existing file 206 unchanged. The authenticated user or developer must have write access to the 207 artifact's owner. 208 209 Args: 210 artifact: Artifact ID (`art_...`) of the artifact to update. 211 input: Request body. 212 input.description: New description for the artifact. Omit to leave the existing description unchanged. 213 input.file: Replacement file payload. Omit to leave the current file unchanged. 214 input.file_content: Legacy flat Base64 file content. Prefer `file.data`. 215 input.file_content_type: Legacy flat MIME type. Prefer `file.mime_type`. 216 input.file_name: Legacy flat filename. Prefer `file.filename`. 217 input.from_version: The artifact's current version number, used for optimistic concurrency control. Returns 409 if this value does not match the server's current version. 218 input.name: New display name for the artifact. Omit to leave the existing name unchanged. 219 220 Returns: 221 The artifact after applying the update, reflecting the new version number and any changed metadata or file. 222 """ 223 return self._http.request( 224 f"/api/v1/artifacts/{artifact}", 225 method="PUT", 226 body=input, 227 response_type=Artifact, 228 ) 229 230 def archive(self, artifact: str) -> None: 231 """ 232 Archive an artifact 233 Soft-deletes the artifact identified by `artifact`. The artifact record is 234 retained in storage but is no longer returned by the list or show endpoints. 235 The authenticated user must have write access to the artifact's owning team or 236 organization. Attempting to archive an artifact you do not own returns 403. 237 Attempting to archive an artifact that does not exist or is already archived 238 returns 404. 239 240 Args: 241 artifact: Artifact ID (`art_...`) of the artifact to archive. 242 243 Returns: 244 Returns 204 No Content on success. The artifact is soft-deleted and no longer accessible through the API. 245 """ 246 self._http.request(f"/api/v1/artifacts/{artifact}/archive", method="POST") 247 248 def content(self, artifact: str, *, version: int | None = None) -> dict[str, str]: 249 """ 250 Retrieve raw artifact file content 251 Returns the raw binary content of the file stored for the specified artifact. 252 The response `Content-Type` header reflects the artifact file's MIME type, so 253 you can pipe the response body directly to disk or display it in a browser. 254 By default the endpoint serves the artifact's current version. Pass the 255 `version` parameter to retrieve a specific historical version. The authenticated 256 user must have read access to the artifact's owning team or organization. 257 258 Args: 259 artifact: Artifact ID (`art_...`) of the artifact whose content to retrieve. 260 version: Version number to retrieve. Omit to return the artifact's current version. 261 262 Returns: 263 Raw binary content of the artifact file. The `Content-Type` header is set to the artifact's stored MIME type. 264 """ 265 query: dict[str, object] = {} 266 if version is not None: 267 query["version"] = version 268 return self._http.request_raw(f"/api/v1/artifacts/{artifact}/content", query=query)
23class ArtifactReplaceInput(TypedDict, total=False): 24 "Update an artifact" 25 26 description: str | None 27 "New description for the artifact. Omit to leave the existing description unchanged." 28 file: ArtifactReplaceInputFile | None 29 "Replacement file payload. Omit to leave the current file unchanged." 30 file_content: str | None 31 "Legacy flat Base64 file content. Prefer `file.data`." 32 file_content_type: str | None 33 "Legacy flat MIME type. Prefer `file.mime_type`." 34 file_name: str | None 35 "Legacy flat filename. Prefer `file.filename`." 36 from_version: Required[int] 37 "The artifact's current version number, used for optimistic concurrency control. Returns 409 if this value does not match the server's current version." 38 name: str | None 39 "New display name for the artifact. Omit to leave the existing name unchanged."
Update an artifact
New description for the artifact. Omit to leave the existing description unchanged.
Replacement file payload. Omit to leave the current file unchanged.
42class AsyncArtifactResource: 43 def __init__(self, http: HttpClient): 44 self._http = http 45 46 async def delete(self, artifact: str) -> None: 47 """ 48 Delete an artifact 49 Permanently deletes the artifact and all associated file versions. This 50 operation is irreversible deleted artifacts and their file content cannot 51 be recovered. 52 The authenticated user must have write access to the artifact's owning team 53 or organization. Returns 404 if the artifact does not exist or is not 54 accessible to the caller. 55 56 Args: 57 artifact: Artifact ID (`art_...`) of the artifact to delete. 58 59 Returns: 60 Empty body. HTTP 204 indicates the artifact and all associated file versions were permanently deleted. 61 """ 62 await self._http.request(f"/api/v1/artifacts/{artifact}", method="DELETE") 63 64 async def get(self, artifact: str) -> Artifact: 65 """ 66 Retrieve an artifact 67 Returns the artifact identified by `artifact`. The response includes metadata 68 such as name, description, version, and a signed `file_url` for downloading 69 the current file version. Image artifacts also include an `image_source` object 70 with display-ready metadata. 71 The authenticated user must have read access to the artifact's owning team or 72 organization. Returns 404 if the artifact does not exist or is not accessible 73 to the caller. 74 75 Args: 76 artifact: Artifact ID (`art_...`) of the artifact to retrieve. 77 78 Returns: 79 The requested artifact, including its current version's file metadata and signed download URL. 80 """ 81 return await self._http.request(f"/api/v1/artifacts/{artifact}", response_type=Artifact) 82 83 async def replace(self, artifact: str, input: ArtifactReplaceInput) -> Artifact: 84 """ 85 Update an artifact 86 Updates the metadata and, optionally, the file content of an existing artifact. 87 This endpoint uses optimistic concurrency control: you must supply the artifact's 88 current `version` number as `from_version`. If another update has incremented the 89 version since you last fetched the artifact, the request returns 409. 90 To replace the artifact's file, include a nested `file` object with Base64 91 `data`, `filename`, and `mime_type`. Omitting `file` leaves the existing file 92 unchanged. The authenticated user or developer must have write access to the 93 artifact's owner. 94 95 Args: 96 artifact: Artifact ID (`art_...`) of the artifact to update. 97 input: Request body. 98 input.description: New description for the artifact. Omit to leave the existing description unchanged. 99 input.file: Replacement file payload. Omit to leave the current file unchanged. 100 input.file_content: Legacy flat Base64 file content. Prefer `file.data`. 101 input.file_content_type: Legacy flat MIME type. Prefer `file.mime_type`. 102 input.file_name: Legacy flat filename. Prefer `file.filename`. 103 input.from_version: The artifact's current version number, used for optimistic concurrency control. Returns 409 if this value does not match the server's current version. 104 input.name: New display name for the artifact. Omit to leave the existing name unchanged. 105 106 Returns: 107 The artifact after applying the update, reflecting the new version number and any changed metadata or file. 108 """ 109 return await self._http.request( 110 f"/api/v1/artifacts/{artifact}", 111 method="PUT", 112 body=input, 113 response_type=Artifact, 114 ) 115 116 async def archive(self, artifact: str) -> None: 117 """ 118 Archive an artifact 119 Soft-deletes the artifact identified by `artifact`. The artifact record is 120 retained in storage but is no longer returned by the list or show endpoints. 121 The authenticated user must have write access to the artifact's owning team or 122 organization. Attempting to archive an artifact you do not own returns 403. 123 Attempting to archive an artifact that does not exist or is already archived 124 returns 404. 125 126 Args: 127 artifact: Artifact ID (`art_...`) of the artifact to archive. 128 129 Returns: 130 Returns 204 No Content on success. The artifact is soft-deleted and no longer accessible through the API. 131 """ 132 await self._http.request(f"/api/v1/artifacts/{artifact}/archive", method="POST") 133 134 async def content(self, artifact: str, *, version: int | None = None) -> dict[str, str]: 135 """ 136 Retrieve raw artifact file content 137 Returns the raw binary content of the file stored for the specified artifact. 138 The response `Content-Type` header reflects the artifact file's MIME type, so 139 you can pipe the response body directly to disk or display it in a browser. 140 By default the endpoint serves the artifact's current version. Pass the 141 `version` parameter to retrieve a specific historical version. The authenticated 142 user must have read access to the artifact's owning team or organization. 143 144 Args: 145 artifact: Artifact ID (`art_...`) of the artifact whose content to retrieve. 146 version: Version number to retrieve. Omit to return the artifact's current version. 147 148 Returns: 149 Raw binary content of the artifact file. The `Content-Type` header is set to the artifact's stored MIME type. 150 """ 151 query: dict[str, object] = {} 152 if version is not None: 153 query["version"] = version 154 return await self._http.request_raw(f"/api/v1/artifacts/{artifact}/content", query=query)
46 async def delete(self, artifact: str) -> None: 47 """ 48 Delete an artifact 49 Permanently deletes the artifact and all associated file versions. This 50 operation is irreversible deleted artifacts and their file content cannot 51 be recovered. 52 The authenticated user must have write access to the artifact's owning team 53 or organization. Returns 404 if the artifact does not exist or is not 54 accessible to the caller. 55 56 Args: 57 artifact: Artifact ID (`art_...`) of the artifact to delete. 58 59 Returns: 60 Empty body. HTTP 204 indicates the artifact and all associated file versions were permanently deleted. 61 """ 62 await self._http.request(f"/api/v1/artifacts/{artifact}", method="DELETE")
Delete an artifact Permanently deletes the artifact and all associated file versions. This operation is irreversible deleted artifacts and their file content cannot be recovered. The authenticated user must have write access to the artifact's owning team or organization. Returns 404 if the artifact does not exist or is not accessible to the caller.
Arguments:
- artifact: Artifact ID (
art_...) of the artifact to delete.
Returns:
Empty body. HTTP 204 indicates the artifact and all associated file versions were permanently deleted.
64 async def get(self, artifact: str) -> Artifact: 65 """ 66 Retrieve an artifact 67 Returns the artifact identified by `artifact`. The response includes metadata 68 such as name, description, version, and a signed `file_url` for downloading 69 the current file version. Image artifacts also include an `image_source` object 70 with display-ready metadata. 71 The authenticated user must have read access to the artifact's owning team or 72 organization. Returns 404 if the artifact does not exist or is not accessible 73 to the caller. 74 75 Args: 76 artifact: Artifact ID (`art_...`) of the artifact to retrieve. 77 78 Returns: 79 The requested artifact, including its current version's file metadata and signed download URL. 80 """ 81 return await self._http.request(f"/api/v1/artifacts/{artifact}", response_type=Artifact)
Retrieve an artifact
Returns the artifact identified by artifact. The response includes metadata
such as name, description, version, and a signed file_url for downloading
the current file version. Image artifacts also include an image_source object
with display-ready metadata.
The authenticated user must have read access to the artifact's owning team or
organization. Returns 404 if the artifact does not exist or is not accessible
to the caller.
Arguments:
- artifact: Artifact ID (
art_...) of the artifact to retrieve.
Returns:
The requested artifact, including its current version's file metadata and signed download URL.
83 async def replace(self, artifact: str, input: ArtifactReplaceInput) -> Artifact: 84 """ 85 Update an artifact 86 Updates the metadata and, optionally, the file content of an existing artifact. 87 This endpoint uses optimistic concurrency control: you must supply the artifact's 88 current `version` number as `from_version`. If another update has incremented the 89 version since you last fetched the artifact, the request returns 409. 90 To replace the artifact's file, include a nested `file` object with Base64 91 `data`, `filename`, and `mime_type`. Omitting `file` leaves the existing file 92 unchanged. The authenticated user or developer must have write access to the 93 artifact's owner. 94 95 Args: 96 artifact: Artifact ID (`art_...`) of the artifact to update. 97 input: Request body. 98 input.description: New description for the artifact. Omit to leave the existing description unchanged. 99 input.file: Replacement file payload. Omit to leave the current file unchanged. 100 input.file_content: Legacy flat Base64 file content. Prefer `file.data`. 101 input.file_content_type: Legacy flat MIME type. Prefer `file.mime_type`. 102 input.file_name: Legacy flat filename. Prefer `file.filename`. 103 input.from_version: The artifact's current version number, used for optimistic concurrency control. Returns 409 if this value does not match the server's current version. 104 input.name: New display name for the artifact. Omit to leave the existing name unchanged. 105 106 Returns: 107 The artifact after applying the update, reflecting the new version number and any changed metadata or file. 108 """ 109 return await self._http.request( 110 f"/api/v1/artifacts/{artifact}", 111 method="PUT", 112 body=input, 113 response_type=Artifact, 114 )
Update an artifact
Updates the metadata and, optionally, the file content of an existing artifact.
This endpoint uses optimistic concurrency control: you must supply the artifact's
current version number as from_version. If another update has incremented the
version since you last fetched the artifact, the request returns 409.
To replace the artifact's file, include a nested file object with Base64
data, filename, and mime_type. Omitting file leaves the existing file
unchanged. The authenticated user or developer must have write access to the
artifact's owner.
Arguments:
- artifact: Artifact ID (
art_...) of the artifact to update. - input: Request body.
- input.description: New description for the artifact. Omit to leave the existing description unchanged.
- input.file: Replacement file payload. Omit to leave the current file unchanged.
- input.file_content: Legacy flat Base64 file content. Prefer
file.data. - input.file_content_type: Legacy flat MIME type. Prefer
file.mime_type. - input.file_name: Legacy flat filename. Prefer
file.filename. - input.from_version: The artifact's current version number, used for optimistic concurrency control. Returns 409 if this value does not match the server's current version.
- input.name: New display name for the artifact. Omit to leave the existing name unchanged.
Returns:
The artifact after applying the update, reflecting the new version number and any changed metadata or file.
116 async def archive(self, artifact: str) -> None: 117 """ 118 Archive an artifact 119 Soft-deletes the artifact identified by `artifact`. The artifact record is 120 retained in storage but is no longer returned by the list or show endpoints. 121 The authenticated user must have write access to the artifact's owning team or 122 organization. Attempting to archive an artifact you do not own returns 403. 123 Attempting to archive an artifact that does not exist or is already archived 124 returns 404. 125 126 Args: 127 artifact: Artifact ID (`art_...`) of the artifact to archive. 128 129 Returns: 130 Returns 204 No Content on success. The artifact is soft-deleted and no longer accessible through the API. 131 """ 132 await self._http.request(f"/api/v1/artifacts/{artifact}/archive", method="POST")
Archive an artifact
Soft-deletes the artifact identified by artifact. The artifact record is
retained in storage but is no longer returned by the list or show endpoints.
The authenticated user must have write access to the artifact's owning team or
organization. Attempting to archive an artifact you do not own returns 403.
Attempting to archive an artifact that does not exist or is already archived
returns 404.
Arguments:
- artifact: Artifact ID (
art_...) of the artifact to archive.
Returns:
Returns 204 No Content on success. The artifact is soft-deleted and no longer accessible through the API.
134 async def content(self, artifact: str, *, version: int | None = None) -> dict[str, str]: 135 """ 136 Retrieve raw artifact file content 137 Returns the raw binary content of the file stored for the specified artifact. 138 The response `Content-Type` header reflects the artifact file's MIME type, so 139 you can pipe the response body directly to disk or display it in a browser. 140 By default the endpoint serves the artifact's current version. Pass the 141 `version` parameter to retrieve a specific historical version. The authenticated 142 user must have read access to the artifact's owning team or organization. 143 144 Args: 145 artifact: Artifact ID (`art_...`) of the artifact whose content to retrieve. 146 version: Version number to retrieve. Omit to return the artifact's current version. 147 148 Returns: 149 Raw binary content of the artifact file. The `Content-Type` header is set to the artifact's stored MIME type. 150 """ 151 query: dict[str, object] = {} 152 if version is not None: 153 query["version"] = version 154 return await self._http.request_raw(f"/api/v1/artifacts/{artifact}/content", query=query)
Retrieve raw artifact file content
Returns the raw binary content of the file stored for the specified artifact.
The response Content-Type header reflects the artifact file's MIME type, so
you can pipe the response body directly to disk or display it in a browser.
By default the endpoint serves the artifact's current version. Pass the
version parameter to retrieve a specific historical version. The authenticated
user must have read access to the artifact's owning team or organization.
Arguments:
- artifact: Artifact ID (
art_...) of the artifact whose content to retrieve. - version: Version number to retrieve. Omit to return the artifact's current version.
Returns:
Raw binary content of the artifact file. The
Content-Typeheader is set to the artifact's stored MIME type.
157class ArtifactResource: 158 def __init__(self, http: SyncHttpClient): 159 self._http = http 160 161 def delete(self, artifact: str) -> None: 162 """ 163 Delete an artifact 164 Permanently deletes the artifact and all associated file versions. This 165 operation is irreversible deleted artifacts and their file content cannot 166 be recovered. 167 The authenticated user must have write access to the artifact's owning team 168 or organization. Returns 404 if the artifact does not exist or is not 169 accessible to the caller. 170 171 Args: 172 artifact: Artifact ID (`art_...`) of the artifact to delete. 173 174 Returns: 175 Empty body. HTTP 204 indicates the artifact and all associated file versions were permanently deleted. 176 """ 177 self._http.request(f"/api/v1/artifacts/{artifact}", method="DELETE") 178 179 def get(self, artifact: str) -> Artifact: 180 """ 181 Retrieve an artifact 182 Returns the artifact identified by `artifact`. The response includes metadata 183 such as name, description, version, and a signed `file_url` for downloading 184 the current file version. Image artifacts also include an `image_source` object 185 with display-ready metadata. 186 The authenticated user must have read access to the artifact's owning team or 187 organization. Returns 404 if the artifact does not exist or is not accessible 188 to the caller. 189 190 Args: 191 artifact: Artifact ID (`art_...`) of the artifact to retrieve. 192 193 Returns: 194 The requested artifact, including its current version's file metadata and signed download URL. 195 """ 196 return self._http.request(f"/api/v1/artifacts/{artifact}", response_type=Artifact) 197 198 def replace(self, artifact: str, input: ArtifactReplaceInput) -> Artifact: 199 """ 200 Update an artifact 201 Updates the metadata and, optionally, the file content of an existing artifact. 202 This endpoint uses optimistic concurrency control: you must supply the artifact's 203 current `version` number as `from_version`. If another update has incremented the 204 version since you last fetched the artifact, the request returns 409. 205 To replace the artifact's file, include a nested `file` object with Base64 206 `data`, `filename`, and `mime_type`. Omitting `file` leaves the existing file 207 unchanged. The authenticated user or developer must have write access to the 208 artifact's owner. 209 210 Args: 211 artifact: Artifact ID (`art_...`) of the artifact to update. 212 input: Request body. 213 input.description: New description for the artifact. Omit to leave the existing description unchanged. 214 input.file: Replacement file payload. Omit to leave the current file unchanged. 215 input.file_content: Legacy flat Base64 file content. Prefer `file.data`. 216 input.file_content_type: Legacy flat MIME type. Prefer `file.mime_type`. 217 input.file_name: Legacy flat filename. Prefer `file.filename`. 218 input.from_version: The artifact's current version number, used for optimistic concurrency control. Returns 409 if this value does not match the server's current version. 219 input.name: New display name for the artifact. Omit to leave the existing name unchanged. 220 221 Returns: 222 The artifact after applying the update, reflecting the new version number and any changed metadata or file. 223 """ 224 return self._http.request( 225 f"/api/v1/artifacts/{artifact}", 226 method="PUT", 227 body=input, 228 response_type=Artifact, 229 ) 230 231 def archive(self, artifact: str) -> None: 232 """ 233 Archive an artifact 234 Soft-deletes the artifact identified by `artifact`. The artifact record is 235 retained in storage but is no longer returned by the list or show endpoints. 236 The authenticated user must have write access to the artifact's owning team or 237 organization. Attempting to archive an artifact you do not own returns 403. 238 Attempting to archive an artifact that does not exist or is already archived 239 returns 404. 240 241 Args: 242 artifact: Artifact ID (`art_...`) of the artifact to archive. 243 244 Returns: 245 Returns 204 No Content on success. The artifact is soft-deleted and no longer accessible through the API. 246 """ 247 self._http.request(f"/api/v1/artifacts/{artifact}/archive", method="POST") 248 249 def content(self, artifact: str, *, version: int | None = None) -> dict[str, str]: 250 """ 251 Retrieve raw artifact file content 252 Returns the raw binary content of the file stored for the specified artifact. 253 The response `Content-Type` header reflects the artifact file's MIME type, so 254 you can pipe the response body directly to disk or display it in a browser. 255 By default the endpoint serves the artifact's current version. Pass the 256 `version` parameter to retrieve a specific historical version. The authenticated 257 user must have read access to the artifact's owning team or organization. 258 259 Args: 260 artifact: Artifact ID (`art_...`) of the artifact whose content to retrieve. 261 version: Version number to retrieve. Omit to return the artifact's current version. 262 263 Returns: 264 Raw binary content of the artifact file. The `Content-Type` header is set to the artifact's stored MIME type. 265 """ 266 query: dict[str, object] = {} 267 if version is not None: 268 query["version"] = version 269 return self._http.request_raw(f"/api/v1/artifacts/{artifact}/content", query=query)
161 def delete(self, artifact: str) -> None: 162 """ 163 Delete an artifact 164 Permanently deletes the artifact and all associated file versions. This 165 operation is irreversible deleted artifacts and their file content cannot 166 be recovered. 167 The authenticated user must have write access to the artifact's owning team 168 or organization. Returns 404 if the artifact does not exist or is not 169 accessible to the caller. 170 171 Args: 172 artifact: Artifact ID (`art_...`) of the artifact to delete. 173 174 Returns: 175 Empty body. HTTP 204 indicates the artifact and all associated file versions were permanently deleted. 176 """ 177 self._http.request(f"/api/v1/artifacts/{artifact}", method="DELETE")
Delete an artifact Permanently deletes the artifact and all associated file versions. This operation is irreversible deleted artifacts and their file content cannot be recovered. The authenticated user must have write access to the artifact's owning team or organization. Returns 404 if the artifact does not exist or is not accessible to the caller.
Arguments:
- artifact: Artifact ID (
art_...) of the artifact to delete.
Returns:
Empty body. HTTP 204 indicates the artifact and all associated file versions were permanently deleted.
179 def get(self, artifact: str) -> Artifact: 180 """ 181 Retrieve an artifact 182 Returns the artifact identified by `artifact`. The response includes metadata 183 such as name, description, version, and a signed `file_url` for downloading 184 the current file version. Image artifacts also include an `image_source` object 185 with display-ready metadata. 186 The authenticated user must have read access to the artifact's owning team or 187 organization. Returns 404 if the artifact does not exist or is not accessible 188 to the caller. 189 190 Args: 191 artifact: Artifact ID (`art_...`) of the artifact to retrieve. 192 193 Returns: 194 The requested artifact, including its current version's file metadata and signed download URL. 195 """ 196 return self._http.request(f"/api/v1/artifacts/{artifact}", response_type=Artifact)
Retrieve an artifact
Returns the artifact identified by artifact. The response includes metadata
such as name, description, version, and a signed file_url for downloading
the current file version. Image artifacts also include an image_source object
with display-ready metadata.
The authenticated user must have read access to the artifact's owning team or
organization. Returns 404 if the artifact does not exist or is not accessible
to the caller.
Arguments:
- artifact: Artifact ID (
art_...) of the artifact to retrieve.
Returns:
The requested artifact, including its current version's file metadata and signed download URL.
198 def replace(self, artifact: str, input: ArtifactReplaceInput) -> Artifact: 199 """ 200 Update an artifact 201 Updates the metadata and, optionally, the file content of an existing artifact. 202 This endpoint uses optimistic concurrency control: you must supply the artifact's 203 current `version` number as `from_version`. If another update has incremented the 204 version since you last fetched the artifact, the request returns 409. 205 To replace the artifact's file, include a nested `file` object with Base64 206 `data`, `filename`, and `mime_type`. Omitting `file` leaves the existing file 207 unchanged. The authenticated user or developer must have write access to the 208 artifact's owner. 209 210 Args: 211 artifact: Artifact ID (`art_...`) of the artifact to update. 212 input: Request body. 213 input.description: New description for the artifact. Omit to leave the existing description unchanged. 214 input.file: Replacement file payload. Omit to leave the current file unchanged. 215 input.file_content: Legacy flat Base64 file content. Prefer `file.data`. 216 input.file_content_type: Legacy flat MIME type. Prefer `file.mime_type`. 217 input.file_name: Legacy flat filename. Prefer `file.filename`. 218 input.from_version: The artifact's current version number, used for optimistic concurrency control. Returns 409 if this value does not match the server's current version. 219 input.name: New display name for the artifact. Omit to leave the existing name unchanged. 220 221 Returns: 222 The artifact after applying the update, reflecting the new version number and any changed metadata or file. 223 """ 224 return self._http.request( 225 f"/api/v1/artifacts/{artifact}", 226 method="PUT", 227 body=input, 228 response_type=Artifact, 229 )
Update an artifact
Updates the metadata and, optionally, the file content of an existing artifact.
This endpoint uses optimistic concurrency control: you must supply the artifact's
current version number as from_version. If another update has incremented the
version since you last fetched the artifact, the request returns 409.
To replace the artifact's file, include a nested file object with Base64
data, filename, and mime_type. Omitting file leaves the existing file
unchanged. The authenticated user or developer must have write access to the
artifact's owner.
Arguments:
- artifact: Artifact ID (
art_...) of the artifact to update. - input: Request body.
- input.description: New description for the artifact. Omit to leave the existing description unchanged.
- input.file: Replacement file payload. Omit to leave the current file unchanged.
- input.file_content: Legacy flat Base64 file content. Prefer
file.data. - input.file_content_type: Legacy flat MIME type. Prefer
file.mime_type. - input.file_name: Legacy flat filename. Prefer
file.filename. - input.from_version: The artifact's current version number, used for optimistic concurrency control. Returns 409 if this value does not match the server's current version.
- input.name: New display name for the artifact. Omit to leave the existing name unchanged.
Returns:
The artifact after applying the update, reflecting the new version number and any changed metadata or file.
231 def archive(self, artifact: str) -> None: 232 """ 233 Archive an artifact 234 Soft-deletes the artifact identified by `artifact`. The artifact record is 235 retained in storage but is no longer returned by the list or show endpoints. 236 The authenticated user must have write access to the artifact's owning team or 237 organization. Attempting to archive an artifact you do not own returns 403. 238 Attempting to archive an artifact that does not exist or is already archived 239 returns 404. 240 241 Args: 242 artifact: Artifact ID (`art_...`) of the artifact to archive. 243 244 Returns: 245 Returns 204 No Content on success. The artifact is soft-deleted and no longer accessible through the API. 246 """ 247 self._http.request(f"/api/v1/artifacts/{artifact}/archive", method="POST")
Archive an artifact
Soft-deletes the artifact identified by artifact. The artifact record is
retained in storage but is no longer returned by the list or show endpoints.
The authenticated user must have write access to the artifact's owning team or
organization. Attempting to archive an artifact you do not own returns 403.
Attempting to archive an artifact that does not exist or is already archived
returns 404.
Arguments:
- artifact: Artifact ID (
art_...) of the artifact to archive.
Returns:
Returns 204 No Content on success. The artifact is soft-deleted and no longer accessible through the API.
249 def content(self, artifact: str, *, version: int | None = None) -> dict[str, str]: 250 """ 251 Retrieve raw artifact file content 252 Returns the raw binary content of the file stored for the specified artifact. 253 The response `Content-Type` header reflects the artifact file's MIME type, so 254 you can pipe the response body directly to disk or display it in a browser. 255 By default the endpoint serves the artifact's current version. Pass the 256 `version` parameter to retrieve a specific historical version. The authenticated 257 user must have read access to the artifact's owning team or organization. 258 259 Args: 260 artifact: Artifact ID (`art_...`) of the artifact whose content to retrieve. 261 version: Version number to retrieve. Omit to return the artifact's current version. 262 263 Returns: 264 Raw binary content of the artifact file. The `Content-Type` header is set to the artifact's stored MIME type. 265 """ 266 query: dict[str, object] = {} 267 if version is not None: 268 query["version"] = version 269 return self._http.request_raw(f"/api/v1/artifacts/{artifact}/content", query=query)
Retrieve raw artifact file content
Returns the raw binary content of the file stored for the specified artifact.
The response Content-Type header reflects the artifact file's MIME type, so
you can pipe the response body directly to disk or display it in a browser.
By default the endpoint serves the artifact's current version. Pass the
version parameter to retrieve a specific historical version. The authenticated
user must have read access to the artifact's owning team or organization.
Arguments:
- artifact: Artifact ID (
art_...) of the artifact whose content to retrieve. - version: Version number to retrieve. Omit to return the artifact's current version.
Returns:
Raw binary content of the artifact file. The
Content-Typeheader is set to the artifact's stored MIME type.