You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.3 KiB

2 years ago
  1. # coding: utf-8
  2. """
  3. Seaweedfs Master Server API
  4. The Seaweedfs Master Server API allows you to store blobs # noqa: E501
  5. The version of the OpenAPI document: 3.43.0
  6. Generated by: https://openapi-generator.tech
  7. """
  8. from __future__ import annotations
  9. from inspect import getfullargspec
  10. import pprint
  11. import re # noqa: F401
  12. import json
  13. from typing import Any, Optional
  14. from pydantic import BaseModel
  15. class FileKey(BaseModel):
  16. """NOTE: This class is auto generated by OpenAPI Generator.
  17. Ref: https://openapi-generator.tech
  18. Do not edit the class manually.
  19. """
  20. count: Optional[Any] = None
  21. fid: Optional[Any] = None
  22. url: Optional[Any] = None
  23. __properties = ["count", "fid", "url"]
  24. class Config:
  25. allow_population_by_field_name = True
  26. validate_assignment = True
  27. def to_str(self) -> str:
  28. """Returns the string representation of the model using alias"""
  29. return pprint.pformat(self.dict(by_alias=True))
  30. def to_json(self) -> str:
  31. """Returns the JSON representation of the model using alias"""
  32. return json.dumps(self.to_dict())
  33. @classmethod
  34. def from_json(cls, json_str: str) -> FileKey:
  35. """Create an instance of FileKey from a JSON string"""
  36. return cls.from_dict(json.loads(json_str))
  37. def to_dict(self):
  38. """Returns the dictionary representation of the model using alias"""
  39. _dict = self.dict(by_alias=True,
  40. exclude={
  41. },
  42. exclude_none=True)
  43. # set to None if count (nullable) is None
  44. if self.count is None:
  45. _dict['count'] = None
  46. # set to None if fid (nullable) is None
  47. if self.fid is None:
  48. _dict['fid'] = None
  49. # set to None if url (nullable) is None
  50. if self.url is None:
  51. _dict['url'] = None
  52. return _dict
  53. @classmethod
  54. def from_dict(cls, obj: dict) -> FileKey:
  55. """Create an instance of FileKey from a dict"""
  56. if obj is None:
  57. return None
  58. if type(obj) is not dict:
  59. return FileKey.parse_obj(obj)
  60. _obj = FileKey.parse_obj({
  61. "count": obj.get("count"),
  62. "fid": obj.get("fid"),
  63. "url": obj.get("url")
  64. })
  65. return _obj