rapidata 1.7.0__py3-none-any.whl → 1.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rapidata might be problematic. Click here for more details.

Files changed (47) hide show
  1. rapidata/api_client/__init__.py +6 -1
  2. rapidata/api_client/api/__init__.py +1 -0
  3. rapidata/api_client/api/client_api.py +836 -0
  4. rapidata/api_client/api/identity_api.py +305 -49
  5. rapidata/api_client/api/order_api.py +7 -7
  6. rapidata/api_client/models/__init__.py +5 -1
  7. rapidata/api_client/models/clients_query_result.py +107 -0
  8. rapidata/api_client/models/clients_query_result_paged_result.py +105 -0
  9. rapidata/api_client/models/create_bridge_token_result.py +89 -0
  10. rapidata/api_client/models/create_client_model.py +1 -1
  11. rapidata/api_client/models/evaluation_workflow_config.py +5 -3
  12. rapidata/api_client/models/evaluation_workflow_model.py +5 -3
  13. rapidata/api_client/models/problem_details.py +133 -0
  14. rapidata/api_client/models/query_model.py +8 -8
  15. rapidata/api_client/models/read_bridge_token_keys_result.py +127 -0
  16. rapidata/api_client_README.md +10 -2
  17. rapidata/rapidata_client/assets/__init__.py +1 -1
  18. rapidata/rapidata_client/assets/media_asset.py +22 -0
  19. rapidata/rapidata_client/assets/text_asset.py +3 -0
  20. rapidata/rapidata_client/country_codes/country_codes.py +1 -1
  21. rapidata/rapidata_client/dataset/rapid_builders/__init__.py +4 -0
  22. rapidata/rapidata_client/dataset/rapid_builders/base_rapid_builder.py +33 -0
  23. rapidata/rapidata_client/dataset/rapid_builders/classify_rapid_builders.py +166 -0
  24. rapidata/rapidata_client/dataset/rapid_builders/compare_rapid_builders.py +145 -0
  25. rapidata/rapidata_client/dataset/rapid_builders/rapids.py +32 -0
  26. rapidata/rapidata_client/dataset/rapid_builders/transcription_rapid_builders.py +132 -0
  27. rapidata/rapidata_client/dataset/rapidata_dataset.py +12 -9
  28. rapidata/rapidata_client/dataset/rapidata_validation_set.py +24 -7
  29. rapidata/rapidata_client/dataset/validation_set_builder.py +115 -8
  30. rapidata/rapidata_client/filter/country_filter.py +3 -0
  31. rapidata/rapidata_client/filter/language_filter.py +3 -0
  32. rapidata/rapidata_client/metadata/prompt_metadata.py +5 -1
  33. rapidata/rapidata_client/order/rapidata_order.py +1 -1
  34. rapidata/rapidata_client/order/rapidata_order_builder.py +5 -5
  35. rapidata/rapidata_client/rapidata_client.py +37 -9
  36. rapidata/rapidata_client/settings/__init__.py +1 -1
  37. rapidata/rapidata_client/settings/settings.py +10 -9
  38. rapidata/rapidata_client/simple_builders/simple_classification_builders.py +132 -21
  39. rapidata/rapidata_client/simple_builders/simple_compare_builders.py +141 -15
  40. rapidata/rapidata_client/simple_builders/simple_free_text_builders.py +180 -0
  41. rapidata/rapidata_client/simple_builders/simple_transcription_builders.py +194 -0
  42. rapidata/service/openapi_service.py +4 -2
  43. {rapidata-1.7.0.dist-info → rapidata-1.8.0.dist-info}/METADATA +2 -2
  44. {rapidata-1.7.0.dist-info → rapidata-1.8.0.dist-info}/RECORD +46 -33
  45. rapidata/rapidata_client/config.py +0 -9
  46. {rapidata-1.7.0.dist-info → rapidata-1.8.0.dist-info}/LICENSE +0 -0
  47. {rapidata-1.7.0.dist-info → rapidata-1.8.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,107 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ClientsQueryResult(BaseModel):
27
+ """
28
+ ClientsQueryResult
29
+ """ # noqa: E501
30
+ client_id: Optional[StrictStr] = Field(alias="clientId")
31
+ display_name: Optional[StrictStr] = Field(alias="displayName")
32
+ created_at: Optional[datetime] = Field(alias="createdAt")
33
+ __properties: ClassVar[List[str]] = ["clientId", "displayName", "createdAt"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of ClientsQueryResult from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # set to None if client_id (nullable) is None
75
+ # and model_fields_set contains the field
76
+ if self.client_id is None and "client_id" in self.model_fields_set:
77
+ _dict['clientId'] = None
78
+
79
+ # set to None if display_name (nullable) is None
80
+ # and model_fields_set contains the field
81
+ if self.display_name is None and "display_name" in self.model_fields_set:
82
+ _dict['displayName'] = None
83
+
84
+ # set to None if created_at (nullable) is None
85
+ # and model_fields_set contains the field
86
+ if self.created_at is None and "created_at" in self.model_fields_set:
87
+ _dict['createdAt'] = None
88
+
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of ClientsQueryResult from a dict"""
94
+ if obj is None:
95
+ return None
96
+
97
+ if not isinstance(obj, dict):
98
+ return cls.model_validate(obj)
99
+
100
+ _obj = cls.model_validate({
101
+ "clientId": obj.get("clientId"),
102
+ "displayName": obj.get("displayName"),
103
+ "createdAt": obj.get("createdAt")
104
+ })
105
+ return _obj
106
+
107
+
@@ -0,0 +1,105 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.clients_query_result import ClientsQueryResult
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ClientsQueryResultPagedResult(BaseModel):
27
+ """
28
+ ClientsQueryResultPagedResult
29
+ """ # noqa: E501
30
+ total: StrictInt
31
+ page: StrictInt
32
+ page_size: StrictInt = Field(alias="pageSize")
33
+ items: List[ClientsQueryResult]
34
+ total_pages: Optional[StrictInt] = Field(default=None, alias="totalPages")
35
+ __properties: ClassVar[List[str]] = ["total", "page", "pageSize", "items", "totalPages"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of ClientsQueryResultPagedResult from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ * OpenAPI `readOnly` fields are excluded.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ "total_pages",
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # override the default output from pydantic by calling `to_dict()` of each item in items (list)
79
+ _items = []
80
+ if self.items:
81
+ for _item_items in self.items:
82
+ if _item_items:
83
+ _items.append(_item_items.to_dict())
84
+ _dict['items'] = _items
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of ClientsQueryResultPagedResult from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "total": obj.get("total"),
98
+ "page": obj.get("page"),
99
+ "pageSize": obj.get("pageSize"),
100
+ "items": [ClientsQueryResult.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
101
+ "totalPages": obj.get("totalPages")
102
+ })
103
+ return _obj
104
+
105
+
@@ -0,0 +1,89 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class CreateBridgeTokenResult(BaseModel):
26
+ """
27
+ CreateBridgeTokenResult
28
+ """ # noqa: E501
29
+ read_key: StrictStr = Field(alias="readKey")
30
+ write_key: StrictStr = Field(alias="writeKey")
31
+ __properties: ClassVar[List[str]] = ["readKey", "writeKey"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of CreateBridgeTokenResult from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of CreateBridgeTokenResult from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "readKey": obj.get("readKey"),
85
+ "writeKey": obj.get("writeKey")
86
+ })
87
+ return _obj
88
+
89
+
@@ -27,7 +27,7 @@ class CreateClientModel(BaseModel):
27
27
  The model for creating a new client.
28
28
  """ # noqa: E501
29
29
  display_name: Optional[StrictStr] = Field(default=None, description="An optional display name for the client.", alias="displayName")
30
- customer_id: Optional[StrictStr] = Field(default=None, alias="customerId")
30
+ customer_id: Optional[StrictStr] = Field(default=None, description="An optional customer ID to create the client for.", alias="customerId")
31
31
  __properties: ClassVar[List[str]] = ["displayName", "customerId"]
32
32
 
33
33
  model_config = ConfigDict(
@@ -17,7 +17,7 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List
22
22
  from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
23
23
  from typing import Optional, Set
@@ -30,7 +30,8 @@ class EvaluationWorkflowConfig(BaseModel):
30
30
  t: StrictStr = Field(description="Discriminator value for EvaluationWorkflowConfig", alias="_t")
31
31
  validation_set_id: StrictStr = Field(alias="validationSetId")
32
32
  referee: CompareWorkflowModel1Referee
33
- __properties: ClassVar[List[str]] = ["_t", "validationSetId", "referee"]
33
+ should_accept_incorrect: StrictBool = Field(alias="shouldAcceptIncorrect")
34
+ __properties: ClassVar[List[str]] = ["_t", "validationSetId", "referee", "shouldAcceptIncorrect"]
34
35
 
35
36
  @field_validator('t')
36
37
  def t_validate_enum(cls, value):
@@ -95,7 +96,8 @@ class EvaluationWorkflowConfig(BaseModel):
95
96
  _obj = cls.model_validate({
96
97
  "_t": obj.get("_t") if obj.get("_t") is not None else 'EvaluationWorkflowConfig',
97
98
  "validationSetId": obj.get("validationSetId"),
98
- "referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None
99
+ "referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
100
+ "shouldAcceptIncorrect": obj.get("shouldAcceptIncorrect")
99
101
  })
100
102
  return _obj
101
103
 
@@ -17,7 +17,7 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
@@ -28,7 +28,8 @@ class EvaluationWorkflowModel(BaseModel):
28
28
  """ # noqa: E501
29
29
  t: StrictStr = Field(description="Discriminator value for EvaluationWorkflow", alias="_t")
30
30
  validation_set_id: StrictStr = Field(description="The Validation Set Id is used to as a source for the tasks that will be sent to the user.", alias="validationSetId")
31
- __properties: ClassVar[List[str]] = ["_t", "validationSetId"]
31
+ should_accept_incorrect: StrictBool = Field(description="Indicates if the user should get feedback on their answers if they answer wrong. If set to true the user will not notice that he was tested.", alias="shouldAcceptIncorrect")
32
+ __properties: ClassVar[List[str]] = ["_t", "validationSetId", "shouldAcceptIncorrect"]
32
33
 
33
34
  @field_validator('t')
34
35
  def t_validate_enum(cls, value):
@@ -89,7 +90,8 @@ class EvaluationWorkflowModel(BaseModel):
89
90
 
90
91
  _obj = cls.model_validate({
91
92
  "_t": obj.get("_t") if obj.get("_t") is not None else 'EvaluationWorkflow',
92
- "validationSetId": obj.get("validationSetId")
93
+ "validationSetId": obj.get("validationSetId"),
94
+ "shouldAcceptIncorrect": obj.get("shouldAcceptIncorrect")
93
95
  })
94
96
  return _obj
95
97
 
@@ -0,0 +1,133 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ProblemDetails(BaseModel):
26
+ """
27
+ ProblemDetails
28
+ """ # noqa: E501
29
+ type: Optional[StrictStr] = None
30
+ title: Optional[StrictStr] = None
31
+ status: Optional[StrictInt] = None
32
+ detail: Optional[StrictStr] = None
33
+ instance: Optional[StrictStr] = None
34
+ additional_properties: Dict[str, Any] = {}
35
+ __properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of ProblemDetails from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ * Fields in `self.additional_properties` are added to the output dict.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ "additional_properties",
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # puts key-value pairs in additional_properties in the top level
79
+ if self.additional_properties is not None:
80
+ for _key, _value in self.additional_properties.items():
81
+ _dict[_key] = _value
82
+
83
+ # set to None if type (nullable) is None
84
+ # and model_fields_set contains the field
85
+ if self.type is None and "type" in self.model_fields_set:
86
+ _dict['type'] = None
87
+
88
+ # set to None if title (nullable) is None
89
+ # and model_fields_set contains the field
90
+ if self.title is None and "title" in self.model_fields_set:
91
+ _dict['title'] = None
92
+
93
+ # set to None if status (nullable) is None
94
+ # and model_fields_set contains the field
95
+ if self.status is None and "status" in self.model_fields_set:
96
+ _dict['status'] = None
97
+
98
+ # set to None if detail (nullable) is None
99
+ # and model_fields_set contains the field
100
+ if self.detail is None and "detail" in self.model_fields_set:
101
+ _dict['detail'] = None
102
+
103
+ # set to None if instance (nullable) is None
104
+ # and model_fields_set contains the field
105
+ if self.instance is None and "instance" in self.model_fields_set:
106
+ _dict['instance'] = None
107
+
108
+ return _dict
109
+
110
+ @classmethod
111
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
112
+ """Create an instance of ProblemDetails from a dict"""
113
+ if obj is None:
114
+ return None
115
+
116
+ if not isinstance(obj, dict):
117
+ return cls.model_validate(obj)
118
+
119
+ _obj = cls.model_validate({
120
+ "type": obj.get("type"),
121
+ "title": obj.get("title"),
122
+ "status": obj.get("status"),
123
+ "detail": obj.get("detail"),
124
+ "instance": obj.get("instance")
125
+ })
126
+ # store additional fields in additional_properties
127
+ for _key in obj.keys():
128
+ if _key not in cls.__properties:
129
+ _obj.additional_properties[_key] = obj.get(_key)
130
+
131
+ return _obj
132
+
133
+
@@ -27,12 +27,12 @@ from typing_extensions import Self
27
27
 
28
28
  class QueryModel(BaseModel):
29
29
  """
30
- The model for a query.
30
+ QueryModel
31
31
  """ # noqa: E501
32
- page_info: Optional[PageInfo] = Field(default=None, alias="pageInfo")
32
+ page: Optional[PageInfo] = None
33
33
  filter: Optional[RootFilter] = None
34
- sort_criteria: Optional[List[SortCriterion]] = Field(default=None, description="The sort criteria to apply to the query.", alias="sortCriteria")
35
- __properties: ClassVar[List[str]] = ["pageInfo", "filter", "sortCriteria"]
34
+ sort_criteria: Optional[List[SortCriterion]] = Field(default=None, alias="sortCriteria")
35
+ __properties: ClassVar[List[str]] = ["page", "filter", "sortCriteria"]
36
36
 
37
37
  model_config = ConfigDict(
38
38
  populate_by_name=True,
@@ -73,9 +73,9 @@ class QueryModel(BaseModel):
73
73
  exclude=excluded_fields,
74
74
  exclude_none=True,
75
75
  )
76
- # override the default output from pydantic by calling `to_dict()` of page_info
77
- if self.page_info:
78
- _dict['pageInfo'] = self.page_info.to_dict()
76
+ # override the default output from pydantic by calling `to_dict()` of page
77
+ if self.page:
78
+ _dict['page'] = self.page.to_dict()
79
79
  # override the default output from pydantic by calling `to_dict()` of filter
80
80
  if self.filter:
81
81
  _dict['filter'] = self.filter.to_dict()
@@ -103,7 +103,7 @@ class QueryModel(BaseModel):
103
103
  return cls.model_validate(obj)
104
104
 
105
105
  _obj = cls.model_validate({
106
- "pageInfo": PageInfo.from_dict(obj["pageInfo"]) if obj.get("pageInfo") is not None else None,
106
+ "page": PageInfo.from_dict(obj["page"]) if obj.get("page") is not None else None,
107
107
  "filter": RootFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
108
108
  "sortCriteria": [SortCriterion.from_dict(_item) for _item in obj["sortCriteria"]] if obj.get("sortCriteria") is not None else None
109
109
  })
@@ -0,0 +1,127 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ReadBridgeTokenKeysResult(BaseModel):
26
+ """
27
+ ReadBridgeTokenKeysResult
28
+ """ # noqa: E501
29
+ access_token: Optional[StrictStr] = Field(alias="accessToken")
30
+ expires_in: Optional[StrictInt] = Field(alias="expiresIn")
31
+ refresh_token: Optional[StrictStr] = Field(alias="refreshToken")
32
+ id_token: Optional[StrictStr] = Field(alias="idToken")
33
+ token_type: Optional[StrictStr] = Field(alias="tokenType")
34
+ scope: Optional[StrictStr]
35
+ __properties: ClassVar[List[str]] = ["accessToken", "expiresIn", "refreshToken", "idToken", "tokenType", "scope"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of ReadBridgeTokenKeysResult from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # set to None if access_token (nullable) is None
77
+ # and model_fields_set contains the field
78
+ if self.access_token is None and "access_token" in self.model_fields_set:
79
+ _dict['accessToken'] = None
80
+
81
+ # set to None if expires_in (nullable) is None
82
+ # and model_fields_set contains the field
83
+ if self.expires_in is None and "expires_in" in self.model_fields_set:
84
+ _dict['expiresIn'] = None
85
+
86
+ # set to None if refresh_token (nullable) is None
87
+ # and model_fields_set contains the field
88
+ if self.refresh_token is None and "refresh_token" in self.model_fields_set:
89
+ _dict['refreshToken'] = None
90
+
91
+ # set to None if id_token (nullable) is None
92
+ # and model_fields_set contains the field
93
+ if self.id_token is None and "id_token" in self.model_fields_set:
94
+ _dict['idToken'] = None
95
+
96
+ # set to None if token_type (nullable) is None
97
+ # and model_fields_set contains the field
98
+ if self.token_type is None and "token_type" in self.model_fields_set:
99
+ _dict['tokenType'] = None
100
+
101
+ # set to None if scope (nullable) is None
102
+ # and model_fields_set contains the field
103
+ if self.scope is None and "scope" in self.model_fields_set:
104
+ _dict['scope'] = None
105
+
106
+ return _dict
107
+
108
+ @classmethod
109
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
110
+ """Create an instance of ReadBridgeTokenKeysResult from a dict"""
111
+ if obj is None:
112
+ return None
113
+
114
+ if not isinstance(obj, dict):
115
+ return cls.model_validate(obj)
116
+
117
+ _obj = cls.model_validate({
118
+ "accessToken": obj.get("accessToken"),
119
+ "expiresIn": obj.get("expiresIn"),
120
+ "refreshToken": obj.get("refreshToken"),
121
+ "idToken": obj.get("idToken"),
122
+ "tokenType": obj.get("tokenType"),
123
+ "scope": obj.get("scope")
124
+ })
125
+ return _obj
126
+
127
+