Skip to content

Commit 54d1aec

Browse files
fix: BROS-870: SAML Attributes are not getting propely saved (#796)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent ece0a2f commit 54d1aec

9 files changed

Lines changed: 703 additions & 148 deletions

File tree

poetry.lock

Lines changed: 167 additions & 148 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reference.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,82 @@ client.annotation_history.delete()
315315
</dl>
316316

317317

318+
</dd>
319+
</dl>
320+
</details>
321+
322+
<details><summary><code>client.annotation_history.<a href="src/label_studio_sdk/annotation_history/client.py">retrieve</a>(...) -&gt; AsyncHttpResponse[AnnotationHistory]</code></summary>
323+
<dl>
324+
<dd>
325+
326+
#### 📝 Description
327+
328+
<dl>
329+
<dd>
330+
331+
<dl>
332+
<dd>
333+
334+
<Card href="https://humansignal.com/goenterprise">
335+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
336+
<p style="margin-top: 10px; font-size: 14px;">
337+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
338+
</p>
339+
</Card>
340+
Get one annotation history item by ID with full result. Used when FIT-720 lazy load is on and the user clicks a stubbed history item to hydrate it.
341+
</dd>
342+
</dl>
343+
</dd>
344+
</dl>
345+
346+
#### 🔌 Usage
347+
348+
<dl>
349+
<dd>
350+
351+
<dl>
352+
<dd>
353+
354+
```python
355+
from label_studio_sdk import LabelStudio
356+
357+
client = LabelStudio(
358+
api_key="YOUR_API_KEY",
359+
)
360+
client.annotation_history.retrieve(
361+
id=1,
362+
)
363+
364+
```
365+
</dd>
366+
</dl>
367+
</dd>
368+
</dl>
369+
370+
#### ⚙️ Parameters
371+
372+
<dl>
373+
<dd>
374+
375+
<dl>
376+
<dd>
377+
378+
**id:** `int`
379+
380+
</dd>
381+
</dl>
382+
383+
<dl>
384+
<dd>
385+
386+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
387+
388+
</dd>
389+
</dl>
390+
</dd>
391+
</dl>
392+
393+
318394
</dd>
319395
</dl>
320396
</details>
@@ -39201,6 +39277,82 @@ client.sso.saml.reset()
3920139277
</dl>
3920239278

3920339279

39280+
</dd>
39281+
</dl>
39282+
</details>
39283+
39284+
<details><summary><code>client.sso.saml.<a href="src/label_studio_sdk/sso/saml/client.py">validate_metadata_url</a>(...) -&gt; AsyncHttpResponse[ValidateSamlMetadataUrlResponse]</code></summary>
39285+
<dl>
39286+
<dd>
39287+
39288+
#### 📝 Description
39289+
39290+
<dl>
39291+
<dd>
39292+
39293+
<dl>
39294+
<dd>
39295+
39296+
<Card href="https://humansignal.com/goenterprise">
39297+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
39298+
<p style="margin-top: 10px; font-size: 14px;">
39299+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
39300+
</p>
39301+
</Card>
39302+
Validate a SAML metadata URL by fetching it and checking whether it returns valid XML, without saving any settings.
39303+
</dd>
39304+
</dl>
39305+
</dd>
39306+
</dl>
39307+
39308+
#### 🔌 Usage
39309+
39310+
<dl>
39311+
<dd>
39312+
39313+
<dl>
39314+
<dd>
39315+
39316+
```python
39317+
from label_studio_sdk import LabelStudio
39318+
39319+
client = LabelStudio(
39320+
api_key="YOUR_API_KEY",
39321+
)
39322+
client.sso.saml.validate_metadata_url(
39323+
metadata_url="metadata_url",
39324+
)
39325+
39326+
```
39327+
</dd>
39328+
</dl>
39329+
</dd>
39330+
</dl>
39331+
39332+
#### ⚙️ Parameters
39333+
39334+
<dl>
39335+
<dd>
39336+
39337+
<dl>
39338+
<dd>
39339+
39340+
**metadata_url:** `str`
39341+
39342+
</dd>
39343+
</dl>
39344+
39345+
<dl>
39346+
<dd>
39347+
39348+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
39349+
39350+
</dd>
39351+
</dl>
39352+
</dd>
39353+
</dl>
39354+
39355+
3920439356
</dd>
3920539357
</dl>
3920639358
</details>

src/label_studio_sdk/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@
237237
TypeEnum,
238238
UserSimple,
239239
UserSimpleRequest,
240+
ValidateSamlMetadataUrlResponse,
240241
VersionResponse,
241242
View,
242243
Webhook,
@@ -657,6 +658,7 @@
657658
"UpdateViewsRequestDataOrderingItem": ".views",
658659
"UserSimple": ".types",
659660
"UserSimpleRequest": ".types",
661+
"ValidateSamlMetadataUrlResponse": ".types",
660662
"VersionResponse": ".types",
661663
"View": ".types",
662664
"Webhook": ".types",
@@ -1024,6 +1026,7 @@ def __dir__():
10241026
"UpdateViewsRequestDataOrderingItem",
10251027
"UserSimple",
10261028
"UserSimpleRequest",
1029+
"ValidateSamlMetadataUrlResponse",
10271030
"VersionResponse",
10281031
"View",
10291032
"Webhook",

src/label_studio_sdk/annotation_history/client.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,42 @@ def delete(
119119
)
120120
return _response.data
121121

122+
def retrieve(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> AnnotationHistory:
123+
"""
124+
<Card href="https://humansignal.com/goenterprise">
125+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
126+
<p style="margin-top: 10px; font-size: 14px;">
127+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
128+
</p>
129+
</Card>
130+
Get one annotation history item by ID with full result. Used when FIT-720 lazy load is on and the user clicks a stubbed history item to hydrate it.
131+
132+
Parameters
133+
----------
134+
id : int
135+
136+
request_options : typing.Optional[RequestOptions]
137+
Request-specific configuration.
138+
139+
Returns
140+
-------
141+
AnnotationHistory
142+
143+
144+
Examples
145+
--------
146+
from label_studio_sdk import LabelStudio
147+
148+
client = LabelStudio(
149+
api_key="YOUR_API_KEY",
150+
)
151+
client.annotation_history.retrieve(
152+
id=1,
153+
)
154+
"""
155+
_response = self._raw_client.retrieve(id, request_options=request_options)
156+
return _response.data
157+
122158
def list_for_project(
123159
self,
124160
id: int,
@@ -298,6 +334,50 @@ async def main() -> None:
298334
)
299335
return _response.data
300336

337+
async def retrieve(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> AnnotationHistory:
338+
"""
339+
<Card href="https://humansignal.com/goenterprise">
340+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
341+
<p style="margin-top: 10px; font-size: 14px;">
342+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
343+
</p>
344+
</Card>
345+
Get one annotation history item by ID with full result. Used when FIT-720 lazy load is on and the user clicks a stubbed history item to hydrate it.
346+
347+
Parameters
348+
----------
349+
id : int
350+
351+
request_options : typing.Optional[RequestOptions]
352+
Request-specific configuration.
353+
354+
Returns
355+
-------
356+
AnnotationHistory
357+
358+
359+
Examples
360+
--------
361+
import asyncio
362+
363+
from label_studio_sdk import AsyncLabelStudio
364+
365+
client = AsyncLabelStudio(
366+
api_key="YOUR_API_KEY",
367+
)
368+
369+
370+
async def main() -> None:
371+
await client.annotation_history.retrieve(
372+
id=1,
373+
)
374+
375+
376+
asyncio.run(main())
377+
"""
378+
_response = await self._raw_client.retrieve(id, request_options=request_options)
379+
return _response.data
380+
301381
async def list_for_project(
302382
self,
303383
id: int,

src/label_studio_sdk/annotation_history/raw_client.py

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,50 @@ def delete(
135135
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
136136
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
137137

138+
def retrieve(
139+
self, id: int, *, request_options: typing.Optional[RequestOptions] = None
140+
) -> HttpResponse[AnnotationHistory]:
141+
"""
142+
<Card href="https://humansignal.com/goenterprise">
143+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
144+
<p style="margin-top: 10px; font-size: 14px;">
145+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
146+
</p>
147+
</Card>
148+
Get one annotation history item by ID with full result. Used when FIT-720 lazy load is on and the user clicks a stubbed history item to hydrate it.
149+
150+
Parameters
151+
----------
152+
id : int
153+
154+
request_options : typing.Optional[RequestOptions]
155+
Request-specific configuration.
156+
157+
Returns
158+
-------
159+
HttpResponse[AnnotationHistory]
160+
161+
"""
162+
_response = self._client_wrapper.httpx_client.request(
163+
f"api/annotation-history/{jsonable_encoder(id)}/",
164+
method="GET",
165+
request_options=request_options,
166+
)
167+
try:
168+
if 200 <= _response.status_code < 300:
169+
_data = typing.cast(
170+
AnnotationHistory,
171+
construct_type(
172+
type_=AnnotationHistory, # type: ignore
173+
object_=_response.json(),
174+
),
175+
)
176+
return HttpResponse(response=_response, data=_data)
177+
_response_json = _response.json()
178+
except JSONDecodeError:
179+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
180+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
181+
138182
def list_for_project(
139183
self,
140184
id: int,
@@ -316,6 +360,50 @@ async def delete(
316360
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
317361
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
318362

363+
async def retrieve(
364+
self, id: int, *, request_options: typing.Optional[RequestOptions] = None
365+
) -> AsyncHttpResponse[AnnotationHistory]:
366+
"""
367+
<Card href="https://humansignal.com/goenterprise">
368+
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
369+
<p style="margin-top: 10px; font-size: 14px;">
370+
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
371+
</p>
372+
</Card>
373+
Get one annotation history item by ID with full result. Used when FIT-720 lazy load is on and the user clicks a stubbed history item to hydrate it.
374+
375+
Parameters
376+
----------
377+
id : int
378+
379+
request_options : typing.Optional[RequestOptions]
380+
Request-specific configuration.
381+
382+
Returns
383+
-------
384+
AsyncHttpResponse[AnnotationHistory]
385+
386+
"""
387+
_response = await self._client_wrapper.httpx_client.request(
388+
f"api/annotation-history/{jsonable_encoder(id)}/",
389+
method="GET",
390+
request_options=request_options,
391+
)
392+
try:
393+
if 200 <= _response.status_code < 300:
394+
_data = typing.cast(
395+
AnnotationHistory,
396+
construct_type(
397+
type_=AnnotationHistory, # type: ignore
398+
object_=_response.json(),
399+
),
400+
)
401+
return AsyncHttpResponse(response=_response, data=_data)
402+
_response_json = _response.json()
403+
except JSONDecodeError:
404+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
405+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
406+
319407
async def list_for_project(
320408
self,
321409
id: int,

0 commit comments

Comments
 (0)