vectorize_client.models.sharepoint1
Vectorize API
API for Vectorize services (Beta)
The version of the OpenAPI document: 0.1.2 Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
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 15from __future__ import annotations 16import pprint 17import re # noqa: F401 18import json 19 20from pydantic import BaseModel, ConfigDict 21from typing import Any, ClassVar, Dict, List, Optional 22from vectorize_client.models.sharepoint_auth_config import SHAREPOINTAuthConfig 23from typing import Optional, Set 24from typing_extensions import Self 25 26class Sharepoint1(BaseModel): 27 """ 28 Sharepoint1 29 """ # noqa: E501 30 config: Optional[SHAREPOINTAuthConfig] = None 31 __properties: ClassVar[List[str]] = ["config"] 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 Sharepoint1 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 # override the default output from pydantic by calling `to_dict()` of config 73 if self.config: 74 _dict['config'] = self.config.to_dict() 75 return _dict 76 77 @classmethod 78 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 79 """Create an instance of Sharepoint1 from a dict""" 80 if obj is None: 81 return None 82 83 if not isinstance(obj, dict): 84 return cls.model_validate(obj) 85 86 _obj = cls.model_validate({ 87 "config": SHAREPOINTAuthConfig.from_dict(obj["config"]) if obj.get("config") is not None else None 88 }) 89 return _obj