archastro.platform.v1.resources.relays

  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: b775160d8a63
  4
  5from __future__ import annotations
  6
  7from typing import TypedDict
  8
  9from ...runtime.http_client import HttpClient, SyncHttpClient
 10from ...types.relays import Relay
 11
 12
 13class RelayCreateInput(TypedDict):
 14    "Create an owner-only relay"
 15
 16    purpose: str
 17    ttl_seconds: int
 18
 19
 20class RelayExtendInput(TypedDict):
 21    "Extend an owner-only relay"
 22
 23    ttl_seconds: int
 24
 25
 26class AsyncRelayResource:
 27    def __init__(self, http: HttpClient):
 28        self._http = http
 29
 30    async def create(self, input: RelayCreateInput) -> Relay:
 31        """
 32        Create an owner-only relay
 33        Only the owning user in the same app may access this relay.
 34
 35        Args:
 36            input: Request body.
 37
 38        Returns:
 39            Successful response
 40        """
 41        return await self._http.request(
 42            "/api/v1/relays",
 43            method="POST",
 44            body=input,
 45            response_type=Relay,
 46        )
 47
 48    async def delete(self, relay: str) -> Relay:
 49        """
 50        Delete an owner-only relay
 51        Only the owning user in the same app may access this relay.
 52
 53        Returns:
 54            Successful response
 55        """
 56        return await self._http.request(
 57            f"/api/v1/relays/{relay}",
 58            method="DELETE",
 59            response_type=Relay,
 60        )
 61
 62    async def get(self, relay: str) -> Relay:
 63        """
 64        Show an owner-only relay
 65        Only the owning user in the same app may access this relay.
 66
 67        Returns:
 68            Successful response
 69        """
 70        return await self._http.request(f"/api/v1/relays/{relay}", response_type=Relay)
 71
 72    async def extend(self, relay: str, input: RelayExtendInput) -> Relay:
 73        """
 74        Extend an owner-only relay
 75        Only the owning user in the same app may access this relay.
 76
 77        Args:
 78            input: Request body.
 79
 80        Returns:
 81            Successful response
 82        """
 83        return await self._http.request(
 84            f"/api/v1/relays/{relay}/extend",
 85            method="POST",
 86            body=input,
 87            response_type=Relay,
 88        )
 89
 90
 91class RelayResource:
 92    def __init__(self, http: SyncHttpClient):
 93        self._http = http
 94
 95    def create(self, input: RelayCreateInput) -> Relay:
 96        """
 97        Create an owner-only relay
 98        Only the owning user in the same app may access this relay.
 99
100        Args:
101            input: Request body.
102
103        Returns:
104            Successful response
105        """
106        return self._http.request("/api/v1/relays", method="POST", body=input, response_type=Relay)
107
108    def delete(self, relay: str) -> Relay:
109        """
110        Delete an owner-only relay
111        Only the owning user in the same app may access this relay.
112
113        Returns:
114            Successful response
115        """
116        return self._http.request(f"/api/v1/relays/{relay}", method="DELETE", response_type=Relay)
117
118    def get(self, relay: str) -> Relay:
119        """
120        Show an owner-only relay
121        Only the owning user in the same app may access this relay.
122
123        Returns:
124            Successful response
125        """
126        return self._http.request(f"/api/v1/relays/{relay}", response_type=Relay)
127
128    def extend(self, relay: str, input: RelayExtendInput) -> Relay:
129        """
130        Extend an owner-only relay
131        Only the owning user in the same app may access this relay.
132
133        Args:
134            input: Request body.
135
136        Returns:
137            Successful response
138        """
139        return self._http.request(
140            f"/api/v1/relays/{relay}/extend",
141            method="POST",
142            body=input,
143            response_type=Relay,
144        )
class RelayCreateInput(typing.TypedDict):
14class RelayCreateInput(TypedDict):
15    "Create an owner-only relay"
16
17    purpose: str
18    ttl_seconds: int

Create an owner-only relay

purpose: str
ttl_seconds: int
class RelayExtendInput(typing.TypedDict):
21class RelayExtendInput(TypedDict):
22    "Extend an owner-only relay"
23
24    ttl_seconds: int

Extend an owner-only relay

ttl_seconds: int
class AsyncRelayResource:
27class AsyncRelayResource:
28    def __init__(self, http: HttpClient):
29        self._http = http
30
31    async def create(self, input: RelayCreateInput) -> Relay:
32        """
33        Create an owner-only relay
34        Only the owning user in the same app may access this relay.
35
36        Args:
37            input: Request body.
38
39        Returns:
40            Successful response
41        """
42        return await self._http.request(
43            "/api/v1/relays",
44            method="POST",
45            body=input,
46            response_type=Relay,
47        )
48
49    async def delete(self, relay: str) -> Relay:
50        """
51        Delete an owner-only relay
52        Only the owning user in the same app may access this relay.
53
54        Returns:
55            Successful response
56        """
57        return await self._http.request(
58            f"/api/v1/relays/{relay}",
59            method="DELETE",
60            response_type=Relay,
61        )
62
63    async def get(self, relay: str) -> Relay:
64        """
65        Show an owner-only relay
66        Only the owning user in the same app may access this relay.
67
68        Returns:
69            Successful response
70        """
71        return await self._http.request(f"/api/v1/relays/{relay}", response_type=Relay)
72
73    async def extend(self, relay: str, input: RelayExtendInput) -> Relay:
74        """
75        Extend an owner-only relay
76        Only the owning user in the same app may access this relay.
77
78        Args:
79            input: Request body.
80
81        Returns:
82            Successful response
83        """
84        return await self._http.request(
85            f"/api/v1/relays/{relay}/extend",
86            method="POST",
87            body=input,
88            response_type=Relay,
89        )
AsyncRelayResource(http: archastro.platform.runtime.http_client.HttpClient)
28    def __init__(self, http: HttpClient):
29        self._http = http
async def create( self, input: RelayCreateInput) -> archastro.platform.types.relays.Relay:
31    async def create(self, input: RelayCreateInput) -> Relay:
32        """
33        Create an owner-only relay
34        Only the owning user in the same app may access this relay.
35
36        Args:
37            input: Request body.
38
39        Returns:
40            Successful response
41        """
42        return await self._http.request(
43            "/api/v1/relays",
44            method="POST",
45            body=input,
46            response_type=Relay,
47        )

Create an owner-only relay Only the owning user in the same app may access this relay.

Arguments:
  • input: Request body.
Returns:

Successful response

async def delete(self, relay: str) -> archastro.platform.types.relays.Relay:
49    async def delete(self, relay: str) -> Relay:
50        """
51        Delete an owner-only relay
52        Only the owning user in the same app may access this relay.
53
54        Returns:
55            Successful response
56        """
57        return await self._http.request(
58            f"/api/v1/relays/{relay}",
59            method="DELETE",
60            response_type=Relay,
61        )

Delete an owner-only relay Only the owning user in the same app may access this relay.

Returns:

Successful response

async def get(self, relay: str) -> archastro.platform.types.relays.Relay:
63    async def get(self, relay: str) -> Relay:
64        """
65        Show an owner-only relay
66        Only the owning user in the same app may access this relay.
67
68        Returns:
69            Successful response
70        """
71        return await self._http.request(f"/api/v1/relays/{relay}", response_type=Relay)

Show an owner-only relay Only the owning user in the same app may access this relay.

Returns:

Successful response

async def extend( self, relay: str, input: RelayExtendInput) -> archastro.platform.types.relays.Relay:
73    async def extend(self, relay: str, input: RelayExtendInput) -> Relay:
74        """
75        Extend an owner-only relay
76        Only the owning user in the same app may access this relay.
77
78        Args:
79            input: Request body.
80
81        Returns:
82            Successful response
83        """
84        return await self._http.request(
85            f"/api/v1/relays/{relay}/extend",
86            method="POST",
87            body=input,
88            response_type=Relay,
89        )

Extend an owner-only relay Only the owning user in the same app may access this relay.

Arguments:
  • input: Request body.
Returns:

Successful response

class RelayResource:
 92class RelayResource:
 93    def __init__(self, http: SyncHttpClient):
 94        self._http = http
 95
 96    def create(self, input: RelayCreateInput) -> Relay:
 97        """
 98        Create an owner-only relay
 99        Only the owning user in the same app may access this relay.
100
101        Args:
102            input: Request body.
103
104        Returns:
105            Successful response
106        """
107        return self._http.request("/api/v1/relays", method="POST", body=input, response_type=Relay)
108
109    def delete(self, relay: str) -> Relay:
110        """
111        Delete an owner-only relay
112        Only the owning user in the same app may access this relay.
113
114        Returns:
115            Successful response
116        """
117        return self._http.request(f"/api/v1/relays/{relay}", method="DELETE", response_type=Relay)
118
119    def get(self, relay: str) -> Relay:
120        """
121        Show an owner-only relay
122        Only the owning user in the same app may access this relay.
123
124        Returns:
125            Successful response
126        """
127        return self._http.request(f"/api/v1/relays/{relay}", response_type=Relay)
128
129    def extend(self, relay: str, input: RelayExtendInput) -> Relay:
130        """
131        Extend an owner-only relay
132        Only the owning user in the same app may access this relay.
133
134        Args:
135            input: Request body.
136
137        Returns:
138            Successful response
139        """
140        return self._http.request(
141            f"/api/v1/relays/{relay}/extend",
142            method="POST",
143            body=input,
144            response_type=Relay,
145        )
93    def __init__(self, http: SyncHttpClient):
94        self._http = http
def create( self, input: RelayCreateInput) -> archastro.platform.types.relays.Relay:
 96    def create(self, input: RelayCreateInput) -> Relay:
 97        """
 98        Create an owner-only relay
 99        Only the owning user in the same app may access this relay.
100
101        Args:
102            input: Request body.
103
104        Returns:
105            Successful response
106        """
107        return self._http.request("/api/v1/relays", method="POST", body=input, response_type=Relay)

Create an owner-only relay Only the owning user in the same app may access this relay.

Arguments:
  • input: Request body.
Returns:

Successful response

def delete(self, relay: str) -> archastro.platform.types.relays.Relay:
109    def delete(self, relay: str) -> Relay:
110        """
111        Delete an owner-only relay
112        Only the owning user in the same app may access this relay.
113
114        Returns:
115            Successful response
116        """
117        return self._http.request(f"/api/v1/relays/{relay}", method="DELETE", response_type=Relay)

Delete an owner-only relay Only the owning user in the same app may access this relay.

Returns:

Successful response

def get(self, relay: str) -> archastro.platform.types.relays.Relay:
119    def get(self, relay: str) -> Relay:
120        """
121        Show an owner-only relay
122        Only the owning user in the same app may access this relay.
123
124        Returns:
125            Successful response
126        """
127        return self._http.request(f"/api/v1/relays/{relay}", response_type=Relay)

Show an owner-only relay Only the owning user in the same app may access this relay.

Returns:

Successful response

def extend( self, relay: str, input: RelayExtendInput) -> archastro.platform.types.relays.Relay:
129    def extend(self, relay: str, input: RelayExtendInput) -> Relay:
130        """
131        Extend an owner-only relay
132        Only the owning user in the same app may access this relay.
133
134        Args:
135            input: Request body.
136
137        Returns:
138            Successful response
139        """
140        return self._http.request(
141            f"/api/v1/relays/{relay}/extend",
142            method="POST",
143            body=input,
144            response_type=Relay,
145        )

Extend an owner-only relay Only the owning user in the same app may access this relay.

Arguments:
  • input: Request body.
Returns:

Successful response