wordlift-client 1.134.0__py3-none-any.whl → 1.136.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.
Files changed (45) hide show
  1. wordlift_client/__init__.py +25 -3
  2. wordlift_client/api/__init__.py +1 -0
  3. wordlift_client/api/audit_api.py +18 -6
  4. wordlift_client/api/default_api.py +1767 -39
  5. wordlift_client/api_client.py +1 -1
  6. wordlift_client/configuration.py +1 -1
  7. wordlift_client/models/__init__.py +23 -2
  8. wordlift_client/models/audit_data.py +27 -11
  9. wordlift_client/models/automation_issue.py +110 -0
  10. wordlift_client/models/automation_readiness.py +16 -5
  11. wordlift_client/models/bot_status.py +102 -0
  12. wordlift_client/models/content_freshness.py +106 -0
  13. wordlift_client/models/content_structure.py +10 -6
  14. wordlift_client/models/detected_schema.py +100 -0
  15. wordlift_client/models/error_response.py +5 -3
  16. wordlift_client/models/html_semantics.py +100 -0
  17. wordlift_client/models/http_validation_error1.py +96 -0
  18. wordlift_client/models/image_accessibility.py +9 -7
  19. wordlift_client/models/internal_linking.py +100 -0
  20. wordlift_client/models/js_rendering.py +8 -17
  21. wordlift_client/models/monitor_result_item.py +117 -0
  22. wordlift_client/models/monitor_state.py +39 -0
  23. wordlift_client/models/monitor_summary_item.py +105 -0
  24. wordlift_client/models/neighbors.py +101 -0
  25. wordlift_client/models/page_info.py +95 -0
  26. wordlift_client/models/quick_wins_result.py +110 -0
  27. wordlift_client/models/resource_request.py +92 -0
  28. wordlift_client/models/resource_type.py +40 -0
  29. wordlift_client/models/schema_recommendation.py +90 -0
  30. wordlift_client/models/seo_fundamentals.py +6 -3
  31. wordlift_client/models/site_files.py +25 -10
  32. wordlift_client/models/structured_data.py +28 -5
  33. wordlift_client/models/url_list_item.py +132 -0
  34. wordlift_client/models/url_list_response.py +104 -0
  35. wordlift_client/models/url_results_response.py +121 -0
  36. wordlift_client/models/url_summary_response.py +136 -0
  37. wordlift_client/models/validation_error1.py +22 -9
  38. wordlift_client/models/validation_error2.py +96 -0
  39. wordlift_client/models/validation_error2_detail_inner.py +92 -0
  40. wordlift_client/models/well_known_files.py +98 -0
  41. {wordlift_client-1.134.0.dist-info → wordlift_client-1.136.0.dist-info}/METADATA +1 -1
  42. {wordlift_client-1.134.0.dist-info → wordlift_client-1.136.0.dist-info}/RECORD +45 -22
  43. {wordlift_client-1.134.0.dist-info → wordlift_client-1.136.0.dist-info}/LICENSE +0 -0
  44. {wordlift_client-1.134.0.dist-info → wordlift_client-1.136.0.dist-info}/WHEEL +0 -0
  45. {wordlift_client-1.134.0.dist-info → wordlift_client-1.136.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ WordLift API
5
+
6
+ WordLift API
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: hello@wordlift.io
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class DetectedSchema(BaseModel):
27
+ """
28
+ DetectedSchema
29
+ """ # noqa: E501
30
+ type: Optional[StrictStr] = Field(default=None, description="Schema.org type (e.g., Organization, WebSite, Article)")
31
+ format: Optional[StrictStr] = Field(default=None, description="Format of the structured data")
32
+ __properties: ClassVar[List[str]] = ["type", "format"]
33
+
34
+ @field_validator('format')
35
+ def format_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value is None:
38
+ return value
39
+
40
+ if value not in set(['JSON-LD', 'Microdata']):
41
+ raise ValueError("must be one of enum values ('JSON-LD', 'Microdata')")
42
+ return value
43
+
44
+ model_config = ConfigDict(
45
+ populate_by_name=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.model_dump(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
+ return json.dumps(self.to_dict())
59
+
60
+ @classmethod
61
+ def from_json(cls, json_str: str) -> Optional[Self]:
62
+ """Create an instance of DetectedSchema from a JSON string"""
63
+ return cls.from_dict(json.loads(json_str))
64
+
65
+ def to_dict(self) -> Dict[str, Any]:
66
+ """Return the dictionary representation of the model using alias.
67
+
68
+ This has the following differences from calling pydantic's
69
+ `self.model_dump(by_alias=True)`:
70
+
71
+ * `None` is only added to the output dict for nullable fields that
72
+ were set at model initialization. Other fields with value `None`
73
+ are ignored.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ ])
77
+
78
+ _dict = self.model_dump(
79
+ by_alias=True,
80
+ exclude=excluded_fields,
81
+ exclude_none=True,
82
+ )
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
+ """Create an instance of DetectedSchema from a dict"""
88
+ if obj is None:
89
+ return None
90
+
91
+ if not isinstance(obj, dict):
92
+ return cls.model_validate(obj)
93
+
94
+ _obj = cls.model_validate({
95
+ "type": obj.get("type"),
96
+ "format": obj.get("format")
97
+ })
98
+ return _obj
99
+
100
+
@@ -28,8 +28,9 @@ class ErrorResponse(BaseModel):
28
28
  ErrorResponse
29
29
  """ # noqa: E501
30
30
  success: Optional[StrictBool] = None
31
- error: Optional[StrictStr] = Field(default=None, description="Error message")
32
- __properties: ClassVar[List[str]] = ["success", "error"]
31
+ error: Optional[StrictStr] = Field(default=None, description="Error type/category")
32
+ message: Optional[StrictStr] = Field(default=None, description="Detailed error message")
33
+ __properties: ClassVar[List[str]] = ["success", "error", "message"]
33
34
 
34
35
  model_config = ConfigDict(
35
36
  populate_by_name=True,
@@ -83,7 +84,8 @@ class ErrorResponse(BaseModel):
83
84
 
84
85
  _obj = cls.model_validate({
85
86
  "success": obj.get("success"),
86
- "error": obj.get("error")
87
+ "error": obj.get("error"),
88
+ "message": obj.get("message")
87
89
  })
88
90
  return _obj
89
91
 
@@ -0,0 +1,100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ WordLift API
5
+
6
+ WordLift API
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: hello@wordlift.io
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class HtmlSemantics(BaseModel):
27
+ """
28
+ Legacy field - always returns status Unknown
29
+ """ # noqa: E501
30
+ status: Optional[StrictStr] = Field(default=None, description="Always returns Unknown as this analysis is integrated into Content Structure")
31
+ explanation: Optional[StrictStr] = Field(default=None, description="Explanation that this is integrated into Content Structure")
32
+ __properties: ClassVar[List[str]] = ["status", "explanation"]
33
+
34
+ @field_validator('status')
35
+ def status_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value is None:
38
+ return value
39
+
40
+ if value not in set(['Unknown']):
41
+ raise ValueError("must be one of enum values ('Unknown')")
42
+ return value
43
+
44
+ model_config = ConfigDict(
45
+ populate_by_name=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.model_dump(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
+ return json.dumps(self.to_dict())
59
+
60
+ @classmethod
61
+ def from_json(cls, json_str: str) -> Optional[Self]:
62
+ """Create an instance of HtmlSemantics from a JSON string"""
63
+ return cls.from_dict(json.loads(json_str))
64
+
65
+ def to_dict(self) -> Dict[str, Any]:
66
+ """Return the dictionary representation of the model using alias.
67
+
68
+ This has the following differences from calling pydantic's
69
+ `self.model_dump(by_alias=True)`:
70
+
71
+ * `None` is only added to the output dict for nullable fields that
72
+ were set at model initialization. Other fields with value `None`
73
+ are ignored.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ ])
77
+
78
+ _dict = self.model_dump(
79
+ by_alias=True,
80
+ exclude=excluded_fields,
81
+ exclude_none=True,
82
+ )
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
+ """Create an instance of HtmlSemantics from a dict"""
88
+ if obj is None:
89
+ return None
90
+
91
+ if not isinstance(obj, dict):
92
+ return cls.model_validate(obj)
93
+
94
+ _obj = cls.model_validate({
95
+ "status": obj.get("status"),
96
+ "explanation": obj.get("explanation")
97
+ })
98
+ return _obj
99
+
100
+
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ WordLift API
5
+
6
+ WordLift API
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: hello@wordlift.io
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from wordlift_client.models.validation_error1 import ValidationError1
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class HTTPValidationError1(BaseModel):
28
+ """
29
+ HTTPValidationError1
30
+ """ # noqa: E501
31
+ detail: Optional[List[ValidationError1]] = None
32
+ __properties: ClassVar[List[str]] = ["detail"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of HTTPValidationError1 from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of each item in detail (list)
74
+ _items = []
75
+ if self.detail:
76
+ for _item in self.detail:
77
+ if _item:
78
+ _items.append(_item.to_dict())
79
+ _dict['detail'] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of HTTPValidationError1 from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "detail": [ValidationError1.from_dict(_item) for _item in obj["detail"]] if obj.get("detail") is not None else None
93
+ })
94
+ return _obj
95
+
96
+
@@ -19,7 +19,7 @@ import re # noqa: F401
19
19
  import json
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
22
- from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing_extensions import Annotated
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
@@ -28,12 +28,13 @@ class ImageAccessibility(BaseModel):
28
28
  """
29
29
  ImageAccessibility
30
30
  """ # noqa: E501
31
+ score: Optional[Annotated[int, Field(le=5, strict=True, ge=0)]] = Field(default=None, description="Numeric score for image accessibility (0-5)")
31
32
  status: Optional[StrictStr] = None
32
33
  explanation: Optional[StrictStr] = None
33
- missing_alt_percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = Field(default=None, description="Percentage of images missing alt text", alias="missingAltPercentage")
34
34
  total_images: Optional[StrictInt] = Field(default=None, description="Total number of images on the page", alias="totalImages")
35
35
  images_without_alt: Optional[StrictInt] = Field(default=None, description="Number of images without alt text", alias="imagesWithoutAlt")
36
- __properties: ClassVar[List[str]] = ["status", "explanation", "missingAltPercentage", "totalImages", "imagesWithoutAlt"]
36
+ missing_alt_text_images: Optional[List[StrictStr]] = Field(default=None, description="Sample URLs or descriptions of images missing alt text", alias="missingAltTextImages")
37
+ __properties: ClassVar[List[str]] = ["score", "status", "explanation", "totalImages", "imagesWithoutAlt", "missingAltTextImages"]
37
38
 
38
39
  @field_validator('status')
39
40
  def status_validate_enum(cls, value):
@@ -41,8 +42,8 @@ class ImageAccessibility(BaseModel):
41
42
  if value is None:
42
43
  return value
43
44
 
44
- if value not in set(['Good', 'Needs Improvement', 'Poor']):
45
- raise ValueError("must be one of enum values ('Good', 'Needs Improvement', 'Poor')")
45
+ if value not in set(['Good', 'Needs Improvement', 'Poor', 'Unknown']):
46
+ raise ValueError("must be one of enum values ('Good', 'Needs Improvement', 'Poor', 'Unknown')")
46
47
  return value
47
48
 
48
49
  model_config = ConfigDict(
@@ -96,11 +97,12 @@ class ImageAccessibility(BaseModel):
96
97
  return cls.model_validate(obj)
97
98
 
98
99
  _obj = cls.model_validate({
100
+ "score": obj.get("score"),
99
101
  "status": obj.get("status"),
100
102
  "explanation": obj.get("explanation"),
101
- "missingAltPercentage": obj.get("missingAltPercentage"),
102
103
  "totalImages": obj.get("totalImages"),
103
- "imagesWithoutAlt": obj.get("imagesWithoutAlt")
104
+ "imagesWithoutAlt": obj.get("imagesWithoutAlt"),
105
+ "missingAltTextImages": obj.get("missingAltTextImages")
104
106
  })
105
107
  return _obj
106
108
 
@@ -0,0 +1,100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ WordLift API
5
+
6
+ WordLift API
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: hello@wordlift.io
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class InternalLinking(BaseModel):
27
+ """
28
+ Legacy field - always returns status Unknown
29
+ """ # noqa: E501
30
+ status: Optional[StrictStr] = Field(default=None, description="Always returns Unknown as this analysis is integrated into Content Structure")
31
+ explanation: Optional[StrictStr] = Field(default=None, description="Explanation that this is integrated into Content Structure")
32
+ __properties: ClassVar[List[str]] = ["status", "explanation"]
33
+
34
+ @field_validator('status')
35
+ def status_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value is None:
38
+ return value
39
+
40
+ if value not in set(['Unknown']):
41
+ raise ValueError("must be one of enum values ('Unknown')")
42
+ return value
43
+
44
+ model_config = ConfigDict(
45
+ populate_by_name=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.model_dump(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
+ return json.dumps(self.to_dict())
59
+
60
+ @classmethod
61
+ def from_json(cls, json_str: str) -> Optional[Self]:
62
+ """Create an instance of InternalLinking from a JSON string"""
63
+ return cls.from_dict(json.loads(json_str))
64
+
65
+ def to_dict(self) -> Dict[str, Any]:
66
+ """Return the dictionary representation of the model using alias.
67
+
68
+ This has the following differences from calling pydantic's
69
+ `self.model_dump(by_alias=True)`:
70
+
71
+ * `None` is only added to the output dict for nullable fields that
72
+ were set at model initialization. Other fields with value `None`
73
+ are ignored.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ ])
77
+
78
+ _dict = self.model_dump(
79
+ by_alias=True,
80
+ exclude=excluded_fields,
81
+ exclude_none=True,
82
+ )
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
+ """Create an instance of InternalLinking from a dict"""
88
+ if obj is None:
89
+ return None
90
+
91
+ if not isinstance(obj, dict):
92
+ return cls.model_validate(obj)
93
+
94
+ _obj = cls.model_validate({
95
+ "status": obj.get("status"),
96
+ "explanation": obj.get("explanation")
97
+ })
98
+ return _obj
99
+
100
+
@@ -20,6 +20,7 @@ import json
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
23
24
  from typing import Optional, Set
24
25
  from typing_extensions import Self
25
26
 
@@ -27,14 +28,14 @@ class JsRendering(BaseModel):
27
28
  """
28
29
  JsRendering
29
30
  """ # noqa: E501
31
+ score: Optional[Annotated[int, Field(le=15, strict=True, ge=0)]] = Field(default=None, description="Numeric score for JavaScript rendering (0-15)")
30
32
  status: Optional[StrictStr] = None
31
33
  explanation: Optional[StrictStr] = None
32
- framework_detected: Optional[StrictStr] = Field(default=None, description="Detected JavaScript framework (React, Vue, Angular, etc.)", alias="frameworkDetected")
34
+ framework_detected: Optional[StrictStr] = Field(default=None, description="Detected JavaScript framework (None, React, Vue, Angular, Next.js, Nuxt, Gatsby, Other)", alias="frameworkDetected")
33
35
  rendering_type: Optional[StrictStr] = Field(default=None, description="Type of rendering used by the site", alias="renderingType")
34
- ai_accessibility: Optional[StrictStr] = Field(default=None, description="How accessible the content is to AI agents", alias="aiAccessibility")
35
- content_availability: Optional[StrictStr] = Field(default=None, description="Description of content availability in HTML", alias="contentAvailability")
36
+ content_availability: Optional[StrictStr] = Field(default=None, description="Description of content availability in HTML (e.g., \"All content in HTML\", \"Mostly in HTML\", \"Partially in JS\", \"Mostly in JS\")", alias="contentAvailability")
36
37
  recommendations: Optional[List[StrictStr]] = Field(default=None, description="Recommendations for improving JS rendering")
37
- __properties: ClassVar[List[str]] = ["status", "explanation", "frameworkDetected", "renderingType", "aiAccessibility", "contentAvailability", "recommendations"]
38
+ __properties: ClassVar[List[str]] = ["score", "status", "explanation", "frameworkDetected", "renderingType", "contentAvailability", "recommendations"]
38
39
 
39
40
  @field_validator('status')
40
41
  def status_validate_enum(cls, value):
@@ -42,8 +43,8 @@ class JsRendering(BaseModel):
42
43
  if value is None:
43
44
  return value
44
45
 
45
- if value not in set(['Good', 'Needs Improvement', 'Poor']):
46
- raise ValueError("must be one of enum values ('Good', 'Needs Improvement', 'Poor')")
46
+ if value not in set(['Good', 'Needs Improvement', 'Poor', 'Unknown']):
47
+ raise ValueError("must be one of enum values ('Good', 'Needs Improvement', 'Poor', 'Unknown')")
47
48
  return value
48
49
 
49
50
  @field_validator('rendering_type')
@@ -56,16 +57,6 @@ class JsRendering(BaseModel):
56
57
  raise ValueError("must be one of enum values ('Static', 'SSR', 'SSG', 'CSR', 'Hybrid')")
57
58
  return value
58
59
 
59
- @field_validator('ai_accessibility')
60
- def ai_accessibility_validate_enum(cls, value):
61
- """Validates the enum"""
62
- if value is None:
63
- return value
64
-
65
- if value not in set(['Excellent', 'Good', 'Limited', 'Blocked']):
66
- raise ValueError("must be one of enum values ('Excellent', 'Good', 'Limited', 'Blocked')")
67
- return value
68
-
69
60
  model_config = ConfigDict(
70
61
  populate_by_name=True,
71
62
  validate_assignment=True,
@@ -117,11 +108,11 @@ class JsRendering(BaseModel):
117
108
  return cls.model_validate(obj)
118
109
 
119
110
  _obj = cls.model_validate({
111
+ "score": obj.get("score"),
120
112
  "status": obj.get("status"),
121
113
  "explanation": obj.get("explanation"),
122
114
  "frameworkDetected": obj.get("frameworkDetected"),
123
115
  "renderingType": obj.get("renderingType"),
124
- "aiAccessibility": obj.get("aiAccessibility"),
125
116
  "contentAvailability": obj.get("contentAvailability"),
126
117
  "recommendations": obj.get("recommendations")
127
118
  })
@@ -0,0 +1,117 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ WordLift API
5
+
6
+ WordLift API
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: hello@wordlift.io
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from datetime import datetime
22
+ from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
23
+ from typing import Any, ClassVar, Dict, List, Optional, Union
24
+ from wordlift_client.models.monitor_state import MonitorState
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class MonitorResultItem(BaseModel):
29
+ """
30
+ MonitorResultItem
31
+ """ # noqa: E501
32
+ monitor_name: StrictStr
33
+ state: MonitorState
34
+ details: Optional[StrictStr] = None
35
+ score: Optional[Union[StrictFloat, StrictInt]] = None
36
+ metadata: Optional[Dict[str, Any]] = None
37
+ created_at: datetime
38
+ processed_at: Optional[datetime] = None
39
+ __properties: ClassVar[List[str]] = ["monitor_name", "state", "details", "score", "metadata", "created_at", "processed_at"]
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of MonitorResultItem from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ # set to None if details (nullable) is None
81
+ # and model_fields_set contains the field
82
+ if self.details is None and "details" in self.model_fields_set:
83
+ _dict['details'] = None
84
+
85
+ # set to None if score (nullable) is None
86
+ # and model_fields_set contains the field
87
+ if self.score is None and "score" in self.model_fields_set:
88
+ _dict['score'] = None
89
+
90
+ # set to None if processed_at (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.processed_at is None and "processed_at" in self.model_fields_set:
93
+ _dict['processed_at'] = None
94
+
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
+ """Create an instance of MonitorResultItem from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return cls.model_validate(obj)
105
+
106
+ _obj = cls.model_validate({
107
+ "monitor_name": obj.get("monitor_name"),
108
+ "state": obj.get("state"),
109
+ "details": obj.get("details"),
110
+ "score": obj.get("score"),
111
+ "metadata": obj.get("metadata"),
112
+ "created_at": obj.get("created_at"),
113
+ "processed_at": obj.get("processed_at")
114
+ })
115
+ return _obj
116
+
117
+