archastro.platform.v1.resources.external_objects
1# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License. 2# This file is auto-generated by @archastro/sdk-generator. Do not edit. 3# Content hash: 3f9c8fa7d5a1 4 5from __future__ import annotations 6 7from datetime import datetime 8from typing import Any, Literal, Required, TypedDict 9 10from pydantic import BaseModel, Field 11 12from ...runtime.http_client import HttpClient, SyncHttpClient 13from ...types.common import ExternalObject 14 15 16class ExternalObjectCreateInput(TypedDict, total=False): 17 "Provision an external object through an integration service" 18 19 agent: str | None 20 "Owning agent ID (`agt_...`). Supply exactly one owner field." 21 object: Required[dict[str, Any] | dict[str, Any]] 22 "Provisioning fields selected by external object type." 23 org: str | None 24 "Owning organization ID (`org_...`). Supply exactly one owner field." 25 service: Required[Literal["cloudflare"]] 26 team: str | None 27 "Owning team ID (`tem_...`). Supply exactly one owner field." 28 user: str | None 29 "Owning user ID (`usr_...`). Supply exactly one owner field." 30 31 32class ExternalObjectUpdateInput(TypedDict): 33 "Update an external object" 34 35 object: dict[str, Any] | dict[str, Any] 36 "Mutable fields selected by external object type." 37 38 39class ExternalObjectListResponseDataItem(BaseModel): 40 agent: str | None = None 41 created_at: datetime 42 id: str = Field(..., description="ArchAstro external object ID (`ext_...`).") 43 integration: str = Field(..., description="Integration ID (`int_...`).") 44 object: dict[str, Any] | dict[str, Any] = Field( 45 ..., description="Service-specific object payload." 46 ) 47 org: str | None = None 48 service: Literal["cloudflare"] = "cloudflare" 49 team: str | None = None 50 updated_at: datetime 51 user: str | None = None 52 53 54class ExternalObjectListResponse(BaseModel): 55 """ 56 Successful response 57 """ 58 59 data: list[ExternalObjectListResponseDataItem] 60 has_next: bool 61 has_prev: bool 62 page: int 63 page_size: int 64 total_entries: int 65 total_pages: int 66 67 68class AsyncExternalObjectResource: 69 def __init__(self, http: HttpClient): 70 self._http = http 71 72 async def list( 73 self, 74 *, 75 service: Literal["cloudflare"] | None = None, 76 type: Literal["r2_bucket", "d1_database"] | None = None, 77 page: int | None = None, 78 page_size: int | None = None, 79 search: str | None = None, 80 ) -> ExternalObjectListResponse: 81 """ 82 List external objects 83 84 Returns: 85 Successful response 86 """ 87 query: dict[str, object] = {} 88 if service is not None: 89 query["service"] = service 90 if type is not None: 91 query["type"] = type 92 if page is not None: 93 query["page"] = page 94 if page_size is not None: 95 query["page_size"] = page_size 96 if search is not None: 97 query["search"] = search 98 return await self._http.request( 99 "/api/v1/external_objects", 100 query=query, 101 response_type=ExternalObjectListResponse, 102 ) 103 104 async def create(self, input: ExternalObjectCreateInput) -> ExternalObject: 105 """ 106 Provision an external object through an integration service 107 108 Args: 109 input: Request body. 110 input.agent: Owning agent ID (`agt_...`). Supply exactly one owner field. 111 input.object: Provisioning fields selected by external object type. 112 input.org: Owning organization ID (`org_...`). Supply exactly one owner field. 113 input.team: Owning team ID (`tem_...`). Supply exactly one owner field. 114 input.user: Owning user ID (`usr_...`). Supply exactly one owner field. 115 116 Returns: 117 Successful response 118 """ 119 return await self._http.request( 120 "/api/v1/external_objects", 121 method="POST", 122 body=input, 123 response_type=ExternalObject, 124 ) 125 126 async def delete(self, external_object: str) -> None: 127 """ 128 Delete an external object 129 130 Returns: 131 No content 132 """ 133 await self._http.request(f"/api/v1/external_objects/{external_object}", method="DELETE") 134 135 async def get(self, external_object: str) -> ExternalObject: 136 """ 137 Show an external object 138 139 Returns: 140 Successful response 141 """ 142 return await self._http.request( 143 f"/api/v1/external_objects/{external_object}", 144 response_type=ExternalObject, 145 ) 146 147 async def update( 148 self, external_object: str, input: ExternalObjectUpdateInput 149 ) -> ExternalObject: 150 """ 151 Update an external object 152 153 Args: 154 input: Request body. 155 input.object: Mutable fields selected by external object type. 156 157 Returns: 158 Successful response 159 """ 160 return await self._http.request( 161 f"/api/v1/external_objects/{external_object}", 162 method="PATCH", 163 body=input, 164 response_type=ExternalObject, 165 ) 166 167 168class ExternalObjectResource: 169 def __init__(self, http: SyncHttpClient): 170 self._http = http 171 172 def list( 173 self, 174 *, 175 service: Literal["cloudflare"] | None = None, 176 type: Literal["r2_bucket", "d1_database"] | None = None, 177 page: int | None = None, 178 page_size: int | None = None, 179 search: str | None = None, 180 ) -> ExternalObjectListResponse: 181 """ 182 List external objects 183 184 Returns: 185 Successful response 186 """ 187 query: dict[str, object] = {} 188 if service is not None: 189 query["service"] = service 190 if type is not None: 191 query["type"] = type 192 if page is not None: 193 query["page"] = page 194 if page_size is not None: 195 query["page_size"] = page_size 196 if search is not None: 197 query["search"] = search 198 return self._http.request( 199 "/api/v1/external_objects", 200 query=query, 201 response_type=ExternalObjectListResponse, 202 ) 203 204 def create(self, input: ExternalObjectCreateInput) -> ExternalObject: 205 """ 206 Provision an external object through an integration service 207 208 Args: 209 input: Request body. 210 input.agent: Owning agent ID (`agt_...`). Supply exactly one owner field. 211 input.object: Provisioning fields selected by external object type. 212 input.org: Owning organization ID (`org_...`). Supply exactly one owner field. 213 input.team: Owning team ID (`tem_...`). Supply exactly one owner field. 214 input.user: Owning user ID (`usr_...`). Supply exactly one owner field. 215 216 Returns: 217 Successful response 218 """ 219 return self._http.request( 220 "/api/v1/external_objects", 221 method="POST", 222 body=input, 223 response_type=ExternalObject, 224 ) 225 226 def delete(self, external_object: str) -> None: 227 """ 228 Delete an external object 229 230 Returns: 231 No content 232 """ 233 self._http.request(f"/api/v1/external_objects/{external_object}", method="DELETE") 234 235 def get(self, external_object: str) -> ExternalObject: 236 """ 237 Show an external object 238 239 Returns: 240 Successful response 241 """ 242 return self._http.request( 243 f"/api/v1/external_objects/{external_object}", 244 response_type=ExternalObject, 245 ) 246 247 def update(self, external_object: str, input: ExternalObjectUpdateInput) -> ExternalObject: 248 """ 249 Update an external object 250 251 Args: 252 input: Request body. 253 input.object: Mutable fields selected by external object type. 254 255 Returns: 256 Successful response 257 """ 258 return self._http.request( 259 f"/api/v1/external_objects/{external_object}", 260 method="PATCH", 261 body=input, 262 response_type=ExternalObject, 263 )
class
ExternalObjectCreateInput(typing.TypedDict):
17class ExternalObjectCreateInput(TypedDict, total=False): 18 "Provision an external object through an integration service" 19 20 agent: str | None 21 "Owning agent ID (`agt_...`). Supply exactly one owner field." 22 object: Required[dict[str, Any] | dict[str, Any]] 23 "Provisioning fields selected by external object type." 24 org: str | None 25 "Owning organization ID (`org_...`). Supply exactly one owner field." 26 service: Required[Literal["cloudflare"]] 27 team: str | None 28 "Owning team ID (`tem_...`). Supply exactly one owner field." 29 user: str | None 30 "Owning user ID (`usr_...`). Supply exactly one owner field."
Provision an external object through an integration service
class
ExternalObjectUpdateInput(typing.TypedDict):
33class ExternalObjectUpdateInput(TypedDict): 34 "Update an external object" 35 36 object: dict[str, Any] | dict[str, Any] 37 "Mutable fields selected by external object type."
Update an external object
class
ExternalObjectListResponseDataItem(pydantic.main.BaseModel):
40class ExternalObjectListResponseDataItem(BaseModel): 41 agent: str | None = None 42 created_at: datetime 43 id: str = Field(..., description="ArchAstro external object ID (`ext_...`).") 44 integration: str = Field(..., description="Integration ID (`int_...`).") 45 object: dict[str, Any] | dict[str, Any] = Field( 46 ..., description="Service-specific object payload." 47 ) 48 org: str | None = None 49 service: Literal["cloudflare"] = "cloudflare" 50 team: str | None = None 51 updated_at: datetime 52 user: str | None = None
!!! abstract "Usage Documentation" Models
A base class for creating Pydantic models.
Attributes:
- __class_vars__: The names of the class variables defined on the model.
- __private_attributes__: Metadata about the private attributes of the model.
- __signature__: The synthesized
__init__[Signature][inspect.Signature] of the model. - __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
- __pydantic_core_schema__: The core schema of the model.
- __pydantic_custom_init__: Whether the model has a custom
__init__function. - __pydantic_decorators__: Metadata containing the decorators defined on the model.
This replaces
Model.__validators__andModel.__root_validators__from Pydantic V1. - __pydantic_generic_metadata__: A dictionary containing metadata about generic Pydantic models.
The
originandargsitems map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and theparameteritem maps to the__parameter__attribute of generic classes. - __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_post_init__: The name of the post-init method for the model, if defined.
- __pydantic_root_model__: Whether the model is a [
RootModel][pydantic.root_model.RootModel]. - __pydantic_serializer__: The
pydantic-coreSchemaSerializerused to dump instances of the model. - __pydantic_validator__: The
pydantic-coreSchemaValidatorused to validate instances of the model. - __pydantic_fields__: A dictionary of field names and their corresponding [
FieldInfo][pydantic.fields.FieldInfo] objects. - __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [
ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects. - __pydantic_extra__: A dictionary containing extra values, if [
extra][pydantic.config.ConfigDict.extra] is set to'allow'. - __pydantic_fields_set__: The names of fields explicitly set during instantiation.
- __pydantic_private__: Values of private attributes set on the model instance.
class
ExternalObjectListResponse(pydantic.main.BaseModel):
55class ExternalObjectListResponse(BaseModel): 56 """ 57 Successful response 58 """ 59 60 data: list[ExternalObjectListResponseDataItem] 61 has_next: bool 62 has_prev: bool 63 page: int 64 page_size: int 65 total_entries: int 66 total_pages: int
Successful response
class
AsyncExternalObjectResource:
69class AsyncExternalObjectResource: 70 def __init__(self, http: HttpClient): 71 self._http = http 72 73 async def list( 74 self, 75 *, 76 service: Literal["cloudflare"] | None = None, 77 type: Literal["r2_bucket", "d1_database"] | None = None, 78 page: int | None = None, 79 page_size: int | None = None, 80 search: str | None = None, 81 ) -> ExternalObjectListResponse: 82 """ 83 List external objects 84 85 Returns: 86 Successful response 87 """ 88 query: dict[str, object] = {} 89 if service is not None: 90 query["service"] = service 91 if type is not None: 92 query["type"] = type 93 if page is not None: 94 query["page"] = page 95 if page_size is not None: 96 query["page_size"] = page_size 97 if search is not None: 98 query["search"] = search 99 return await self._http.request( 100 "/api/v1/external_objects", 101 query=query, 102 response_type=ExternalObjectListResponse, 103 ) 104 105 async def create(self, input: ExternalObjectCreateInput) -> ExternalObject: 106 """ 107 Provision an external object through an integration service 108 109 Args: 110 input: Request body. 111 input.agent: Owning agent ID (`agt_...`). Supply exactly one owner field. 112 input.object: Provisioning fields selected by external object type. 113 input.org: Owning organization ID (`org_...`). Supply exactly one owner field. 114 input.team: Owning team ID (`tem_...`). Supply exactly one owner field. 115 input.user: Owning user ID (`usr_...`). Supply exactly one owner field. 116 117 Returns: 118 Successful response 119 """ 120 return await self._http.request( 121 "/api/v1/external_objects", 122 method="POST", 123 body=input, 124 response_type=ExternalObject, 125 ) 126 127 async def delete(self, external_object: str) -> None: 128 """ 129 Delete an external object 130 131 Returns: 132 No content 133 """ 134 await self._http.request(f"/api/v1/external_objects/{external_object}", method="DELETE") 135 136 async def get(self, external_object: str) -> ExternalObject: 137 """ 138 Show an external object 139 140 Returns: 141 Successful response 142 """ 143 return await self._http.request( 144 f"/api/v1/external_objects/{external_object}", 145 response_type=ExternalObject, 146 ) 147 148 async def update( 149 self, external_object: str, input: ExternalObjectUpdateInput 150 ) -> ExternalObject: 151 """ 152 Update an external object 153 154 Args: 155 input: Request body. 156 input.object: Mutable fields selected by external object type. 157 158 Returns: 159 Successful response 160 """ 161 return await self._http.request( 162 f"/api/v1/external_objects/{external_object}", 163 method="PATCH", 164 body=input, 165 response_type=ExternalObject, 166 )
AsyncExternalObjectResource(http: archastro.platform.runtime.http_client.HttpClient)
async def
list( self, *, service: Optional[Literal['cloudflare']] = None, type: Optional[Literal['r2_bucket', 'd1_database']] = None, page: int | None = None, page_size: int | None = None, search: str | None = None) -> ExternalObjectListResponse:
73 async def list( 74 self, 75 *, 76 service: Literal["cloudflare"] | None = None, 77 type: Literal["r2_bucket", "d1_database"] | None = None, 78 page: int | None = None, 79 page_size: int | None = None, 80 search: str | None = None, 81 ) -> ExternalObjectListResponse: 82 """ 83 List external objects 84 85 Returns: 86 Successful response 87 """ 88 query: dict[str, object] = {} 89 if service is not None: 90 query["service"] = service 91 if type is not None: 92 query["type"] = type 93 if page is not None: 94 query["page"] = page 95 if page_size is not None: 96 query["page_size"] = page_size 97 if search is not None: 98 query["search"] = search 99 return await self._http.request( 100 "/api/v1/external_objects", 101 query=query, 102 response_type=ExternalObjectListResponse, 103 )
List external objects
Returns:
Successful response
async def
create( self, input: ExternalObjectCreateInput) -> archastro.platform.types.common.ExternalObject:
105 async def create(self, input: ExternalObjectCreateInput) -> ExternalObject: 106 """ 107 Provision an external object through an integration service 108 109 Args: 110 input: Request body. 111 input.agent: Owning agent ID (`agt_...`). Supply exactly one owner field. 112 input.object: Provisioning fields selected by external object type. 113 input.org: Owning organization ID (`org_...`). Supply exactly one owner field. 114 input.team: Owning team ID (`tem_...`). Supply exactly one owner field. 115 input.user: Owning user ID (`usr_...`). Supply exactly one owner field. 116 117 Returns: 118 Successful response 119 """ 120 return await self._http.request( 121 "/api/v1/external_objects", 122 method="POST", 123 body=input, 124 response_type=ExternalObject, 125 )
Provision an external object through an integration service
Arguments:
- input: Request body.
- input.agent: Owning agent ID (
agt_...). Supply exactly one owner field. - input.object: Provisioning fields selected by external object type.
- input.org: Owning organization ID (
org_...). Supply exactly one owner field. - input.team: Owning team ID (
tem_...). Supply exactly one owner field. - input.user: Owning user ID (
usr_...). Supply exactly one owner field.
Returns:
Successful response
async def
delete(self, external_object: str) -> None:
127 async def delete(self, external_object: str) -> None: 128 """ 129 Delete an external object 130 131 Returns: 132 No content 133 """ 134 await self._http.request(f"/api/v1/external_objects/{external_object}", method="DELETE")
Delete an external object
Returns:
No content
136 async def get(self, external_object: str) -> ExternalObject: 137 """ 138 Show an external object 139 140 Returns: 141 Successful response 142 """ 143 return await self._http.request( 144 f"/api/v1/external_objects/{external_object}", 145 response_type=ExternalObject, 146 )
Show an external object
Returns:
Successful response
async def
update( self, external_object: str, input: ExternalObjectUpdateInput) -> archastro.platform.types.common.ExternalObject:
148 async def update( 149 self, external_object: str, input: ExternalObjectUpdateInput 150 ) -> ExternalObject: 151 """ 152 Update an external object 153 154 Args: 155 input: Request body. 156 input.object: Mutable fields selected by external object type. 157 158 Returns: 159 Successful response 160 """ 161 return await self._http.request( 162 f"/api/v1/external_objects/{external_object}", 163 method="PATCH", 164 body=input, 165 response_type=ExternalObject, 166 )
Update an external object
Arguments:
- input: Request body.
- input.object: Mutable fields selected by external object type.
Returns:
Successful response
class
ExternalObjectResource:
169class ExternalObjectResource: 170 def __init__(self, http: SyncHttpClient): 171 self._http = http 172 173 def list( 174 self, 175 *, 176 service: Literal["cloudflare"] | None = None, 177 type: Literal["r2_bucket", "d1_database"] | None = None, 178 page: int | None = None, 179 page_size: int | None = None, 180 search: str | None = None, 181 ) -> ExternalObjectListResponse: 182 """ 183 List external objects 184 185 Returns: 186 Successful response 187 """ 188 query: dict[str, object] = {} 189 if service is not None: 190 query["service"] = service 191 if type is not None: 192 query["type"] = type 193 if page is not None: 194 query["page"] = page 195 if page_size is not None: 196 query["page_size"] = page_size 197 if search is not None: 198 query["search"] = search 199 return self._http.request( 200 "/api/v1/external_objects", 201 query=query, 202 response_type=ExternalObjectListResponse, 203 ) 204 205 def create(self, input: ExternalObjectCreateInput) -> ExternalObject: 206 """ 207 Provision an external object through an integration service 208 209 Args: 210 input: Request body. 211 input.agent: Owning agent ID (`agt_...`). Supply exactly one owner field. 212 input.object: Provisioning fields selected by external object type. 213 input.org: Owning organization ID (`org_...`). Supply exactly one owner field. 214 input.team: Owning team ID (`tem_...`). Supply exactly one owner field. 215 input.user: Owning user ID (`usr_...`). Supply exactly one owner field. 216 217 Returns: 218 Successful response 219 """ 220 return self._http.request( 221 "/api/v1/external_objects", 222 method="POST", 223 body=input, 224 response_type=ExternalObject, 225 ) 226 227 def delete(self, external_object: str) -> None: 228 """ 229 Delete an external object 230 231 Returns: 232 No content 233 """ 234 self._http.request(f"/api/v1/external_objects/{external_object}", method="DELETE") 235 236 def get(self, external_object: str) -> ExternalObject: 237 """ 238 Show an external object 239 240 Returns: 241 Successful response 242 """ 243 return self._http.request( 244 f"/api/v1/external_objects/{external_object}", 245 response_type=ExternalObject, 246 ) 247 248 def update(self, external_object: str, input: ExternalObjectUpdateInput) -> ExternalObject: 249 """ 250 Update an external object 251 252 Args: 253 input: Request body. 254 input.object: Mutable fields selected by external object type. 255 256 Returns: 257 Successful response 258 """ 259 return self._http.request( 260 f"/api/v1/external_objects/{external_object}", 261 method="PATCH", 262 body=input, 263 response_type=ExternalObject, 264 )
ExternalObjectResource(http: archastro.platform.runtime.http_client.SyncHttpClient)
def
list( self, *, service: Optional[Literal['cloudflare']] = None, type: Optional[Literal['r2_bucket', 'd1_database']] = None, page: int | None = None, page_size: int | None = None, search: str | None = None) -> ExternalObjectListResponse:
173 def list( 174 self, 175 *, 176 service: Literal["cloudflare"] | None = None, 177 type: Literal["r2_bucket", "d1_database"] | None = None, 178 page: int | None = None, 179 page_size: int | None = None, 180 search: str | None = None, 181 ) -> ExternalObjectListResponse: 182 """ 183 List external objects 184 185 Returns: 186 Successful response 187 """ 188 query: dict[str, object] = {} 189 if service is not None: 190 query["service"] = service 191 if type is not None: 192 query["type"] = type 193 if page is not None: 194 query["page"] = page 195 if page_size is not None: 196 query["page_size"] = page_size 197 if search is not None: 198 query["search"] = search 199 return self._http.request( 200 "/api/v1/external_objects", 201 query=query, 202 response_type=ExternalObjectListResponse, 203 )
List external objects
Returns:
Successful response
def
create( self, input: ExternalObjectCreateInput) -> archastro.platform.types.common.ExternalObject:
205 def create(self, input: ExternalObjectCreateInput) -> ExternalObject: 206 """ 207 Provision an external object through an integration service 208 209 Args: 210 input: Request body. 211 input.agent: Owning agent ID (`agt_...`). Supply exactly one owner field. 212 input.object: Provisioning fields selected by external object type. 213 input.org: Owning organization ID (`org_...`). Supply exactly one owner field. 214 input.team: Owning team ID (`tem_...`). Supply exactly one owner field. 215 input.user: Owning user ID (`usr_...`). Supply exactly one owner field. 216 217 Returns: 218 Successful response 219 """ 220 return self._http.request( 221 "/api/v1/external_objects", 222 method="POST", 223 body=input, 224 response_type=ExternalObject, 225 )
Provision an external object through an integration service
Arguments:
- input: Request body.
- input.agent: Owning agent ID (
agt_...). Supply exactly one owner field. - input.object: Provisioning fields selected by external object type.
- input.org: Owning organization ID (
org_...). Supply exactly one owner field. - input.team: Owning team ID (
tem_...). Supply exactly one owner field. - input.user: Owning user ID (
usr_...). Supply exactly one owner field.
Returns:
Successful response
def
delete(self, external_object: str) -> None:
227 def delete(self, external_object: str) -> None: 228 """ 229 Delete an external object 230 231 Returns: 232 No content 233 """ 234 self._http.request(f"/api/v1/external_objects/{external_object}", method="DELETE")
Delete an external object
Returns:
No content
236 def get(self, external_object: str) -> ExternalObject: 237 """ 238 Show an external object 239 240 Returns: 241 Successful response 242 """ 243 return self._http.request( 244 f"/api/v1/external_objects/{external_object}", 245 response_type=ExternalObject, 246 )
Show an external object
Returns:
Successful response
def
update( self, external_object: str, input: ExternalObjectUpdateInput) -> archastro.platform.types.common.ExternalObject:
248 def update(self, external_object: str, input: ExternalObjectUpdateInput) -> ExternalObject: 249 """ 250 Update an external object 251 252 Args: 253 input: Request body. 254 input.object: Mutable fields selected by external object type. 255 256 Returns: 257 Successful response 258 """ 259 return self._http.request( 260 f"/api/v1/external_objects/{external_object}", 261 method="PATCH", 262 body=input, 263 response_type=ExternalObject, 264 )
Update an external object
Arguments:
- input: Request body.
- input.object: Mutable fields selected by external object type.
Returns:
Successful response