archastro.platform.v1.resources.agent_env_vars

  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: 9eadce99c169
  4
  5from __future__ import annotations
  6
  7from typing import TypedDict
  8
  9from ...runtime.http_client import HttpClient, SyncHttpClient
 10from ...types.common import AgentEnvVarMasked
 11
 12
 13class AgentEnvVarUpdateInput(TypedDict, total=False):
 14    "Update an agent environment variable"
 15
 16    description: str | None
 17    "Updated human-readable note describing what the variable is used for."
 18    value: str | None
 19    "New plaintext secret value. The value is encrypted at rest and never returned in full."
 20
 21
 22class AsyncAgentEnvVarResource:
 23    def __init__(self, http: HttpClient):
 24        self._http = http
 25
 26    async def delete(self, env_var: str) -> None:
 27        """
 28        Delete an agent environment variable
 29        Permanently deletes the specified environment variable from the agent. This
 30        action is irreversible; the stored value is destroyed and cannot be recovered.
 31        The authenticated user must have access to the agent's parent app. Pass the
 32        app scope via the `app` parameter when calling with an API key that is scoped
 33        to a specific app. Returns `204 No Content` on success.
 34
 35        Args:
 36            env_var: Environment variable ID (`anv_...`) of the variable to delete.
 37
 38        Returns:
 39            Empty response. Returns HTTP 204 No Content on successful deletion.
 40        """
 41        await self._http.request(f"/api/v1/agent_env_vars/{env_var}", method="DELETE")
 42
 43    async def get(self, env_var: str) -> AgentEnvVarMasked:
 44        """
 45        Retrieve an agent environment variable
 46        Returns the environment variable identified by `env_var`. The stored value
 47        is always masked in the response; only the last four characters are visible.
 48        There is no endpoint that returns the plaintext value after creation.
 49        The authenticated user must have access to the agent's parent app. Pass the
 50        app scope via the `app` parameter when calling with an API key that is scoped
 51        to a specific app.
 52
 53        Args:
 54            env_var: Environment variable ID (`anv_...`) to retrieve.
 55
 56        Returns:
 57            The requested environment variable with its value masked.
 58        """
 59        return await self._http.request(
 60            f"/api/v1/agent_env_vars/{env_var}",
 61            response_type=AgentEnvVarMasked,
 62        )
 63
 64    async def update(self, env_var: str, input: AgentEnvVarUpdateInput) -> AgentEnvVarMasked:
 65        """
 66        Update an agent environment variable
 67        Updates the `value` or `description` of an existing environment variable.
 68        Only fields provided in the request are changed; omitted fields retain their
 69        current values. The variable `key` cannot be changed after creation.
 70        The updated value is stored securely and, like creation, the plaintext is
 71        never returned; the response contains the masked representation. The
 72        authenticated user must have access to the agent's parent app. Pass the app
 73        scope via the `app` parameter when calling with an API key that is scoped to
 74        a specific app.
 75
 76        Args:
 77            env_var: Environment variable ID (`anv_...`) to update.
 78            input: Request body.
 79            input.description: Updated human-readable note describing what the variable is used for.
 80            input.value: New plaintext secret value. The value is encrypted at rest and never returned in full.
 81
 82        Returns:
 83            The updated environment variable with its value masked.
 84        """
 85        return await self._http.request(
 86            f"/api/v1/agent_env_vars/{env_var}",
 87            method="PATCH",
 88            body=input,
 89            response_type=AgentEnvVarMasked,
 90        )
 91
 92
 93class AgentEnvVarResource:
 94    def __init__(self, http: SyncHttpClient):
 95        self._http = http
 96
 97    def delete(self, env_var: str) -> None:
 98        """
 99        Delete an agent environment variable
100        Permanently deletes the specified environment variable from the agent. This
101        action is irreversible; the stored value is destroyed and cannot be recovered.
102        The authenticated user must have access to the agent's parent app. Pass the
103        app scope via the `app` parameter when calling with an API key that is scoped
104        to a specific app. Returns `204 No Content` on success.
105
106        Args:
107            env_var: Environment variable ID (`anv_...`) of the variable to delete.
108
109        Returns:
110            Empty response. Returns HTTP 204 No Content on successful deletion.
111        """
112        self._http.request(f"/api/v1/agent_env_vars/{env_var}", method="DELETE")
113
114    def get(self, env_var: str) -> AgentEnvVarMasked:
115        """
116        Retrieve an agent environment variable
117        Returns the environment variable identified by `env_var`. The stored value
118        is always masked in the response; only the last four characters are visible.
119        There is no endpoint that returns the plaintext value after creation.
120        The authenticated user must have access to the agent's parent app. Pass the
121        app scope via the `app` parameter when calling with an API key that is scoped
122        to a specific app.
123
124        Args:
125            env_var: Environment variable ID (`anv_...`) to retrieve.
126
127        Returns:
128            The requested environment variable with its value masked.
129        """
130        return self._http.request(
131            f"/api/v1/agent_env_vars/{env_var}",
132            response_type=AgentEnvVarMasked,
133        )
134
135    def update(self, env_var: str, input: AgentEnvVarUpdateInput) -> AgentEnvVarMasked:
136        """
137        Update an agent environment variable
138        Updates the `value` or `description` of an existing environment variable.
139        Only fields provided in the request are changed; omitted fields retain their
140        current values. The variable `key` cannot be changed after creation.
141        The updated value is stored securely and, like creation, the plaintext is
142        never returned; the response contains the masked representation. The
143        authenticated user must have access to the agent's parent app. Pass the app
144        scope via the `app` parameter when calling with an API key that is scoped to
145        a specific app.
146
147        Args:
148            env_var: Environment variable ID (`anv_...`) to update.
149            input: Request body.
150            input.description: Updated human-readable note describing what the variable is used for.
151            input.value: New plaintext secret value. The value is encrypted at rest and never returned in full.
152
153        Returns:
154            The updated environment variable with its value masked.
155        """
156        return self._http.request(
157            f"/api/v1/agent_env_vars/{env_var}",
158            method="PATCH",
159            body=input,
160            response_type=AgentEnvVarMasked,
161        )
class AgentEnvVarUpdateInput(typing.TypedDict):
14class AgentEnvVarUpdateInput(TypedDict, total=False):
15    "Update an agent environment variable"
16
17    description: str | None
18    "Updated human-readable note describing what the variable is used for."
19    value: str | None
20    "New plaintext secret value. The value is encrypted at rest and never returned in full."

Update an agent environment variable

description: str | None

Updated human-readable note describing what the variable is used for.

value: str | None

New plaintext secret value. The value is encrypted at rest and never returned in full.

class AsyncAgentEnvVarResource:
23class AsyncAgentEnvVarResource:
24    def __init__(self, http: HttpClient):
25        self._http = http
26
27    async def delete(self, env_var: str) -> None:
28        """
29        Delete an agent environment variable
30        Permanently deletes the specified environment variable from the agent. This
31        action is irreversible; the stored value is destroyed and cannot be recovered.
32        The authenticated user must have access to the agent's parent app. Pass the
33        app scope via the `app` parameter when calling with an API key that is scoped
34        to a specific app. Returns `204 No Content` on success.
35
36        Args:
37            env_var: Environment variable ID (`anv_...`) of the variable to delete.
38
39        Returns:
40            Empty response. Returns HTTP 204 No Content on successful deletion.
41        """
42        await self._http.request(f"/api/v1/agent_env_vars/{env_var}", method="DELETE")
43
44    async def get(self, env_var: str) -> AgentEnvVarMasked:
45        """
46        Retrieve an agent environment variable
47        Returns the environment variable identified by `env_var`. The stored value
48        is always masked in the response; only the last four characters are visible.
49        There is no endpoint that returns the plaintext value after creation.
50        The authenticated user must have access to the agent's parent app. Pass the
51        app scope via the `app` parameter when calling with an API key that is scoped
52        to a specific app.
53
54        Args:
55            env_var: Environment variable ID (`anv_...`) to retrieve.
56
57        Returns:
58            The requested environment variable with its value masked.
59        """
60        return await self._http.request(
61            f"/api/v1/agent_env_vars/{env_var}",
62            response_type=AgentEnvVarMasked,
63        )
64
65    async def update(self, env_var: str, input: AgentEnvVarUpdateInput) -> AgentEnvVarMasked:
66        """
67        Update an agent environment variable
68        Updates the `value` or `description` of an existing environment variable.
69        Only fields provided in the request are changed; omitted fields retain their
70        current values. The variable `key` cannot be changed after creation.
71        The updated value is stored securely and, like creation, the plaintext is
72        never returned; the response contains the masked representation. The
73        authenticated user must have access to the agent's parent app. Pass the app
74        scope via the `app` parameter when calling with an API key that is scoped to
75        a specific app.
76
77        Args:
78            env_var: Environment variable ID (`anv_...`) to update.
79            input: Request body.
80            input.description: Updated human-readable note describing what the variable is used for.
81            input.value: New plaintext secret value. The value is encrypted at rest and never returned in full.
82
83        Returns:
84            The updated environment variable with its value masked.
85        """
86        return await self._http.request(
87            f"/api/v1/agent_env_vars/{env_var}",
88            method="PATCH",
89            body=input,
90            response_type=AgentEnvVarMasked,
91        )
AsyncAgentEnvVarResource(http: archastro.platform.runtime.http_client.HttpClient)
24    def __init__(self, http: HttpClient):
25        self._http = http
async def delete(self, env_var: str) -> None:
27    async def delete(self, env_var: str) -> None:
28        """
29        Delete an agent environment variable
30        Permanently deletes the specified environment variable from the agent. This
31        action is irreversible; the stored value is destroyed and cannot be recovered.
32        The authenticated user must have access to the agent's parent app. Pass the
33        app scope via the `app` parameter when calling with an API key that is scoped
34        to a specific app. Returns `204 No Content` on success.
35
36        Args:
37            env_var: Environment variable ID (`anv_...`) of the variable to delete.
38
39        Returns:
40            Empty response. Returns HTTP 204 No Content on successful deletion.
41        """
42        await self._http.request(f"/api/v1/agent_env_vars/{env_var}", method="DELETE")

Delete an agent environment variable Permanently deletes the specified environment variable from the agent. This action is irreversible; the stored value is destroyed and cannot be recovered. The authenticated user must have access to the agent's parent app. Pass the app scope via the app parameter when calling with an API key that is scoped to a specific app. Returns 204 No Content on success.

Arguments:
  • env_var: Environment variable ID (anv_...) of the variable to delete.
Returns:

Empty response. Returns HTTP 204 No Content on successful deletion.

async def get(self, env_var: str) -> archastro.platform.types.common.AgentEnvVarMasked:
44    async def get(self, env_var: str) -> AgentEnvVarMasked:
45        """
46        Retrieve an agent environment variable
47        Returns the environment variable identified by `env_var`. The stored value
48        is always masked in the response; only the last four characters are visible.
49        There is no endpoint that returns the plaintext value after creation.
50        The authenticated user must have access to the agent's parent app. Pass the
51        app scope via the `app` parameter when calling with an API key that is scoped
52        to a specific app.
53
54        Args:
55            env_var: Environment variable ID (`anv_...`) to retrieve.
56
57        Returns:
58            The requested environment variable with its value masked.
59        """
60        return await self._http.request(
61            f"/api/v1/agent_env_vars/{env_var}",
62            response_type=AgentEnvVarMasked,
63        )

Retrieve an agent environment variable Returns the environment variable identified by env_var. The stored value is always masked in the response; only the last four characters are visible. There is no endpoint that returns the plaintext value after creation. The authenticated user must have access to the agent's parent app. Pass the app scope via the app parameter when calling with an API key that is scoped to a specific app.

Arguments:
  • env_var: Environment variable ID (anv_...) to retrieve.
Returns:

The requested environment variable with its value masked.

async def update( self, env_var: str, input: AgentEnvVarUpdateInput) -> archastro.platform.types.common.AgentEnvVarMasked:
65    async def update(self, env_var: str, input: AgentEnvVarUpdateInput) -> AgentEnvVarMasked:
66        """
67        Update an agent environment variable
68        Updates the `value` or `description` of an existing environment variable.
69        Only fields provided in the request are changed; omitted fields retain their
70        current values. The variable `key` cannot be changed after creation.
71        The updated value is stored securely and, like creation, the plaintext is
72        never returned; the response contains the masked representation. The
73        authenticated user must have access to the agent's parent app. Pass the app
74        scope via the `app` parameter when calling with an API key that is scoped to
75        a specific app.
76
77        Args:
78            env_var: Environment variable ID (`anv_...`) to update.
79            input: Request body.
80            input.description: Updated human-readable note describing what the variable is used for.
81            input.value: New plaintext secret value. The value is encrypted at rest and never returned in full.
82
83        Returns:
84            The updated environment variable with its value masked.
85        """
86        return await self._http.request(
87            f"/api/v1/agent_env_vars/{env_var}",
88            method="PATCH",
89            body=input,
90            response_type=AgentEnvVarMasked,
91        )

Update an agent environment variable Updates the value or description of an existing environment variable. Only fields provided in the request are changed; omitted fields retain their current values. The variable key cannot be changed after creation. The updated value is stored securely and, like creation, the plaintext is never returned; the response contains the masked representation. The authenticated user must have access to the agent's parent app. Pass the app scope via the app parameter when calling with an API key that is scoped to a specific app.

Arguments:
  • env_var: Environment variable ID (anv_...) to update.
  • input: Request body.
  • input.description: Updated human-readable note describing what the variable is used for.
  • input.value: New plaintext secret value. The value is encrypted at rest and never returned in full.
Returns:

The updated environment variable with its value masked.

class AgentEnvVarResource:
 94class AgentEnvVarResource:
 95    def __init__(self, http: SyncHttpClient):
 96        self._http = http
 97
 98    def delete(self, env_var: str) -> None:
 99        """
100        Delete an agent environment variable
101        Permanently deletes the specified environment variable from the agent. This
102        action is irreversible; the stored value is destroyed and cannot be recovered.
103        The authenticated user must have access to the agent's parent app. Pass the
104        app scope via the `app` parameter when calling with an API key that is scoped
105        to a specific app. Returns `204 No Content` on success.
106
107        Args:
108            env_var: Environment variable ID (`anv_...`) of the variable to delete.
109
110        Returns:
111            Empty response. Returns HTTP 204 No Content on successful deletion.
112        """
113        self._http.request(f"/api/v1/agent_env_vars/{env_var}", method="DELETE")
114
115    def get(self, env_var: str) -> AgentEnvVarMasked:
116        """
117        Retrieve an agent environment variable
118        Returns the environment variable identified by `env_var`. The stored value
119        is always masked in the response; only the last four characters are visible.
120        There is no endpoint that returns the plaintext value after creation.
121        The authenticated user must have access to the agent's parent app. Pass the
122        app scope via the `app` parameter when calling with an API key that is scoped
123        to a specific app.
124
125        Args:
126            env_var: Environment variable ID (`anv_...`) to retrieve.
127
128        Returns:
129            The requested environment variable with its value masked.
130        """
131        return self._http.request(
132            f"/api/v1/agent_env_vars/{env_var}",
133            response_type=AgentEnvVarMasked,
134        )
135
136    def update(self, env_var: str, input: AgentEnvVarUpdateInput) -> AgentEnvVarMasked:
137        """
138        Update an agent environment variable
139        Updates the `value` or `description` of an existing environment variable.
140        Only fields provided in the request are changed; omitted fields retain their
141        current values. The variable `key` cannot be changed after creation.
142        The updated value is stored securely and, like creation, the plaintext is
143        never returned; the response contains the masked representation. The
144        authenticated user must have access to the agent's parent app. Pass the app
145        scope via the `app` parameter when calling with an API key that is scoped to
146        a specific app.
147
148        Args:
149            env_var: Environment variable ID (`anv_...`) to update.
150            input: Request body.
151            input.description: Updated human-readable note describing what the variable is used for.
152            input.value: New plaintext secret value. The value is encrypted at rest and never returned in full.
153
154        Returns:
155            The updated environment variable with its value masked.
156        """
157        return self._http.request(
158            f"/api/v1/agent_env_vars/{env_var}",
159            method="PATCH",
160            body=input,
161            response_type=AgentEnvVarMasked,
162        )
AgentEnvVarResource(http: archastro.platform.runtime.http_client.SyncHttpClient)
95    def __init__(self, http: SyncHttpClient):
96        self._http = http
def delete(self, env_var: str) -> None:
 98    def delete(self, env_var: str) -> None:
 99        """
100        Delete an agent environment variable
101        Permanently deletes the specified environment variable from the agent. This
102        action is irreversible; the stored value is destroyed and cannot be recovered.
103        The authenticated user must have access to the agent's parent app. Pass the
104        app scope via the `app` parameter when calling with an API key that is scoped
105        to a specific app. Returns `204 No Content` on success.
106
107        Args:
108            env_var: Environment variable ID (`anv_...`) of the variable to delete.
109
110        Returns:
111            Empty response. Returns HTTP 204 No Content on successful deletion.
112        """
113        self._http.request(f"/api/v1/agent_env_vars/{env_var}", method="DELETE")

Delete an agent environment variable Permanently deletes the specified environment variable from the agent. This action is irreversible; the stored value is destroyed and cannot be recovered. The authenticated user must have access to the agent's parent app. Pass the app scope via the app parameter when calling with an API key that is scoped to a specific app. Returns 204 No Content on success.

Arguments:
  • env_var: Environment variable ID (anv_...) of the variable to delete.
Returns:

Empty response. Returns HTTP 204 No Content on successful deletion.

def get(self, env_var: str) -> archastro.platform.types.common.AgentEnvVarMasked:
115    def get(self, env_var: str) -> AgentEnvVarMasked:
116        """
117        Retrieve an agent environment variable
118        Returns the environment variable identified by `env_var`. The stored value
119        is always masked in the response; only the last four characters are visible.
120        There is no endpoint that returns the plaintext value after creation.
121        The authenticated user must have access to the agent's parent app. Pass the
122        app scope via the `app` parameter when calling with an API key that is scoped
123        to a specific app.
124
125        Args:
126            env_var: Environment variable ID (`anv_...`) to retrieve.
127
128        Returns:
129            The requested environment variable with its value masked.
130        """
131        return self._http.request(
132            f"/api/v1/agent_env_vars/{env_var}",
133            response_type=AgentEnvVarMasked,
134        )

Retrieve an agent environment variable Returns the environment variable identified by env_var. The stored value is always masked in the response; only the last four characters are visible. There is no endpoint that returns the plaintext value after creation. The authenticated user must have access to the agent's parent app. Pass the app scope via the app parameter when calling with an API key that is scoped to a specific app.

Arguments:
  • env_var: Environment variable ID (anv_...) to retrieve.
Returns:

The requested environment variable with its value masked.

def update( self, env_var: str, input: AgentEnvVarUpdateInput) -> archastro.platform.types.common.AgentEnvVarMasked:
136    def update(self, env_var: str, input: AgentEnvVarUpdateInput) -> AgentEnvVarMasked:
137        """
138        Update an agent environment variable
139        Updates the `value` or `description` of an existing environment variable.
140        Only fields provided in the request are changed; omitted fields retain their
141        current values. The variable `key` cannot be changed after creation.
142        The updated value is stored securely and, like creation, the plaintext is
143        never returned; the response contains the masked representation. The
144        authenticated user must have access to the agent's parent app. Pass the app
145        scope via the `app` parameter when calling with an API key that is scoped to
146        a specific app.
147
148        Args:
149            env_var: Environment variable ID (`anv_...`) to update.
150            input: Request body.
151            input.description: Updated human-readable note describing what the variable is used for.
152            input.value: New plaintext secret value. The value is encrypted at rest and never returned in full.
153
154        Returns:
155            The updated environment variable with its value masked.
156        """
157        return self._http.request(
158            f"/api/v1/agent_env_vars/{env_var}",
159            method="PATCH",
160            body=input,
161            response_type=AgentEnvVarMasked,
162        )

Update an agent environment variable Updates the value or description of an existing environment variable. Only fields provided in the request are changed; omitted fields retain their current values. The variable key cannot be changed after creation. The updated value is stored securely and, like creation, the plaintext is never returned; the response contains the masked representation. The authenticated user must have access to the agent's parent app. Pass the app scope via the app parameter when calling with an API key that is scoped to a specific app.

Arguments:
  • env_var: Environment variable ID (anv_...) to update.
  • input: Request body.
  • input.description: Updated human-readable note describing what the variable is used for.
  • input.value: New plaintext secret value. The value is encrypted at rest and never returned in full.
Returns:

The updated environment variable with its value masked.