Skip to content

Commit 20f4dbe

Browse files
committed
add files from generation
1 parent 0fb0382 commit 20f4dbe

38 files changed

+4014
-0
lines changed

src/python/vectorize_client/api/workspaces_api.py

Lines changed: 641 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# coding: utf-8
2+
3+
"""
4+
Vectorize API
5+
6+
API for Vectorize services (Beta)
7+
8+
The version of the OpenAPI document: 0.1.2
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
22+
from vectorize_client.models.anthropic_auth_config import ANTHROPICAuthConfig
23+
from typing import Optional, Set
24+
from typing_extensions import Self
25+
26+
class Anthropic(BaseModel):
27+
"""
28+
Anthropic
29+
""" # noqa: E501
30+
name: StrictStr = Field(description="Name of the connector")
31+
type: StrictStr = Field(description="Must be \"ANTHROPIC\"")
32+
config: ANTHROPICAuthConfig
33+
__properties: ClassVar[List[str]] = ["name", "type", "config"]
34+
35+
@field_validator('type')
36+
def type_validate_enum(cls, value):
37+
"""Validates the enum"""
38+
if value not in set(['ANTHROPIC']):
39+
raise ValueError("must be one of enum values ('ANTHROPIC')")
40+
return value
41+
42+
model_config = ConfigDict(
43+
populate_by_name=True,
44+
validate_assignment=True,
45+
protected_namespaces=(),
46+
)
47+
48+
49+
def to_str(self) -> str:
50+
"""Returns the string representation of the model using alias"""
51+
return pprint.pformat(self.model_dump(by_alias=True))
52+
53+
def to_json(self) -> str:
54+
"""Returns the JSON representation of the model using alias"""
55+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56+
return json.dumps(self.to_dict())
57+
58+
@classmethod
59+
def from_json(cls, json_str: str) -> Optional[Self]:
60+
"""Create an instance of Anthropic from a JSON string"""
61+
return cls.from_dict(json.loads(json_str))
62+
63+
def to_dict(self) -> Dict[str, Any]:
64+
"""Return the dictionary representation of the model using alias.
65+
66+
This has the following differences from calling pydantic's
67+
`self.model_dump(by_alias=True)`:
68+
69+
* `None` is only added to the output dict for nullable fields that
70+
were set at model initialization. Other fields with value `None`
71+
are ignored.
72+
"""
73+
excluded_fields: Set[str] = set([
74+
])
75+
76+
_dict = self.model_dump(
77+
by_alias=True,
78+
exclude=excluded_fields,
79+
exclude_none=True,
80+
)
81+
# override the default output from pydantic by calling `to_dict()` of config
82+
if self.config:
83+
_dict['config'] = self.config.to_dict()
84+
return _dict
85+
86+
@classmethod
87+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88+
"""Create an instance of Anthropic from a dict"""
89+
if obj is None:
90+
return None
91+
92+
if not isinstance(obj, dict):
93+
return cls.model_validate(obj)
94+
95+
_obj = cls.model_validate({
96+
"name": obj.get("name"),
97+
"type": obj.get("type"),
98+
"config": ANTHROPICAuthConfig.from_dict(obj["config"]) if obj.get("config") is not None else None
99+
})
100+
return _obj
101+
102+
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# coding: utf-8
2+
3+
"""
4+
Vectorize API
5+
6+
API for Vectorize services (Beta)
7+
8+
The version of the OpenAPI document: 0.1.2
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
21+
from typing import Any, ClassVar, Dict, List, Optional
22+
from typing import Optional, Set
23+
from typing_extensions import Self
24+
25+
class Anthropic1(BaseModel):
26+
"""
27+
Anthropic1
28+
""" # noqa: E501
29+
config: Optional[Dict[str, Any]] = Field(default=None, description="Configuration updates")
30+
__properties: ClassVar[List[str]] = ["config"]
31+
32+
model_config = ConfigDict(
33+
populate_by_name=True,
34+
validate_assignment=True,
35+
protected_namespaces=(),
36+
)
37+
38+
39+
def to_str(self) -> str:
40+
"""Returns the string representation of the model using alias"""
41+
return pprint.pformat(self.model_dump(by_alias=True))
42+
43+
def to_json(self) -> str:
44+
"""Returns the JSON representation of the model using alias"""
45+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46+
return json.dumps(self.to_dict())
47+
48+
@classmethod
49+
def from_json(cls, json_str: str) -> Optional[Self]:
50+
"""Create an instance of Anthropic1 from a JSON string"""
51+
return cls.from_dict(json.loads(json_str))
52+
53+
def to_dict(self) -> Dict[str, Any]:
54+
"""Return the dictionary representation of the model using alias.
55+
56+
This has the following differences from calling pydantic's
57+
`self.model_dump(by_alias=True)`:
58+
59+
* `None` is only added to the output dict for nullable fields that
60+
were set at model initialization. Other fields with value `None`
61+
are ignored.
62+
"""
63+
excluded_fields: Set[str] = set([
64+
])
65+
66+
_dict = self.model_dump(
67+
by_alias=True,
68+
exclude=excluded_fields,
69+
exclude_none=True,
70+
)
71+
return _dict
72+
73+
@classmethod
74+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75+
"""Create an instance of Anthropic1 from a dict"""
76+
if obj is None:
77+
return None
78+
79+
if not isinstance(obj, dict):
80+
return cls.model_validate(obj)
81+
82+
_obj = cls.model_validate({
83+
"config": obj.get("config")
84+
})
85+
return _obj
86+
87+
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# coding: utf-8
2+
3+
"""
4+
Vectorize API
5+
6+
API for Vectorize services (Beta)
7+
8+
The version of the OpenAPI document: 0.1.2
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, field_validator
21+
from typing import Any, ClassVar, Dict, List
22+
from typing_extensions import Annotated
23+
from typing import Optional, Set
24+
from typing_extensions import Self
25+
26+
class ANTHROPICAuthConfig(BaseModel):
27+
"""
28+
Authentication configuration for Anthropic
29+
""" # noqa: E501
30+
key: Annotated[str, Field(strict=True)] = Field(description="API Key. Example: Enter your Anthropic API Key")
31+
__properties: ClassVar[List[str]] = ["key"]
32+
33+
@field_validator('key')
34+
def key_validate_regular_expression(cls, value):
35+
"""Validates the regular expression"""
36+
if not re.match(r"^\S.*\S$|^\S$", value):
37+
raise ValueError(r"must validate the regular expression /^\S.*\S$|^\S$/")
38+
return value
39+
40+
model_config = ConfigDict(
41+
populate_by_name=True,
42+
validate_assignment=True,
43+
protected_namespaces=(),
44+
)
45+
46+
47+
def to_str(self) -> str:
48+
"""Returns the string representation of the model using alias"""
49+
return pprint.pformat(self.model_dump(by_alias=True))
50+
51+
def to_json(self) -> str:
52+
"""Returns the JSON representation of the model using alias"""
53+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54+
return json.dumps(self.to_dict())
55+
56+
@classmethod
57+
def from_json(cls, json_str: str) -> Optional[Self]:
58+
"""Create an instance of ANTHROPICAuthConfig from a JSON string"""
59+
return cls.from_dict(json.loads(json_str))
60+
61+
def to_dict(self) -> Dict[str, Any]:
62+
"""Return the dictionary representation of the model using alias.
63+
64+
This has the following differences from calling pydantic's
65+
`self.model_dump(by_alias=True)`:
66+
67+
* `None` is only added to the output dict for nullable fields that
68+
were set at model initialization. Other fields with value `None`
69+
are ignored.
70+
"""
71+
excluded_fields: Set[str] = set([
72+
])
73+
74+
_dict = self.model_dump(
75+
by_alias=True,
76+
exclude=excluded_fields,
77+
exclude_none=True,
78+
)
79+
return _dict
80+
81+
@classmethod
82+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83+
"""Create an instance of ANTHROPICAuthConfig from a dict"""
84+
if obj is None:
85+
return None
86+
87+
if not isinstance(obj, dict):
88+
return cls.model_validate(obj)
89+
90+
_obj = cls.model_validate({
91+
"key": obj.get("key")
92+
})
93+
return _obj
94+
95+
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# coding: utf-8
2+
3+
"""
4+
Vectorize API
5+
6+
API for Vectorize services (Beta)
7+
8+
The version of the OpenAPI document: 0.1.2
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, Optional
22+
from typing import Optional, Set
23+
from typing_extensions import Self
24+
25+
class GetWorkspaceByIdResponse(BaseModel):
26+
"""
27+
GetWorkspaceByIdResponse
28+
""" # noqa: E501
29+
id: StrictStr
30+
name: StrictStr
31+
created_at: Optional[StrictStr] = Field(default=None, alias="createdAt")
32+
updated_at: Optional[StrictStr] = Field(default=None, alias="updatedAt")
33+
__properties: ClassVar[List[str]] = ["id", "name", "createdAt", "updatedAt"]
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 GetWorkspaceByIdResponse 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 created_at (nullable) is None
75+
# and model_fields_set contains the field
76+
if self.created_at is None and "created_at" in self.model_fields_set:
77+
_dict['createdAt'] = None
78+
79+
# set to None if updated_at (nullable) is None
80+
# and model_fields_set contains the field
81+
if self.updated_at is None and "updated_at" in self.model_fields_set:
82+
_dict['updatedAt'] = None
83+
84+
return _dict
85+
86+
@classmethod
87+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88+
"""Create an instance of GetWorkspaceByIdResponse from a dict"""
89+
if obj is None:
90+
return None
91+
92+
if not isinstance(obj, dict):
93+
return cls.model_validate(obj)
94+
95+
_obj = cls.model_validate({
96+
"id": obj.get("id"),
97+
"name": obj.get("name"),
98+
"createdAt": obj.get("createdAt"),
99+
"updatedAt": obj.get("updatedAt")
100+
})
101+
return _obj
102+
103+

0 commit comments

Comments
 (0)