Skip to content

Commit d3b08d7

Browse files
committed
new client version
1 parent 1e5a4d8 commit d3b08d7

File tree

4,288 files changed

+59007
-54148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,288 files changed

+59007
-54148
lines changed

dataforseo_client/__init__.py

Lines changed: 58 additions & 5 deletions
Large diffs are not rendered by default.

dataforseo_client/api/keywords_data_api.py

Lines changed: 2282 additions & 683 deletions
Large diffs are not rendered by default.

dataforseo_client/api/serp_api.py

Lines changed: 1298 additions & 3 deletions
Large diffs are not rendered by default.

dataforseo_client/models/__init__.py

Lines changed: 58 additions & 5 deletions
Large diffs are not rendered by default.

dataforseo_client/models/about_this_result_element.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from typing import Optional, Set
2323
from typing_extensions import Self
@@ -37,11 +37,11 @@ class AboutThisResultElement(BaseModel):
3737
related_terms: Optional[List[Optional[StrictStr]]] = Field(default=None, description="related search terms that appear in the result")
3838
__properties: ClassVar[List[str]] = ["type", "url", "source", "source_info", "source_url", "language", "location", "search_terms", "related_terms"]
3939

40-
model_config = {
41-
"populate_by_name": True,
42-
"validate_assignment": True,
43-
"protected_namespaces": (),
44-
}
40+
model_config = ConfigDict(
41+
populate_by_name=True,
42+
validate_assignment=True,
43+
protected_namespaces=(),
44+
)
4545

4646

4747
def to_str(self) -> str:
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# coding: utf-8
2+
3+
"""
4+
DataForSEO API documentation
5+
6+
DataForSEO API is the starting point on your journey towards building powerful SEO software. With DataForSEO you can get all the data you need to build an efficient application while also saving your time and budget. DataForSEO API is using the REST technology for interchanging data between your application and our service. The data exchange is made through the widely used HTTP protocol, which allows applying our API to almost all programming languages.
7+
8+
The version of the OpenAPI document: 1.0.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, StrictInt, 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 AbsoluteItems(BaseModel):
26+
"""
27+
AbsoluteItems
28+
""" # noqa: E501
29+
geo_id: Optional[StrictStr] = Field(default=None, description="location identifier you can use this field for matching obtained results with location parameters specified in the request see the full list of available locations with their geo_id here or by making a separate request to https://api.dataforseo.com/v3/keywords_data/dataforseo_trends/locations example: US-NY")
30+
geo_name: Optional[StrictStr] = Field(default=None, description="location name you can use this field for matching obtained results with location parameters specified in the request see the full list of available locations with their geo_name here or by making a separate request to https://api.dataforseo.com/v3/keywords_data/dataforseo_trends/locations example: Andorra")
31+
values: Optional[List[Optional[StrictInt]]] = Field(default=None, description="keyword popularity rates within a given location represents location-specific keyword popularity rate over the specified time range; using these values, you can understand which of the specified keywords is more popular in the related location; the first value in the array is provided for the first term from the keywords array, the second value is provided for the second keyword, and so on; calculation: we determine the highest popularity value across all specified keywords within a given location, and then express the popularity values of each keyword as a percentage of the highest value (100); a value of 100 is the peak popularity for the term a value of 50 means that the term is half as popular a value of 0 means there was not enough data for this term")
32+
__properties: ClassVar[List[str]] = ["geo_id", "geo_name", "values"]
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 AbsoluteItems 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+
# set to None if geo_id (nullable) is None
74+
# and model_fields_set contains the field
75+
if self.geo_id is None and "geo_id" in self.model_fields_set:
76+
_dict['geo_id'] = None
77+
78+
# set to None if geo_name (nullable) is None
79+
# and model_fields_set contains the field
80+
if self.geo_name is None and "geo_name" in self.model_fields_set:
81+
_dict['geo_name'] = None
82+
83+
# set to None if values (nullable) is None
84+
# and model_fields_set contains the field
85+
if self.values is None and "values" in self.model_fields_set:
86+
_dict['values'] = None
87+
88+
return _dict
89+
90+
@classmethod
91+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92+
"""Create an instance of AbsoluteItems from a dict"""
93+
if obj is None:
94+
return None
95+
96+
if not isinstance(obj, dict):
97+
return cls.model_validate(obj)
98+
99+
_obj = cls.model_validate({
100+
"geo_id": obj.get("geo_id"),
101+
"geo_name": obj.get("geo_name"),
102+
"values": obj.get("values")
103+
})
104+
return _obj
105+
106+

dataforseo_client/models/ad_link_element.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from typing import Optional, Set
2323
from typing_extensions import Self
@@ -27,18 +27,18 @@ class AdLinkElement(BaseModel):
2727
AdLinkElement
2828
""" # noqa: E501
2929
type: Optional[StrictStr] = Field(default=None, description="type of element")
30-
title: Optional[StrictStr] = Field(default=None, description="title of a given link element")
30+
title: Optional[StrictStr] = Field(default=None, description="title of the element")
3131
description: Optional[StrictStr] = Field(default=None, description="description of the results element in SERP")
32-
url: Optional[StrictStr] = Field(default=None, description="relevant URL")
33-
domain: Optional[StrictStr] = Field(default=None, description="website domain")
32+
url: Optional[StrictStr] = Field(default=None, description="URL")
33+
domain: Optional[StrictStr] = Field(default=None, description="domain where a link points")
3434
ad_aclk: Optional[StrictStr] = Field(default=None, description="the identifier of the ad")
3535
__properties: ClassVar[List[str]] = ["type", "title", "description", "url", "domain", "ad_aclk"]
3636

37-
model_config = {
38-
"populate_by_name": True,
39-
"validate_assignment": True,
40-
"protected_namespaces": (),
41-
}
37+
model_config = ConfigDict(
38+
populate_by_name=True,
39+
validate_assignment=True,
40+
protected_namespaces=(),
41+
)
4242

4343

4444
def to_str(self) -> str:

dataforseo_client/models/address_info.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from typing import Optional, Set
2323
from typing_extensions import Self
@@ -34,11 +34,11 @@ class AddressInfo(BaseModel):
3434
country_code: Optional[StrictStr] = Field(default=None, description="ISO country code of the local establishment")
3535
__properties: ClassVar[List[str]] = ["borough", "address", "city", "zip", "region", "country_code"]
3636

37-
model_config = {
38-
"populate_by_name": True,
39-
"validate_assignment": True,
40-
"protected_namespaces": (),
41-
}
37+
model_config = ConfigDict(
38+
populate_by_name=True,
39+
validate_assignment=True,
40+
protected_namespaces=(),
41+
)
4242

4343

4444
def to_str(self) -> str:

dataforseo_client/models/amazon_delivery_info.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from dataforseo_client.models.price_info import PriceInfo
2323
from typing import Optional, Set
@@ -35,11 +35,11 @@ class AmazonDeliveryInfo(BaseModel):
3535
delivery_price: Optional[PriceInfo] = None
3636
__properties: ClassVar[List[str]] = ["delivery_message", "delivery_date_from", "delivery_date_to", "fastest_delivery_date_from", "fastest_delivery_date_to", "delivery_price"]
3737

38-
model_config = {
39-
"populate_by_name": True,
40-
"validate_assignment": True,
41-
"protected_namespaces": (),
42-
}
38+
model_config = ConfigDict(
39+
populate_by_name=True,
40+
validate_assignment=True,
41+
protected_namespaces=(),
42+
)
4343

4444

4545
def to_str(self) -> str:

dataforseo_client/models/amazon_keyword_data.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, Field, StrictInt, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from dataforseo_client.models.amazon_keyword_info import AmazonKeywordInfo
2323
from typing import Optional, Set
@@ -34,11 +34,11 @@ class AmazonKeywordData(BaseModel):
3434
keyword_info: Optional[AmazonKeywordInfo] = None
3535
__properties: ClassVar[List[str]] = ["se_type", "keyword", "location_code", "language_code", "keyword_info"]
3636

37-
model_config = {
38-
"populate_by_name": True,
39-
"validate_assignment": True,
40-
"protected_namespaces": (),
41-
}
37+
model_config = ConfigDict(
38+
populate_by_name=True,
39+
validate_assignment=True,
40+
protected_namespaces=(),
41+
)
4242

4343

4444
def to_str(self) -> str:

0 commit comments

Comments
 (0)