Skip to content

Commit 6ac7d0e

Browse files
committed
update format
1 parent 39ed1bb commit 6ac7d0e

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

synapseclient/models/mixins/json_schema.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ async def bind_schema_async(
210210
211211
Example: Using this function
212212
Binding JSON schema to a folder or a file
213+
214+
```python
213215
import synapseclient
214216
from synapseclient.models import File, Folder
215217
import asyncio
@@ -277,7 +279,7 @@ async def bind_schema_to_file():
277279
)
278280
return bound_schema_file
279281
asyncio.run(bind_schema_to_file())
280-
282+
```
281283
Returns:
282284
JSONSchemaBinding: An object containing details about the JSON schema binding.
283285
"""
@@ -319,6 +321,8 @@ async def get_schema_async(
319321
320322
Example: Using this function
321323
Retrieving the bound JSON schema from a folder or file
324+
325+
```python
322326
import synapseclient
323327
from synapseclient.models import File, Folder
324328
import asyncio
@@ -399,7 +403,7 @@ async def get_bound_schema_from_file():
399403
return bound_schema_file
400404
bound_schema_file = asyncio.run(get_bound_schema_from_file())
401405
print("Bound schema from file retrieved:", bound_schema_file)
402-
406+
```
403407
Returns:
404408
JSONSchemaBinding: An object containing details about the bound JSON schema.
405409
"""
@@ -441,6 +445,8 @@ async def unbind_schema_async(
441445
442446
Example: Using this function
443447
Unbinding a JSON schema from a folder or file
448+
449+
```python
444450
import synapseclient
445451
from synapseclient.models import File, Folder
446452
import asyncio
@@ -520,6 +526,7 @@ async def unbind_schema_from_file():
520526
response = await example_file.unbind_schema_async()
521527
return response
522528
unbind_response_file = asyncio.run(unbind_schema_from_file())
529+
```
523530
"""
524531
return await delete_json_schema_from_entity(
525532
synapse_id=self.id, synapse_client=synapse_client
@@ -537,6 +544,8 @@ async def validate_schema_async(
537544
538545
Example: Using this function
539546
Validating a folder or file against the bound JSON schema
547+
548+
```python
540549
import synapseclient
541550
from synapseclient.models import File, Folder
542551
import asyncio
@@ -625,6 +634,7 @@ async def validate_file_with_json_schema():
625634
return response
626635
validation_response_file = asyncio.run(validate_file_with_json_schema())
627636
print('validation response:', validation_response_file)
637+
```
628638
Returns:
629639
Union[JSONSchemaValidation, InvalidJSONSchemaValidation]: The validation results.
630640
"""
@@ -698,6 +708,8 @@ async def get_schema_derived_keys_async(
698708
699709
Example: Using this function
700710
Retrieving derived keys from a folder or file
711+
712+
```python
701713
import synapseclient
702714
from synapseclient.models import File, Folder
703715
import asyncio
@@ -784,7 +796,7 @@ async def get_schema_derived_keys_from_file():
784796
derived_keys_file = await example_file.get_schema_derived_keys_async()
785797
return derived_keys_file
786798
print('Derived keys from file:', asyncio.run(get_schema_derived_keys_from_file()))
787-
799+
```
788800
Returns:
789801
JSONSchemaDerivedKeys: An object containing the derived keys for the entity.
790802
"""
@@ -815,6 +827,7 @@ async def get_schema_validation_statistics_async(
815827
Example: Using this function
816828
Retrieving validation statistics for a folder
817829
830+
```python
818831
import synapseclient
819832
from synapseclient.models import File, Folder
820833
import asyncio
@@ -880,7 +893,7 @@ async def get_validation_statistics():
880893
881894
stats = asyncio.run(get_validation_statistics())
882895
print('Validation statistics:', stats)
883-
896+
```
884897
Returns:
885898
JSONSchemaValidationStatistics: The validation statistics.
886899
"""
@@ -908,6 +921,8 @@ async def get_invalid_validation_async(
908921
909922
Example: Using this function
910923
Retrieving invalid validation results for a folder
924+
925+
```python
911926
import synapseclient
912927
from synapseclient.models import File, Folder
913928
import asyncio
@@ -971,6 +986,7 @@ async def get_invalid_validation_async():
971986
gen = test_folder.get_invalid_validation_async(synapse_client=syn)
972987
async for child in gen:
973988
print(child)
989+
```
974990
975991
Yields:
976992
InvalidJSONSchemaValidation: An object containing the validation response, all validation messages,
@@ -1036,6 +1052,8 @@ def get_invalid_validation(
10361052
10371053
Example: Using this function
10381054
Retrieving invalid validation results for a folder
1055+
1056+
```python
10391057
import synapseclient
10401058
from synapseclient.models import File, Folder
10411059
import asyncio
@@ -1098,6 +1116,7 @@ async def bind_json_schema():
10981116
invalid_results = test_folder.get_invalid_validation(synapse_client=syn)
10991117
for child in invalid_results:
11001118
print(child)
1119+
```
11011120
11021121
Yields:
11031122
InvalidJSONSchemaValidation: An object containing the validation response, all validation messages,

0 commit comments

Comments
 (0)