Skip to content

Commit 5d83ea0

Browse files
committed
chore: update to API v0.30.0
1 parent 816f528 commit 5d83ea0

9 files changed

+288
-82
lines changed

lib/binarylane/api/domains/post_v2_domains_domain_name_records.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ def sync_detailed(
8383
Args:
8484
domain_name (Union[int, str]): The domain name or domain ID for for which the record
8585
should be created. Example: 5.
86-
json_body (DomainRecordRequest): If this is used to update an existing DomainRecord any
87-
values not provided will be retained. Provide empty strings to clear existing string
88-
values, nulls to retain the existing values.
86+
json_body (DomainRecordRequest):
8987
9088
Raises:
9189
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -120,9 +118,7 @@ def sync(
120118
Args:
121119
domain_name (Union[int, str]): The domain name or domain ID for for which the record
122120
should be created. Example: 5.
123-
json_body (DomainRecordRequest): If this is used to update an existing DomainRecord any
124-
values not provided will be retained. Provide empty strings to clear existing string
125-
values, nulls to retain the existing values.
121+
json_body (DomainRecordRequest):
126122
127123
Raises:
128124
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -150,9 +146,7 @@ async def asyncio_detailed(
150146
Args:
151147
domain_name (Union[int, str]): The domain name or domain ID for for which the record
152148
should be created. Example: 5.
153-
json_body (DomainRecordRequest): If this is used to update an existing DomainRecord any
154-
values not provided will be retained. Provide empty strings to clear existing string
155-
values, nulls to retain the existing values.
149+
json_body (DomainRecordRequest):
156150
157151
Raises:
158152
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -185,9 +179,7 @@ async def asyncio(
185179
Args:
186180
domain_name (Union[int, str]): The domain name or domain ID for for which the record
187181
should be created. Example: 5.
188-
json_body (DomainRecordRequest): If this is used to update an existing DomainRecord any
189-
values not provided will be retained. Provide empty strings to clear existing string
190-
values, nulls to retain the existing values.
182+
json_body (DomainRecordRequest):
191183
192184
Raises:
193185
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

lib/binarylane/api/domains/post_v2_domains_refresh_nameserver_cache.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,29 @@
77

88
from binarylane import errors
99
from binarylane.client import Client
10+
from binarylane.models.domain_refresh_request import DomainRefreshRequest
1011
from binarylane.types import Response
1112

1213

1314
def _get_kwargs(
1415
*,
1516
client: Client,
17+
json_body: DomainRefreshRequest,
1618
) -> Dict[str, Any]:
1719
url = "{}/v2/domains/refresh_nameserver_cache".format(client.base_url)
1820

1921
headers: Dict[str, str] = client.get_headers()
2022
cookies: Dict[str, Any] = client.get_cookies()
2123

24+
json_json_body = json_body.to_dict()
25+
2226
return {
2327
"method": "post",
2428
"url": url,
2529
"headers": headers,
2630
"cookies": cookies,
2731
"timeout": client.get_timeout(),
32+
"json": json_json_body,
2833
}
2934

3035

@@ -51,12 +56,16 @@ def _build_response(*, client: Client, response: httpx.Response) -> Response[Any
5156
def sync_detailed(
5257
*,
5358
client: Client,
59+
json_body: DomainRefreshRequest,
5460
) -> Response[Any]:
5561
"""Refresh Cached Nameserver Domain Records
5662
5763
The nameservers for domains are cached. If you have recently altered the nameservers for a managed
5864
domain you may need to refresh the cached domain records.
5965
66+
Args:
67+
json_body (DomainRefreshRequest):
68+
6069
Raises:
6170
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
6271
httpx.TimeoutException: If the request takes longer than Client.timeout.
@@ -67,6 +76,7 @@ def sync_detailed(
6776

6877
kwargs = _get_kwargs(
6978
client=client,
79+
json_body=json_body,
7080
)
7181

7282
response = httpx.request(
@@ -80,12 +90,16 @@ def sync_detailed(
8090
async def asyncio_detailed(
8191
*,
8292
client: Client,
93+
json_body: DomainRefreshRequest,
8394
) -> Response[Any]:
8495
"""Refresh Cached Nameserver Domain Records
8596
8697
The nameservers for domains are cached. If you have recently altered the nameservers for a managed
8798
domain you may need to refresh the cached domain records.
8899
100+
Args:
101+
json_body (DomainRefreshRequest):
102+
89103
Raises:
90104
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
91105
httpx.TimeoutException: If the request takes longer than Client.timeout.
@@ -96,6 +110,7 @@ async def asyncio_detailed(
96110

97111
kwargs = _get_kwargs(
98112
client=client,
113+
json_body=json_body,
99114
)
100115

101116
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:

lib/binarylane/api/domains/put_v2_domains_domain_name_records_record_id.py

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
from binarylane import errors
99
from binarylane.client import Client
10-
from binarylane.models.domain_record_request import DomainRecordRequest
1110
from binarylane.models.domain_record_response import DomainRecordResponse
1211
from binarylane.models.problem_details import ProblemDetails
12+
from binarylane.models.update_domain_record_request import UpdateDomainRecordRequest
1313
from binarylane.models.validation_problem_details import ValidationProblemDetails
1414
from binarylane.types import Response
1515

@@ -19,7 +19,7 @@ def _get_kwargs(
1919
record_id: int,
2020
*,
2121
client: Client,
22-
json_body: DomainRecordRequest,
22+
json_body: UpdateDomainRecordRequest,
2323
) -> Dict[str, Any]:
2424
url = "{}/v2/domains/{domain_name}/records/{record_id}".format(
2525
client.base_url, domain_name=domain_name, record_id=record_id
@@ -80,17 +80,16 @@ def sync_detailed(
8080
record_id: int,
8181
*,
8282
client: Client,
83-
json_body: DomainRecordRequest,
83+
json_body: UpdateDomainRecordRequest,
8484
) -> Response[Union[Any, DomainRecordResponse, ProblemDetails, ValidationProblemDetails]]:
8585
"""Update an Existing Domain Record
8686
8787
Args:
8888
domain_name (Union[int, str]): The domain name or domain ID for for which the record
8989
should be updated. Example: 5.
9090
record_id (int): The ID of the record to update.
91-
json_body (DomainRecordRequest): If this is used to update an existing DomainRecord any
92-
values not provided will be retained. Provide empty strings to clear existing string
93-
values, nulls to retain the existing values.
91+
json_body (UpdateDomainRecordRequest): Any values not provided will be retained. Provide
92+
empty strings to clear existing string values, nulls to retain the existing values.
9493
9594
Raises:
9695
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -120,17 +119,16 @@ def sync(
120119
record_id: int,
121120
*,
122121
client: Client,
123-
json_body: DomainRecordRequest,
122+
json_body: UpdateDomainRecordRequest,
124123
) -> Optional[Union[Any, DomainRecordResponse, ProblemDetails, ValidationProblemDetails]]:
125124
"""Update an Existing Domain Record
126125
127126
Args:
128127
domain_name (Union[int, str]): The domain name or domain ID for for which the record
129128
should be updated. Example: 5.
130129
record_id (int): The ID of the record to update.
131-
json_body (DomainRecordRequest): If this is used to update an existing DomainRecord any
132-
values not provided will be retained. Provide empty strings to clear existing string
133-
values, nulls to retain the existing values.
130+
json_body (UpdateDomainRecordRequest): Any values not provided will be retained. Provide
131+
empty strings to clear existing string values, nulls to retain the existing values.
134132
135133
Raises:
136134
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -153,17 +151,16 @@ async def asyncio_detailed(
153151
record_id: int,
154152
*,
155153
client: Client,
156-
json_body: DomainRecordRequest,
154+
json_body: UpdateDomainRecordRequest,
157155
) -> Response[Union[Any, DomainRecordResponse, ProblemDetails, ValidationProblemDetails]]:
158156
"""Update an Existing Domain Record
159157
160158
Args:
161159
domain_name (Union[int, str]): The domain name or domain ID for for which the record
162160
should be updated. Example: 5.
163161
record_id (int): The ID of the record to update.
164-
json_body (DomainRecordRequest): If this is used to update an existing DomainRecord any
165-
values not provided will be retained. Provide empty strings to clear existing string
166-
values, nulls to retain the existing values.
162+
json_body (UpdateDomainRecordRequest): Any values not provided will be retained. Provide
163+
empty strings to clear existing string values, nulls to retain the existing values.
167164
168165
Raises:
169166
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -191,17 +188,16 @@ async def asyncio(
191188
record_id: int,
192189
*,
193190
client: Client,
194-
json_body: DomainRecordRequest,
191+
json_body: UpdateDomainRecordRequest,
195192
) -> Optional[Union[Any, DomainRecordResponse, ProblemDetails, ValidationProblemDetails]]:
196193
"""Update an Existing Domain Record
197194
198195
Args:
199196
domain_name (Union[int, str]): The domain name or domain ID for for which the record
200197
should be updated. Example: 5.
201198
record_id (int): The ID of the record to update.
202-
json_body (DomainRecordRequest): If this is used to update an existing DomainRecord any
203-
values not provided will be retained. Provide empty strings to clear existing string
204-
values, nulls to retain the existing values.
199+
json_body (UpdateDomainRecordRequest): Any values not provided will be retained. Provide
200+
empty strings to clear existing string values, nulls to retain the existing values.
205201
206202
Raises:
207203
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

lib/binarylane/models/domain_record_request.py

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,23 @@
1212

1313
@attr.s(auto_attribs=True)
1414
class DomainRecordRequest:
15-
"""If this is used to update an existing DomainRecord any values not provided will be retained. Provide empty strings
16-
to clear existing string values, nulls to retain the existing values.
17-
18-
Attributes:
19-
type (Union[Unset, None, DomainRecordType]): The type of the DNS record.
20-
name (Union[Unset, None, str]): The subdomain for this record. Use @ for records on the domain itself, and * to
21-
create a wildcard record.
22-
data (Union[Unset, None, str]): A general data field that has different functions depending on the record type.
23-
priority (Union[Unset, None, int]): A priority value that is only relevant for SRV and MX records.
24-
port (Union[Unset, None, int]): A port value that is only relevant for SRV records.
25-
ttl (Union[Unset, None, int]): This value is the time to live for the record, in seconds.
26-
weight (Union[Unset, None, int]): The weight value that is only relevant for SRV records.
27-
flags (Union[Unset, None, int]): An unsigned integer between 0-255 that is only relevant for CAA records.
28-
tag (Union[Unset, None, str]): A parameter tag that is only relevant for CAA records.
15+
"""
16+
Attributes:
17+
type (DomainRecordType): The type of the DNS record.
18+
name (str): The subdomain for this record. Use @ for records on the domain itself, and * to create a wildcard
19+
record.
20+
data (str): A general data field that has different functions depending on the record type.
21+
priority (Union[Unset, None, int]): A priority value that is only relevant for SRV and MX records.
22+
port (Union[Unset, None, int]): A port value that is only relevant for SRV records.
23+
ttl (Union[Unset, None, int]): This value is the time to live for the record, in seconds.
24+
weight (Union[Unset, None, int]): The weight value that is only relevant for SRV records.
25+
flags (Union[Unset, None, int]): An unsigned integer between 0-255 that is only relevant for CAA records.
26+
tag (Union[Unset, None, str]): A parameter tag that is only relevant for CAA records.
2927
"""
3028

31-
type: Union[Unset, None, DomainRecordType] = UNSET
32-
name: Union[Unset, None, str] = UNSET
33-
data: Union[Unset, None, str] = UNSET
29+
type: DomainRecordType
30+
name: str
31+
data: str
3432
priority: Union[Unset, None, int] = UNSET
3533
port: Union[Unset, None, int] = UNSET
3634
ttl: Union[Unset, None, int] = UNSET
@@ -40,9 +38,7 @@ class DomainRecordRequest:
4038
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
4139

4240
def to_dict(self) -> Dict[str, Any]:
43-
type: Union[Unset, None, str] = UNSET
44-
if not isinstance(self.type, Unset):
45-
type = self.type.value if self.type else None
41+
type = self.type.value
4642

4743
name = self.name
4844
data = self.data
@@ -55,13 +51,13 @@ def to_dict(self) -> Dict[str, Any]:
5551

5652
field_dict: Dict[str, Any] = {}
5753
field_dict.update(self.additional_properties)
58-
field_dict.update({})
59-
if type is not UNSET:
60-
field_dict["type"] = type
61-
if name is not UNSET:
62-
field_dict["name"] = name
63-
if data is not UNSET:
64-
field_dict["data"] = data
54+
field_dict.update(
55+
{
56+
"type": type,
57+
"name": name,
58+
"data": data,
59+
}
60+
)
6561
if priority is not UNSET:
6662
field_dict["priority"] = priority
6763
if port is not UNSET:
@@ -80,18 +76,11 @@ def to_dict(self) -> Dict[str, Any]:
8076
@classmethod
8177
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
8278
d = src_dict.copy()
83-
_type = d.pop("type", UNSET)
84-
type: Union[Unset, None, DomainRecordType]
85-
if _type is None:
86-
type = None
87-
elif isinstance(_type, Unset):
88-
type = UNSET
89-
else:
90-
type = DomainRecordType(_type)
91-
92-
name = d.pop("name", UNSET)
93-
94-
data = d.pop("data", UNSET)
79+
type = DomainRecordType(d.pop("type"))
80+
81+
name = d.pop("name")
82+
83+
data = d.pop("data")
9584

9685
priority = d.pop("priority", UNSET)
9786

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
from __future__ import annotations
2+
3+
from typing import Any, Dict, List, Type, TypeVar, cast
4+
5+
import attr
6+
7+
T = TypeVar("T", bound="DomainRefreshRequest")
8+
9+
10+
@attr.s(auto_attribs=True)
11+
class DomainRefreshRequest:
12+
"""
13+
Attributes:
14+
domain_names (List[str]): The domain names to refresh.
15+
"""
16+
17+
domain_names: List[str]
18+
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
19+
20+
def to_dict(self) -> Dict[str, Any]:
21+
domain_names = self.domain_names
22+
23+
field_dict: Dict[str, Any] = {}
24+
field_dict.update(self.additional_properties)
25+
field_dict.update(
26+
{
27+
"domain_names": domain_names,
28+
}
29+
)
30+
31+
return field_dict
32+
33+
@classmethod
34+
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
35+
d = src_dict.copy()
36+
domain_names = cast(List[str], d.pop("domain_names"))
37+
38+
domain_refresh_request = cls(
39+
domain_names=domain_names,
40+
)
41+
42+
domain_refresh_request.additional_properties = d
43+
return domain_refresh_request
44+
45+
@property
46+
def additional_keys(self) -> List[str]:
47+
return list(self.additional_properties.keys())
48+
49+
def __getitem__(self, key: str) -> Any:
50+
return self.additional_properties[key]
51+
52+
def __setitem__(self, key: str, value: Any) -> None:
53+
self.additional_properties[key] = value
54+
55+
def __delitem__(self, key: str) -> None:
56+
del self.additional_properties[key]
57+
58+
def __contains__(self, key: str) -> bool:
59+
return key in self.additional_properties

0 commit comments

Comments
 (0)