API objects

The following reference is generated from the current Python source with mkdocstrings.

Client configuration

stac_transaction_api_client.client

AuthenticatedClient

A Client which has been authenticated for use on secured endpoints

The following are accepted as keyword arguments and will be used to construct httpx Clients internally:

``base_url``: The base URL for the API, all requests are made to a relative path to this URL

``cookies``: A dictionary of cookies to be sent with every request

``headers``: A dictionary of headers to be sent with every request

``timeout``: The maximum amount of a time a request can take. API functions will raise
httpx.TimeoutException if this is exceeded.

``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,
but can be set to False for testing purposes.

``follow_redirects``: Whether or not to follow redirects. Default value is False.

``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.
Attributes:
  • raise_on_unexpected_status (bool) –

    Whether or not to raise an errors.UnexpectedStatus if the API returns a status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor.

  • token (str) –

    The token to use for authentication

  • prefix (str) –

    The prefix to use for the Authorization header

  • auth_header_name (str) –

    The name of the Authorization header

Source code in src/stac_transaction_api_client/client.py
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
@define
class AuthenticatedClient:
    """A Client which has been authenticated for use on secured endpoints

    The following are accepted as keyword arguments and will be used to construct httpx Clients internally:

        ``base_url``: The base URL for the API, all requests are made to a relative path to this URL

        ``cookies``: A dictionary of cookies to be sent with every request

        ``headers``: A dictionary of headers to be sent with every request

        ``timeout``: The maximum amount of a time a request can take. API functions will raise
        httpx.TimeoutException if this is exceeded.

        ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,
        but can be set to False for testing purposes.

        ``follow_redirects``: Whether or not to follow redirects. Default value is False.

        ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.


    Attributes:
        raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a
            status code that was not documented in the source OpenAPI document. Can also be provided as a keyword
            argument to the constructor.
        token: The token to use for authentication
        prefix: The prefix to use for the Authorization header
        auth_header_name: The name of the Authorization header
    """

    raise_on_unexpected_status: bool = field(default=False, kw_only=True)
    _base_url: str = field(alias="base_url")
    _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies")
    _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers")
    _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout")
    _verify_ssl: str | bool | ssl.SSLContext = field(
        default=True, kw_only=True, alias="verify_ssl"
    )
    _follow_redirects: bool = field(
        default=False, kw_only=True, alias="follow_redirects"
    )
    _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args")
    _client: httpx.Client | None = field(default=None, init=False)
    _async_client: httpx.AsyncClient | None = field(default=None, init=False)

    token: str
    prefix: str = "Bearer"
    auth_header_name: str = "Authorization"

    def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient":
        """Get a new client matching this one with additional headers"""
        if self._client is not None:
            self._client.headers.update(headers)
        if self._async_client is not None:
            self._async_client.headers.update(headers)
        return evolve(self, headers={**self._headers, **headers})

    def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient":
        """Get a new client matching this one with additional cookies"""
        if self._client is not None:
            self._client.cookies.update(cookies)
        if self._async_client is not None:
            self._async_client.cookies.update(cookies)
        return evolve(self, cookies={**self._cookies, **cookies})

    def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient":
        """Get a new client matching this one with a new timeout configuration"""
        if self._client is not None:
            self._client.timeout = timeout
        if self._async_client is not None:
            self._async_client.timeout = timeout
        return evolve(self, timeout=timeout)

    def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient":
        """Manually set the underlying httpx.Client

        **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
        """
        self._client = client
        return self

    def get_httpx_client(self) -> httpx.Client:
        """Get the underlying httpx.Client, constructing a new one if not previously set"""
        if self._client is None:
            self._headers[self.auth_header_name] = (
                f"{self.prefix} {self.token}" if self.prefix else self.token
            )
            self._client = httpx.Client(
                base_url=self._base_url,
                cookies=self._cookies,
                headers=self._headers,
                timeout=self._timeout,
                verify=self._verify_ssl,
                follow_redirects=self._follow_redirects,
                **self._httpx_args,
            )
        return self._client

    def __enter__(self) -> "AuthenticatedClient":
        """Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
        self.get_httpx_client().__enter__()
        return self

    def __exit__(self, *args: Any, **kwargs: Any) -> None:
        """Exit a context manager for internal httpx.Client (see httpx docs)"""
        self.get_httpx_client().__exit__(*args, **kwargs)

    def set_async_httpx_client(
        self, async_client: httpx.AsyncClient
    ) -> "AuthenticatedClient":
        """Manually set the underlying httpx.AsyncClient

        **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
        """
        self._async_client = async_client
        return self

    def get_async_httpx_client(self) -> httpx.AsyncClient:
        """Get the underlying httpx.AsyncClient, constructing a new one if not previously set"""
        if self._async_client is None:
            self._headers[self.auth_header_name] = (
                f"{self.prefix} {self.token}" if self.prefix else self.token
            )
            self._async_client = httpx.AsyncClient(
                base_url=self._base_url,
                cookies=self._cookies,
                headers=self._headers,
                timeout=self._timeout,
                verify=self._verify_ssl,
                follow_redirects=self._follow_redirects,
                **self._httpx_args,
            )
        return self._async_client

    async def __aenter__(self) -> "AuthenticatedClient":
        """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
        await self.get_async_httpx_client().__aenter__()
        return self

    async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
        """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)"""
        await self.get_async_httpx_client().__aexit__(*args, **kwargs)

__aenter__() async

Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)

Source code in src/stac_transaction_api_client/client.py
289
290
291
292
async def __aenter__(self) -> "AuthenticatedClient":
    """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
    await self.get_async_httpx_client().__aenter__()
    return self

__aexit__(*args, **kwargs) async

Exit a context manager for underlying httpx.AsyncClient (see httpx docs)

Source code in src/stac_transaction_api_client/client.py
294
295
296
async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
    """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)"""
    await self.get_async_httpx_client().__aexit__(*args, **kwargs)

__enter__()

Enter a context manager for self.client—you cannot enter twice (see httpx docs)

Source code in src/stac_transaction_api_client/client.py
253
254
255
256
def __enter__(self) -> "AuthenticatedClient":
    """Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
    self.get_httpx_client().__enter__()
    return self

__exit__(*args, **kwargs)

Exit a context manager for internal httpx.Client (see httpx docs)

Source code in src/stac_transaction_api_client/client.py
258
259
260
def __exit__(self, *args: Any, **kwargs: Any) -> None:
    """Exit a context manager for internal httpx.Client (see httpx docs)"""
    self.get_httpx_client().__exit__(*args, **kwargs)

get_async_httpx_client()

Get the underlying httpx.AsyncClient, constructing a new one if not previously set

Source code in src/stac_transaction_api_client/client.py
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
def get_async_httpx_client(self) -> httpx.AsyncClient:
    """Get the underlying httpx.AsyncClient, constructing a new one if not previously set"""
    if self._async_client is None:
        self._headers[self.auth_header_name] = (
            f"{self.prefix} {self.token}" if self.prefix else self.token
        )
        self._async_client = httpx.AsyncClient(
            base_url=self._base_url,
            cookies=self._cookies,
            headers=self._headers,
            timeout=self._timeout,
            verify=self._verify_ssl,
            follow_redirects=self._follow_redirects,
            **self._httpx_args,
        )
    return self._async_client

get_httpx_client()

Get the underlying httpx.Client, constructing a new one if not previously set

Source code in src/stac_transaction_api_client/client.py
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
def get_httpx_client(self) -> httpx.Client:
    """Get the underlying httpx.Client, constructing a new one if not previously set"""
    if self._client is None:
        self._headers[self.auth_header_name] = (
            f"{self.prefix} {self.token}" if self.prefix else self.token
        )
        self._client = httpx.Client(
            base_url=self._base_url,
            cookies=self._cookies,
            headers=self._headers,
            timeout=self._timeout,
            verify=self._verify_ssl,
            follow_redirects=self._follow_redirects,
            **self._httpx_args,
        )
    return self._client

set_async_httpx_client(async_client)

Manually set the underlying httpx.AsyncClient

NOTE: This will override any other settings on the client, including cookies, headers, and timeout.

Source code in src/stac_transaction_api_client/client.py
262
263
264
265
266
267
268
269
270
def set_async_httpx_client(
    self, async_client: httpx.AsyncClient
) -> "AuthenticatedClient":
    """Manually set the underlying httpx.AsyncClient

    **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
    """
    self._async_client = async_client
    return self

set_httpx_client(client)

Manually set the underlying httpx.Client

NOTE: This will override any other settings on the client, including cookies, headers, and timeout.

Source code in src/stac_transaction_api_client/client.py
228
229
230
231
232
233
234
def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient":
    """Manually set the underlying httpx.Client

    **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
    """
    self._client = client
    return self

with_cookies(cookies)

Get a new client matching this one with additional cookies

Source code in src/stac_transaction_api_client/client.py
212
213
214
215
216
217
218
def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient":
    """Get a new client matching this one with additional cookies"""
    if self._client is not None:
        self._client.cookies.update(cookies)
    if self._async_client is not None:
        self._async_client.cookies.update(cookies)
    return evolve(self, cookies={**self._cookies, **cookies})

with_headers(headers)

Get a new client matching this one with additional headers

Source code in src/stac_transaction_api_client/client.py
204
205
206
207
208
209
210
def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient":
    """Get a new client matching this one with additional headers"""
    if self._client is not None:
        self._client.headers.update(headers)
    if self._async_client is not None:
        self._async_client.headers.update(headers)
    return evolve(self, headers={**self._headers, **headers})

with_timeout(timeout)

Get a new client matching this one with a new timeout configuration

Source code in src/stac_transaction_api_client/client.py
220
221
222
223
224
225
226
def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient":
    """Get a new client matching this one with a new timeout configuration"""
    if self._client is not None:
        self._client.timeout = timeout
    if self._async_client is not None:
        self._async_client.timeout = timeout
    return evolve(self, timeout=timeout)

Client

A class for keeping track of data related to the API

The following are accepted as keyword arguments and will be used to construct httpx Clients internally:

``base_url``: The base URL for the API, all requests are made to a relative path to this URL

``cookies``: A dictionary of cookies to be sent with every request

``headers``: A dictionary of headers to be sent with every request

``timeout``: The maximum amount of a time a request can take. API functions will raise
httpx.TimeoutException if this is exceeded.

``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,
but can be set to False for testing purposes.

``follow_redirects``: Whether or not to follow redirects. Default value is False.

``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.
Attributes:
  • raise_on_unexpected_status (bool) –

    Whether or not to raise an errors.UnexpectedStatus if the API returns a status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor.

Source code in src/stac_transaction_api_client/client.py
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
@define
class Client:
    """A class for keeping track of data related to the API

    The following are accepted as keyword arguments and will be used to construct httpx Clients internally:

        ``base_url``: The base URL for the API, all requests are made to a relative path to this URL

        ``cookies``: A dictionary of cookies to be sent with every request

        ``headers``: A dictionary of headers to be sent with every request

        ``timeout``: The maximum amount of a time a request can take. API functions will raise
        httpx.TimeoutException if this is exceeded.

        ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,
        but can be set to False for testing purposes.

        ``follow_redirects``: Whether or not to follow redirects. Default value is False.

        ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.


    Attributes:
        raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a
            status code that was not documented in the source OpenAPI document. Can also be provided as a keyword
            argument to the constructor.
    """

    raise_on_unexpected_status: bool = field(default=False, kw_only=True)
    _base_url: str = field(alias="base_url")
    _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies")
    _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers")
    _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout")
    _verify_ssl: str | bool | ssl.SSLContext = field(
        default=True, kw_only=True, alias="verify_ssl"
    )
    _follow_redirects: bool = field(
        default=False, kw_only=True, alias="follow_redirects"
    )
    _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args")
    _client: httpx.Client | None = field(default=None, init=False)
    _async_client: httpx.AsyncClient | None = field(default=None, init=False)

    def with_headers(self, headers: dict[str, str]) -> "Client":
        """Get a new client matching this one with additional headers"""
        if self._client is not None:
            self._client.headers.update(headers)
        if self._async_client is not None:
            self._async_client.headers.update(headers)
        return evolve(self, headers={**self._headers, **headers})

    def with_cookies(self, cookies: dict[str, str]) -> "Client":
        """Get a new client matching this one with additional cookies"""
        if self._client is not None:
            self._client.cookies.update(cookies)
        if self._async_client is not None:
            self._async_client.cookies.update(cookies)
        return evolve(self, cookies={**self._cookies, **cookies})

    def with_timeout(self, timeout: httpx.Timeout) -> "Client":
        """Get a new client matching this one with a new timeout configuration"""
        if self._client is not None:
            self._client.timeout = timeout
        if self._async_client is not None:
            self._async_client.timeout = timeout
        return evolve(self, timeout=timeout)

    def set_httpx_client(self, client: httpx.Client) -> "Client":
        """Manually set the underlying httpx.Client

        **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
        """
        self._client = client
        return self

    def get_httpx_client(self) -> httpx.Client:
        """Get the underlying httpx.Client, constructing a new one if not previously set"""
        if self._client is None:
            self._client = httpx.Client(
                base_url=self._base_url,
                cookies=self._cookies,
                headers=self._headers,
                timeout=self._timeout,
                verify=self._verify_ssl,
                follow_redirects=self._follow_redirects,
                **self._httpx_args,
            )
        return self._client

    def __enter__(self) -> "Client":
        """Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
        self.get_httpx_client().__enter__()
        return self

    def __exit__(self, *args: Any, **kwargs: Any) -> None:
        """Exit a context manager for internal httpx.Client (see httpx docs)"""
        self.get_httpx_client().__exit__(*args, **kwargs)

    def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
        """Manually set the underlying httpx.AsyncClient

        **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
        """
        self._async_client = async_client
        return self

    def get_async_httpx_client(self) -> httpx.AsyncClient:
        """Get the underlying httpx.AsyncClient, constructing a new one if not previously set"""
        if self._async_client is None:
            self._async_client = httpx.AsyncClient(
                base_url=self._base_url,
                cookies=self._cookies,
                headers=self._headers,
                timeout=self._timeout,
                verify=self._verify_ssl,
                follow_redirects=self._follow_redirects,
                **self._httpx_args,
            )
        return self._async_client

    async def __aenter__(self) -> "Client":
        """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
        await self.get_async_httpx_client().__aenter__()
        return self

    async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
        """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)"""
        await self.get_async_httpx_client().__aexit__(*args, **kwargs)

__aenter__() async

Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)

Source code in src/stac_transaction_api_client/client.py
143
144
145
146
async def __aenter__(self) -> "Client":
    """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
    await self.get_async_httpx_client().__aenter__()
    return self

__aexit__(*args, **kwargs) async

Exit a context manager for underlying httpx.AsyncClient (see httpx docs)

Source code in src/stac_transaction_api_client/client.py
148
149
150
async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
    """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)"""
    await self.get_async_httpx_client().__aexit__(*args, **kwargs)

__enter__()

Enter a context manager for self.client—you cannot enter twice (see httpx docs)

Source code in src/stac_transaction_api_client/client.py
112
113
114
115
def __enter__(self) -> "Client":
    """Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
    self.get_httpx_client().__enter__()
    return self

__exit__(*args, **kwargs)

Exit a context manager for internal httpx.Client (see httpx docs)

Source code in src/stac_transaction_api_client/client.py
117
118
119
def __exit__(self, *args: Any, **kwargs: Any) -> None:
    """Exit a context manager for internal httpx.Client (see httpx docs)"""
    self.get_httpx_client().__exit__(*args, **kwargs)

get_async_httpx_client()

Get the underlying httpx.AsyncClient, constructing a new one if not previously set

Source code in src/stac_transaction_api_client/client.py
129
130
131
132
133
134
135
136
137
138
139
140
141
def get_async_httpx_client(self) -> httpx.AsyncClient:
    """Get the underlying httpx.AsyncClient, constructing a new one if not previously set"""
    if self._async_client is None:
        self._async_client = httpx.AsyncClient(
            base_url=self._base_url,
            cookies=self._cookies,
            headers=self._headers,
            timeout=self._timeout,
            verify=self._verify_ssl,
            follow_redirects=self._follow_redirects,
            **self._httpx_args,
        )
    return self._async_client

get_httpx_client()

Get the underlying httpx.Client, constructing a new one if not previously set

Source code in src/stac_transaction_api_client/client.py
 98
 99
100
101
102
103
104
105
106
107
108
109
110
def get_httpx_client(self) -> httpx.Client:
    """Get the underlying httpx.Client, constructing a new one if not previously set"""
    if self._client is None:
        self._client = httpx.Client(
            base_url=self._base_url,
            cookies=self._cookies,
            headers=self._headers,
            timeout=self._timeout,
            verify=self._verify_ssl,
            follow_redirects=self._follow_redirects,
            **self._httpx_args,
        )
    return self._client

set_async_httpx_client(async_client)

Manually set the underlying httpx.AsyncClient

NOTE: This will override any other settings on the client, including cookies, headers, and timeout.

Source code in src/stac_transaction_api_client/client.py
121
122
123
124
125
126
127
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
    """Manually set the underlying httpx.AsyncClient

    **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
    """
    self._async_client = async_client
    return self

set_httpx_client(client)

Manually set the underlying httpx.Client

NOTE: This will override any other settings on the client, including cookies, headers, and timeout.

Source code in src/stac_transaction_api_client/client.py
90
91
92
93
94
95
96
def set_httpx_client(self, client: httpx.Client) -> "Client":
    """Manually set the underlying httpx.Client

    **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
    """
    self._client = client
    return self

with_cookies(cookies)

Get a new client matching this one with additional cookies

Source code in src/stac_transaction_api_client/client.py
74
75
76
77
78
79
80
def with_cookies(self, cookies: dict[str, str]) -> "Client":
    """Get a new client matching this one with additional cookies"""
    if self._client is not None:
        self._client.cookies.update(cookies)
    if self._async_client is not None:
        self._async_client.cookies.update(cookies)
    return evolve(self, cookies={**self._cookies, **cookies})

with_headers(headers)

Get a new client matching this one with additional headers

Source code in src/stac_transaction_api_client/client.py
66
67
68
69
70
71
72
def with_headers(self, headers: dict[str, str]) -> "Client":
    """Get a new client matching this one with additional headers"""
    if self._client is not None:
        self._client.headers.update(headers)
    if self._async_client is not None:
        self._async_client.headers.update(headers)
    return evolve(self, headers={**self._headers, **headers})

with_timeout(timeout)

Get a new client matching this one with a new timeout configuration

Source code in src/stac_transaction_api_client/client.py
82
83
84
85
86
87
88
def with_timeout(self, timeout: httpx.Timeout) -> "Client":
    """Get a new client matching this one with a new timeout configuration"""
    if self._client is not None:
        self._client.timeout = timeout
    if self._async_client is not None:
        self._async_client.timeout = timeout
    return evolve(self, timeout=timeout)

Shared response types

stac_transaction_api_client.types

Contains some shared types for properties

File

Contains information for file uploads

Source code in src/stac_transaction_api_client/types.py
42
43
44
45
46
47
48
49
50
51
52
@define
class File:
    """Contains information for file uploads"""

    payload: BinaryIO
    file_name: str | None = None
    mime_type: str | None = None

    def to_tuple(self) -> FileTypes:
        """Return a tuple representation that httpx will accept for multipart/form-data"""
        return self.file_name, self.payload, self.mime_type

to_tuple()

Return a tuple representation that httpx will accept for multipart/form-data

Source code in src/stac_transaction_api_client/types.py
50
51
52
def to_tuple(self) -> FileTypes:
    """Return a tuple representation that httpx will accept for multipart/form-data"""
    return self.file_name, self.payload, self.mime_type

Response

Bases: Generic[T]

A response from an endpoint

Source code in src/stac_transaction_api_client/types.py
58
59
60
61
62
63
64
65
@define
class Response(Generic[T]):
    """A response from an endpoint"""

    status_code: HTTPStatus
    content: bytes
    headers: MutableMapping[str, str]
    parsed: T | None

Error response model

stac_transaction_api_client.models

Exception

Bases: BaseModel

Information about the exception: an error code plus an optional description.

Source code in src/stac_transaction_api_client/models.py
24
25
26
27
28
29
30
31
32
33
34
class Exception(BaseModel):
    """
    Information about the exception: an error code plus an optional description.
    """

    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    code: str
    description: str | None = None

Retrieve an item

stac_transaction_api_client.api.transaction.get_feature

asyncio_detailed(collection_id, feature_id, *, client) async

Fetch the feature with id featureId in the feature collection with id collectionId.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
Source code in src/stac_transaction_api_client/api/transaction/get_feature.py
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
async def asyncio_detailed(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
) -> Response[Item]:
    """Fetch the feature with id `featureId` in the feature collection
    with id `collectionId`.

    Args:
        collection_id (str):
        feature_id (str):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any]
    """

    kwargs = _get_kwargs(
        collection_id=collection_id,
        feature_id=feature_id,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync_detailed(collection_id, feature_id, *, client)

Fetch the feature with id featureId in the feature collection with id collectionId.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
Source code in src/stac_transaction_api_client/api/transaction/get_feature.py
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
def sync_detailed(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
) -> Response[Item]:
    """Fetch the feature with id `featureId` in the feature collection
    with id `collectionId`.

    Args:
        collection_id (str):
        feature_id (str):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any]
    """

    kwargs = _get_kwargs(
        collection_id=collection_id,
        feature_id=feature_id,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

Create an item

stac_transaction_api_client.api.transaction.post_feature

asyncio(collection_id, *, client, body=UNSET) async

add a new STAC Item or Items in an ItemCollection to a collection

create a new STAC Item r Items in an ItemCollection in a specific collection

Parameters:
  • collection_id (str) –
  • body (Item | ItemCollection | Unset, default: UNSET ) –
Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
  • Any | Exception | Item | None –

    Any | Exception_ | Item

Source code in src/stac_transaction_api_client/api/transaction/post_feature.py
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
async def asyncio(
    collection_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Item | ItemCollection | Unset = UNSET,
) -> Any | Exception_ | Item | None:
    """add a new STAC Item or Items in an ItemCollection to a collection

     create a new STAC Item r Items in an ItemCollection in a specific collection

    Args:
        collection_id (str):
        body (Item | ItemCollection | Unset):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Any | Exception_ | Item
    """

    return (
        await asyncio_detailed(
            collection_id=collection_id,
            client=client,
            body=body,
        )
    ).parsed

asyncio_detailed(collection_id, *, client, body=UNSET) async

add a new STAC Item or Items in an ItemCollection to a collection

create a new STAC Item r Items in an ItemCollection in a specific collection

Parameters:
  • collection_id (str) –
  • body (Item | ItemCollection | Unset, default: UNSET ) –
Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
Source code in src/stac_transaction_api_client/api/transaction/post_feature.py
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
async def asyncio_detailed(
    collection_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Item | ItemCollection | Unset = UNSET,
) -> Response[Any | Exception_ | Item]:
    """add a new STAC Item or Items in an ItemCollection to a collection

     create a new STAC Item r Items in an ItemCollection in a specific collection

    Args:
        collection_id (str):
        body (Item | ItemCollection | Unset):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any | Exception_ | Item]
    """

    kwargs = _get_kwargs(
        collection_id=collection_id,
        body=body,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync(collection_id, *, client, body=UNSET)

add a new STAC Item or Items in an ItemCollection to a collection

create a new STAC Item r Items in an ItemCollection in a specific collection

Parameters:
  • collection_id (str) –
  • body (Item | ItemCollection | Unset, default: UNSET ) –
Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
  • Any | Exception | Item | None –

    Any | Exception_ | Item

Source code in src/stac_transaction_api_client/api/transaction/post_feature.py
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
def sync(
    collection_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Item | ItemCollection | Unset = UNSET,
) -> Any | Exception_ | Item | None:
    """add a new STAC Item or Items in an ItemCollection to a collection

     create a new STAC Item r Items in an ItemCollection in a specific collection

    Args:
        collection_id (str):
        body (Item | ItemCollection | Unset):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Any | Exception_ | Item
    """

    return sync_detailed(
        collection_id=collection_id,
        client=client,
        body=body,
    ).parsed

sync_detailed(collection_id, *, client, body=UNSET)

add a new STAC Item or Items in an ItemCollection to a collection

create a new STAC Item r Items in an ItemCollection in a specific collection

Parameters:
  • collection_id (str) –
  • body (Item | ItemCollection | Unset, default: UNSET ) –
Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
Source code in src/stac_transaction_api_client/api/transaction/post_feature.py
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
def sync_detailed(
    collection_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Item | ItemCollection | Unset = UNSET,
) -> Response[Any | Exception_ | Item]:
    """add a new STAC Item or Items in an ItemCollection to a collection

     create a new STAC Item r Items in an ItemCollection in a specific collection

    Args:
        collection_id (str):
        body (Item | ItemCollection | Unset):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any | Exception_ | Item]
    """

    kwargs = _get_kwargs(
        collection_id=collection_id,
        body=body,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

Replace an item

stac_transaction_api_client.api.transaction.update_feature

asyncio(collection_id, feature_id, *, client, body=UNSET, if_match) async

update an existing feature by Id with a complete item definition

Use this method to update an existing feature. Requires the entire GeoJSON description be submitted.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str) –
  • body (PostOrPutItem | Unset, default: UNSET ) –

    An object that is a valid GeoJSON Feature, but not necessarily a valid STAC Item.

Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
  • Any | Exception | Item | None –

    Any | Exception_ | Item

Source code in src/stac_transaction_api_client/api/transaction/update_feature.py
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
async def asyncio(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Item | Unset = UNSET,
    if_match: str,
) -> Any | Exception_ | Item | None:
    """update an existing feature by Id with a complete item definition

     Use this method to update an existing feature. Requires the entire GeoJSON  description be
    submitted.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str):
        body (PostOrPutItem | Unset): An object that is a valid GeoJSON Feature, but not
            necessarily a valid STAC Item.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Any | Exception_ | Item
    """

    return (
        await asyncio_detailed(
            collection_id=collection_id,
            feature_id=feature_id,
            client=client,
            body=body,
            if_match=if_match,
        )
    ).parsed

asyncio_detailed(collection_id, feature_id, *, client, body=UNSET, if_match) async

update an existing feature by Id with a complete item definition

Use this method to update an existing feature. Requires the entire GeoJSON description be submitted.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str) –
  • body (PostOrPutItem | Unset, default: UNSET ) –

    An object that is a valid GeoJSON Feature, but not necessarily a valid STAC Item.

Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
Source code in src/stac_transaction_api_client/api/transaction/update_feature.py
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
async def asyncio_detailed(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Item | Unset = UNSET,
    if_match: str,
) -> Response[Any | Exception_ | Item]:
    """update an existing feature by Id with a complete item definition

     Use this method to update an existing feature. Requires the entire GeoJSON  description be
    submitted.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str):
        body (PostOrPutItem | Unset): An object that is a valid GeoJSON Feature, but not
            necessarily a valid STAC Item.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any | Exception_ | Item]
    """

    kwargs = _get_kwargs(
        collection_id=collection_id,
        feature_id=feature_id,
        body=body,
        if_match=if_match,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync(collection_id, feature_id, *, client, body=UNSET, if_match)

update an existing feature by Id with a complete item definition

Use this method to update an existing feature. Requires the entire GeoJSON description be submitted.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str) –
  • body (PostOrPutItem | Unset, default: UNSET ) –

    An object that is a valid GeoJSON Feature, but not necessarily a valid STAC Item.

Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
  • Any | Exception | Item | None –

    Any | Exception_ | Item

Source code in src/stac_transaction_api_client/api/transaction/update_feature.py
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
def sync(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Item | Unset = UNSET,
    if_match: str,
) -> Any | Exception_ | Item | None:
    """update an existing feature by Id with a complete item definition

     Use this method to update an existing feature. Requires the entire GeoJSON  description be
    submitted.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str):
        body (PostOrPutItem | Unset): An object that is a valid GeoJSON Feature, but not
            necessarily a valid STAC Item.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Any | Exception_ | Item
    """

    return sync_detailed(
        collection_id=collection_id,
        feature_id=feature_id,
        client=client,
        body=body,
        if_match=if_match,
    ).parsed

sync_detailed(collection_id, feature_id, *, client, body=UNSET, if_match)

update an existing feature by Id with a complete item definition

Use this method to update an existing feature. Requires the entire GeoJSON description be submitted.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str) –
  • body (PostOrPutItem | Unset, default: UNSET ) –

    An object that is a valid GeoJSON Feature, but not necessarily a valid STAC Item.

Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
Source code in src/stac_transaction_api_client/api/transaction/update_feature.py
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
def sync_detailed(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Item | Unset = UNSET,
    if_match: str,
) -> Response[Any | Exception_ | Item]:
    """update an existing feature by Id with a complete item definition

     Use this method to update an existing feature. Requires the entire GeoJSON  description be
    submitted.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str):
        body (PostOrPutItem | Unset): An object that is a valid GeoJSON Feature, but not
            necessarily a valid STAC Item.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any | Exception_ | Item]
    """

    kwargs = _get_kwargs(
        collection_id=collection_id,
        feature_id=feature_id,
        body=body,
        if_match=if_match,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

Patch an item

stac_transaction_api_client.api.transaction.patch_feature

asyncio(collection_id, feature_id, *, client, body=UNSET, if_match=UNSET) async

update an existing feature by Id with a partial item definition

Use this method to update an existing feature. Requires a GeoJSON fragment (containing the fields to be updated) be submitted.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str | Unset, default: UNSET ) –
  • body (Mapping[str, Any] | Item | Unset, default: UNSET ) –

    An object that contains at least a subset of the fields for a STAC Item.

Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
  • Any | Exception | Item | None –

    Any | Exception_ | Item

Source code in src/stac_transaction_api_client/api/transaction/patch_feature.py
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
async def asyncio(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Mapping[str, Any] | Item | Unset = UNSET,
    if_match: str | Unset = UNSET,
) -> Any | Exception_ | Item | None:
    """update an existing feature by Id with a partial item definition

     Use this method to update an existing feature. Requires a GeoJSON fragment (containing the fields to
    be updated) be submitted.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str | Unset):
        body (Mapping[str, Any] | Item | Unset): An object that contains at least a subset of the fields for a
            STAC Item.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Any | Exception_ | Item
    """

    return (
        await asyncio_detailed(
            collection_id=collection_id,
            feature_id=feature_id,
            client=client,
            body=body,
            if_match=if_match,
        )
    ).parsed

asyncio_detailed(collection_id, feature_id, *, client, body=UNSET, if_match=UNSET) async

update an existing feature by Id with a partial item definition

Use this method to update an existing feature. Requires a GeoJSON fragment (containing the fields to be updated) be submitted.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str | Unset, default: UNSET ) –
  • body (Mapping[str, Any] | Item | Unset, default: UNSET ) –

    An object that contains at least a subset of the fields for a STAC Item.

Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
Source code in src/stac_transaction_api_client/api/transaction/patch_feature.py
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
async def asyncio_detailed(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Mapping[str, Any] | Item | Unset = UNSET,
    if_match: str | Unset = UNSET,
) -> Response[Any | Exception_ | Item]:
    """update an existing feature by Id with a partial item definition

     Use this method to update an existing feature. Requires a GeoJSON fragment (containing the fields to
    be updated) be submitted.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str | Unset):
        body (Mapping[str, Any] | Item | Unset): An object that contains at least a subset of the fields for a
            STAC Item.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any | Exception_ | Item]
    """

    kwargs = _get_kwargs(
        collection_id=collection_id,
        feature_id=feature_id,
        body=body,
        if_match=if_match,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync(collection_id, feature_id, *, client, body=UNSET, if_match=UNSET)

update an existing feature by Id with a partial item definition

Use this method to update an existing feature. Requires a GeoJSON fragment (containing the fields to be updated) be submitted.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str | Unset, default: UNSET ) –
  • body (Mapping[str, Any] | Item | Unset, default: UNSET ) –

    An object that contains at least a subset of the fields for a STAC Item.

Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
  • Any | Exception | Item | None –

    Any | Exception_ | Item

Source code in src/stac_transaction_api_client/api/transaction/patch_feature.py
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
def sync(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Mapping[str, Any] | Item | Unset = UNSET,
    if_match: str | Unset = UNSET,
) -> Any | Exception_ | Item | None:
    """update an existing feature by Id with a partial item definition

     Use this method to update an existing feature. Requires a GeoJSON fragment (containing the fields to
    be updated) be submitted.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str | Unset):
        body (Mapping[str, Any] | Item | Unset): An object that contains at least a subset of the fields for a
            STAC Item.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Any | Exception_ | Item
    """

    return sync_detailed(
        collection_id=collection_id,
        feature_id=feature_id,
        client=client,
        body=body,
        if_match=if_match,
    ).parsed

sync_detailed(collection_id, feature_id, *, client, body=UNSET, if_match=UNSET)

update an existing feature by Id with a partial item definition

Use this method to update an existing feature. Requires a GeoJSON fragment (containing the fields to be updated) be submitted.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str | Unset, default: UNSET ) –
  • body (Mapping[str, Any] | Item | Unset, default: UNSET ) –

    An object that contains at least a subset of the fields for a STAC Item.

Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
Source code in src/stac_transaction_api_client/api/transaction/patch_feature.py
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
def sync_detailed(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    body: Mapping[str, Any] | Item | Unset = UNSET,
    if_match: str | Unset = UNSET,
) -> Response[Any | Exception_ | Item]:
    """update an existing feature by Id with a partial item definition

     Use this method to update an existing feature. Requires a GeoJSON fragment (containing the fields to
    be updated) be submitted.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str | Unset):
        body (Mapping[str, Any] | Item | Unset): An object that contains at least a subset of the fields for a
            STAC Item.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any | Exception_ | Item]
    """

    kwargs = _get_kwargs(
        collection_id=collection_id,
        feature_id=feature_id,
        body=body,
        if_match=if_match,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

Delete an item

stac_transaction_api_client.api.transaction.delete_feature

asyncio(collection_id, feature_id, *, client, if_match) async

delete an existing feature by Id

Use this method to delete an existing feature.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str) –
Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
  • Any | Exception | None –

    Any | Exception_

Source code in src/stac_transaction_api_client/api/transaction/delete_feature.py
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
async def asyncio(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    if_match: str,
) -> Any | Exception_ | None:
    """delete an existing feature by Id

     Use this method to delete an existing feature.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Any | Exception_
    """

    return (
        await asyncio_detailed(
            collection_id=collection_id,
            feature_id=feature_id,
            client=client,
            if_match=if_match,
        )
    ).parsed

asyncio_detailed(collection_id, feature_id, *, client, if_match) async

delete an existing feature by Id

Use this method to delete an existing feature.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str) –
Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
Source code in src/stac_transaction_api_client/api/transaction/delete_feature.py
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
async def asyncio_detailed(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    if_match: str,
) -> Response[Any | Exception_]:
    """delete an existing feature by Id

     Use this method to delete an existing feature.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any | Exception_]
    """

    kwargs = _get_kwargs(
        collection_id=collection_id,
        feature_id=feature_id,
        if_match=if_match,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync(collection_id, feature_id, *, client, if_match)

delete an existing feature by Id

Use this method to delete an existing feature.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str) –
Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
  • Any | Exception | None –

    Any | Exception_

Source code in src/stac_transaction_api_client/api/transaction/delete_feature.py
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
def sync(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    if_match: str,
) -> Any | Exception_ | None:
    """delete an existing feature by Id

     Use this method to delete an existing feature.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Any | Exception_
    """

    return sync_detailed(
        collection_id=collection_id,
        feature_id=feature_id,
        client=client,
        if_match=if_match,
    ).parsed

sync_detailed(collection_id, feature_id, *, client, if_match)

delete an existing feature by Id

Use this method to delete an existing feature.

Parameters:
  • collection_id (str) –
  • feature_id (str) –
  • if_match (str) –
Raises:
  • UnexpectedStatus –

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException –

    If the request takes longer than Client.timeout.

Returns:
Source code in src/stac_transaction_api_client/api/transaction/delete_feature.py
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
def sync_detailed(
    collection_id: str,
    feature_id: str,
    *,
    client: AuthenticatedClient | Client,
    if_match: str,
) -> Response[Any | Exception_]:
    """delete an existing feature by Id

     Use this method to delete an existing feature.

    Args:
        collection_id (str):
        feature_id (str):
        if_match (str):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any | Exception_]
    """

    kwargs = _get_kwargs(
        collection_id=collection_id,
        feature_id=feature_id,
        if_match=if_match,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)