scope-client 1.4.922__py3-none-any.whl → 1.4.924__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.
- scope_client/api_bindings/__init__.py +5 -1
- scope_client/api_bindings/models/__init__.py +5 -1
- scope_client/api_bindings/models/create_model_task_job_spec.py +118 -0
- scope_client/api_bindings/models/delete_model_task_job_spec.py +99 -0
- scope_client/api_bindings/models/fetch_model_task_job_spec.py +99 -0
- scope_client/api_bindings/models/job_kind.py +4 -0
- scope_client/api_bindings/models/job_spec.py +66 -6
- scope_client/api_bindings/models/post_model.py +1 -1
- scope_client/api_bindings/models/post_task_request.py +3 -1
- scope_client/api_bindings/models/rule_response.py +3 -3
- scope_client/api_bindings/models/{config1.py → rule_response_config.py} +5 -5
- scope_client/api_bindings/models/update_model_task_rules_job_spec.py +115 -0
- {scope_client-1.4.922.dist-info → scope_client-1.4.924.dist-info}/METADATA +1 -1
- {scope_client-1.4.922.dist-info → scope_client-1.4.924.dist-info}/RECORD +16 -12
- {scope_client-1.4.922.dist-info → scope_client-1.4.924.dist-info}/WHEEL +0 -0
- {scope_client-1.4.922.dist-info → scope_client-1.4.924.dist-info}/top_level.txt +0 -0
|
@@ -77,7 +77,6 @@ from scope_client.api_bindings.models.bound_resource import BoundResource
|
|
|
77
77
|
from scope_client.api_bindings.models.bound_resource_kind import BoundResourceKind
|
|
78
78
|
from scope_client.api_bindings.models.bound_role import BoundRole
|
|
79
79
|
from scope_client.api_bindings.models.config import Config
|
|
80
|
-
from scope_client.api_bindings.models.config1 import Config1
|
|
81
80
|
from scope_client.api_bindings.models.conflict_error import ConflictError
|
|
82
81
|
from scope_client.api_bindings.models.connector_check_job_spec import ConnectorCheckJobSpec
|
|
83
82
|
from scope_client.api_bindings.models.connector_check_outcome import ConnectorCheckOutcome
|
|
@@ -91,6 +90,7 @@ from scope_client.api_bindings.models.connector_spec_schema import ConnectorSpec
|
|
|
91
90
|
from scope_client.api_bindings.models.connector_spec_schema_field import ConnectorSpecSchemaField
|
|
92
91
|
from scope_client.api_bindings.models.connector_type import ConnectorType
|
|
93
92
|
from scope_client.api_bindings.models.connectors_sort import ConnectorsSort
|
|
93
|
+
from scope_client.api_bindings.models.create_model_task_job_spec import CreateModelTaskJobSpec
|
|
94
94
|
from scope_client.api_bindings.models.created_alerts import CreatedAlerts
|
|
95
95
|
from scope_client.api_bindings.models.credentials import Credentials
|
|
96
96
|
from scope_client.api_bindings.models.d_type import DType
|
|
@@ -121,11 +121,13 @@ from scope_client.api_bindings.models.dataset_schema import DatasetSchema
|
|
|
121
121
|
from scope_client.api_bindings.models.datasets_sort import DatasetsSort
|
|
122
122
|
from scope_client.api_bindings.models.definition import Definition
|
|
123
123
|
from scope_client.api_bindings.models.delete_group_membership import DeleteGroupMembership
|
|
124
|
+
from scope_client.api_bindings.models.delete_model_task_job_spec import DeleteModelTaskJobSpec
|
|
124
125
|
from scope_client.api_bindings.models.dimension import Dimension
|
|
125
126
|
from scope_client.api_bindings.models.example_config import ExampleConfig
|
|
126
127
|
from scope_client.api_bindings.models.examples_config import ExamplesConfig
|
|
127
128
|
from scope_client.api_bindings.models.extended_role import ExtendedRole
|
|
128
129
|
from scope_client.api_bindings.models.fetch_data_job_spec import FetchDataJobSpec
|
|
130
|
+
from scope_client.api_bindings.models.fetch_model_task_job_spec import FetchModelTaskJobSpec
|
|
129
131
|
from scope_client.api_bindings.models.generate_metrics_spec_request import GenerateMetricsSpecRequest
|
|
130
132
|
from scope_client.api_bindings.models.group import Group
|
|
131
133
|
from scope_client.api_bindings.models.group_membership import GroupMembership
|
|
@@ -279,6 +281,7 @@ from scope_client.api_bindings.models.role import Role
|
|
|
279
281
|
from scope_client.api_bindings.models.role_binding import RoleBinding
|
|
280
282
|
from scope_client.api_bindings.models.role_sort import RoleSort
|
|
281
283
|
from scope_client.api_bindings.models.rule_response import RuleResponse
|
|
284
|
+
from scope_client.api_bindings.models.rule_response_config import RuleResponseConfig
|
|
282
285
|
from scope_client.api_bindings.models.rule_scope import RuleScope
|
|
283
286
|
from scope_client.api_bindings.models.rule_type import RuleType
|
|
284
287
|
from scope_client.api_bindings.models.scalar_type import ScalarType
|
|
@@ -296,6 +299,7 @@ from scope_client.api_bindings.models.task_mutation_response import TaskMutation
|
|
|
296
299
|
from scope_client.api_bindings.models.task_read_response import TaskReadResponse
|
|
297
300
|
from scope_client.api_bindings.models.task_response import TaskResponse
|
|
298
301
|
from scope_client.api_bindings.models.toxicity_config import ToxicityConfig
|
|
302
|
+
from scope_client.api_bindings.models.update_model_task_rules_job_spec import UpdateModelTaskRulesJobSpec
|
|
299
303
|
from scope_client.api_bindings.models.upsolve_token import UpsolveToken
|
|
300
304
|
from scope_client.api_bindings.models.user import User
|
|
301
305
|
from scope_client.api_bindings.models.user_credentials import UserCredentials
|
|
@@ -36,7 +36,6 @@ from scope_client.api_bindings.models.bound_resource import BoundResource
|
|
|
36
36
|
from scope_client.api_bindings.models.bound_resource_kind import BoundResourceKind
|
|
37
37
|
from scope_client.api_bindings.models.bound_role import BoundRole
|
|
38
38
|
from scope_client.api_bindings.models.config import Config
|
|
39
|
-
from scope_client.api_bindings.models.config1 import Config1
|
|
40
39
|
from scope_client.api_bindings.models.conflict_error import ConflictError
|
|
41
40
|
from scope_client.api_bindings.models.connector_check_job_spec import ConnectorCheckJobSpec
|
|
42
41
|
from scope_client.api_bindings.models.connector_check_outcome import ConnectorCheckOutcome
|
|
@@ -50,6 +49,7 @@ from scope_client.api_bindings.models.connector_spec_schema import ConnectorSpec
|
|
|
50
49
|
from scope_client.api_bindings.models.connector_spec_schema_field import ConnectorSpecSchemaField
|
|
51
50
|
from scope_client.api_bindings.models.connector_type import ConnectorType
|
|
52
51
|
from scope_client.api_bindings.models.connectors_sort import ConnectorsSort
|
|
52
|
+
from scope_client.api_bindings.models.create_model_task_job_spec import CreateModelTaskJobSpec
|
|
53
53
|
from scope_client.api_bindings.models.created_alerts import CreatedAlerts
|
|
54
54
|
from scope_client.api_bindings.models.credentials import Credentials
|
|
55
55
|
from scope_client.api_bindings.models.d_type import DType
|
|
@@ -80,11 +80,13 @@ from scope_client.api_bindings.models.dataset_schema import DatasetSchema
|
|
|
80
80
|
from scope_client.api_bindings.models.datasets_sort import DatasetsSort
|
|
81
81
|
from scope_client.api_bindings.models.definition import Definition
|
|
82
82
|
from scope_client.api_bindings.models.delete_group_membership import DeleteGroupMembership
|
|
83
|
+
from scope_client.api_bindings.models.delete_model_task_job_spec import DeleteModelTaskJobSpec
|
|
83
84
|
from scope_client.api_bindings.models.dimension import Dimension
|
|
84
85
|
from scope_client.api_bindings.models.example_config import ExampleConfig
|
|
85
86
|
from scope_client.api_bindings.models.examples_config import ExamplesConfig
|
|
86
87
|
from scope_client.api_bindings.models.extended_role import ExtendedRole
|
|
87
88
|
from scope_client.api_bindings.models.fetch_data_job_spec import FetchDataJobSpec
|
|
89
|
+
from scope_client.api_bindings.models.fetch_model_task_job_spec import FetchModelTaskJobSpec
|
|
88
90
|
from scope_client.api_bindings.models.generate_metrics_spec_request import GenerateMetricsSpecRequest
|
|
89
91
|
from scope_client.api_bindings.models.group import Group
|
|
90
92
|
from scope_client.api_bindings.models.group_membership import GroupMembership
|
|
@@ -238,6 +240,7 @@ from scope_client.api_bindings.models.role import Role
|
|
|
238
240
|
from scope_client.api_bindings.models.role_binding import RoleBinding
|
|
239
241
|
from scope_client.api_bindings.models.role_sort import RoleSort
|
|
240
242
|
from scope_client.api_bindings.models.rule_response import RuleResponse
|
|
243
|
+
from scope_client.api_bindings.models.rule_response_config import RuleResponseConfig
|
|
241
244
|
from scope_client.api_bindings.models.rule_scope import RuleScope
|
|
242
245
|
from scope_client.api_bindings.models.rule_type import RuleType
|
|
243
246
|
from scope_client.api_bindings.models.scalar_type import ScalarType
|
|
@@ -255,6 +258,7 @@ from scope_client.api_bindings.models.task_mutation_response import TaskMutation
|
|
|
255
258
|
from scope_client.api_bindings.models.task_read_response import TaskReadResponse
|
|
256
259
|
from scope_client.api_bindings.models.task_response import TaskResponse
|
|
257
260
|
from scope_client.api_bindings.models.toxicity_config import ToxicityConfig
|
|
261
|
+
from scope_client.api_bindings.models.update_model_task_rules_job_spec import UpdateModelTaskRulesJobSpec
|
|
258
262
|
from scope_client.api_bindings.models.upsolve_token import UpsolveToken
|
|
259
263
|
from scope_client.api_bindings.models.user import User
|
|
260
264
|
from scope_client.api_bindings.models.user_credentials import UserCredentials
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Arthur Scope
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
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, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from scope_client.api_bindings.models.new_rule_request import NewRuleRequest
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class CreateModelTaskJobSpec(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CreateModelTaskJobSpec
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
job_type: Optional[StrictStr] = 'create_model_task'
|
|
31
|
+
connector_id: StrictStr = Field(description="The id of the Shield connector to use to create the task.")
|
|
32
|
+
task_name: StrictStr = Field(description="The name of the task.")
|
|
33
|
+
onboarding_identifier: Optional[StrictStr] = None
|
|
34
|
+
initial_rules: List[NewRuleRequest] = Field(description="The initial rules to apply to the created model.")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["job_type", "connector_id", "task_name", "onboarding_identifier", "initial_rules"]
|
|
36
|
+
|
|
37
|
+
@field_validator('job_type')
|
|
38
|
+
def job_type_validate_enum(cls, value):
|
|
39
|
+
"""Validates the enum"""
|
|
40
|
+
if value is None:
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
if value not in set(['create_model_task']):
|
|
44
|
+
raise ValueError("must be one of enum values ('create_model_task')")
|
|
45
|
+
return value
|
|
46
|
+
|
|
47
|
+
model_config = ConfigDict(
|
|
48
|
+
populate_by_name=True,
|
|
49
|
+
validate_assignment=True,
|
|
50
|
+
protected_namespaces=(),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def to_str(self) -> str:
|
|
55
|
+
"""Returns the string representation of the model using alias"""
|
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
57
|
+
|
|
58
|
+
def to_json(self) -> str:
|
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
|
60
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
61
|
+
return json.dumps(self.to_dict())
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
65
|
+
"""Create an instance of CreateModelTaskJobSpec from a JSON string"""
|
|
66
|
+
return cls.from_dict(json.loads(json_str))
|
|
67
|
+
|
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
|
70
|
+
|
|
71
|
+
This has the following differences from calling pydantic's
|
|
72
|
+
`self.model_dump(by_alias=True)`:
|
|
73
|
+
|
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
|
75
|
+
were set at model initialization. Other fields with value `None`
|
|
76
|
+
are ignored.
|
|
77
|
+
"""
|
|
78
|
+
excluded_fields: Set[str] = set([
|
|
79
|
+
])
|
|
80
|
+
|
|
81
|
+
_dict = self.model_dump(
|
|
82
|
+
by_alias=True,
|
|
83
|
+
exclude=excluded_fields,
|
|
84
|
+
exclude_none=True,
|
|
85
|
+
)
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of each item in initial_rules (list)
|
|
87
|
+
_items = []
|
|
88
|
+
if self.initial_rules:
|
|
89
|
+
for _item_initial_rules in self.initial_rules:
|
|
90
|
+
if _item_initial_rules:
|
|
91
|
+
_items.append(_item_initial_rules.to_dict())
|
|
92
|
+
_dict['initial_rules'] = _items
|
|
93
|
+
# set to None if onboarding_identifier (nullable) is None
|
|
94
|
+
# and model_fields_set contains the field
|
|
95
|
+
if self.onboarding_identifier is None and "onboarding_identifier" in self.model_fields_set:
|
|
96
|
+
_dict['onboarding_identifier'] = None
|
|
97
|
+
|
|
98
|
+
return _dict
|
|
99
|
+
|
|
100
|
+
@classmethod
|
|
101
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
102
|
+
"""Create an instance of CreateModelTaskJobSpec from a dict"""
|
|
103
|
+
if obj is None:
|
|
104
|
+
return None
|
|
105
|
+
|
|
106
|
+
if not isinstance(obj, dict):
|
|
107
|
+
return cls.model_validate(obj)
|
|
108
|
+
|
|
109
|
+
_obj = cls.model_validate({
|
|
110
|
+
"job_type": obj.get("job_type") if obj.get("job_type") is not None else 'create_model_task',
|
|
111
|
+
"connector_id": obj.get("connector_id"),
|
|
112
|
+
"task_name": obj.get("task_name"),
|
|
113
|
+
"onboarding_identifier": obj.get("onboarding_identifier"),
|
|
114
|
+
"initial_rules": [NewRuleRequest.from_dict(_item) for _item in obj["initial_rules"]] if obj.get("initial_rules") is not None else None
|
|
115
|
+
})
|
|
116
|
+
return _obj
|
|
117
|
+
|
|
118
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Arthur Scope
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
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, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class DeleteModelTaskJobSpec(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
DeleteModelTaskJobSpec
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
job_type: Optional[StrictStr] = 'delete_model_task'
|
|
30
|
+
scope_model_id: StrictStr = Field(description="The id of the model to delete.")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["job_type", "scope_model_id"]
|
|
32
|
+
|
|
33
|
+
@field_validator('job_type')
|
|
34
|
+
def job_type_validate_enum(cls, value):
|
|
35
|
+
"""Validates the enum"""
|
|
36
|
+
if value is None:
|
|
37
|
+
return value
|
|
38
|
+
|
|
39
|
+
if value not in set(['delete_model_task']):
|
|
40
|
+
raise ValueError("must be one of enum values ('delete_model_task')")
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
populate_by_name=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of DeleteModelTaskJobSpec from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of DeleteModelTaskJobSpec from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"job_type": obj.get("job_type") if obj.get("job_type") is not None else 'delete_model_task',
|
|
95
|
+
"scope_model_id": obj.get("scope_model_id")
|
|
96
|
+
})
|
|
97
|
+
return _obj
|
|
98
|
+
|
|
99
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Arthur Scope
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
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, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class FetchModelTaskJobSpec(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
FetchModelTaskJobSpec
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
job_type: Optional[StrictStr] = 'fetch_model_task'
|
|
30
|
+
scope_model_id: StrictStr = Field(description="The id of the model to fetch its corresponding task.")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["job_type", "scope_model_id"]
|
|
32
|
+
|
|
33
|
+
@field_validator('job_type')
|
|
34
|
+
def job_type_validate_enum(cls, value):
|
|
35
|
+
"""Validates the enum"""
|
|
36
|
+
if value is None:
|
|
37
|
+
return value
|
|
38
|
+
|
|
39
|
+
if value not in set(['fetch_model_task']):
|
|
40
|
+
raise ValueError("must be one of enum values ('fetch_model_task')")
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
populate_by_name=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of FetchModelTaskJobSpec from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of FetchModelTaskJobSpec from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"job_type": obj.get("job_type") if obj.get("job_type") is not None else 'fetch_model_task',
|
|
95
|
+
"scope_model_id": obj.get("scope_model_id")
|
|
96
|
+
})
|
|
97
|
+
return _obj
|
|
98
|
+
|
|
99
|
+
|
|
@@ -33,6 +33,10 @@ class JobKind(str, Enum):
|
|
|
33
33
|
FETCH_DATA = 'fetch_data'
|
|
34
34
|
ALERT_CHECK = 'alert_check'
|
|
35
35
|
SCHEDULE_JOBS = 'schedule_jobs'
|
|
36
|
+
CREATE_MODEL_TASK = 'create_model_task'
|
|
37
|
+
UPDATE_MODEL_TASK_RULES = 'update_model_task_rules'
|
|
38
|
+
DELETE_MODEL_TASK = 'delete_model_task'
|
|
39
|
+
FETCH_MODEL_TASK = 'fetch_model_task'
|
|
36
40
|
|
|
37
41
|
@classmethod
|
|
38
42
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -21,16 +21,20 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, f
|
|
|
21
21
|
from typing import Optional
|
|
22
22
|
from scope_client.api_bindings.models.alert_check_job_spec import AlertCheckJobSpec
|
|
23
23
|
from scope_client.api_bindings.models.connector_check_job_spec import ConnectorCheckJobSpec
|
|
24
|
+
from scope_client.api_bindings.models.create_model_task_job_spec import CreateModelTaskJobSpec
|
|
25
|
+
from scope_client.api_bindings.models.delete_model_task_job_spec import DeleteModelTaskJobSpec
|
|
24
26
|
from scope_client.api_bindings.models.fetch_data_job_spec import FetchDataJobSpec
|
|
27
|
+
from scope_client.api_bindings.models.fetch_model_task_job_spec import FetchModelTaskJobSpec
|
|
25
28
|
from scope_client.api_bindings.models.list_datasets_job_spec import ListDatasetsJobSpec
|
|
26
29
|
from scope_client.api_bindings.models.metrics_calculation_job_spec import MetricsCalculationJobSpec
|
|
27
30
|
from scope_client.api_bindings.models.schedule_jobs_job_spec import ScheduleJobsJobSpec
|
|
28
31
|
from scope_client.api_bindings.models.schema_inspection_job_spec import SchemaInspectionJobSpec
|
|
32
|
+
from scope_client.api_bindings.models.update_model_task_rules_job_spec import UpdateModelTaskRulesJobSpec
|
|
29
33
|
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
30
34
|
from typing_extensions import Literal, Self
|
|
31
35
|
from pydantic import Field
|
|
32
36
|
|
|
33
|
-
JOBSPEC_ANY_OF_SCHEMAS = ["AlertCheckJobSpec", "ConnectorCheckJobSpec", "FetchDataJobSpec", "ListDatasetsJobSpec", "MetricsCalculationJobSpec", "ScheduleJobsJobSpec", "SchemaInspectionJobSpec"]
|
|
37
|
+
JOBSPEC_ANY_OF_SCHEMAS = ["AlertCheckJobSpec", "ConnectorCheckJobSpec", "CreateModelTaskJobSpec", "DeleteModelTaskJobSpec", "FetchDataJobSpec", "FetchModelTaskJobSpec", "ListDatasetsJobSpec", "MetricsCalculationJobSpec", "ScheduleJobsJobSpec", "SchemaInspectionJobSpec", "UpdateModelTaskRulesJobSpec"]
|
|
34
38
|
|
|
35
39
|
class JobSpec(BaseModel):
|
|
36
40
|
"""
|
|
@@ -51,11 +55,19 @@ class JobSpec(BaseModel):
|
|
|
51
55
|
anyof_schema_6_validator: Optional[ScheduleJobsJobSpec] = None
|
|
52
56
|
# data type: AlertCheckJobSpec
|
|
53
57
|
anyof_schema_7_validator: Optional[AlertCheckJobSpec] = None
|
|
58
|
+
# data type: CreateModelTaskJobSpec
|
|
59
|
+
anyof_schema_8_validator: Optional[CreateModelTaskJobSpec] = None
|
|
60
|
+
# data type: UpdateModelTaskRulesJobSpec
|
|
61
|
+
anyof_schema_9_validator: Optional[UpdateModelTaskRulesJobSpec] = None
|
|
62
|
+
# data type: DeleteModelTaskJobSpec
|
|
63
|
+
anyof_schema_10_validator: Optional[DeleteModelTaskJobSpec] = None
|
|
64
|
+
# data type: FetchModelTaskJobSpec
|
|
65
|
+
anyof_schema_11_validator: Optional[FetchModelTaskJobSpec] = None
|
|
54
66
|
if TYPE_CHECKING:
|
|
55
|
-
actual_instance: Optional[Union[AlertCheckJobSpec, ConnectorCheckJobSpec, FetchDataJobSpec, ListDatasetsJobSpec, MetricsCalculationJobSpec, ScheduleJobsJobSpec, SchemaInspectionJobSpec]] = None
|
|
67
|
+
actual_instance: Optional[Union[AlertCheckJobSpec, ConnectorCheckJobSpec, CreateModelTaskJobSpec, DeleteModelTaskJobSpec, FetchDataJobSpec, FetchModelTaskJobSpec, ListDatasetsJobSpec, MetricsCalculationJobSpec, ScheduleJobsJobSpec, SchemaInspectionJobSpec, UpdateModelTaskRulesJobSpec]] = None
|
|
56
68
|
else:
|
|
57
69
|
actual_instance: Any = None
|
|
58
|
-
any_of_schemas: Set[str] = { "AlertCheckJobSpec", "ConnectorCheckJobSpec", "FetchDataJobSpec", "ListDatasetsJobSpec", "MetricsCalculationJobSpec", "ScheduleJobsJobSpec", "SchemaInspectionJobSpec" }
|
|
70
|
+
any_of_schemas: Set[str] = { "AlertCheckJobSpec", "ConnectorCheckJobSpec", "CreateModelTaskJobSpec", "DeleteModelTaskJobSpec", "FetchDataJobSpec", "FetchModelTaskJobSpec", "ListDatasetsJobSpec", "MetricsCalculationJobSpec", "ScheduleJobsJobSpec", "SchemaInspectionJobSpec", "UpdateModelTaskRulesJobSpec" }
|
|
59
71
|
|
|
60
72
|
model_config = {
|
|
61
73
|
"validate_assignment": True,
|
|
@@ -118,9 +130,33 @@ class JobSpec(BaseModel):
|
|
|
118
130
|
else:
|
|
119
131
|
return v
|
|
120
132
|
|
|
133
|
+
# validate data type: CreateModelTaskJobSpec
|
|
134
|
+
if not isinstance(v, CreateModelTaskJobSpec):
|
|
135
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CreateModelTaskJobSpec`")
|
|
136
|
+
else:
|
|
137
|
+
return v
|
|
138
|
+
|
|
139
|
+
# validate data type: UpdateModelTaskRulesJobSpec
|
|
140
|
+
if not isinstance(v, UpdateModelTaskRulesJobSpec):
|
|
141
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateModelTaskRulesJobSpec`")
|
|
142
|
+
else:
|
|
143
|
+
return v
|
|
144
|
+
|
|
145
|
+
# validate data type: DeleteModelTaskJobSpec
|
|
146
|
+
if not isinstance(v, DeleteModelTaskJobSpec):
|
|
147
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `DeleteModelTaskJobSpec`")
|
|
148
|
+
else:
|
|
149
|
+
return v
|
|
150
|
+
|
|
151
|
+
# validate data type: FetchModelTaskJobSpec
|
|
152
|
+
if not isinstance(v, FetchModelTaskJobSpec):
|
|
153
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FetchModelTaskJobSpec`")
|
|
154
|
+
else:
|
|
155
|
+
return v
|
|
156
|
+
|
|
121
157
|
if error_messages:
|
|
122
158
|
# no match
|
|
123
|
-
raise ValueError("No match found when setting the actual_instance in JobSpec with anyOf schemas: AlertCheckJobSpec, ConnectorCheckJobSpec, FetchDataJobSpec, ListDatasetsJobSpec, MetricsCalculationJobSpec, ScheduleJobsJobSpec, SchemaInspectionJobSpec. Details: " + ", ".join(error_messages))
|
|
159
|
+
raise ValueError("No match found when setting the actual_instance in JobSpec with anyOf schemas: AlertCheckJobSpec, ConnectorCheckJobSpec, CreateModelTaskJobSpec, DeleteModelTaskJobSpec, FetchDataJobSpec, FetchModelTaskJobSpec, ListDatasetsJobSpec, MetricsCalculationJobSpec, ScheduleJobsJobSpec, SchemaInspectionJobSpec, UpdateModelTaskRulesJobSpec. Details: " + ", ".join(error_messages))
|
|
124
160
|
else:
|
|
125
161
|
return v
|
|
126
162
|
|
|
@@ -175,10 +211,34 @@ class JobSpec(BaseModel):
|
|
|
175
211
|
return instance
|
|
176
212
|
except (ValidationError, ValueError) as e:
|
|
177
213
|
error_messages.append(str(e))
|
|
214
|
+
# anyof_schema_8_validator: Optional[CreateModelTaskJobSpec] = None
|
|
215
|
+
try:
|
|
216
|
+
instance.actual_instance = CreateModelTaskJobSpec.from_json(json_str)
|
|
217
|
+
return instance
|
|
218
|
+
except (ValidationError, ValueError) as e:
|
|
219
|
+
error_messages.append(str(e))
|
|
220
|
+
# anyof_schema_9_validator: Optional[UpdateModelTaskRulesJobSpec] = None
|
|
221
|
+
try:
|
|
222
|
+
instance.actual_instance = UpdateModelTaskRulesJobSpec.from_json(json_str)
|
|
223
|
+
return instance
|
|
224
|
+
except (ValidationError, ValueError) as e:
|
|
225
|
+
error_messages.append(str(e))
|
|
226
|
+
# anyof_schema_10_validator: Optional[DeleteModelTaskJobSpec] = None
|
|
227
|
+
try:
|
|
228
|
+
instance.actual_instance = DeleteModelTaskJobSpec.from_json(json_str)
|
|
229
|
+
return instance
|
|
230
|
+
except (ValidationError, ValueError) as e:
|
|
231
|
+
error_messages.append(str(e))
|
|
232
|
+
# anyof_schema_11_validator: Optional[FetchModelTaskJobSpec] = None
|
|
233
|
+
try:
|
|
234
|
+
instance.actual_instance = FetchModelTaskJobSpec.from_json(json_str)
|
|
235
|
+
return instance
|
|
236
|
+
except (ValidationError, ValueError) as e:
|
|
237
|
+
error_messages.append(str(e))
|
|
178
238
|
|
|
179
239
|
if error_messages:
|
|
180
240
|
# no match
|
|
181
|
-
raise ValueError("No match found when deserializing the JSON string into JobSpec with anyOf schemas: AlertCheckJobSpec, ConnectorCheckJobSpec, FetchDataJobSpec, ListDatasetsJobSpec, MetricsCalculationJobSpec, ScheduleJobsJobSpec, SchemaInspectionJobSpec. Details: " + ", ".join(error_messages))
|
|
241
|
+
raise ValueError("No match found when deserializing the JSON string into JobSpec with anyOf schemas: AlertCheckJobSpec, ConnectorCheckJobSpec, CreateModelTaskJobSpec, DeleteModelTaskJobSpec, FetchDataJobSpec, FetchModelTaskJobSpec, ListDatasetsJobSpec, MetricsCalculationJobSpec, ScheduleJobsJobSpec, SchemaInspectionJobSpec, UpdateModelTaskRulesJobSpec. Details: " + ", ".join(error_messages))
|
|
182
242
|
else:
|
|
183
243
|
return instance
|
|
184
244
|
|
|
@@ -192,7 +252,7 @@ class JobSpec(BaseModel):
|
|
|
192
252
|
else:
|
|
193
253
|
return json.dumps(self.actual_instance)
|
|
194
254
|
|
|
195
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], AlertCheckJobSpec, ConnectorCheckJobSpec, FetchDataJobSpec, ListDatasetsJobSpec, MetricsCalculationJobSpec, ScheduleJobsJobSpec, SchemaInspectionJobSpec]]:
|
|
255
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], AlertCheckJobSpec, ConnectorCheckJobSpec, CreateModelTaskJobSpec, DeleteModelTaskJobSpec, FetchDataJobSpec, FetchModelTaskJobSpec, ListDatasetsJobSpec, MetricsCalculationJobSpec, ScheduleJobsJobSpec, SchemaInspectionJobSpec, UpdateModelTaskRulesJobSpec]]:
|
|
196
256
|
"""Returns the dict representation of the actual instance"""
|
|
197
257
|
if self.actual_instance is None:
|
|
198
258
|
return None
|
|
@@ -29,7 +29,7 @@ class PostModel(BaseModel):
|
|
|
29
29
|
PostModel
|
|
30
30
|
""" # noqa: E501
|
|
31
31
|
name: StrictStr = Field(description="Name of the model.")
|
|
32
|
-
description: Optional[StrictStr]
|
|
32
|
+
description: Optional[StrictStr] = None
|
|
33
33
|
onboarding_identifier: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None
|
|
34
34
|
metric_config: Optional[PutModelMetricSpec] = None
|
|
35
35
|
dataset_ids: List[StrictStr] = Field(description="IDs of datasets for the model.")
|
|
@@ -29,9 +29,10 @@ class PostTaskRequest(BaseModel):
|
|
|
29
29
|
PostTaskRequest
|
|
30
30
|
""" # noqa: E501
|
|
31
31
|
name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The name of the task")
|
|
32
|
+
connector_id: StrictStr = Field(description="The id of the connector where the task will be created. The connector must be a Shield connector.")
|
|
32
33
|
onboarding_identifier: Optional[StrictStr] = None
|
|
33
34
|
rules_to_add: Optional[List[NewRuleRequest]] = Field(default=None, description="List of rules to add to the task.")
|
|
34
|
-
__properties: ClassVar[List[str]] = ["name", "onboarding_identifier", "rules_to_add"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["name", "connector_id", "onboarding_identifier", "rules_to_add"]
|
|
35
36
|
|
|
36
37
|
model_config = ConfigDict(
|
|
37
38
|
populate_by_name=True,
|
|
@@ -97,6 +98,7 @@ class PostTaskRequest(BaseModel):
|
|
|
97
98
|
|
|
98
99
|
_obj = cls.model_validate({
|
|
99
100
|
"name": obj.get("name"),
|
|
101
|
+
"connector_id": obj.get("connector_id"),
|
|
100
102
|
"onboarding_identifier": obj.get("onboarding_identifier"),
|
|
101
103
|
"rules_to_add": [NewRuleRequest.from_dict(_item) for _item in obj["rules_to_add"]] if obj.get("rules_to_add") is not None else None
|
|
102
104
|
})
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from scope_client.api_bindings.models.
|
|
22
|
+
from scope_client.api_bindings.models.rule_response_config import RuleResponseConfig
|
|
23
23
|
from scope_client.api_bindings.models.rule_scope import RuleScope
|
|
24
24
|
from scope_client.api_bindings.models.rule_type import RuleType
|
|
25
25
|
from typing import Optional, Set
|
|
@@ -38,7 +38,7 @@ class RuleResponse(BaseModel):
|
|
|
38
38
|
scope: RuleScope = Field(description="Scope of the rule. The rule can be set at default level or task level.")
|
|
39
39
|
created_at: StrictInt = Field(description="Time the rule was created in unix milliseconds")
|
|
40
40
|
updated_at: StrictInt = Field(description="Time the rule was updated in unix milliseconds")
|
|
41
|
-
config: Optional[
|
|
41
|
+
config: Optional[RuleResponseConfig] = None
|
|
42
42
|
__properties: ClassVar[List[str]] = ["id", "name", "type", "apply_to_prompt", "apply_to_response", "enabled", "scope", "created_at", "updated_at", "config"]
|
|
43
43
|
|
|
44
44
|
model_config = ConfigDict(
|
|
@@ -114,7 +114,7 @@ class RuleResponse(BaseModel):
|
|
|
114
114
|
"scope": obj.get("scope"),
|
|
115
115
|
"created_at": obj.get("created_at"),
|
|
116
116
|
"updated_at": obj.get("updated_at"),
|
|
117
|
-
"config":
|
|
117
|
+
"config": RuleResponseConfig.from_dict(obj["config"]) if obj.get("config") is not None else None
|
|
118
118
|
})
|
|
119
119
|
return _obj
|
|
120
120
|
|
|
@@ -28,9 +28,9 @@ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
|
28
28
|
from typing_extensions import Literal, Self
|
|
29
29
|
from pydantic import Field
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
RULERESPONSECONFIG_ANY_OF_SCHEMAS = ["ExamplesConfig", "KeywordsConfig", "PIIConfig", "RegexConfig", "ToxicityConfig"]
|
|
32
32
|
|
|
33
|
-
class
|
|
33
|
+
class RuleResponseConfig(BaseModel):
|
|
34
34
|
"""
|
|
35
35
|
Config of the rule
|
|
36
36
|
"""
|
|
@@ -71,7 +71,7 @@ class Config1(BaseModel):
|
|
|
71
71
|
if v is None:
|
|
72
72
|
return v
|
|
73
73
|
|
|
74
|
-
instance =
|
|
74
|
+
instance = RuleResponseConfig.model_construct()
|
|
75
75
|
error_messages = []
|
|
76
76
|
# validate data type: KeywordsConfig
|
|
77
77
|
if not isinstance(v, KeywordsConfig):
|
|
@@ -105,7 +105,7 @@ class Config1(BaseModel):
|
|
|
105
105
|
|
|
106
106
|
if error_messages:
|
|
107
107
|
# no match
|
|
108
|
-
raise ValueError("No match found when setting the actual_instance in
|
|
108
|
+
raise ValueError("No match found when setting the actual_instance in RuleResponseConfig with anyOf schemas: ExamplesConfig, KeywordsConfig, PIIConfig, RegexConfig, ToxicityConfig. Details: " + ", ".join(error_messages))
|
|
109
109
|
else:
|
|
110
110
|
return v
|
|
111
111
|
|
|
@@ -154,7 +154,7 @@ class Config1(BaseModel):
|
|
|
154
154
|
|
|
155
155
|
if error_messages:
|
|
156
156
|
# no match
|
|
157
|
-
raise ValueError("No match found when deserializing the JSON string into
|
|
157
|
+
raise ValueError("No match found when deserializing the JSON string into RuleResponseConfig with anyOf schemas: ExamplesConfig, KeywordsConfig, PIIConfig, RegexConfig, ToxicityConfig. Details: " + ", ".join(error_messages))
|
|
158
158
|
else:
|
|
159
159
|
return instance
|
|
160
160
|
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Arthur Scope
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
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, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from scope_client.api_bindings.models.new_rule_request import NewRuleRequest
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class UpdateModelTaskRulesJobSpec(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
UpdateModelTaskRulesJobSpec
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
job_type: Optional[StrictStr] = 'update_model_task_rules'
|
|
31
|
+
scope_model_id: StrictStr = Field(description="The id of the model to update the task rules.")
|
|
32
|
+
rules_to_enable: Optional[List[StrictStr]] = Field(default=None, description="The list of rule IDs to enable on the task.")
|
|
33
|
+
rules_to_disable: Optional[List[StrictStr]] = Field(default=None, description="The list of rule IDs to disable on the task.")
|
|
34
|
+
rules_to_archive: Optional[List[StrictStr]] = Field(default=None, description="The list of rule IDs to archive on the task.")
|
|
35
|
+
rules_to_add: Optional[List[NewRuleRequest]] = Field(default=None, description="The new rules to add to the task.")
|
|
36
|
+
__properties: ClassVar[List[str]] = ["job_type", "scope_model_id", "rules_to_enable", "rules_to_disable", "rules_to_archive", "rules_to_add"]
|
|
37
|
+
|
|
38
|
+
@field_validator('job_type')
|
|
39
|
+
def job_type_validate_enum(cls, value):
|
|
40
|
+
"""Validates the enum"""
|
|
41
|
+
if value is None:
|
|
42
|
+
return value
|
|
43
|
+
|
|
44
|
+
if value not in set(['update_model_task_rules']):
|
|
45
|
+
raise ValueError("must be one of enum values ('update_model_task_rules')")
|
|
46
|
+
return value
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(
|
|
49
|
+
populate_by_name=True,
|
|
50
|
+
validate_assignment=True,
|
|
51
|
+
protected_namespaces=(),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def to_str(self) -> str:
|
|
56
|
+
"""Returns the string representation of the model using alias"""
|
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
58
|
+
|
|
59
|
+
def to_json(self) -> str:
|
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
62
|
+
return json.dumps(self.to_dict())
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
66
|
+
"""Create an instance of UpdateModelTaskRulesJobSpec from a JSON string"""
|
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
|
68
|
+
|
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
|
71
|
+
|
|
72
|
+
This has the following differences from calling pydantic's
|
|
73
|
+
`self.model_dump(by_alias=True)`:
|
|
74
|
+
|
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
|
76
|
+
were set at model initialization. Other fields with value `None`
|
|
77
|
+
are ignored.
|
|
78
|
+
"""
|
|
79
|
+
excluded_fields: Set[str] = set([
|
|
80
|
+
])
|
|
81
|
+
|
|
82
|
+
_dict = self.model_dump(
|
|
83
|
+
by_alias=True,
|
|
84
|
+
exclude=excluded_fields,
|
|
85
|
+
exclude_none=True,
|
|
86
|
+
)
|
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of each item in rules_to_add (list)
|
|
88
|
+
_items = []
|
|
89
|
+
if self.rules_to_add:
|
|
90
|
+
for _item_rules_to_add in self.rules_to_add:
|
|
91
|
+
if _item_rules_to_add:
|
|
92
|
+
_items.append(_item_rules_to_add.to_dict())
|
|
93
|
+
_dict['rules_to_add'] = _items
|
|
94
|
+
return _dict
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
98
|
+
"""Create an instance of UpdateModelTaskRulesJobSpec from a dict"""
|
|
99
|
+
if obj is None:
|
|
100
|
+
return None
|
|
101
|
+
|
|
102
|
+
if not isinstance(obj, dict):
|
|
103
|
+
return cls.model_validate(obj)
|
|
104
|
+
|
|
105
|
+
_obj = cls.model_validate({
|
|
106
|
+
"job_type": obj.get("job_type") if obj.get("job_type") is not None else 'update_model_task_rules',
|
|
107
|
+
"scope_model_id": obj.get("scope_model_id"),
|
|
108
|
+
"rules_to_enable": obj.get("rules_to_enable"),
|
|
109
|
+
"rules_to_disable": obj.get("rules_to_disable"),
|
|
110
|
+
"rules_to_archive": obj.get("rules_to_archive"),
|
|
111
|
+
"rules_to_add": [NewRuleRequest.from_dict(_item) for _item in obj["rules_to_add"]] if obj.get("rules_to_add") is not None else None
|
|
112
|
+
})
|
|
113
|
+
return _obj
|
|
114
|
+
|
|
115
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
scope_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
scope_client/api_bindings/__init__.py,sha256=
|
|
2
|
+
scope_client/api_bindings/__init__.py,sha256=w02f2QrHLe9o71lGEekWxCMjGJrDCyXV7-C-n8-MM3A,23904
|
|
3
3
|
scope_client/api_bindings/api_client.py,sha256=nkt88XDyPiuURu94lnI4MtOfMeYXd_jazGUde0T4xVU,27538
|
|
4
4
|
scope_client/api_bindings/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
|
5
5
|
scope_client/api_bindings/configuration.py,sha256=a0o2OhNYo7GdZscfNtFKW2kfgoln1mcWE-8E_UeiWv8,15338
|
|
@@ -31,7 +31,7 @@ scope_client/api_bindings/api/upsolve_v1_api.py,sha256=Vdep9x-_lIJq_kOwtsGqYqkss
|
|
|
31
31
|
scope_client/api_bindings/api/users_v1_api.py,sha256=F1n0VJy3IWrxRIddhdFTM2NgW5qnNF8s40UZrZUd9k4,92844
|
|
32
32
|
scope_client/api_bindings/api/webhooks_v1_api.py,sha256=86tRi7pgwICshf8WVyYA1WrJggThpnsTaON9Mx8R-0M,71286
|
|
33
33
|
scope_client/api_bindings/api/workspaces_v1_api.py,sha256=OjMc-pJe2JAGgv5ZGTD8_TkQxw82vz2e381-5m37vJ4,58653
|
|
34
|
-
scope_client/api_bindings/models/__init__.py,sha256=
|
|
34
|
+
scope_client/api_bindings/models/__init__.py,sha256=xdpJhSaMLcINA4t0FuS4fAHjId1YEecafToPSs9ZbFY,21398
|
|
35
35
|
scope_client/api_bindings/models/aggregation_metric_type.py,sha256=USKpDqhX4TQ4lqIoHOp3q70mydsf1u_zc1EKus9QhYo,783
|
|
36
36
|
scope_client/api_bindings/models/aggregation_spec.py,sha256=gWFTgLqxNdiIw4iXwbNqKAnAwDpbcgeoFfQ_7VxtKOQ,4109
|
|
37
37
|
scope_client/api_bindings/models/aggregation_spec_schema.py,sha256=MHGlB9eF8NfOasOHiqj1ZzYiBaIl8y8J2SmQysoSWVU,4624
|
|
@@ -54,7 +54,6 @@ scope_client/api_bindings/models/bound_resource.py,sha256=2Wyf_rSmXFmzirPi_-PO-y
|
|
|
54
54
|
scope_client/api_bindings/models/bound_resource_kind.py,sha256=pjZCSLDKfVYqMQyXIZoJhhpPzB7Ndo5I83aBH7lHtUk,841
|
|
55
55
|
scope_client/api_bindings/models/bound_role.py,sha256=FkKYlol1I2uzWl_wTHGYsvuQyfbdDiFsR02v1oR-aMo,2607
|
|
56
56
|
scope_client/api_bindings/models/config.py,sha256=_CdcDAUU6lsES-DMqUpPOvGEQ7ZOd-moe3aff8LoSkk,7190
|
|
57
|
-
scope_client/api_bindings/models/config1.py,sha256=T6utDhmeuH32EAXS7HjLK9aJW3jesxYKPhEBhkDd0sE,7194
|
|
58
57
|
scope_client/api_bindings/models/conflict_error.py,sha256=vQzpZVUN-IANUMrlaFhsSvUtf1pC9MAypOG-wHXEJXg,2563
|
|
59
58
|
scope_client/api_bindings/models/connector_check_job_spec.py,sha256=xYE_WektRnb2A1R-WTjD44rRKKI87cvsvje4QApITN0,3110
|
|
60
59
|
scope_client/api_bindings/models/connector_check_outcome.py,sha256=hVtC6MSjIGi6ISDsi7Yezt628l6OcogA-i-iGpWtbME,787
|
|
@@ -68,6 +67,7 @@ scope_client/api_bindings/models/connector_spec_schema.py,sha256=JH998qMIcyEKRrN
|
|
|
68
67
|
scope_client/api_bindings/models/connector_spec_schema_field.py,sha256=KA_WA-6L4pf4ePSxXnHvr7VWxgDEX36cqb_xxdwp3iA,3660
|
|
69
68
|
scope_client/api_bindings/models/connector_type.py,sha256=amqo2vs8InHDef30PoU47ZCeDwWE5Cg0xHcr8jrJYZU,791
|
|
70
69
|
scope_client/api_bindings/models/connectors_sort.py,sha256=F3uMScMW0SrVBscHsUczrwRjEQlpc1cnIZgkds3N-qo,794
|
|
70
|
+
scope_client/api_bindings/models/create_model_task_job_spec.py,sha256=WqQPt8I5nA8l0j5YE-u56qLuq6w482nfuINJUY2XnP4,4418
|
|
71
71
|
scope_client/api_bindings/models/created_alerts.py,sha256=HEU8jGJvowCbwZgU7wUn410lNiJAAox5SYRyDd2uglw,3949
|
|
72
72
|
scope_client/api_bindings/models/credentials.py,sha256=z1kk6SelBNpHCC78wW0-feiY6I0Q9sxFD3Bo3C0j_zI,5118
|
|
73
73
|
scope_client/api_bindings/models/d_type.py,sha256=sg1LfWA05rBStEo9VIEgimHRpk8sCcrx63c8WUDCj6Y,869
|
|
@@ -98,11 +98,13 @@ scope_client/api_bindings/models/dataset_schema.py,sha256=2Q0o0TI8MsucLsuROY3ndi
|
|
|
98
98
|
scope_client/api_bindings/models/datasets_sort.py,sha256=-Cg-gWqvCUmSExw_CJrK0nMRekKKPdMI7p0UsuYOm9E,770
|
|
99
99
|
scope_client/api_bindings/models/definition.py,sha256=ggbBLbOpV2-_UMGjeoozC22Svo2gjCrhnxuLDIXDMc8,5795
|
|
100
100
|
scope_client/api_bindings/models/delete_group_membership.py,sha256=cVIQsbRIz84oBzF4U7B3QxB35Q8NnHFgB1uX-BY2o9c,2602
|
|
101
|
+
scope_client/api_bindings/models/delete_model_task_job_spec.py,sha256=QgwifcxqfkmUvzeV7XV38jZsye-NvcbxHOFg4iBqMpo,3127
|
|
101
102
|
scope_client/api_bindings/models/dimension.py,sha256=sXCpG1c4l2MInsUE-HEtP2l80xBgqI2j--TwL_Hex2A,2626
|
|
102
103
|
scope_client/api_bindings/models/example_config.py,sha256=_LZR1lAWotaaiVZzoiFpiUtZEHEsLerghz0hmWDYDP4,2749
|
|
103
104
|
scope_client/api_bindings/models/examples_config.py,sha256=UDWj4-UuNOn762BDoBAwt8LXu_WYVLTvpcwbiKLXAL0,3370
|
|
104
105
|
scope_client/api_bindings/models/extended_role.py,sha256=73Lfw-WjtWRB6x7oRZuuYi7KLzsU8i_LVVsGAcN-fBs,5397
|
|
105
106
|
scope_client/api_bindings/models/fetch_data_job_spec.py,sha256=9xf7DYrqKJv5PMp3ItV3KhnMt74WxoD9v_vY8eV73B4,5503
|
|
107
|
+
scope_client/api_bindings/models/fetch_model_task_job_spec.py,sha256=z6fY4_F4ojBhP1smFiLauC12z9GXPYtfgXVa-gaLbes,3141
|
|
106
108
|
scope_client/api_bindings/models/generate_metrics_spec_request.py,sha256=Qh2U03AZNA7j2_e0b7D3kZxG5thy96uJkP8r_GLyIfI,2698
|
|
107
109
|
scope_client/api_bindings/models/group.py,sha256=yh_C78nGDEH8HEA2Eoy12iIsK-3EAbLxRnwwdmf616Y,3590
|
|
108
110
|
scope_client/api_bindings/models/group_membership.py,sha256=deLoylO3w8YAARoql3NqZ74sG9UZlpr9Ii0IXAA02No,3414
|
|
@@ -119,13 +121,13 @@ scope_client/api_bindings/models/job.py,sha256=3dpiy8u05WFEV082bMw5FtbLQU___89Z7
|
|
|
119
121
|
scope_client/api_bindings/models/job_dequeue_parameters.py,sha256=oy6URXFQWXSBnow7H7x1gD0Mema2WhkYAIx538dQJPE,2623
|
|
120
122
|
scope_client/api_bindings/models/job_error.py,sha256=zaCcZargRPJIMo1jv7jk8NUKMxRqgo8uA5cseLS1T3Y,2521
|
|
121
123
|
scope_client/api_bindings/models/job_errors.py,sha256=8mMGVItmGeqS9zTG3o1DR9RY3ZVWLoLrn92WSzxN0Iw,3008
|
|
122
|
-
scope_client/api_bindings/models/job_kind.py,sha256=
|
|
124
|
+
scope_client/api_bindings/models/job_kind.py,sha256=RJivQ3SfuUpltZPhJc05-iTVJ1HwLqf_L-tJiVkPXlg,1147
|
|
123
125
|
scope_client/api_bindings/models/job_log.py,sha256=FhUjGBR3Y6Ki9N0EMmnrEg28GAB-tQQbl7a_Y6zvGOY,2876
|
|
124
126
|
scope_client/api_bindings/models/job_log_level.py,sha256=SwmLnCkMw7FpGyTwamut6sNxq3H9LElS4NGIjgS3Oy4,815
|
|
125
127
|
scope_client/api_bindings/models/job_logs.py,sha256=UqhK5mHLKemIKDdSC3hmzC46CL7mproK3KRe4EK6cuc,2971
|
|
126
128
|
scope_client/api_bindings/models/job_priority.py,sha256=Lm7NAjSrdjA6FNR9dK9Pcc_idNpCsuKTTV4kv9usxPM,791
|
|
127
129
|
scope_client/api_bindings/models/job_run.py,sha256=leSujxhY9zIM2M58T06Ha4rmIZ72eJ2RkIN5KJ4q9DE,3533
|
|
128
|
-
scope_client/api_bindings/models/job_spec.py,sha256=
|
|
130
|
+
scope_client/api_bindings/models/job_spec.py,sha256=sLo5yFgRb2jXfwDA_sO4X9tHLqUhPynvJqsW-KbqRBI,13026
|
|
129
131
|
scope_client/api_bindings/models/job_state.py,sha256=vi7T966HQ3RDEzqccvJNHycb0JCSH4rc6VpWPkRzam0,822
|
|
130
132
|
scope_client/api_bindings/models/job_trigger.py,sha256=ngtU8po-kDVQv8tAHCcLNsfETd-9Lc0i8QKBea50F8E,768
|
|
131
133
|
scope_client/api_bindings/models/jobs_batch.py,sha256=hQmSvADV9szYbLmdlfCiCtR295FTKRzljhsP1BCs74g,2924
|
|
@@ -207,11 +209,11 @@ scope_client/api_bindings/models/post_metrics_query_result_filter_or_group.py,sh
|
|
|
207
209
|
scope_client/api_bindings/models/post_metrics_query_result_filter_or_group_or_inner.py,sha256=DcqJxePk8zc_iB5p8fMyGziBg-eififDNI4_Kdb2ky8,6864
|
|
208
210
|
scope_client/api_bindings/models/post_metrics_query_time_range.py,sha256=gTOllCTs3OnTzgYLuQc5h7BlH47pCqn4rt8-PCGNHHI,2730
|
|
209
211
|
scope_client/api_bindings/models/post_metrics_versions.py,sha256=CtnQAw9vkAzAkMASJUOnJPrR-vu3mdDB88rVdMxlB3M,2818
|
|
210
|
-
scope_client/api_bindings/models/post_model.py,sha256=
|
|
212
|
+
scope_client/api_bindings/models/post_model.py,sha256=Di6lIz6Fer2bT-ro5kt5zEvgZ839EJfyn1jtJZ2qing,4218
|
|
211
213
|
scope_client/api_bindings/models/post_project.py,sha256=8yrNEepmtdckb75U32g9A9pZrXv4RJV7aG-PsemrmXw,2863
|
|
212
214
|
scope_client/api_bindings/models/post_role_binding.py,sha256=eaw4eELQLRNlBJoMaK6Sb8WcikYqc7NR1shQKMhr2RE,3173
|
|
213
215
|
scope_client/api_bindings/models/post_service_account.py,sha256=KaOLpnB_kI0Cj1XMFVV3-HYBBhnMFkU9Q7dIhcIuOug,2551
|
|
214
|
-
scope_client/api_bindings/models/post_task_request.py,sha256=
|
|
216
|
+
scope_client/api_bindings/models/post_task_request.py,sha256=Y80glGQl7viuzp2a7tw6WpFUN65DefO0QY5xOoOMsZ8,3978
|
|
215
217
|
scope_client/api_bindings/models/post_upsolve_tenant.py,sha256=irDLUIOXKXX5DDS-0U0NixgFC1R9R5_OD3H94DctzsU,2869
|
|
216
218
|
scope_client/api_bindings/models/post_webhook.py,sha256=DRcXlSxpJHbtHbBhyWHMtfkw5pv4XJGQyR4xUgkw_uc,2909
|
|
217
219
|
scope_client/api_bindings/models/post_workspace.py,sha256=lZYMoo_9WcGEMMe9LDqTKX54jCHlqPAeo23Z4sQKarA,2526
|
|
@@ -255,7 +257,8 @@ scope_client/api_bindings/models/result_filter.py,sha256=yQQU9L_MXBXIpXkh7aXeL5H
|
|
|
255
257
|
scope_client/api_bindings/models/role.py,sha256=GyMzXvc_d19leOOe_JPKikloy946lbllpblL1unOYLA,4449
|
|
256
258
|
scope_client/api_bindings/models/role_binding.py,sha256=_9Um8-l8e2BKiopnVnfMKZXR3FNGgZtpq1LKmzjPdTQ,4657
|
|
257
259
|
scope_client/api_bindings/models/role_sort.py,sha256=tnFgMGKLKBqPJ3Mtq78v03Q1nwO_tl9pOKKnNwa2CG0,776
|
|
258
|
-
scope_client/api_bindings/models/rule_response.py,sha256=
|
|
260
|
+
scope_client/api_bindings/models/rule_response.py,sha256=7mhbl5yh5dPlWM5ZHjhecWqBG27bMfbw-OzHmdMKUcI,4604
|
|
261
|
+
scope_client/api_bindings/models/rule_response_config.py,sha256=ojsIusoRVFBzaKceiC3oDWM6hiNjyrj6THWM3zZabos,7249
|
|
259
262
|
scope_client/api_bindings/models/rule_scope.py,sha256=PPwbxg4xCT8CxaddgR_hcJktYeAKKlQ7RXsH-KBU7Lw,743
|
|
260
263
|
scope_client/api_bindings/models/rule_type.py,sha256=uzSIk0G9q--MBKfda7N0Ooju_IBSu46E_rUE6Ut0nUw,1096
|
|
261
264
|
scope_client/api_bindings/models/scalar_type.py,sha256=S5BiTsMG-oM2GC-EmlX7OdY2l9dISlathXja4XCkjMM,2508
|
|
@@ -273,6 +276,7 @@ scope_client/api_bindings/models/task_mutation_response.py,sha256=gE26KTGgiGlukc
|
|
|
273
276
|
scope_client/api_bindings/models/task_read_response.py,sha256=ZNSxrwoeAd0U42tEkbfqy20c0DI5br4XGV-6BPKuaiU,3580
|
|
274
277
|
scope_client/api_bindings/models/task_response.py,sha256=J_gaN6GokYLh7qcL6g10vnRxiP5y0zP6x3Q_4Erd3-g,3548
|
|
275
278
|
scope_client/api_bindings/models/toxicity_config.py,sha256=hNi71Gj8Y6w7Bxy8uPwCNeY984zBFDYjNI-psWEERGc,3415
|
|
279
|
+
scope_client/api_bindings/models/update_model_task_rules_job_spec.py,sha256=KrwhSittkKBCnFhOTBqc3mLUkCg8rl3eb6lpA9YuNuQ,4536
|
|
276
280
|
scope_client/api_bindings/models/upsolve_token.py,sha256=Tp09Alv4XAG_1Jccgr1Wpn3XyuwupCmMqWvF8LHxnTI,2533
|
|
277
281
|
scope_client/api_bindings/models/user.py,sha256=iW9M0isNrpBBLIf_ycbmMCm6sZv6nMn8AhhtWQmZ43o,5071
|
|
278
282
|
scope_client/api_bindings/models/user_credentials.py,sha256=EfUMAguJoZBFxUY81mPWVFw35F1V_mOx5jDeY5M42H4,2548
|
|
@@ -293,7 +297,7 @@ scope_client/auth/device_authorizer.py,sha256=bJMIZRjkwQwoSWTLEp7OoXM2MytO3ADSD9
|
|
|
293
297
|
scope_client/auth/discovery.py,sha256=hR0MglzRWHdwyi72If5hTnjO50fDJhquP_DD7OzjIQQ,1188
|
|
294
298
|
scope_client/auth/oauth_api_config.py,sha256=wcEslusOFKr0oTzW0Ku2MhM1mvc-nm4BEJU8LHo1uXA,1347
|
|
295
299
|
scope_client/auth/session.py,sha256=wCriib5ajfm1e1WTL_QXVCJmEOrGwQg_0v91e5qrC6g,2649
|
|
296
|
-
scope_client-1.4.
|
|
297
|
-
scope_client-1.4.
|
|
298
|
-
scope_client-1.4.
|
|
299
|
-
scope_client-1.4.
|
|
300
|
+
scope_client-1.4.924.dist-info/METADATA,sha256=3gCt0G5by3gXW6DF35lGiRV8SMvnyIf3SAksOjvtP8c,1776
|
|
301
|
+
scope_client-1.4.924.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
302
|
+
scope_client-1.4.924.dist-info/top_level.txt,sha256=x6MngS09hi-TUDoUGb3SLzmnf8_cf8IVAVNPSqtTzAY,13
|
|
303
|
+
scope_client-1.4.924.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|