@@ -19,7 +19,9 @@ def __init__(self, client):
19
19
super ().__init__ (client )
20
20
self .factory = ModelFactory (Project )
21
21
22
- def list (self , team_id : str = None , include_deleted : bool = False ) -> list [Project ]:
22
+ def list (
23
+ self , team_id : str | None = None , include_deleted : bool = False
24
+ ) -> list [Project ]:
23
25
"""
24
26
List projects.
25
27
@@ -37,7 +39,7 @@ def list(self, team_id: str = None, include_deleted: bool = False) -> list[Proje
37
39
response = self ._get ("v1/projects" , params )
38
40
return self .factory .create_list (response )
39
41
40
- def get (self , project_id : str , team_id : str = None ) -> Project :
42
+ def get (self , project_id : str , team_id : str | None = None ) -> Project :
41
43
"""
42
44
Get a project by ID.
43
45
@@ -55,7 +57,9 @@ def get(self, project_id: str, team_id: str = None) -> Project:
55
57
response = self ._get (f"v1/projects/{ project_id } " , params )
56
58
return self .factory .create (response )
57
59
58
- def create (self , name : str , team_id : str , description : str = None ) -> Project :
60
+ def create (
61
+ self , name : str , team_id : str , description : str | None = None
62
+ ) -> Project :
59
63
"""
60
64
Create a new project.
61
65
@@ -81,7 +85,7 @@ def create(self, name: str, team_id: str, description: str = None) -> Project:
81
85
return project
82
86
83
87
def update (
84
- self , project_id : str , name : str = None , description : str = None
88
+ self , project_id : str , name : str | None = None , description : str | None = None
85
89
) -> Project :
86
90
"""
87
91
Update a project.
@@ -149,7 +153,7 @@ def __init__(self, client):
149
153
super ().__init__ (client )
150
154
self .factory = ModelFactory (DataSource )
151
155
152
- def list (self , project_id : str = None ) -> list [DataSource ]:
156
+ def list (self , project_id : str | None = None ) -> list [DataSource ]:
153
157
"""
154
158
List data sources for a project.
155
159
@@ -181,7 +185,11 @@ def get(self, datasource_id: str) -> DataSource:
181
185
return self .factory .create (response )
182
186
183
187
def create (
184
- self , name : str , project_id : str = None , type : str = None , uri : str = None
188
+ self ,
189
+ name : str ,
190
+ project_id : str | None = None ,
191
+ type : str | None = None ,
192
+ uri : str | None = None ,
185
193
) -> DataSource :
186
194
"""
187
195
Create a new data source.
@@ -212,7 +220,11 @@ def create(
212
220
return self .factory .create (response )
213
221
214
222
def update (
215
- self , datasource_id : str , name : str = None , type : str = None , uri : str = None
223
+ self ,
224
+ datasource_id : str ,
225
+ name : str | None = None ,
226
+ type : str | None = None ,
227
+ uri : str | None = None ,
216
228
) -> DataSource :
217
229
"""
218
230
Update a data source.
@@ -259,9 +271,9 @@ def upload(
259
271
self ,
260
272
datasource_id : str ,
261
273
file_path : str ,
262
- project_id : str = None ,
263
- source_url : str = None ,
264
- file_type : str = None ,
274
+ project_id : str | None = None ,
275
+ source_url : str | None = None ,
276
+ file_type : str | None = None ,
265
277
) -> dict :
266
278
"""
267
279
Upload a file to a data source.
@@ -307,7 +319,7 @@ def __init__(self, client):
307
319
super ().__init__ (client )
308
320
self .factory = ModelFactory (DataLine )
309
321
310
- def list (self , project_id : str = None ) -> list [DataLine ]:
322
+ def list (self , project_id : str | None = None ) -> list [DataLine ]:
311
323
"""
312
324
List data lines for a project.
313
325
@@ -341,10 +353,10 @@ def get(self, dataline_id: str) -> DataLine:
341
353
def create (
342
354
self ,
343
355
name : str ,
344
- project_id : str = None ,
345
- dataobject_id : str = None ,
346
- schema_code : str = None ,
347
- data_model : dict = None ,
356
+ project_id : str | None = None ,
357
+ dataobject_id : str | None = None ,
358
+ schema_code : str | None = None ,
359
+ data_model : dict | None = None ,
348
360
) -> DataLine :
349
361
"""
350
362
Create a new data line.
@@ -378,9 +390,9 @@ def create(
378
390
def update (
379
391
self ,
380
392
dataline_id : str ,
381
- name : str = None ,
382
- dataobject_id : str = None ,
383
- data_model : dict = None ,
393
+ name : str | None = None ,
394
+ dataobject_id : str | None = None ,
395
+ data_model : dict | None = None ,
384
396
) -> DataLine :
385
397
"""
386
398
Update a data line.
@@ -418,7 +430,9 @@ def update_schema(self, dataline_id: str, schema_code: str) -> DataLine:
418
430
Returns:
419
431
Updated data line
420
432
"""
421
- response = self ._patch (f"v1/datalines/{ dataline_id } /schema" , data = schema_code )
433
+ response = self ._patch (
434
+ f"v1/datalines/{ dataline_id } /schema" , data = {"schema_code" : schema_code }
435
+ )
422
436
return self .factory .create (response )
423
437
424
438
def delete (self , dataline_id : str , permanent : bool = False ) -> DataLine :
@@ -444,7 +458,7 @@ def __init__(self, client):
444
458
super ().__init__ (client )
445
459
self .factory = ModelFactory (Team )
446
460
447
- def list (self , organization_id : str = None ) -> list [Team ]:
461
+ def list (self , organization_id : str | None = None ) -> list [Team ]:
448
462
"""
449
463
List teams.
450
464
@@ -478,7 +492,7 @@ def get(self, team_id: str) -> Team:
478
492
response = self ._get (f"v1/teams/{ team_id } " )
479
493
return self .factory .create (response )
480
494
481
- def create (self , name : str , organization_id : str = None ) -> Team :
495
+ def create (self , name : str , organization_id : str | None = None ) -> Team :
482
496
"""
483
497
Create a new team.
484
498
@@ -609,9 +623,9 @@ def get_by_clerk_id(self, clerk_org_id: str) -> Organization:
609
623
def create (
610
624
self ,
611
625
name : str ,
612
- description : str = None ,
613
- platform_id : str = None ,
614
- clerk_org_id : str = None ,
626
+ description : str | None = None ,
627
+ platform_id : str | None = None ,
628
+ clerk_org_id : str | None = None ,
615
629
) -> Organization :
616
630
"""
617
631
Create a new organization.
@@ -645,7 +659,10 @@ def create(
645
659
return org
646
660
647
661
def update (
648
- self , organization_id : str , name : str = None , description : str = None
662
+ self ,
663
+ organization_id : str ,
664
+ name : str | None = None ,
665
+ description : str | None = None ,
649
666
) -> Organization :
650
667
"""
651
668
Update an organization.
@@ -711,7 +728,7 @@ def __init__(self, client):
711
728
super ().__init__ (client )
712
729
self .factory = ModelFactory (User )
713
730
714
- def list (self , organization_id : str = None ) -> list [User ]:
731
+ def list (self , organization_id : str | None = None ) -> list [User ]:
715
732
"""
716
733
List users.
717
734
@@ -754,9 +771,9 @@ def get_current(self) -> User:
754
771
def create (
755
772
self ,
756
773
email : str ,
757
- name : str = None ,
758
- organization_id : str = None ,
759
- role : str = None ,
774
+ name : str | None = None ,
775
+ organization_id : str | None = None ,
776
+ role : str | None = None ,
760
777
) -> User :
761
778
"""
762
779
Create a new user.
@@ -785,7 +802,11 @@ def create(
785
802
return self .factory .create (response )
786
803
787
804
def update (
788
- self , user_id : str , email : str = None , name : str = None , role : str = None
805
+ self ,
806
+ user_id : str ,
807
+ email : str | None = None ,
808
+ name : str | None = None ,
809
+ role : str | None = None ,
789
810
) -> User :
790
811
"""
791
812
Update a user.
@@ -842,7 +863,10 @@ def move(self, user_id: str, new_organization_id: str) -> User:
842
863
return self .factory .create (response )
843
864
844
865
def get_teams_with_organizations_and_projects (
845
- self , user_id : str = None , clerk_user_id : str = None , email : str = None
866
+ self ,
867
+ user_id : str | None = None ,
868
+ clerk_user_id : str | None = None ,
869
+ email : str | None = None ,
846
870
) -> dict :
847
871
"""
848
872
Get teams, organizations, and projects for a user.
@@ -881,8 +905,8 @@ def __init__(self, client):
881
905
882
906
def list (
883
907
self ,
884
- project_id : str = None ,
885
- dataline_id : str = None ,
908
+ project_id : str | None = None ,
909
+ dataline_id : str | None = None ,
886
910
skip : int = 0 ,
887
911
take : int = 100 ,
888
912
include_deleted : bool = False ,
@@ -937,7 +961,7 @@ def create(
937
961
question : str ,
938
962
code : str ,
939
963
dataline_id : str ,
940
- project_id : str = None ,
964
+ project_id : str | None = None ,
941
965
) -> QueryProgram :
942
966
"""
943
967
Create a new query program.
@@ -971,9 +995,9 @@ def create(
971
995
def update (
972
996
self ,
973
997
queryprogram_id : str ,
974
- name : str = None ,
975
- question : str = None ,
976
- code : str = None ,
998
+ name : str | None = None ,
999
+ question : str | None = None ,
1000
+ code : str | None = None ,
977
1001
) -> QueryProgram :
978
1002
"""
979
1003
Update a query program.
@@ -1046,7 +1070,7 @@ def unpublish(self, queryprogram_id: str) -> QueryProgram:
1046
1070
response = self ._patch (f"v1/queryprograms/{ queryprogram_id } /unpublish" )
1047
1071
return self .factory .create (response )
1048
1072
1049
- def evaluate (self , queryprogram_id : str , dataline_id : str = None ) -> dict :
1073
+ def evaluate (self , queryprogram_id : str , dataline_id : str | None = None ) -> dict :
1050
1074
"""
1051
1075
Evaluate a query program.
1052
1076
0 commit comments